./mach bootstrap fails with "psutil/_psutil_common.c:9:10: fatal error: 'Python.h' file not found"
Categories
(Firefox Build System :: Bootstrap Configuration, defect)
Tracking
(firefox-esr78 unaffected, firefox83 unaffected, firefox84 unaffected, firefox85 fixed)
Tracking | Status | |
---|---|---|
firefox-esr78 | --- | unaffected |
firefox83 | --- | unaffected |
firefox84 | --- | unaffected |
firefox85 | --- | fixed |
People
(Reporter: dholbert, Assigned: mhentges)
References
(Regression)
Details
(Keywords: regression)
Attachments
(2 files)
388 bytes,
patch
|
Details | Diff | Splinter Review | |
47 bytes,
text/x-phabricator-request
|
Details | Review |
STR:
(Steps 1 and 2 are to put you into a state where bootstrap will attempt to rebuild psutil. Step 3 puts you into a "freshly installed OS" state, from the perspective of this bug. Step 4 triggers the actual issue.)
-
Delete your
$HOME/ .cache/pip
directory (because it might contain a cached precompiled version ofpsutil
). -
Delete your
$MOZBUILD_STATE_PATH/_virtualenvs
directory. -
Remove your linux distro's packages for
python-dev
andpython3-dev
. e.g. on Ubuntu, run:
sudo apt-get remove python-dev python3-dev && sudo apt-get autoremove
-
./mach bootstrap
, choose option 2, and accept all the default options.
ACTUAL RESULTS:
This error:
Building wheels for collected packages: psutil
Building wheel for psutil (setup.py) ... error
ERROR: Command errored out with exit status 1:
[...SNIP...]
psutil/_psutil_common.c:9:10: fatal error: 'Python.h' file not found
#include <Python.h>
^~~~~~~~~~
1 error generated.
error: command 'clang' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for psutil
Running setup.py clean for psutil
Failed to build psutil
This is the same as bug 1679616, except on developers' machines rather than in CI.
I think we need to update the various mozboot files like https://searchfox.org/mozilla-central/source/python/mozboot/mozboot/debian.py in order to address this. I only have Ubuntu locally, so that's all I can test, so I'll only try to fix it there for now.
Reporter | ||
Comment 1•3 years ago
|
||
Hmm -- I was hoping that I could just fix this by adding python-dev
and python3-dev
to that mozboot debian.py
file's COMMON_PACKAGES list, but that doesn't quite fix this after all, because it looks like we don't try to install COMMON_PACKAGES until after we've set up the _virtualenv and failed to compile psutil.
I think this strawman fix would work if you run bootstrap twice (with the second invocation only being useful to install psutil), but that's kinda sloppy.
mhenteges, do you know if there's a cleaner/better fix here?
Reporter | ||
Comment 2•3 years ago
|
||
Reporter | ||
Comment 3•3 years ago
|
||
(I posted the strawman patch purely for reference, BTW; I'm not intending to take this bug myself, though we could theoretically push the strawman patch as a stopgap if there's in fact nothing better that we can do. If you know the right way to fix this, please proceed and don't worry about stepping on any toes. :))
Updated•3 years ago
|
Comment 4•3 years ago
|
||
Set release status flags based on info from the regressing bug 1666345
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Comment 5•3 years ago
|
||
Heh, thanks for the report! The CI-specific issue should've tipped me off that this was possible on dev machines too :)
We have a similar chicken-and-egg problem around needing a compiler to build python packages, but installing the compiler via a python script (which depends on the python environment, which depends on the packages).
I'll take a look to remember how we solved that, and to see if a similar approach can be used here.
Assignee | ||
Comment 6•3 years ago
|
||
Native python packages will probably require python headers. For some
systems, these are available in a separate system package (such as
python[3]-dev).
Pushed by mhentges@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/1a5dcdffe6c1 Install python packages after system packages r=firefox-build-system-reviewers,glandium
Comment 8•3 years ago
|
||
bugherder |
Updated•3 years ago
|
Description
•