From nobody Tue Nov 01 21:02:45 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 4N22Xj4sTjz4hGgP; Tue, 1 Nov 2022 21:02:45 +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 4N22Xj4Kcvz3Mxp; Tue, 1 Nov 2022 21:02:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1667336565; 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=qy3mHd/dtNT/kDGLDJpgPhbQnvkPux2D8Elm9BXJ16M=; b=bIpN3RCwJUhXWcTgJPE3di9CTofGTI2DOSRm/vmBY5+il5Oc5IMQ1WuE4hJqaFXfemkusY e/7O6+2hjyWZTkAcl5sV2BrPWY4L46jygH3H3m1ZhCPMPtsaC/DgTRK2j4CEYonwdBaBvY D2W0XZ4erXSnjTIj3QLBQrk8/MgjRBS2EzUlQ1wqd9CE0sqouk/RLBk0ZtnSK7IiBLZAby Ox5vryP10IY6GSuBefp5e0JHaFGaqkaezSCRAa/0c27zq+cCWVrIz2b7CAscJHvmTX4G1t NDeSVwl+VBHWzna3WjVEEQcFnu9HjIT3PHGyi4rcjf3dUbunzBZeald+0oDObA== 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 4N22Xj3LmRzW2Z; Tue, 1 Nov 2022 21:02:45 +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 2A1L2jtu069851; Tue, 1 Nov 2022 21:02:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2A1L2jW7069850; Tue, 1 Nov 2022 21:02:45 GMT (envelope-from git) Date: Tue, 1 Nov 2022 21:02:45 GMT Message-Id: <202211012102.2A1L2jW7069850@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: "Alfredo Dal'Ava Junior" Subject: git: b7ac17b48bdf - main - 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/main X-Git-Reftype: branch X-Git-Commit: b7ac17b48bdfc688b54b29aa4feacb535c91aec2 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1667336565; 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=qy3mHd/dtNT/kDGLDJpgPhbQnvkPux2D8Elm9BXJ16M=; b=IObBpf2w8p3prqG4VCJw4Md7VElS3q3AA8AdpPQX8xL8UyC6f0ycVOOMIXB7+E5hFfhn7B veuZ+fSctymo7/pw2VkFjhXyLSNg6NxbT57gwo5JV3mXkrq3SmuEtNRLhFbi7XkBSEcu6T VMfjXENgMj22JRXb04jTLYsohIIyIBGzAv/DHmeXqIWY4ODSTi7YuTvvs/chLnnOcz41Hv SEacTwYL743943dgjf3+lyutNjG6iy+GgejOInMDmOFidopX4hppZiYyaoMjbvuD1kltXf rzA7A+hBE8a7j59Zdjp4hQX2zyYFjnF8shn8FhzRtVeIeGhnnNTksBbq3bZhRQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1667336565; a=rsa-sha256; cv=none; b=LKfv/qYGcScxmOqVMn1uypGfyE0gp48DHl53xW48UQYGDYrBd31WfQdnLU8Fwo0ewwYdRD 9+eVKBXg3b/xJofBAJBe20if+XQHhfH1q2zL3UeElEeGZ8+l3AASSur7UvNCr0alueuF+Q hlfId5st3ucJSjLgS1Jo9OnupIOO72aFH6IUCZ8g+JvDiqDe55p2Cbmo/7hXw2WdRpexgF kFyzdhwVPHgW5Fbq5OSDct6p3uFwgUCrqeOVMTsxqpTv7f/JlhRhApqsP1FbmcItmTN/C+ VphRBFhocSfPIun5LzzuFkIXQLNZRvLIdVG52/styLOeTLcWRe4TU04d7G3CVQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by alfredo: URL: https://cgit.FreeBSD.org/src/commit/?id=b7ac17b48bdfc688b54b29aa4feacb535c91aec2 commit b7ac17b48bdfc688b54b29aa4feacb535c91aec2 Author: Alfredo Dal'Ava Junior AuthorDate: 2022-11-01 23:59:58 +0000 Commit: Alfredo Dal'Ava Junior CommitDate: 2022-11-02 00:04:10 +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 --- 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)