Closed Bug 1523153 Opened 9 months ago Closed 9 months ago

find_program doesn't use PATH from mozconfig

Categories

(Firefox Build System :: General, defect)

defect
Not set

Tracking

(firefox67 fixed)

RESOLVED FIXED
mozilla67
Tracking Status
firefox67 --- fixed

People

(Reporter: glandium, Assigned: glandium)

References

Details

Attachments

(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 mh@glandium.org:
https://hg.mozilla.org/integration/autoland/rev/b6ccebd7411a
Don't rely on which.which's os.environ in python configure. r=chmanchester
https://hg.mozilla.org/integration/autoland/rev/22c349313334
Use find_program instead of which in llvm_config_paths. r=chmanchester
https://hg.mozilla.org/integration/autoland/rev/a12f5e7e9da2
Pass the altered PATH to old-configure. r=chmanchester
Status: NEW → RESOLVED
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.