Skip to content

[macos-15] make build fails with XCode is not installed even if it is installed #2473

Open
@ssbarnea

Description

Summary

  • OS: 15.1.1
  • Architecture: ARM
  • Psutil version: main branch
  • Python version: Python 3.13.0
  • Type: core

Description

~/code/os/psutil
❯ make build
PYTHONWARNINGS=always PYTHONUNBUFFERED=1 PSUTIL_DEBUG=1 python3 setup.py build_ext -i `python3 -c "import sys, os; py36 = sys.version_info[:2] >= (3, 6); cpus = os.cpu_count() or 1 if py36 else 1; print('--parallel %s' % cpus if cpus > 1 else '')"`
running build_ext
building 'psutil._psutil_osx' extension
clang -fno-strict-overflow -Wsign-compare -Wunreachable-code -DNDEBUG -g -O3 -Wall -arch arm64 -mmacosx-version-min=11.0 -Wno-nullability-completeness -Wno-expansion-to-defined -Wno-undef-prefix -fPIC -Werror=unguarded-availability-new -I/opt/homebrew/opt/openssl@3/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include -DPSUTIL_POSIX=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=610 -DPy_LIMITED_API=0x03060000 -DPSUTIL_OSX=1 -I/Users/ssbarnea/.config/mise/installs/python/3.13.0/include/python3.13 -c psutil/_psutil_common.c -o build/temp.macosx-11.0-arm64-cpython-313/psutil/_psutil_common.o
clang -fno-strict-overflow -Wsign-compare -Wunreachable-code -DNDEBUG -g -O3 -Wall -arch arm64 -mmacosx-version-min=11.0 -Wno-nullability-completeness -Wno-expansion-to-defined -Wno-undef-prefix -fPIC -Werror=unguarded-availability-new -I/opt/homebrew/opt/openssl@3/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include -DPSUTIL_POSIX=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=610 -DPy_LIMITED_API=0x03060000 -DPSUTIL_OSX=1 -I/Users/ssbarnea/.config/mise/installs/python/3.13.0/include/python3.13 -c psutil/_psutil_osx.c -o build/temp.macosx-11.0-arm64-cpython-313/psutil/_psutil_osx.o
clang -fno-strict-overflow -Wsign-compare -Wunreachable-code -DNDEBUG -g -O3 -Wall -arch arm64 -mmacosx-version-min=11.0 -Wno-nullability-completeness -Wno-expansion-to-defined -Wno-undef-prefix -fPIC -Werror=unguarded-availability-new -I/opt/homebrew/opt/openssl@3/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include -DPSUTIL_POSIX=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=610 -DPy_LIMITED_API=0x03060000 -DPSUTIL_OSX=1 -I/Users/ssbarnea/.config/mise/installs/python/3.13.0/include/python3.13 -c psutil/_psutil_posix.c -o build/temp.macosx-11.0-arm64-cpython-313/psutil/_psutil_posix.o
clang -fno-strict-overflow -Wsign-compare -Wunreachable-code -DNDEBUG -g -O3 -Wall -arch arm64 -mmacosx-version-min=11.0 -Wno-nullability-completeness -Wno-expansion-to-defined -Wno-undef-prefix -fPIC -Werror=unguarded-availability-new -I/opt/homebrew/opt/openssl@3/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include -DPSUTIL_POSIX=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=610 -DPy_LIMITED_API=0x03060000 -DPSUTIL_OSX=1 -I/Users/ssbarnea/.config/mise/installs/python/3.13.0/include/python3.13 -c psutil/arch/osx/cpu.c -o build/temp.macosx-11.0-arm64-cpython-313/psutil/arch/osx/cpu.o
psutil/arch/osx/cpu.c:140:43: error: 'kIOMainPortDefault' is only available on macOS 12.0 or newer [-Werror,-Wunguarded-availability-new]
  140 |     status = IOServiceGetMatchingServices(kIOMainPortDefault, matching, &iter);
      |                                           ^~~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/IOKit.framework/Headers/IOKitLib.h:112:19: note: 'kIOMainPortDefault' has been marked as being introduced in macOS 12.0 here, but the deployment target is macOS 11.0.0
  112 | const mach_port_t kIOMainPortDefault
      |                   ^
psutil/arch/osx/cpu.c:140:43: note: enclose 'kIOMainPortDefault' in a __builtin_available check to silence this warning
  140 |     status = IOServiceGetMatchingServices(kIOMainPortDefault, matching, &iter);
      |                                           ^~~~~~~~~~~~~~~~~~
1 error generated.
XCode (https://developer.apple.com/xcode/) is not installed
error: command '/usr/bin/clang' failed with exit code 1
make: *** [build] Error 1
  • I mention that Xcode and Xcode command line tools are installed.
  • Python is installed using mise and I tried with 3.13, 3.12, 3.11 and 3.10 all have the same behavior.
  • I also tried the pip install --no-binary :all: . based on the dev guide but it also fails with the same compilation errors while running building 'psutil._psutil_osx' extension, which is a little bit confusing, considering the --no-binary flag.
  • tried doing export MACOSX_DEPLOYMENT_TARGET=12.0 and running again, but no change.

I am trying to figure out where the -mmacosx-version-min=11.0 comes from as I suspect that switching to 12.0 might sort this issue.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions