From nobody Tue Jan 31 01:47:11 2023 X-Original-To: dev-commits-src-branches@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 4P5SbM3TZhz3c3TZ; Tue, 31 Jan 2023 01:47:11 +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 4P5SbM2yZYz4dJM; Tue, 31 Jan 2023 01:47:11 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675129631; 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=Uec4dg3gi6Sf0FzVjTkEuBlyob+yzcyCxwaG/tapJuU=; b=GCiHhfXg3lbXROsE40meWJsMOBB6Rgn6wMXjiEvpORfs+taBrs2PbHZNIoB1QG1Ox+d24o q7jFCoqaKC3BoMC0+l1bvxvqOAajq/om9eKZlD94EiMaw6Y8fsonj+VKGrx1HbxONpjKXd qObFzwhoR/RNlLiw4X+m3LlfEkAjTmh24vDKjc0h8ObSIMNaHcU8LUMRaNrchShogJxx4m mCDRssKwciIgJZrM4g/kqvn5SOlqT0ajzgZUHrborsTTfTci5aeREl0EhHjIEdAVgo0Lw+ ofk/rCnxaW4i02cmjjRw0TQkT5v4GTXTuxqvoCUyLAe48CEaYGN4tZWNTuGxWQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675129631; 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=Uec4dg3gi6Sf0FzVjTkEuBlyob+yzcyCxwaG/tapJuU=; b=AOSRX6uNwn1o1rLAIxlxvYxy0FAimFnjimx0eLB7wSMJO1VJAPSg8rNRUVReB5Z03QYN22 jWHg5CbmnFKeXfAEp8+AAfU+dlHztpCSXjLmEm9b44SsLZg8b3Jj6c5THYXjXRPidM1CZq DsafaUvSgJX4gNIj97frFs1rWDQxfQlAzuB41ZsZ7c+rmwh0SN1EO4ylNMKWXrZN0hd1n+ nCgco8FOiOMLt4IDifKGjAThWyPvQya0gijAYuvMhHmeRFTrcGbUNRPYMK2tL4ZkxtB/RA gfnNrRr4Wv2MG3RdRcwt91f/mysIsoFG2SAutlqF+z42ZyAJAwVeqFRDIq3M3A== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675129631; a=rsa-sha256; cv=none; b=eYr1XCBkQp88ZE5tLYU+f06FJe7ieTMI7Jv6hA37bEzba+qtTA2HBHruPvBxwAk/Acb9RP 7Pbj4NYbFAJhEKqiEsSsN/zCmprkmmEokwc3WHu1KiFDvZFE6/LZ2ZkYfU9KWh/m67k7Hk h/q34H3QlfWn6OvNrF8vAEi2TdqMXGoPDakRlhPGzjwi3T1I00Y1ei0vXU46dWsVEAm24O Y5opNsmi1UygwpIE0WZKIvcpMv7MwDSbSd7addd//DRBi6ja44UvlIJQUl/qkK28tPFFkV y2KL1mT8myWKwSPl0rGvpIpEKZDq2gPEzqg4/1w4g5CXf2mTh7gfeKxMHCSPmQ== 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 4P5SbM23N7zWfh; Tue, 31 Jan 2023 01:47:11 +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 30V1lBNJ058641; Tue, 31 Jan 2023 01:47:11 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30V1lBcX058640; Tue, 31 Jan 2023 01:47:11 GMT (envelope-from git) Date: Tue, 31 Jan 2023 01:47:11 GMT Message-Id: <202301310147.30V1lBcX058640@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Jessica Clarke Subject: git: 6879fc89425f - stable/13 - Makefile: Avoid sanitizing PATH on non-FreeBSD systems List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@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/stable/13 X-Git-Reftype: branch X-Git-Commit: 6879fc89425f57880fa327a1c528f657f80cf68e Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by jrtc27: URL: https://cgit.FreeBSD.org/src/commit/?id=6879fc89425f57880fa327a1c528f657f80cf68e commit 6879fc89425f57880fa327a1c528f657f80cf68e Author: Jake Freeland AuthorDate: 2023-01-19 22:24:44 +0000 Commit: Jessica Clarke CommitDate: 2023-01-31 01:46:18 +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 (cherry picked from commit 16fbf0191243e7c9dff6615b1424b5d39186b36c) --- Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Makefile b/Makefile index e16557f83371..5dac4a3e9ee3 100644 --- a/Makefile +++ b/Makefile @@ -216,7 +216,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} \