Bug 1802405 - Prepend mozillabuild msys2 to path only for the build. r=glandium

This reverts bug 1801826 and instead prepends the msys2 path only for
the build, which is a bit more sensible.

This allows us to remove the existing warning from old_configure, since
that can't happen now.

Differential Revision: https://phabricator.services.mozilla.com/D163073
This commit is contained in:
Emilio Cobos Álvarez
2022-11-26 23:23:34 +00:00
parent cd2b114ec2
commit 40b6b7718c
5 changed files with 53 additions and 37 deletions

View File

@@ -116,11 +116,9 @@ def _maybe_activate_mozillabuild_environment():
paths_to_add = [mozillabuild_msys_tools_path, mozillabuild / "bin"]
existing_paths = [Path(p) for p in os.environ.get("PATH", "").split(os.pathsep)]
# It's important that we prepend to the path rather than append,
# in case mach is getting called from another msys2 environment.
for new_path in paths_to_add:
if new_path not in existing_paths:
os.environ["PATH"] = f"{new_path}{os.pathsep}" + os.environ["PATH"]
os.environ["PATH"] += f"{os.pathsep}{new_path}"
def initialize(topsrcdir):