Closed Bug 1523153 Opened 9 months ago Closed 9 months ago

find_program doesn't use PATH from mozconfig


(Firefox Build System :: General, defect)

Not set


(firefox67 fixed)

Tracking Status
firefox67 --- fixed


(Reporter: glandium, Assigned: glandium)




(3 files)

If you have export PATH=/some/path:$PATH in .mozconfig and have, say, llvm-config in /some/path, configure won't find it. This is actually a regression from bug 1520394.

Bug 1520394 changed things such that the configure sandbox is using a
copy of os.environ. So when mozconfig injects environment changes, they
only affect the sandbox. Which means when the which module uses
os.environ to get PATH, it gets the original unmodified environment.

So instead of relying on the which module getting PATH itself, we feed
it with it. It's worth noting that the which module adds . on Windows,
but we don't copy this behavior, because in the context of configure,
it's actually not important (. would be the topobjdir).

Also, while here, replace subprocess.check_output with check_cmd_output.

Depends on D17771

The combination of bug 1515579 and bug 1520394 made things harder for
old-configure, because it doesn't necessarily have a complete view of
the search PATH that has been used. This doesn't actually cause problems
on non-Windows builds because things work out fine, but on Windows,
some of the executions of clang-cl in old-configure insist on being able
to find a MSVC install. That, again, doesn't currently cause problems in
general on local builds because clang-cl finds it through the registry
(presumably), and on automation, because it's in the mk_add_options export'ed PATH, but the latter is due to change.

Depends on D17772

Blocks: 1523201
Pushed by
Don't rely on which.which's os.environ in python configure. r=chmanchester
Use find_program instead of which in llvm_config_paths. r=chmanchester
Pass the altered PATH to old-configure. r=chmanchester
Closed: 9 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla67
Depends on: 1523593
You need to log in before you can comment on or make changes to this bug.