From owner-dev-commits-src-all@freebsd.org Wed Mar 17 10:27:32 2021 Return-Path: Delivered-To: dev-commits-src-all@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 A39FA5A8E29; Wed, 17 Mar 2021 10:27:32 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4F0mYw0tpZz3FDP; Wed, 17 Mar 2021 10:27:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 61CAF5230; Wed, 17 Mar 2021 10:27:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 12HARUOj095815; Wed, 17 Mar 2021 10:27:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 12HARUjM095814; Wed, 17 Mar 2021 10:27:30 GMT (envelope-from git) Date: Wed, 17 Mar 2021 10:27:30 GMT Message-Id: <202103171027.12HARUjM095814@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alex Richardson Subject: git: aa68a0b324cf - stable/13 - Create symlinks to host tools on non-FreeBSD hosts MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: arichardson X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: aa68a0b324cfa20e0b4383bb0f1e41fe6803e535 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Mar 2021 10:27:33 -0000 The branch stable/13 has been updated by arichardson: URL: https://cgit.FreeBSD.org/src/commit/?id=aa68a0b324cfa20e0b4383bb0f1e41fe6803e535 commit aa68a0b324cfa20e0b4383bb0f1e41fe6803e535 Author: Alex Richardson AuthorDate: 2021-03-17 09:48:28 +0000 Commit: Alex Richardson CommitDate: 2021-03-17 09:48:28 +0000 Create symlinks to host tools on non-FreeBSD hosts This is unnecessary when cross-building from Linux/macOS. Additionally, cp -p appears to be broken on macOS Big Sur (https://openradar.appspot.com/8957219). For some unknown reason this commit appears to fix freezes when building on macOS Big Sur. This also fixes building in docker with volume mounts with ACLs, since setting the ACL with cp -p fails otherwise. Obtained From: CheriBSD Tested By: gnn (macOS Big Sur), Nathaniel Wesley Filardo (docker) Reviewed By: jrtc27, imp Differential Revision: https://reviews.freebsd.org/D28267 (cherry picked from commit a8b20f4fabbca9bef377009429848d4f9cea18ae) --- tools/build/Makefile | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/tools/build/Makefile b/tools/build/Makefile index c0c1786d4bfa..48e62e6561b7 100644 --- a/tools/build/Makefile +++ b/tools/build/Makefile @@ -272,7 +272,17 @@ _host_tools_to_symlink= basename bzip2 bunzip2 chmod chown cmp comm cp date dd \ _make_abs!= which "${MAKE}" _host_abs_tools_to_symlink= ${_make_abs}:make ${_make_abs}:bmake -.if ${.MAKE.OS} != "FreeBSD" +.if ${.MAKE.OS} == "FreeBSD" +# When building on FreeBSD we always copy the host tools instead of linking +# into WORLDTMP to avoid issues with incompatible libraries (see r364030). +# Note: we could create links if we don't intend to update the current machine. +_COPY_HOST_TOOL=cp -pf +.else +# However, this is not necessary on Linux/macOS. Additionally, copying the host +# tools to another directory with cp -p results in freezes on macOS Big Sur for +# some unknown reason. It can also break building inside docker containers if +# there are ACLs on shared volumes. +_COPY_HOST_TOOL=ln -sfn _make_abs!= which "${MAKE}" _host_abs_tools_to_symlink+= ${_make_abs}:make ${_make_abs}:bmake .if ${.MAKE.OS} == "Darwin" @@ -293,7 +303,7 @@ host-symlinks: echo "Cannot find host tool '${_tool}' in PATH ($$PATH)." >&2; false; \ fi; \ rm -f "${DESTDIR}/bin/${_tool}"; \ - cp -pf "$${source_path}" "${DESTDIR}/bin/${_tool}" + ${_COPY_HOST_TOOL} "$${source_path}" "${DESTDIR}/bin/${_tool}" .endfor .for _tool in ${_host_abs_tools_to_symlink} @source_path="${_tool:S/:/ /:[1]}"; \ @@ -302,11 +312,11 @@ host-symlinks: echo "Host tool '${src_path}' is missing"; false; \ fi; \ rm -f "$${target_path}"; \ - cp -pf "$${source_path}" "$${target_path}" + ${_COPY_HOST_TOOL} "$${source_path}" "$${target_path}" .endfor .if exists(/usr/libexec/flua) rm -f ${DESTDIR}/usr/libexec/flua - cp -pf /usr/libexec/flua ${DESTDIR}/usr/libexec/flua + ${_COPY_HOST_TOOL} /usr/libexec/flua ${DESTDIR}/usr/libexec/flua .endif # Create all the directories that are needed during the legacy, bootstrap-tools