From nobody Thu Jan 19 22:25:41 2023 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Nycdx6n84z2srFQ; Thu, 19 Jan 2023 22:25:41 +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 4Nycdx6HZrz4LbY; Thu, 19 Jan 2023 22:25:41 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674167141; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mK1mny0hRRjLks7CyGJ3nsedMyPNCeJNh6kZcYhypTk=; b=sBO/aODWw/zjkTLR44qa5g09NPiSoTDlmfdVFlH6nXEcFSVSgJLCR165wTVgTTlAOkOslg auV72iX4KFxZRGFZOa+GjL+7NPyg+slVcSj25OrRnLJt0P0fpRuLqyqmHQy9AH7t0024KC 00qSJtQjj7GeHifXjQgKtVKo/WbA8bP1TF2FtAomMnw6t42Lba+zZLhvfDFv9fs1b5Q4Bm Fyyxf8JNC8tdVbtY9pomQqCf/kIBSe6swCKEnKyMr1gB4L+gNqxrL+Tx3fCeRdt38FERI7 0/OHrtSVYYiguExGdLsgmyD0ErDJYgbjNmsao6aRcbXUk36hC7/Gom5qlSwJhg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1674167141; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=mK1mny0hRRjLks7CyGJ3nsedMyPNCeJNh6kZcYhypTk=; b=MSKdwL3y8Jr2NNIVLlZf4WgB8MNw/Kz+AXyVrPFUsEj/JsKSnSksI/gUWqCNyId2YJBk6g WyX2HuTtiOiO4zl5lwHjyI8YLDcY8Kt312U6xGIvzZj6eBcvop9Jt9jgdBZoFXn6D/LU9D QxKZaNAJNb8ENATgQXXqHzc1tn1AlBuBBzO3fIIw4axbOOaw8n+V59CvEtkw+ln+6Obs+S dLfH/2JuybGdVzl6Gbfu9rVMjoYFC9j4M0snTggzcvWNwiQLqD6VQwTUpkBBbeZ9IcgBUI qPeQc0peW0Ovme/MgkkloNlMYqgx2mNS9JXrBCTzu22UBNqWFHOteAnz+1HD0g== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1674167141; a=rsa-sha256; cv=none; b=tWAOItmbPfR91XBPK+8Lzg35JPiBD0B7Dqs//fCUXiT7bHJ2brruglI4XiuxNBXGm8LRJ5 abUK2LEKmF/TB/TDtsCjruVKcV/iSvcdgwHXQ8LTe86OeJB0q7hCL+mbKSNbVf8CC/eMJI Auv1+G5BMCobmXMhr5fBT3cW8vqlGJFqX0jsHM+kJEy895tQIQfWBIW5MV2peyCF29meoX mdVpsVtgc1mZAN684brOH+J2mfHQWCdGi7VijEZhou39ACbA5cXIKiy8rpLY3o6yh7l/AR EnGUIkIW629TE7SJ1u2/keth2e67f9jF8oYvdphP+4tv1BFXAOOltHiW04opJQ== 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 4Nycdx5LCkz16Qy; Thu, 19 Jan 2023 22:25:41 +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 30JMPf2j011701; Thu, 19 Jan 2023 22:25:41 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30JMPfqW011700; Thu, 19 Jan 2023 22:25:41 GMT (envelope-from git) Date: Thu, 19 Jan 2023 22:25:41 GMT Message-Id: <202301192225.30JMPfqW011700@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Jessica Clarke Subject: git: 16fbf0191243 - main - Makefile: Avoid sanitizing PATH on non-FreeBSD systems List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jrtc27 X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 16fbf0191243e7c9dff6615b1424b5d39186b36c Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=16fbf0191243e7c9dff6615b1424b5d39186b36c commit 16fbf0191243e7c9dff6615b1424b5d39186b36c Author: Jake Freeland AuthorDate: 2023-01-19 22:24:44 +0000 Commit: Jessica Clarke CommitDate: 2023-01-19 22:24:44 +0000 Makefile: Avoid sanitizing PATH on non-FreeBSD systems Allow the build process to find host binaries during the host-symlinks target when cross-building on non-FreeBSD systems. Whilst most non-FreeBSD systems have all the needed tools in /sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin (the final path added by host-symlinks itself), Homebrew for macOS on Arm defaults to /opt/homebrew/bin, other more niche systems may also deviate and users may expect tools in a customised PATH to be picked up, unlike on FreeBSD where we want to ensure everything comes from base. In particular, (un)xz are needed from Homebrew on macOS, and thus cannot be found on Arm without this. Note that non-FreeBSD builds enforce BUILD_WITH_STRICT_TMPPATH, and so the actual main build steps will still use a sanitised PATH. Reviewed by: jrtc27, arichardson MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D37991 --- Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Makefile b/Makefile index 7ca6d5d9c218..62d2869bfc03 100644 --- a/Makefile +++ b/Makefile @@ -217,7 +217,12 @@ META_TGT_WHITELIST+= \ .ORDER: buildkernel reinstallkernel .ORDER: buildkernel reinstallkernel.debug +# Only sanitize PATH on FreeBSD. +# PATH may include tools that are required to cross-build +# on non-FreeBSD systems. +.if ${.MAKE.OS} == "FreeBSD" PATH= /sbin:/bin:/usr/sbin:/usr/bin +.endif MAKEOBJDIRPREFIX?= /usr/obj _MAKEOBJDIRPREFIX!= /usr/bin/env -i PATH=${PATH} ${MAKE} MK_AUTO_OBJ=no \ ${.MAKEFLAGS:MMAKEOBJDIRPREFIX=*} __MAKE_CONF=${__MAKE_CONF} \