pyobjc icon indicating copy to clipboard operation
pyobjc copied to clipboard

xcodebuild requires Xcode

Open jaraco opened this issue 1 year ago • 3 comments

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

  • Python version: 3.13t (rc1), 3.12
  • How was python installed (python.org, anaconda, homebrew, ...): 3.13 from source, 3.12 homebrew
  • macOS version: 14.6.1

To Reproduce

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

Expected behavior The package(s) should build.

jaraco avatar Aug 25 '24 09:08 jaraco

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/[email protected]/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/[email protected]/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 avatar Aug 25 '24 09:08 jaraco

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

jaraco avatar Aug 25 '24 09:08 jaraco

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

ronaldoussoren avatar Aug 26 '24 19:08 ronaldoussoren

The tip of 10.3-branch should now build with the command line tools.

Current plan is to publish a release later this week, although live might interfere...

ronaldoussoren avatar Oct 27 '24 20:10 ronaldoussoren