From owner-svn-ports-head@freebsd.org Mon Jan 13 18:36:05 2020 Return-Path: Delivered-To: svn-ports-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id C234A1E7ADF; Mon, 13 Jan 2020 18:36:05 +0000 (UTC) (envelope-from tobik@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47xMjd4hdqz41PL; Mon, 13 Jan 2020 18:36:05 +0000 (UTC) (envelope-from tobik@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9C6028EBC; Mon, 13 Jan 2020 18:36:05 +0000 (UTC) (envelope-from tobik@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00DIa5rb022917; Mon, 13 Jan 2020 18:36:05 GMT (envelope-from tobik@FreeBSD.org) Received: (from tobik@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00DIa4FU022914; Mon, 13 Jan 2020 18:36:04 GMT (envelope-from tobik@FreeBSD.org) Message-Id: <202001131836.00DIa4FU022914@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tobik set sender to tobik@FreeBSD.org using -f From: Tobias Kortkamp Date: Mon, 13 Jan 2020 18:36:04 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r522968 - in head: Mk Mk/Scripts Mk/Uses lang/rust X-SVN-Group: ports-head X-SVN-Commit-Author: tobik X-SVN-Commit-Paths: in head: Mk Mk/Scripts Mk/Uses lang/rust X-SVN-Commit-Revision: 522968 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jan 2020 18:36:05 -0000 Author: tobik Date: Mon Jan 13 18:36:04 2020 New Revision: 522968 URL: https://svnweb.freebsd.org/changeset/ports/522968 Log: lang/rust: Add COMPAT_FREEBSD11 canary This attempts to provide a nicer error message for the subset of users who build their own kernels without COMPAT_FREEBSD11 and then attempt to build lang/rust. The Rust ecosystem currently uses pre-ino64 syscalls, so building lang/rust without COMPAT_FREEBSD11 is not going to work. The error message for this is non-obvious and there is a new bug for this at least every 1-2 months. Hopefully this will improve the situation a little. Cargo and Gecko ports are similarly affected, so add the pre-build check to them too. Reviewed by: jbeich, mikael.urankar@gmail.com Tested by: madpilot (negative case) Approved by: gecko (jbeich) Differential Revision: https://reviews.freebsd.org/D23100 Added: head/Mk/Scripts/rust-compat11-canary.sh (contents, props changed) Modified: head/Mk/Uses/cargo.mk head/Mk/bsd.gecko.mk head/lang/rust/Makefile Added: head/Mk/Scripts/rust-compat11-canary.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/Mk/Scripts/rust-compat11-canary.sh Mon Jan 13 18:36:04 2020 (r522968) @@ -0,0 +1,27 @@ +#!/bin/sh +# MAINTAINER: rust@FreeBSD.org +# $FreeBSD$ +set -eu + +if [ "${OPSYS}" != FreeBSD ] || [ "${OSVERSION}" -lt 1200000 ]; then + exit 0 +fi + +cat < +#include +#include + +int +main(void) +{ + return syscall(SYS_freebsd11_mknod, "", 0, 0) < 0 && errno == ENOSYS; +} +EOF +# Canary might be aborted with SIGSYS +ulimit -c 0 +if ! "${WRKDIR}/compat11_canary"; then + echo "=> Sanity check failed: kernel is missing COMPAT_FREEBSD11" + echo "=> Aborting build" + exit 1 +fi Modified: head/Mk/Uses/cargo.mk ============================================================================== --- head/Mk/Uses/cargo.mk Mon Jan 13 18:02:29 2020 (r522967) +++ head/Mk/Uses/cargo.mk Mon Jan 13 18:36:04 2020 (r522968) @@ -247,6 +247,9 @@ _USES_configure+= 250:cargo-configure # configure hook. Place a config file for overriding crates-io index # by local source directory. cargo-configure: +# Check that the running kernel has COMPAT_FREEBSD11 required by lang/rust post-ino64 + @${SETENV} CC="${CC}" OPSYS="${OPSYS}" OSVERSION="${OSVERSION}" WRKDIR="${WRKDIR}" \ + ${SH} ${SCRIPTSDIR}/rust-compat11-canary.sh @${MKDIR} ${WRKDIR}/.cargo @${ECHO_CMD} "[source.cargo]" > ${WRKDIR}/.cargo/config @${ECHO_CMD} "directory = '${CARGO_VENDOR_DIR}'" >> ${WRKDIR}/.cargo/config Modified: head/Mk/bsd.gecko.mk ============================================================================== --- head/Mk/bsd.gecko.mk Mon Jan 13 18:02:29 2020 (r522967) +++ head/Mk/bsd.gecko.mk Mon Jan 13 18:36:04 2020 (r522968) @@ -376,6 +376,11 @@ gecko-post-patch: @${REINPLACE_CMD} 's,"files":{[^}]*},"files":{},' \ ${MOZSRC}/third_party/rust/*/.cargo-checksum.json +pre-configure-script: +# Check that the running kernel has COMPAT_FREEBSD11 required by lang/rust post-ino64 + @${SETENV} CC="${CC}" OPSYS="${OPSYS}" OSVERSION="${OSVERSION}" WRKDIR="${WRKDIR}" \ + ${SH} ${SCRIPTSDIR}/rust-compat11-canary.sh + post-install-script: gecko-create-plist gecko-create-plist: Modified: head/lang/rust/Makefile ============================================================================== --- head/lang/rust/Makefile Mon Jan 13 18:02:29 2020 (r522967) +++ head/lang/rust/Makefile Mon Jan 13 18:36:04 2020 (r522968) @@ -142,6 +142,9 @@ post-patch-SOURCES-off: ${WRKSRC}/src/bootstrap/install.rs do-configure: +# Check that the running kernel has COMPAT_FREEBSD11 required by lang/rust post-ino64 + @${SETENV} CC="${CC}" OPSYS="${OPSYS}" OSVERSION="${OSVERSION}" WRKDIR="${WRKDIR}" \ + ${SH} ${SCRIPTSDIR}/rust-compat11-canary.sh @${ECHO_CMD} '[build]' > ${WRKSRC}/config.toml @${ECHO_CMD} 'vendor=true' >> ${WRKSRC}/config.toml @${ECHO_CMD} 'extended=true' >> ${WRKSRC}/config.toml