ronaldoussoren / pyobjc

The Python <-> Objective-C Bridge with bindings for macOS frameworks
https://pyobjc.readthedocs.io
545 stars 46 forks source link

xcodebuild requires Xcode #620

Open jaraco opened 2 weeks ago

jaraco commented 2 weeks ago

Describe the bug I've encountered the error reported in https://github.com/ronaldoussoren/pyobjc/issues/569#issuecomment-1880015695

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

It does appear as if that issue was addressed in 6a799d2 and released in 10.3 and 10.3.1, but when I try to install that version from source, it fails to build with the reported error.

I do have Xcode installed, but presumably the tools are installed as CLI tools only (?).

I suspect I'm doing something wrong, so I'm mainly looking for expert advice. Should I be doing something differently?

Platform information

To Reproduce

py -3.12 -m pip install --no-binary :all: pyobjc

Expected behavior The package(s) should build.

jaraco commented 2 weeks ago

Looking at the traceback, it points to pyobjc-framework-addressbook:

        File "/private/var/folders/f2/2plv6q2n7l932m2x004jlw340000gn/T/pip-install-35nzwty9/pyobjc-framework-addressbook_694a0abfc59445b6ada044e2b29fffb5/pyobjc_setup.py", line 517, in Extension
          lines = subprocess.check_output(["xcodebuild", "-version"], text=True).splitlines()
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/opt/homebrew/Cellar/python@3.12/3.12.5/Frameworks/Python.framework/Versions/3.12/lib/python3.12/subprocess.py", line 466, in check_output
          return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/opt/homebrew/Cellar/python@3.12/3.12.5/Frameworks/Python.framework/Versions/3.12/lib/python3.12/subprocess.py", line 571, in run
          raise CalledProcessError(retcode, process.args,
      subprocess.CalledProcessError: Command '['xcodebuild', '-version']' returned non-zero exit status 1.
jaraco commented 2 weeks ago

Aha. Looks like there are other references to a similar issue, such as in 864a21829c578f6479ac6401d191fb759215175e, which is not yet part of any release.

ronaldoussoren commented 2 weeks ago

I guess it's time for a new release...