From nobody Tue Nov 8 03:30:42 2022 X-Original-To: dev-commits-src-all@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 4N5tsb1NqLz4hC0s; Tue, 8 Nov 2022 03:30:43 +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 4N5tsb0r34z3lr9; Tue, 8 Nov 2022 03:30:43 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1667878243; 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=4RAIC1upE3k3wvdJawlNLN0sU/zsTGyoBD0T+x5rtZk=; b=aMy75UcubLx7o0PWo6z28IRilvDHFbosyofRpoL0aQPQDEpWNc2VQe7w7dyB0t+l945OfK Nj9a/WDQDzL48oYsOc2op1yeDFMYvtSfINYxUe6dFytu0hREpkFHdDM+omeo3dAgLFo+ta u800NieEtc2AlINjYFziOSYKNC+EiWc2LGJ8phd9jSdNUUU6pDf6hFWLH1C43iLsZDJPaO q4gxqeWIGZnuKrRhboUnL7dAuJHuP7nVBGNAdlI38put61LvFIZM8vhh0lnRWRxTb/ok4F vYZZKRWa5rT5l+F0zvSvAnBnXDfYLw5432Sbl9s5kmWLMW43Nisyj4UnZlF+5g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1667878243; a=rsa-sha256; cv=none; b=uw3924RDOQ9reHv2kqiMJ5TcHEzvkSrW4gT+DBZXh1hNPoDVQ3SsvOvTPVoo6rLoAOSsTs q1N75HZbH3xLXdxnHdzh6vcPHNVHg9uq9M3b/XqaYxvu2jcQBhKAaxr+kcMdEgR0SGHvXf buMr6hTykHWgFMpVYrpgQXw76bWj8mBMxNK6jTGA0qGOX0AOKK1Y493XGYNGNwF5eJKl3p emZOJYMHhtD8oKTjr9CJvmQJqp+FYus5jBLsbbSzbw/HeL0m19qNhWckY7YOkwinzxX2Q4 RyzZUodlfZ95l7DYuYPo1TmohOfFTwDkOprV0XllbMmJN/DnkwVzyfRFcgorww== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1667878243; 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=4RAIC1upE3k3wvdJawlNLN0sU/zsTGyoBD0T+x5rtZk=; b=sOGcsyZDx5fkB95XD0lTq+hQHZq+IZyR1qHyWlmzSs2Bf4PTrkRCUtU4xg06VCpiMNCrDZ M3ZUPC1xBSiubbmunpDFGQeJsnkOoD/s9ptO7bmPmDssVdhRG0d/H19Hcf9+l0fHH5Rf5y QFzvotg0vJvQ67NEmQ3+143mtGdmEIX0w3RxzW6LSqXzMGLWAuYPva750lsKCzjzm0ruAp ftC4/6ld6sY8GnqiBczTP74RlTBdbLl+MfFLlYe/35toPfZTVF/OKlQYyyMguix9z4n4Zb wObQdjYdIt3UsDjYMEQsmYdTF28InSKWqaR1yGj0devD7urOZjwPVU3Axpweew== 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 4N5tsZ70ddzRW5; Tue, 8 Nov 2022 03:30:42 +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 2A83Ug9r073767; Tue, 8 Nov 2022 03:30:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2A83Uge5073766; Tue, 8 Nov 2022 03:30:42 GMT (envelope-from git) Date: Tue, 8 Nov 2022 03:30:42 GMT Message-Id: <202211080330.2A83Uge5073766@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: "Alfredo Dal'Ava Junior" Subject: git: f12e86a205c8 - stable/13 - tools/build/make.py: fix cross build on Fedora Linux List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: alfredo X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: f12e86a205c8577a8f8bd9f9955fed78f658c004 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by alfredo: URL: https://cgit.FreeBSD.org/src/commit/?id=f12e86a205c8577a8f8bd9f9955fed78f658c004 commit f12e86a205c8577a8f8bd9f9955fed78f658c004 Author: Alfredo Dal'Ava Junior AuthorDate: 2022-11-01 23:59:58 +0000 Commit: Alfredo Dal'Ava Junior CommitDate: 2022-11-08 03:29:58 +0000 tools/build/make.py: fix cross build on Fedora Linux Fedora defines shell functions for some commands used by FreeBSD build scripts. Unortunatelly it makes them behave incorrectly for our purposes. For instance 'which which' returns something like: which () { ( alias; eval ${which_declare} ) | /usr/bin/which --tty-only --read-alias ... } instead of /usr/bin/which This patch unsets those functions to restore original/expected behavior Reviewed by: emaste, imp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D36900 (cherry picked from commit b7ac17b48bdfc688b54b29aa4feacb535c91aec2) --- tools/build/make.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/build/make.py b/tools/build/make.py index 799ea89b74b3..cede0c99e316 100755 --- a/tools/build/make.py +++ b/tools/build/make.py @@ -267,5 +267,13 @@ if __name__ == "__main__": shlex.quote(s) for s in [str(bmake_binary)] + bmake_args) debug("Running `env ", env_cmd_str, " ", make_cmd_str, "`", sep="") os.environ.update(new_env_vars) + + # Fedora defines bash function wrapper for some shell commands and this + # makes 'which ' return the function's source code instead of + # the binary path. Undefine it to restore the original behavior. + os.unsetenv("BASH_FUNC_which%%") + os.unsetenv("BASH_FUNC_ml%%") + os.unsetenv("BASH_FUNC_module%%") + os.chdir(str(source_root)) os.execv(str(bmake_binary), [str(bmake_binary)] + bmake_args)