Repository: spack/spack

Issue:
Bootstrap issue: cannot find Python (new apple M2)
### Steps to reproduce the issue

```console
$ spack spec zlib
```

@alalazo I'm setting up a brand-new M2 macbook air.  I've installed XCode and CLT (and used `xcode-select --reset` to cause the default tools to point back to xcode). The `python` command isn't available but `python3` is: Python 3.8 exists at `/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/bin/python3.8` , but the path Spack passes (`/Library/Python/3.8/include`) does not: there is no `/Library/Python`.

### Error message

<details><summary>Error message</summary><pre>
==> Installing clingo-bootstrap-spack-bunntglo2egkmjanvwkhqwejq5ydonh4
==> No binary for clingo-bootstrap-spack-bunntglo2egkmjanvwkhqwejq5ydonh4 found: installing from source
==> Using cached archive: /opt/spack/var/spack/cache/_source-cache/git//potassco/clingo.git/2a025667090d71b2c9dce60fe924feb6bde8f667.tar.gz
==> Warning: Fetching from mirror without a checksum!
  This package is normally checked out from a version control system, but it has been archived on a spack mirror.  This means we cannot know a checksum for the tarball in advance. Be sure that your connection to this mirror is secure!
==> Already patched clingo-bootstrap
==> clingo-bootstrap: Executing phase: 'cmake'
==> Error: ProcessError: Command exited with status 1:
    'cmake' '-G' 'Unix Makefiles' '-DCMAKE_INSTALL_PREFIX:STRING=/Users/seth/.spack/bootstrap/store/darwin-monterey-aarch64/apple-clang-13.1.6/clingo-bootstrap-spack-bunntglo2egkmjanvwkhqwejq5ydonh4' '-DCMAKE_BUILD_TYPE:STRING=Release' '-DBUILD_TESTING:BOOL=OFF' '-DCMAKE_INTERPROCEDURAL_OPTIMIZATION:BOOL=OFF' '-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON' '-DCMAKE_FIND_FRAMEWORK:STRING=LAST' '-DCMAKE_FIND_APPBUNDLE:STRING=LAST' '-DCMAKE_INSTALL_RPATH_USE_LINK_PATH:BOOL=ON' '-DCMAKE_INSTALL_RPATH:STRING=/Users/seth/.spack/bootstrap/store/darwin-monterey-aarch64/apple-clang-13.1.6/clingo-bootstrap-spack-bunntglo2egkmjanvwkhqwejq5ydonh4/lib;/Users/seth/.spack/bootstrap/store/darwin-monterey-aarch64/apple-clang-13.1.6/clingo-bootstrap-spack-bunntglo2egkmjanvwkhqwejq5ydonh4/lib64;/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib' '-DCMAKE_PREFIX_PATH:STRING=/Users/seth/.spack/bootstrap/store/darwin-monterey-aarch64/apple-clang-13.1.6/re2c-2.2-ax6z5gjajrwybsvlnktzrohv2qqhkzbn;/Users/seth/.spack/bootstrap/store/darwin-monterey-aarch64/apple-clang-13.1.6/cmake-3.23.2-syy3udkw2khnxsvhaa6wni3oi3q4ezuj;/Users/seth/.spack/bootstrap/store/darwin-monterey-aarch64/apple-clang-13.1.6/bison-3.8.2-m6v6mtbqsy7ws5ydetr7za6fewxnhw5l;/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8' '-DCLINGO_BUILD_WITH_LUA=OFF' '-DCLINGO_REQUIRE_PYTHON=ON' '-DCLINGO_BUILD_WITH_PYTHON=ON' '-DPYCLINGO_USER_INSTALL=OFF' '-DPYCLINGO_USE_INSTALL_PREFIX=ON' '-DCLINGO_BUILD_PY_SHARED:STRING=OFF' '-DPython_EXECUTABLE:STRING=/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/bin/python3.8' '-DPython_INCLUDE_DIR:STRING=/Library/Python/3.8/include' '-DCLINGO_BUILD_APPS:STRING=OFF' '/var/folders/n9/mqnx20b929z469f6p3fbq7c40000gn/T/seth/spack-stage/spack-stage-clingo-bootstrap-spack-bunntglo2egkmjanvwkhqwejq5ydonh4/spack-src'

1 error found in build log:
  >> 3    CMake Error at /Users/seth/.spack/bootstrap/store/darwin-monterey-aarch64/apple-clang-13.1.6/cmak
          e-3.23.2-syy3udkw2khnxsvhaa6wni3oi3q4ezuj/share/cmake-3.23/Modules/FindPackageHandleStandardArgs.
          cmake:230 (message):
     4      Could NOT find Python (missing: Python_LIBRARIES Interpreter Development
     5      Development.Module Development.Embed)
     6    Call Stack (most recent call first):
     7      /Users/seth/.spack/bootstrap/store/darwin-monterey-aarch64/apple-clang-13.1.6/cmake-3.23.2-syy3
          udkw2khnxsvhaa6wni3oi3q4ezuj/share/cmake-3.23/Modules/FindPackageHandleStandardArgs.cmake:594 (_F
          PHSA_FAILURE_MESSAGE)
     8      /Users/seth/.spack/bootstrap/store/darwin-monterey-aarch64/apple-clang-13.1.6/cmake-3.23.2-syy3
          udkw2khnxsvhaa6wni3oi3q4ezuj/share/cmake-3.23/Modules/FindPython.cmake:561 (find_package_handle_s
          tandard_args)
     9      CMakeLists.txt:130 (find_package)

See build log for details:
  /var/folders/n9/mqnx20b929z469f6p3fbq7c40000gn/T/seth/spack-stage/spack-stage-clingo-bootstrap-spack-bunntglo2egkmjanvwkhqwejq5ydonh4/spack-build-out.txt
==> Error: cannot bootstrap the "clingo" Python module from spec "clingo-bootstrap@spack+python %apple-clang target=aarch64" due to the following failures:
github-actions-v0.1 raised ValueError: source is not trusted
spack-install raised InstallError: Terminating after first install failure: ProcessError: Command exited with status 1:
    'cmake' '-G' 'Unix Makefiles' '-DCMAKE_INSTALL_PREFIX:STRING=/Users/seth/.spack/bootstrap/store/darwin-monterey-aarch64/apple-clang-13.1.6/clingo-bootstrap-spack-bunntglo2egkmjanvwkhqwejq5ydonh4' '-DCMAKE_BUILD_TYPE:STRING=Release' '-DBUILD_TESTING:BOOL=OFF' '-DCMAKE_INTERPROCEDURAL_OPTIMIZATION:BOOL=OFF' '-DCMAKE_VERBOSE_MAKEFILE:BOOL=ON' '-DCMAKE_FIND_FRAMEWORK:STRING=LAST' '-DCMAKE_FIND_APPBUNDLE:STRING=LAST' '-DCMAKE_INSTALL_RPATH_USE_LINK_PATH:BOOL=ON' '-DCMAKE_INSTALL_RPATH:STRING=/Users/seth/.spack/bootstrap/store/darwin-monterey-aarch64/apple-clang-13.1.6/clingo-bootstrap-spack-bunntglo2egkmjanvwkhqwejq5ydonh4/lib;/Users/seth/.spack/bootstrap/store/darwin-monterey-aarch64/apple-clang-13.1.6/clingo-bootstrap-spack-bunntglo2egkmjanvwkhqwejq5ydonh4/lib64;/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib' '-DCMAKE_PREFIX_PATH:STRING=/Users/seth/.spack/bootstrap/store/darwin-monterey-aarch64/apple-clang-13.1.6/re2c-2.2-ax6z5gjajrwybsvlnktzrohv2qqhkzbn;/Users/seth/.spack/bootstrap/store/darwin-monterey-aarch64/apple-clang-13.1.6/cmake-3.23.2-syy3udkw2khnxsvhaa6wni3oi3q4ezuj;/Users/seth/.spack/bootstrap/store/darwin-monterey-aarch64/apple-clang-13.1.6/bison-3.8.2-m6v6mtbqsy7ws5ydetr7za6fewxnhw5l;/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8' '-DCLINGO_BUILD_WITH_LUA=OFF' '-DCLINGO_REQUIRE_PYTHON=ON' '-DCLINGO_BUILD_WITH_PYTHON=ON' '-DPYCLINGO_USER_INSTALL=OFF' '-DPYCLINGO_USE_INSTALL_PREFIX=ON' '-DCLINGO_BUILD_PY_SHARED:STRING=OFF' '-DPython_EXECUTABLE:STRING=/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/bin/python3.8' '-DPython_INCLUDE_DIR:STRING=/Library/Python/3.8/include' '-DCLINGO_BUILD_APPS:STRING=OFF' '/var/folders/n9/mqnx20b929z469f6p3fbq7c40000gn/T/seth/spack-stage/spack-stage-clingo-bootstrap-spack-bunntglo2egkmjanvwkhqwejq5ydonh4/spack-src'
Run `spack --debug ...` for more detailed errors
</pre></details>


### Information on your system

* **Spack:** 0.19.0.dev0 (babb0edf077dfccf8e66ab63784437b06bdc3963)
* **Python:** 3.8.9
* **Platform:** darwin-monterey-m1
* **Concretizer:** clingo

### Additional information

[spack-build-out.txt](https://github.com/spack/spack/files/9184379/spack-build-out.txt)
[spack-build-env.txt](https://github.com/spack/spack/files/9184386/spack-build-env.txt)



### General information

- [X] I have run `spack debug report` and reported the version of Spack/Python/Platform
- [X] I have run `spack maintainers <name-of-the-package>` and **@mentioned** any maintainers
- [X] I have uploaded the build log and environment files
- [X] I have searched the issues of this repo and believe this is not a duplicate
clingo: fix bootstrapping on m1 (at least my configuration)
This is with a very very fresh system on an M2 mac running macOS 12.5, with Xcode 13.4.1 (Build version 13F100) and MacOSX12.3.sdk. `xcode-select` points to XCode rather than CommandLine Tools. CMake 3.23.2 successfully detects the Python include dirs at
```
/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8
```


Discussion:
CMake doesn't know how to find the system Python on macOS. Until we have pre-compiled clingo binaries for macOS arm64, you'll need to first install Python (homebrew, conda, source, etc.).
Also, it's interesting that your spec says M1 instead of M2. @alalazo is that something that needs to be fixed in archspec?
Good call @adamjstewart. Looks like I get to be a Guinea pig again...
https://github.com/archspec/archspec/issues/95
@adamjstewart I installed python through homebrew, and found that Spack still tries to use the system python (getting the same error). I then tried `spack --bootstrap uninstall -a python` and `spack --bootstrap external find python`, but Spack *still* uses the system python. I even removed the system python from `/Users/seth/.spack/bootstrap/config/packages.yaml` but it **still** tries to install it. 😩 
Try unsetting SPACK_PYTHON or explicitly setting it to the right exe. Spack caches this and it controls which exe is used to run Spack (and therefore to bootstrap)
That did the trick, thanks @adamjstewart ! Maybe we need to open a CMake issue to fix system python (especially if CLT or Xcode are installed).
I'm no CMake expert. Would it be an issue in the clingo repo or in the CMake repo? Who actually maintains the findpython code? @chuckatkins?
FindPython is something maintained by Kitware (but open to contributions). I've submitted patches to mainline CMake before so I'll see if I can take a crack at it.
@adamjstewart I dug into this: it turns out that `find_package(Python REQUIRED COMPONENTS Development Interpreter)` works with system python (at least with my current combination of CLT, Xcode). It also works when specifying `-DPython_EXECUTABLE:STRING=/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/bin/python3.8`.

*However* the problem is that the clingo bootstrap sets `'-DPython_INCLUDE_DIR:STRING=/Library/Python/3.8/include'`, which doesn't exist. That breaks the whole installation. So I will try to find out where the bogus include dir is coming from...
That's being set in the `cmake_python_hints` property in the `clingo` package. We query the `python` package and ask it where it's headers live. The problem is that the system Python uses a non-standard layout but fails to patch sysconfig so sysconfig has no idea where the header files actually live. I added a fallback to `<prefix>/include` but if the actual location is different then that won't work either. If you remove the `-DPython_INCLUDE_DIR` do things work? Maybe we should just always remove this. At least when the directory doesn't exist.
See this note in the Python package for a bunch of good references:
```
    # https://docs.python.org/3/library/sysconfig.html#installation-paths                
    # https://discuss.python.org/t/understanding-site-packages-directories/12959         
    # https://github.com/pypa/pip/blob/22.1/src/pip/_internal/locations/__init__.py      
    # https://github.com/pypa/installer/pull/103                                         
                                                                                         
    # NOTE: XCode Python's sysconfing module was incorrectly patched, and hard-codes     
    # everything to be installed in /Library/Python. Therefore, we need to use a         
    # fallback in the following methods. For more information, see:                      
    # https://github.com/pypa/pip/blob/22.1/src/pip/_internal/locations/__init__.py#L486 
```
This is the monolithic PR where I _attempted_ to fix this, or at least get us most of the way there: https://github.com/spack/spack/pull/30834
Yes, just removing the include dir works. Removing it when the directory doesn't exist definitely sounds like the quickest path to a successful bootstrap.
If that solves the issue then that's huge! We've gotten so many bug reports about bootstrapping on M1, glad we finally found a solution. Do you want to open a PR for this?
Alternatively, is there a real include dir somewhere that does exist but we just haven't figured out how to find it yet? If `python -m sysconfig` contains that directory somewhere we can add that to the list of config_vars we check.
I'm still working on this... in the standalone test I have:
```
project(test LANGUAGES CXX)
find_package(Python REQUIRED COMPONENTS Development Interpreter)
```
fails with `'-DPython_EXECUTABLE:STRING=/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/bin/python3.8' '-DPython_INCLUDE_DIR:STRING=/Library/Python/3.8/include'` (which Spack supplies for clingo-bootstrap) but passes with just `'-DPython_EXECUTABLE:STRING=/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/bin/python3.8'`. This is true even with the extra `'-DCMAKE_FIND_FRAMEWORK:STRING=LAST' '-DCMAKE_FIND_APPBUNDLE:STRING=LAST'` args.

However, unfortunately, dropping the bad "include" dir doesn't fix `clingo-bootstrap`... so I'm still working on it.
OK hold on: I think that last failure might've been due to a stale CMakeCache that the boostrap reused.  A standalone build with the env and the updated commands allowed clingo-bootstrap to configure. I'm continuing to try.
success! I deleted clingo-bootstrap and completed the boostrapping with system python. 🎉 

And yes, there is a true python include dir, at least if xcode is installed, at `/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8`. CMake seems to detect this automatically.
What's the output of `python -m sysconfig`? Is this directory (or parts of it) available anywhere?
(Idk why I'm asking, I also have M1 and can confirm/test things myself...)
On the newer systems, the obsolete `python` isn't available, but...
<details><pre>
$ python3 -m sysconfig
Platform: "macosx-10.14-arm64"
Python version: "3.8"
Current installation scheme: "osx_framework_library"

Paths:
	data = "/Library/Python/3.8"
	include = "/Library/Python/3.8/include"
	platinclude = "/Library/Python/3.8/include"
	platlib = "/Library/Python/3.8/site-packages"
	platstdlib = "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8"
	purelib = "/Library/Python/3.8/site-packages"
	scripts = "/usr/local/bin"
	stdlib = "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8"

Variables:
	ABIFLAGS = ""
	AC_APPLE_UNIVERSAL_BUILD = "0"
	AIX_GENUINE_CPLUSPLUS = "0"
	ALT_SOABI = "0"
	ANDROID_API_LEVEL = "0"
	AR = "ar"
	ARFLAGS = "rcs"
	BASECFLAGS = "-Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic"
	BASECPPFLAGS = "-IObjects -IInclude -IPython"
	BASEMODLIBS = ""
	BINDIR = "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/bin"
	BINLIBDEST = "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8"
	BLDLIBRARY = ""
	BLDSHARED = "clang -bundle -undefined dynamic_lookup -arch arm64 -arch x86_64 -Wl,-headerpad,0x1000"
	BUILDEXE = ".exe"
	BUILDPYTHON = "python.exe"
	BUILD_GNU_TYPE = "x86_64-apple-darwin"
	BYTESTR_DEPS = "\"
	CC = "clang"
	CCSHARED = ""
	CFLAGS = "-Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64 -arch x86_64 -Werror=implicit-function-declaration"
	CFLAGSFORSHARED = "-fvisibility=hidden -DPy_BUILD_SHARED"
	CFLAGS_ALIASING = "-fno-strict-aliasing"
	CFLAGS_NODIST = ""
	CONFIGFILES = "configure configure.ac acconfig.h pyconfig.h.in Makefile.pre.in"
	CONFIGURE_CFLAGS = "-iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64 -arch x86_64 -Werror=implicit-function-declaration"
	CONFIGURE_CFLAGS_NODIST = "-std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration"
	CONFIGURE_CPPFLAGS = "-iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64"
	CONFIGURE_LDFLAGS = "-Wl,-headerpad,0x1000"
	CONFIGURE_LDFLAGS_NODIST = ""
	CONFIG_ARGS = "'-C' '--host=x86_64-apple-darwin' '--build=x86_64-apple-darwin' '--enable-framework=/Applications/Xcode.app/Contents/Developer/Library/Frameworks' '--with-framework-name=Python3' '--with-openssl=/AppleInternal/BuildRoot/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.Internal.sdk/usr/local/libressl-2.8' '--with-openssl-ldflags=-L/AppleInternal/BuildRoot/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.Internal.sdk/usr/local/libressl-2.8/lib -F/AppleInternal/BuildRoot/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.Internal.sdk/System/Library/PrivateFrameworks' '--with-openssl-libs=-framework TrustEvaluationAgent' '--with-bundleid-prefix=com.apple' '--enable-ipv6' '--prefix=/Applications/Xcode.app/Contents/Developer/usr' '--with-pymalloc' '--with-cxx-main=xcrun -sdk macosx clang -arch arm64 -arch x86_64' 'PYTHON_FOR_BUILD=PYTHONPATH=/AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Sources/python3/python3-110/Python/Lib DYLD_FRAMEWORK_PATH=/AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Binaries/python3/install/TempContent/Objects/host /AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Binaries/python3/install/TempContent/Objects/host/python.exe' 'TRAIN_STYLE=DT' 'CC=xcrun -sdk macosx clang' 'CXX=xcrun -sdk macosx clang++' 'CPP=xcrun -sdk macosx clang -E' 'CFLAGS=-iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64 -arch x86_64 -Werror=implicit-function-declaration' 'CPPFLAGS=-iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64' 'LIBS=-lSystem' 'LDSHARED=xcrun -sdk macosx clang -bundle -undefined dynamic_lookup -arch arm64 -arch x86_64' 'LDFRAMEWORK=xcrun -sdk macosx clang -dynamiclib -arch arm64 -arch x86_64' 'LDFLAGS=-Wl,-headerpad,0x1000' 'OBJROOT=/AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Binaries/python3/install/TempContent/Objects' 'SDKROOT=/AppleInternal/BuildRoot/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.Internal.sdk' 'build_alias=x86_64-apple-darwin' 'host_alias=x86_64-apple-darwin'"
	CONFINCLUDEDIR = "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/include"
	CONFINCLUDEPY = "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers"
	COREPYTHONPATH = ""
	COVERAGE_INFO = "/AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Binaries/python3/install/TempContent/Objects/host/coverage.info"
	COVERAGE_REPORT = "/AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Binaries/python3/install/TempContent/Objects/host/lcov-report"
	COVERAGE_REPORT_OPTIONS = "--no-branch-coverage --title "CPython lcov report""
	CPPFLAGS = "-IObjects -IInclude -IPython -I. -I/AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Sources/python3/python3-110/Python/Include -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64"
	CURDIR = ""
	CXX = "clang++"
	DESTDIRS = "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8 /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8 /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/lib-dynload"
	DESTLIB = "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8"
	DESTPATH = ""
	DESTSHARED = "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/lib-dynload"
	DFLAGS = ""
	DIRMODE = "755"
	DIST = "README.rst ChangeLog configure configure.ac acconfig.h pyconfig.h.in Makefile.pre.in Include Lib Misc Ext-dummy"
	DISTDIRS = "Include Lib Misc Ext-dummy"
	DISTFILES = "README.rst ChangeLog configure configure.ac acconfig.h pyconfig.h.in Makefile.pre.in"
	DLINCLDIR = "."
	DLLLIBRARY = ""
	DOUBLE_IS_ARM_MIXED_ENDIAN_IEEE754 = "0"
	DOUBLE_IS_BIG_ENDIAN_IEEE754 = "0"
	DOUBLE_IS_LITTLE_ENDIAN_IEEE754 = "1"
	DTRACE = ""
	DTRACE_DEPS = "\"
	DTRACE_HEADERS = ""
	DTRACE_OBJS = ""
	DYNLOADFILE = "dynload_shlib.o"
	ENABLE_IPV6 = "1"
	ENSUREPIP = "upgrade"
	EXE = ""
	EXEMODE = "755"
	EXTRATESTOPTS = ""
	EXTRA_CFLAGS = ""
	EXT_SUFFIX = ".cpython-38-darwin.so"
	FILEMODE = "644"
	FLOAT_WORDS_BIGENDIAN = "0"
	FLOCK_NEEDS_LIBBSD = "0"
	GETPGRP_HAVE_ARG = "0"
	GETTIMEOFDAY_NO_TZ = "0"
	GITBRANCH = ""
	GITTAG = ""
	GITVERSION = ""
	GNULD = "no"
	HAVE_ACCEPT4 = "0"
	HAVE_ACOSH = "1"
	HAVE_ADDRINFO = "1"
	HAVE_ALARM = "1"
	HAVE_ALIGNED_REQUIRED = "0"
	HAVE_ALLOCA_H = "1"
	HAVE_ALTZONE = "0"
	HAVE_ASINH = "1"
	HAVE_ASM_TYPES_H = "0"
	HAVE_ATANH = "1"
	HAVE_BIND_TEXTDOMAIN_CODESET = "0"
	HAVE_BLUETOOTH_BLUETOOTH_H = "0"
	HAVE_BLUETOOTH_H = "0"
	HAVE_BROKEN_MBSTOWCS = "0"
	HAVE_BROKEN_NICE = "0"
	HAVE_BROKEN_PIPE_BUF = "0"
	HAVE_BROKEN_POLL = "0"
	HAVE_BROKEN_POSIX_SEMAPHORES = "0"
	HAVE_BROKEN_PTHREAD_SIGMASK = "0"
	HAVE_BROKEN_SEM_GETVALUE = "1"
	HAVE_BROKEN_UNSETENV = "0"
	HAVE_BUILTIN_ATOMIC = "1"
	HAVE_CHFLAGS = "1"
	HAVE_CHOWN = "1"
	HAVE_CHROOT = "1"
	HAVE_CLOCK = "1"
	HAVE_CLOCK_GETRES = "1"
	HAVE_CLOCK_GETTIME = "1"
	HAVE_CLOCK_SETTIME = "1"
	HAVE_COMPUTED_GOTOS = "1"
	HAVE_CONFSTR = "1"
	HAVE_CONIO_H = "0"
	HAVE_COPYSIGN = "1"
	HAVE_COPY_FILE_RANGE = "0"
	HAVE_CRYPT_H = "0"
	HAVE_CRYPT_R = "0"
	HAVE_CTERMID = "1"
	HAVE_CTERMID_R = "1"
	HAVE_CURSES_FILTER = "1"
	HAVE_CURSES_H = "1"
	HAVE_CURSES_HAS_KEY = "1"
	HAVE_CURSES_IMMEDOK = "1"
	HAVE_CURSES_IS_PAD = "0"
	HAVE_CURSES_IS_TERM_RESIZED = "1"
	HAVE_CURSES_RESIZETERM = "1"
	HAVE_CURSES_RESIZE_TERM = "1"
	HAVE_CURSES_SYNCOK = "1"
	HAVE_CURSES_TYPEAHEAD = "1"
	HAVE_CURSES_USE_ENV = "1"
	HAVE_CURSES_WCHGAT = "1"
	HAVE_DECL_ISFINITE = "1"
	HAVE_DECL_ISINF = "1"
	HAVE_DECL_ISNAN = "1"
	HAVE_DECL_RTLD_DEEPBIND = "0"
	HAVE_DECL_RTLD_GLOBAL = "1"
	HAVE_DECL_RTLD_LAZY = "1"
	HAVE_DECL_RTLD_LOCAL = "1"
	HAVE_DECL_RTLD_MEMBER = "0"
	HAVE_DECL_RTLD_NODELETE = "1"
	HAVE_DECL_RTLD_NOLOAD = "1"
	HAVE_DECL_RTLD_NOW = "1"
	HAVE_DECL_TZNAME = "0"
	HAVE_DEVICE_MACROS = "1"
	HAVE_DEV_PTC = "0"
	HAVE_DEV_PTMX = "1"
	HAVE_DIRECT_H = "0"
	HAVE_DIRENT_D_TYPE = "1"
	HAVE_DIRENT_H = "1"
	HAVE_DIRFD = "1"
	HAVE_DLFCN_H = "1"
	HAVE_DLOPEN = "1"
	HAVE_DUP2 = "1"
	HAVE_DUP3 = "0"
	HAVE_DYNAMIC_LOADING = "1"
	HAVE_ENDIAN_H = "0"
	HAVE_EPOLL = "0"
	HAVE_EPOLL_CREATE1 = "0"
	HAVE_ERF = "1"
	HAVE_ERFC = "1"
	HAVE_ERRNO_H = "1"
	HAVE_EXECV = "1"
	HAVE_EXPLICIT_BZERO = "0"
	HAVE_EXPLICIT_MEMSET = "0"
	HAVE_EXPM1 = "1"
	HAVE_FACCESSAT = "1"
	HAVE_FCHDIR = "1"
	HAVE_FCHMOD = "1"
	HAVE_FCHMODAT = "1"
	HAVE_FCHOWN = "1"
	HAVE_FCHOWNAT = "1"
	HAVE_FCNTL_H = "1"
	HAVE_FDATASYNC = "0"
	HAVE_FDOPENDIR = "1"
	HAVE_FDWALK = "0"
	HAVE_FEXECVE = "0"
	HAVE_FINITE = "0"
	HAVE_FLOCK = "1"
	HAVE_FORK = "1"
	HAVE_FORKPTY = "1"
	HAVE_FPATHCONF = "1"
	HAVE_FSEEK64 = "0"
	HAVE_FSEEKO = "1"
	HAVE_FSTATAT = "1"
	HAVE_FSTATVFS = "1"
	HAVE_FSYNC = "1"
	HAVE_FTELL64 = "0"
	HAVE_FTELLO = "1"
	HAVE_FTIME = "1"
	HAVE_FTRUNCATE = "1"
	HAVE_FUTIMENS = "1"
	HAVE_FUTIMES = "1"
	HAVE_FUTIMESAT = "0"
	HAVE_GAI_STRERROR = "1"
	HAVE_GAMMA = "0"
	HAVE_GCC_ASM_FOR_MC68881 = "0"
	HAVE_GCC_ASM_FOR_X64 = "0"
	HAVE_GCC_ASM_FOR_X87 = "0"
	HAVE_GCC_UINT128_T = "1"
	HAVE_GETADDRINFO = "1"
	HAVE_GETC_UNLOCKED = "1"
	HAVE_GETENTROPY = "0"
	HAVE_GETGRGID_R = "1"
	HAVE_GETGRNAM_R = "1"
	HAVE_GETGROUPLIST = "1"
	HAVE_GETGROUPS = "1"
	HAVE_GETHOSTBYNAME = "1"
	HAVE_GETHOSTBYNAME_R = "0"
	HAVE_GETHOSTBYNAME_R_3_ARG = "0"
	HAVE_GETHOSTBYNAME_R_5_ARG = "0"
	HAVE_GETHOSTBYNAME_R_6_ARG = "0"
	HAVE_GETITIMER = "1"
	HAVE_GETLOADAVG = "1"
	HAVE_GETLOGIN = "1"
	HAVE_GETNAMEINFO = "1"
	HAVE_GETPAGESIZE = "1"
	HAVE_GETPEERNAME = "1"
	HAVE_GETPGID = "1"
	HAVE_GETPGRP = "1"
	HAVE_GETPID = "1"
	HAVE_GETPRIORITY = "1"
	HAVE_GETPWENT = "1"
	HAVE_GETPWNAM_R = "1"
	HAVE_GETPWUID_R = "1"
	HAVE_GETRANDOM = "0"
	HAVE_GETRANDOM_SYSCALL = "0"
	HAVE_GETRESGID = "0"
	HAVE_GETRESUID = "0"
	HAVE_GETSID = "1"
	HAVE_GETSPENT = "0"
	HAVE_GETSPNAM = "0"
	HAVE_GETTIMEOFDAY = "1"
	HAVE_GETWD = "1"
	HAVE_GLIBC_MEMMOVE_BUG = "1"
	HAVE_GRP_H = "1"
	HAVE_HSTRERROR = "1"
	HAVE_HTOLE64 = "0"
	HAVE_HYPOT = "1"
	HAVE_IEEEFP_H = "0"
	HAVE_IF_NAMEINDEX = "1"
	HAVE_INET_ATON = "1"
	HAVE_INET_PTON = "1"
	HAVE_INITGROUPS = "1"
	HAVE_INTTYPES_H = "1"
	HAVE_IO_H = "0"
	HAVE_IPA_PURE_CONST_BUG = "0"
	HAVE_KILL = "1"
	HAVE_KILLPG = "1"
	HAVE_KQUEUE = "1"
	HAVE_LANGINFO_H = "1"
	HAVE_LARGEFILE_SUPPORT = "0"
	HAVE_LCHFLAGS = "1"
	HAVE_LCHMOD = "1"
	HAVE_LCHOWN = "1"
	HAVE_LGAMMA = "1"
	HAVE_LIBDL = "1"
	HAVE_LIBDLD = "0"
	HAVE_LIBIEEE = "0"
	HAVE_LIBINTL_H = "0"
	HAVE_LIBREADLINE = "1"
	HAVE_LIBRESOLV = "0"
	HAVE_LIBSENDFILE = "0"
	HAVE_LIBUTIL_H = "1"
	HAVE_LINK = "1"
	HAVE_LINKAT = "1"
	HAVE_LINUX_CAN_BCM_H = "0"
	HAVE_LINUX_CAN_H = "0"
	HAVE_LINUX_CAN_RAW_FD_FRAMES = "0"
	HAVE_LINUX_CAN_RAW_H = "0"
	HAVE_LINUX_MEMFD_H = "0"
	HAVE_LINUX_NETLINK_H = "0"
	HAVE_LINUX_QRTR_H = "0"
	HAVE_LINUX_RANDOM_H = "0"
	HAVE_LINUX_TIPC_H = "0"
	HAVE_LINUX_VM_SOCKETS_H = "0"
	HAVE_LOCKF = "1"
	HAVE_LOG1P = "1"
	HAVE_LOG2 = "1"
	HAVE_LONG_DOUBLE = "1"
	HAVE_LSTAT = "1"
	HAVE_LUTIMES = "1"
	HAVE_MADVISE = "1"
	HAVE_MAKEDEV = "1"
	HAVE_MBRTOWC = "1"
	HAVE_MEMFD_CREATE = "0"
	HAVE_MEMORY_H = "1"
	HAVE_MEMRCHR = "0"
	HAVE_MKDIRAT = "1"
	HAVE_MKFIFO = "1"
	HAVE_MKFIFOAT = "0"
	HAVE_MKNOD = "1"
	HAVE_MKNODAT = "0"
	HAVE_MKTIME = "1"
	HAVE_MMAP = "1"
	HAVE_MREMAP = "0"
	HAVE_NCURSES_H = "1"
	HAVE_NDIR_H = "0"
	HAVE_NETPACKET_PACKET_H = "0"
	HAVE_NET_IF_H = "1"
	HAVE_NICE = "1"
	HAVE_OPENAT = "1"
	HAVE_OPENPTY = "1"
	HAVE_PATHCONF = "1"
	HAVE_PAUSE = "1"
	HAVE_PIPE2 = "0"
	HAVE_PLOCK = "0"
	HAVE_POLL = "1"
	HAVE_POLL_H = "1"
	HAVE_POSIX_FADVISE = "0"
	HAVE_POSIX_FALLOCATE = "0"
	HAVE_POSIX_SPAWN = "1"
	HAVE_POSIX_SPAWNP = "1"
	HAVE_PREAD = "1"
	HAVE_PREADV = "1"
	HAVE_PREADV2 = "0"
	HAVE_PRLIMIT = "0"
	HAVE_PROCESS_H = "0"
	HAVE_PROTOTYPES = "1"
	HAVE_PTHREAD_CONDATTR_SETCLOCK = "0"
	HAVE_PTHREAD_DESTRUCTOR = "0"
	HAVE_PTHREAD_GETCPUCLOCKID = "0"
	HAVE_PTHREAD_H = "1"
	HAVE_PTHREAD_INIT = "0"
	HAVE_PTHREAD_KILL = "1"
	HAVE_PTHREAD_SIGMASK = "1"
	HAVE_PTY_H = "0"
	HAVE_PUTENV = "1"
	HAVE_PWRITE = "1"
	HAVE_PWRITEV = "1"
	HAVE_PWRITEV2 = "0"
	HAVE_READLINK = "1"
	HAVE_READLINKAT = "1"
	HAVE_READV = "1"
	HAVE_REALPATH = "1"
	HAVE_RENAMEAT = "1"
	HAVE_RL_APPEND_HISTORY = "0"
	HAVE_RL_CATCH_SIGNAL = "0"
	HAVE_RL_COMPLETION_APPEND_CHARACTER = "1"
	HAVE_RL_COMPLETION_DISPLAY_MATCHES_HOOK = "1"
	HAVE_RL_COMPLETION_MATCHES = "1"
	HAVE_RL_COMPLETION_SUPPRESS_APPEND = "0"
	HAVE_RL_PRE_INPUT_HOOK = "1"
	HAVE_RL_RESIZE_TERMINAL = "0"
	HAVE_ROUND = "1"
	HAVE_RTPSPAWN = "0"
	HAVE_SCHED_GET_PRIORITY_MAX = "1"
	HAVE_SCHED_H = "1"
	HAVE_SCHED_RR_GET_INTERVAL = "0"
	HAVE_SCHED_SETAFFINITY = "0"
	HAVE_SCHED_SETPARAM = "0"
	HAVE_SCHED_SETSCHEDULER = "0"
	HAVE_SEM_GETVALUE = "1"
	HAVE_SEM_OPEN = "1"
	HAVE_SEM_TIMEDWAIT = "0"
	HAVE_SEM_UNLINK = "1"
	HAVE_SENDFILE = "1"
	HAVE_SETEGID = "1"
	HAVE_SETEUID = "1"
	HAVE_SETGID = "1"
	HAVE_SETGROUPS = "1"
	HAVE_SETHOSTNAME = "1"
	HAVE_SETITIMER = "1"
	HAVE_SETLOCALE = "1"
	HAVE_SETPGID = "1"
	HAVE_SETPGRP = "1"
	HAVE_SETPRIORITY = "1"
	HAVE_SETREGID = "1"
	HAVE_SETRESGID = "0"
	HAVE_SETRESUID = "0"
	HAVE_SETREUID = "1"
	HAVE_SETSID = "1"
	HAVE_SETUID = "1"
	HAVE_SETVBUF = "1"
	HAVE_SF_HDTR = "1"
	HAVE_SHADOW_H = "0"
	HAVE_SHM_OPEN = "1"
	HAVE_SHM_UNLINK = "1"
	HAVE_SIGACTION = "1"
	HAVE_SIGALTSTACK = "1"
	HAVE_SIGFILLSET = "1"
	HAVE_SIGINFO_T_SI_BAND = "1"
	HAVE_SIGINTERRUPT = "1"
	HAVE_SIGNAL_H = "1"
	HAVE_SIGPENDING = "1"
	HAVE_SIGRELSE = "1"
	HAVE_SIGTIMEDWAIT = "0"
	HAVE_SIGWAIT = "1"
	HAVE_SIGWAITINFO = "0"
	HAVE_SNPRINTF = "1"
	HAVE_SOCKADDR_ALG = "0"
	HAVE_SOCKADDR_SA_LEN = "1"
	HAVE_SOCKADDR_STORAGE = "1"
	HAVE_SOCKETPAIR = "1"
	HAVE_SPAWN_H = "1"
	HAVE_SSIZE_T = "1"
	HAVE_STATVFS = "1"
	HAVE_STAT_TV_NSEC = "0"
	HAVE_STAT_TV_NSEC2 = "1"
	HAVE_STDARG_PROTOTYPES = "1"
	HAVE_STDINT_H = "1"
	HAVE_STDLIB_H = "1"
	HAVE_STD_ATOMIC = "1"
	HAVE_STRDUP = "1"
	HAVE_STRFTIME = "1"
	HAVE_STRINGS_H = "1"
	HAVE_STRING_H = "1"
	HAVE_STRLCPY = "1"
	HAVE_STROPTS_H = "0"
	HAVE_STRSIGNAL = "1"
	HAVE_STRUCT_PASSWD_PW_GECOS = "1"
	HAVE_STRUCT_PASSWD_PW_PASSWD = "1"
	HAVE_STRUCT_STAT_ST_BIRTHTIME = "1"
	HAVE_STRUCT_STAT_ST_BLKSIZE = "1"
	HAVE_STRUCT_STAT_ST_BLOCKS = "1"
	HAVE_STRUCT_STAT_ST_FLAGS = "1"
	HAVE_STRUCT_STAT_ST_GEN = "1"
	HAVE_STRUCT_STAT_ST_RDEV = "1"
	HAVE_STRUCT_TM_TM_ZONE = "1"
	HAVE_SYMLINK = "1"
	HAVE_SYMLINKAT = "1"
	HAVE_SYNC = "1"
	HAVE_SYSCONF = "1"
	HAVE_SYSEXITS_H = "1"
	HAVE_SYS_AUDIOIO_H = "0"
	HAVE_SYS_BSDTTY_H = "0"
	HAVE_SYS_DEVPOLL_H = "0"
	HAVE_SYS_DIR_H = "0"
	HAVE_SYS_ENDIAN_H = "0"
	HAVE_SYS_EPOLL_H = "0"
	HAVE_SYS_EVENT_H = "1"
	HAVE_SYS_FILE_H = "1"
	HAVE_SYS_IOCTL_H = "1"
	HAVE_SYS_KERN_CONTROL_H = "1"
	HAVE_SYS_LOADAVG_H = "0"
	HAVE_SYS_LOCK_H = "1"
	HAVE_SYS_MEMFD_H = "0"
	HAVE_SYS_MKDEV_H = "0"
	HAVE_SYS_MMAN_H = "1"
	HAVE_SYS_MODEM_H = "0"
	HAVE_SYS_NDIR_H = "0"
	HAVE_SYS_PARAM_H = "1"
	HAVE_SYS_POLL_H = "1"
	HAVE_SYS_RANDOM_H = "1"
	HAVE_SYS_RESOURCE_H = "1"
	HAVE_SYS_SELECT_H = "1"
	HAVE_SYS_SENDFILE_H = "0"
	HAVE_SYS_SOCKET_H = "1"
	HAVE_SYS_STATVFS_H = "1"
	HAVE_SYS_STAT_H = "1"
	HAVE_SYS_SYSCALL_H = "1"
	HAVE_SYS_SYSMACROS_H = "0"
	HAVE_SYS_SYS_DOMAIN_H = "1"
	HAVE_SYS_TERMIO_H = "0"
	HAVE_SYS_TIMES_H = "1"
	HAVE_SYS_TIME_H = "1"
	HAVE_SYS_TYPES_H = "1"
	HAVE_SYS_UIO_H = "1"
	HAVE_SYS_UN_H = "1"
	HAVE_SYS_UTSNAME_H = "1"
	HAVE_SYS_WAIT_H = "1"
	HAVE_SYS_XATTR_H = "1"
	HAVE_TCGETPGRP = "1"
	HAVE_TCSETPGRP = "1"
	HAVE_TEMPNAM = "1"
	HAVE_TERMIOS_H = "1"
	HAVE_TERM_H = "1"
	HAVE_TGAMMA = "1"
	HAVE_TIMEGM = "1"
	HAVE_TIMES = "1"
	HAVE_TMPFILE = "1"
	HAVE_TMPNAM = "1"
	HAVE_TMPNAM_R = "0"
	HAVE_TM_ZONE = "1"
	HAVE_TRUNCATE = "1"
	HAVE_TZNAME = "0"
	HAVE_UCS4_TCL = "0"
	HAVE_UNAME = "1"
	HAVE_UNISTD_H = "1"
	HAVE_UNLINKAT = "1"
	HAVE_UNSETENV = "1"
	HAVE_USABLE_WCHAR_T = "0"
	HAVE_UTIL_H = "1"
	HAVE_UTIMENSAT = "1"
	HAVE_UTIMES = "1"
	HAVE_UTIME_H = "1"
	HAVE_UUID_CREATE = "0"
	HAVE_UUID_ENC_BE = "0"
	HAVE_UUID_GENERATE_TIME_SAFE = "0"
	HAVE_UUID_H = "0"
	HAVE_UUID_UUID_H = "1"
	HAVE_WAIT3 = "1"
	HAVE_WAIT4 = "1"
	HAVE_WAITID = "1"
	HAVE_WAITPID = "1"
	HAVE_WCHAR_H = "1"
	HAVE_WCSCOLL = "1"
	HAVE_WCSFTIME = "1"
	HAVE_WCSXFRM = "1"
	HAVE_WMEMCMP = "1"
	HAVE_WORKING_TZSET = "1"
	HAVE_WRITEV = "1"
	HAVE_X509_VERIFY_PARAM_SET1_HOST = "1"
	HAVE_ZLIB_COPY = "1"
	HAVE__GETPTY = "0"
	HOST_GNU_TYPE = "x86_64-apple-darwin"
	INCLDIRSTOMAKE = "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/include /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/include /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers/internal /Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers"
	INCLUDEDIR = "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/include"
	INCLUDEPY = "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers"
	INSTALL = "/usr/bin/install -c"
	INSTALL_DATA = "/usr/bin/install -c -m 644"
	INSTALL_PROGRAM = "/usr/bin/install -c"
	INSTALL_SCRIPT = "/usr/bin/install -c"
	INSTALL_SHARED = "/usr/bin/install -c -m 755"
	INSTSONAME = "Python3.framework/Versions/3.8/Python3"
	IO_H = "Modules/_io/_iomodule.h"
	IO_OBJS = "\"
	LDCXXSHARED = "clang -bundle -undefined dynamic_lookup -arch arm64 -arch x86_64"
	LDFLAGS = "-Wl,-headerpad,0x1000"
	LDFLAGS_NODIST = ""
	LDFRAMEWORK = "clang -dynamiclib -arch arm64 -arch x86_64"
	LDLIBRARY = "Python3.framework/Versions/3.8/Python3"
	LDLIBRARYDIR = ""
	LDSHARED = "clang -bundle -undefined dynamic_lookup -arch arm64 -arch x86_64 -Wl,-headerpad,0x1000"
	LDVERSION = "3.8"
	LIBC = ""
	LIBDEST = "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8"
	LIBDIR = "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib"
	LIBFFI_INCLUDEDIR = ""
	LIBM = ""
	LIBOBJDIR = "Python/"
	LIBOBJS = ""
	LIBPC = "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/pkgconfig"
	LIBPL = "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/config-3.8-darwin"
	LIBPYTHON = ""
	LIBRARY = "libpython3.8.a"
	LIBRARY_OBJS = "\"
	LIBRARY_OBJS_OMIT_FROZEN = "\"
	LIBS = "-ldl -lSystem  -framework CoreFoundation"
	LIBSUBDIRS = "tkinter tkinter/test tkinter/test/test_tkinter \"
	LIBTESTDEST = "/AppleInternal/Tests/Python/3.8/"
	LIBZIPDEST = "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python$(subst .,,3.8).zip"
	LINKCC = "clang -arch arm64 -arch x86_64"
	LINKFORSHARED = "-Wl,-stack_size,1000000  -framework CoreFoundation Python3.framework/Versions/3.8/Python3"
	LIPO_32BIT_FLAGS = ""
	LLVM_PROF_ERR = "no"
	LLVM_PROF_FILE = "LLVM_PROFILE_FILE="code-%p.profclangr""
	LLVM_PROF_MERGER = "/usr/bin/xcrun llvm-profdata merge -output=code.profclangd *.profclangr"
	LN = "ln"
	LOCALMODLIBS = ""
	MACHDEP = "darwin"
	MACHDEP_OBJS = ""
	MACHDESTLIB = "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8"
	MACOSX_DEPLOYMENT_TARGET = "10.14"
	MAINCC = "clang -arch arm64 -arch x86_64"
	MAJOR_IN_MKDEV = "0"
	MAJOR_IN_SYSMACROS = "0"
	MAKESETUP = "/AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Sources/python3/python3-110/Python/Modules/makesetup"
	MANDIR = "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/share/man"
	MKDIR_P = "/AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Sources/python3/python3-110/Python/install-sh -c -d"
	MODBUILT_NAMES = "posix  errno  pwd  _sre  _codecs  _weakref  _functools  _operator  _collections  _abc  itertools  atexit  _signal  _stat  time  _thread  _locale  _io  faulthandler  _tracemalloc  _symtable  xxsubtype"
	MODDISABLED_NAMES = ""
	MODLIBS = ""
	MODOBJS = "Modules/posixmodule.o  Modules/errnomodule.o  Modules/pwdmodule.o  Modules/_sre.o  Modules/_codecsmodule.o  Modules/_weakref.o  Modules/_functoolsmodule.o  Modules/_operator.o  Modules/_collectionsmodule.o  Modules/_abc.o  Modules/itertoolsmodule.o  Modules/atexitmodule.o  Modules/signalmodule.o  Modules/_stat.o  Modules/timemodule.o  Modules/_threadmodule.o  Modules/_localemodule.o  Modules/_iomodule.o Modules/iobase.o Modules/fileio.o Modules/bytesio.o Modules/bufferedio.o Modules/textio.o Modules/stringio.o  Modules/faulthandler.o  Modules/_tracemalloc.o Modules/hashtable.o  Modules/symtablemodule.o  Modules/xxsubtype.o"
	MODULE_OBJS = "\"
	MULTIARCH = "darwin"
	MULTIARCH_CPPFLAGS = "-DMULTIARCH=\"darwin\""
	MVWDELCH_IS_EXPRESSION = "1"
	NO_AS_NEEDED = ""
	OBJECT_OBJS = "\"
	OPENSSL_INCLUDES = "-I/AppleInternal/BuildRoot/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.Internal.sdk/usr/local/libressl-2.8/include"
	OPENSSL_LDFLAGS = "-L/AppleInternal/BuildRoot/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.Internal.sdk/usr/local/libressl-2.8/lib -F/AppleInternal/BuildRoot/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.Internal.sdk/System/Library/PrivateFrameworks"
	OPENSSL_LIBS = "-lssl -lcrypto -framework TrustEvaluationAgent"
	OPT = "-DNDEBUG -g -fwrapv -O3 -Wall"
	OTHER_LIBTOOL_OPT = ""
	PACKAGE_BUGREPORT = "0"
	PACKAGE_NAME = "0"
	PACKAGE_STRING = "0"
	PACKAGE_TARNAME = "0"
	PACKAGE_URL = "0"
	PACKAGE_VERSION = "0"
	PARSER_HEADERS = "\"
	PARSER_OBJS = "\ Parser/myreadline.o Parser/parsetok.o Parser/tokenizer.o"
	PGO_PROF_GEN_FLAG = "-fprofile-instr-generate"
	PGO_PROF_USE_FLAG = "-fprofile-instr-use=code.profclangd"
	POBJS = "\"
	POSIX_SEMAPHORES_NOT_ENABLED = "0"
	PROFILE_TASK = "-m test --pgo"
	PTHREAD_KEY_T_IS_COMPATIBLE_WITH_INT = "0"
	PTHREAD_SYSTEM_SCHED_SUPPORTED = "1"
	PURIFY = ""
	PY3LIBRARY = ""
	PYLONG_BITS_IN_DIGIT = "0"
	PYTHON = "python"
	PYTHONFRAMEWORK = "Python3"
	PYTHONFRAMEWORKDIR = "Python3.framework"
	PYTHONFRAMEWORKINSTALLDIR = "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework"
	PYTHONFRAMEWORKPREFIX = "/Applications/Xcode.app/Contents/Developer/Library/Frameworks"
	PYTHONPATH = ""
	PYTHON_FOR_BUILD = "./python.exe -E"
	PYTHON_FOR_REGEN = "python3.8"
	PYTHON_HEADERS = "\"
	PYTHON_OBJS = "\"
	PY_BUILTIN_MODULE_CFLAGS = "-g -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64 -arch x86_64 -Werror=implicit-function-declaration -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration  -I/AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Sources/python3/python3-110/Python/Include/internal -IObjects -IInclude -IPython -I. -I/AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Sources/python3/python3-110/Python/Include -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64 -fvisibility=hidden -DPy_BUILD_SHARED -DPy_BUILD_CORE_BUILTIN"
	PY_CFLAGS = "-Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64 -arch x86_64 -Werror=implicit-function-declaration"
	PY_CFLAGS_NODIST = "-std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration  -I/AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Sources/python3/python3-110/Python/Include/internal"
	PY_COERCE_C_LOCALE = "1"
	PY_CORE_CFLAGS = "-g -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64 -arch x86_64 -Werror=implicit-function-declaration -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration  -I/AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Sources/python3/python3-110/Python/Include/internal -IObjects -IInclude -IPython -I. -I/AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Sources/python3/python3-110/Python/Include -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64 -fvisibility=hidden -DPy_BUILD_SHARED -DPy_BUILD_CORE"
	PY_CORE_LDFLAGS = "-Wl,-headerpad,0x1000"
	PY_CPPFLAGS = "-IObjects -IInclude -IPython -I. -I/AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Sources/python3/python3-110/Python/Include -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64"
	PY_FORMAT_SIZE_T = ""z""
	PY_LDFLAGS = "-Wl,-headerpad,0x1000"
	PY_LDFLAGS_NODIST = ""
	PY_SSL_DEFAULT_CIPHERS = "1"
	PY_SSL_DEFAULT_CIPHER_STRING = "0"
	PY_STDMODULE_CFLAGS = "-Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64 -arch x86_64 -Werror=implicit-function-declaration -std=c99 -Wextra -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Wstrict-prototypes -Werror=implicit-function-declaration  -I/AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Sources/python3/python3-110/Python/Include/internal -IObjects -IInclude -IPython -I. -I/AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Sources/python3/python3-110/Python/Include -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64 -fvisibility=hidden -DPy_BUILD_SHARED"
	Py_DEBUG = "0"
	Py_ENABLE_SHARED = "0"
	Py_HASH_ALGORITHM = "0"
	Py_TRACE_REFS = "0"
	QUICKTESTOPTS = "-x test_subprocess test_io test_lib2to3 \"
	READELF = ":"
	RESSRCDIR = "Mac/Resources/framework"
	RETSIGTYPE = "void"
	RUNSHARED = "DYLD_FRAMEWORK_PATH=/AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Binaries/python3/install/TempContent/Objects/host:/AppleInternal/XBS/Bundles/XBS.bundle/Contents/Frameworks DYLD_LIBRARY_PATH=/libressl/ssl/.libs:/libressl/crypto/.libs"
	SCRIPTDIR = "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib"
	SDKROOT = "/AppleInternal/BuildRoot/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.Internal.sdk"
	SETPGRP_HAVE_ARG = "0"
	SGI_ABI = "@SGI_ABI@"
	SHELL = "/bin/sh"
	SHLIBS = "-ldl -lSystem  -framework CoreFoundation"
	SHLIB_SUFFIX = ".so"
	SHM_NEEDS_LIBRT = "0"
	SIGNED_RIGHT_SHIFT_ZERO_FILLS = "0"
	SITEPATH = ""
	SIZEOF_DOUBLE = "8"
	SIZEOF_FLOAT = "4"
	SIZEOF_FPOS_T = "8"
	SIZEOF_INT = "4"
	SIZEOF_LONG = "8"
	SIZEOF_LONG_DOUBLE = "16"
	SIZEOF_LONG_LONG = "8"
	SIZEOF_OFF_T = "8"
	SIZEOF_PID_T = "4"
	SIZEOF_PTHREAD_KEY_T = "8"
	SIZEOF_PTHREAD_T = "8"
	SIZEOF_SHORT = "2"
	SIZEOF_SIZE_T = "8"
	SIZEOF_TIME_T = "8"
	SIZEOF_UINTPTR_T = "8"
	SIZEOF_VOID_P = "8"
	SIZEOF_WCHAR_T = "4"
	SIZEOF__BOOL = "1"
	SO = ".cpython-38-darwin.so"
	SOABI = "cpython-38-darwin"
	SRCDIRS = "Parser Objects Python Modules Modules/_io Programs"
	SRC_GDB_HOOKS = "/AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Sources/python3/python3-110/Python/Tools/gdb/libpython.py"
	STDC_HEADERS = "1"
	STRICT_SYSV_CURSES = "/* Don't use ncurses extensions */"
	STRIPFLAG = "-s"
	SUBDIRS = ""
	SUBDIRSTOO = "Include Lib Misc"
	SYSLIBS = ""
	SYS_SELECT_WITH_SYS_TIME = "1"
	TARGET_OS_EMBEDDED = "0"
	TCLTK_INCLUDES = ""
	TCLTK_LIBS = ""
	TESTOPTS = ""
	TESTPATH = ""
	TESTPYTHON = "DYLD_FRAMEWORK_PATH=/AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Binaries/python3/install/TempContent/Objects/host:/AppleInternal/XBS/Bundles/XBS.bundle/Contents/Frameworks DYLD_LIBRARY_PATH=/libressl/ssl/.libs:/libressl/crypto/.libs ./python.exe"
	TESTPYTHONOPTS = ""
	TESTRUNNER = "DYLD_FRAMEWORK_PATH=/AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Binaries/python3/install/TempContent/Objects/host:/AppleInternal/XBS/Bundles/XBS.bundle/Contents/Frameworks DYLD_LIBRARY_PATH=/libressl/ssl/.libs:/libressl/crypto/.libs ./python.exe /AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Sources/python3/python3-110/Python/Tools/scripts/run_tests.py"
	TESTTIMEOUT = "1200"
	TIMEMODULE_LIB = "0"
	TIME_WITH_SYS_TIME = "1"
	TM_IN_SYS_TIME = "0"
	TRAIN_STYLE = "DT"
	TRAIN_STYLE_DT = "1"
	UNICODE_DEPS = "\"
	UNIVERSALSDK = ""
	UPDATE_FILE = "python3.8 /AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Sources/python3/python3-110/Python/Tools/scripts/update_file.py"
	USE_COMPUTED_GOTOS = "0"
	VERSION = "3.8"
	VPATH = "/AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Sources/python3/python3-110/Python"
	WINDOW_HAS_FLAGS = "1"
	WITH_DECIMAL_CONTEXTVAR = "1"
	WITH_DOC_STRINGS = "1"
	WITH_DTRACE = "0"
	WITH_DYLD = "1"
	WITH_LIBINTL = "0"
	WITH_NEXT_FRAMEWORK = "1"
	WITH_PYMALLOC = "1"
	WITH_VALGRIND = "0"
	X87_DOUBLE_ROUNDING = "0"
	XMLLIBSUBDIRS = "xml xml/dom xml/etree xml/parsers xml/sax"
	ZIPSTDLIB = "no"
	abiflags = ""
	abs_builddir = "/AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Binaries/python3/install/TempContent/Objects/host"
	abs_srcdir = "/AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Sources/python3/python3-110/Python"
	base = "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8"
	datarootdir = "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/share"
	exec_prefix = "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8"
	installed_base = "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8"
	installed_platbase = "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8"
	platbase = "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8"
	prefix = "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8"
	projectbase = "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/bin"
	py_version = "3.8.9"
	py_version_nodot = "38"
	py_version_short = "3.8"
	srcdir = "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/config-3.8-darwin"
	userbase = "/Users/seth/Library/Python/3.8"
</pre></details>
I think the solution is to look at the `INCLUDEPY` setting. `CONFINCLUDEPY` also contains the correct directory. We have a ton of methods to search for libraries but no one encountered issues with headers until now. I'll submit a PR to fix `spec['python'].headers`.
Fixes #31735 

Resolving patch:
diff --git a/var/spack/repos/builtin/packages/clingo/package.py b/var/spack/repos/builtin/packages/clingo/package.py
--- a/var/spack/repos/builtin/packages/clingo/package.py
+++ b/var/spack/repos/builtin/packages/clingo/package.py
@@ -74,8 +74,8 @@ def cmake_python_hints(self):
         """
         python = self.spec["python"]
         return [
-            self.define("Python_EXECUTABLE", str(python.command)),
-            self.define("Python_INCLUDE_DIR", python.package.config_vars["include"]),
+            self.define("Python_EXECUTABLE", python.command),
+            self.define("Python_INCLUDE_DIR", python.headers.directories[0]),
         ]
 
     @property
diff --git a/var/spack/repos/builtin/packages/python/package.py b/var/spack/repos/builtin/packages/python/package.py
--- a/var/spack/repos/builtin/packages/python/package.py
+++ b/var/spack/repos/builtin/packages/python/package.py
@@ -961,6 +961,7 @@ def config_vars(self):
                 # get_config_vars
                 "BINDIR": self.prefix.bin,
                 "CC": "cc",
+                "CONFINCLUDEPY": self.prefix.include.join("python{}").format(version),
                 "CXX": "c++",
                 "INCLUDEPY": self.prefix.include.join("python{}").format(version),
                 "LIBDEST": self.prefix.lib.join("python{}").format(version),
@@ -1098,15 +1099,17 @@ def libs(self):
 
     @property
     def headers(self):
-        directory = self.config_vars["include"]
+        # Location where pyconfig.h is _supposed_ to be
         config_h = self.config_vars["config_h_filename"]
-
         if os.path.exists(config_h):
             headers = HeaderList(config_h)
         else:
-            headers = find_headers("pyconfig", directory)
-            if headers:
-                config_h = headers[0]
+            # If not, one of these config vars should contain the right directory
+            for var in ["INCLUDEPY", "CONFINCLUDEPY"]:
+                headers = find_headers("pyconfig", self.config_vars[var])
+                if headers:
+                    config_h = headers[0]
+                    break
             else:
                 msg = "Unable to locate {} headers in {}"
                 raise spack.error.NoHeadersError(msg.format(self.name, directory))


Test patch: