Bug 1829051 - Add clang path to $PATH during the build for mac builds. r=firefox-build-system-reviewers,andi

While here, replace the manual split of os.environ["PATH"] with
original_path, which is the same thing.

Differential Revision: https://phabricator.services.mozilla.com/D178408
This commit is contained in:
Mike Hommey 2023-05-18 21:31:03 +00:00
parent fbe994ebfd
commit 5b8d15821d

View File

@ -721,11 +721,18 @@ def rust_search_path(rust_path, search_order, original_path):
# Prepend the mozilla-build msys2 path, since otherwise we can get mismatched
# cygwin dll errors during configure if we get called from another msys2
# environment, see bug 1801826.
@depends(mozillabuild_bin_paths)
@depends(mozillabuild_bin_paths, clang_search_path, target, original_path)
@imports("os")
def altered_path(mozillabuild_bin_paths):
def altered_path(mozillabuild_bin_paths, clang_search_path, target, original_path):
altered_path = mozillabuild_bin_paths
for p in os.environ["PATH"].split(os.pathsep):
if target.kernel == "Darwin":
# The rust compiler wants to execute dsymutil, but it does so in a
# non-configurable way (https://github.com/rust-lang/rust/issues/52728)
# so we add the clang path.
path = clang_search_path
else:
path = original_path
for p in path:
if p not in altered_path:
altered_path.append(p)
return os.pathsep.join(altered_path)