diff options
author | Todd Gamblin <tgamblin@llnl.gov> | 2022-08-14 16:09:34 -0700 |
---|---|---|
committer | Todd Gamblin <tgamblin@llnl.gov> | 2022-08-17 10:42:15 -0700 |
commit | 73d25984ca898bcfeea6625d78961fb96c9b0f99 (patch) | |
tree | 8416acf9a1c6e79a597d896a0196126d62d6c20e /etc | |
parent | 50f8a0f0d6a70888197324a136dcdb45f0acc8ff (diff) | |
download | spack-73d25984ca898bcfeea6625d78961fb96c9b0f99.tar.gz spack-73d25984ca898bcfeea6625d78961fb96c9b0f99.tar.bz2 spack-73d25984ca898bcfeea6625d78961fb96c9b0f99.tar.xz spack-73d25984ca898bcfeea6625d78961fb96c9b0f99.zip |
clingo: fix bootstrapping on M1/monterey with command line tools
The Python that comes with XCode command line tools is a bit weird.
This fixes two issues that were preventing it from bootstrapping:
- [x] CommandLineTools python does not come with a `python-config` executable. If you
don't have one of these, CMake's FindPython will, for some reason, assume that you
want Python 2, so you need to set `CLINGO_PYTHON_VERSION` to ensure that clingo
tells `find_package(Python <VERSION>)` the right thing.
- [x] We weren't setting `PYTHONHOME` correctly in Python's `package.py`. We were
setting it to the `prefix` from Python `sysconfig`, but `prefix` tells you where
the executable lives. CommandLineTools python reports its prefix as
/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8
but that doesn't exist. It looks like Apple builds the full python and just copies
pieces of it into command line tools. PYTHONHOME is supposed to tell you where the
default python library location is. So you have to look at the `base`, which
`sysconfig` reports as
/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8
On most systems this is probably the same as `prefix`, but not with
CommandLineTools, which has its system library in a different place.
The second change here was cherry-picked to 0d981a012d before merging and doesn't show
up here.
Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
Diffstat (limited to 'etc')
0 files changed, 0 insertions, 0 deletions