`DPyObjC_BUILD_RELEASE` is based on the running macOS version and not the SDK in use

Issue #203 resolved
Max Bélanger
created an issue

In our testing, we're sometimes developing on 10.13 but using Xcode 8 (which comes with the 10.12 SDK). Despite using xcode-select, which properly sets -isysroot when building PyObjC, the DPyObjC_BUILD_RELEASE define gets set to 10.13. Should this not be using the SDK value from xcrun instead?

Comments (6)

  1. Ronald Oussoren repo owner

    That would be better, and it shouldn't be too hard to add detection of the actual SDK to setup.py.

    Why do you use Xcode 8 on macOS 10.13?

    BTW. This is somewhat related to #100, which also involves using an old Xcode version that confuses the PyObjC build machinery.

  2. Max Bélanger reporter

    We sadly can't always upgrade to the latest SDK for development (at the moment we use 10.11), and similarly, when we test with new versions of macOS (such as 10.13), we sometimes have to use an older version (we don't yet have a fully working build on top of 10.13, so we use 10.12 or 10.11 for development).

  3. Ronald Oussoren repo owner

    Interestingly enough this should already work with the tip of the default branch (and the 10.13 branch), PyObjC_BUILD_RELEASE is defined to the SDK level extracted from -isysroot when that's available.

    Changeset 4fb9cc91bf9e in branch macos10.13-support updates that code a bit, it now uses the correct BUILD_RELEASE when using the current Xcode-beta on a 10.12 system.

    Could you test if this branch also works for you w.r.t. setting the BUILD_RELEASE value? Please test pyobjc-core and pyobjc-framework-Cocoa, as those use different code to set BUILD_RELEASE.

  4. Max Bélanger reporter

    Just tested Xcode 8/10.12 SDK on a 10.13 device and as expected, I get -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk -DPyObjC_BUILD_RELEASE=1012.

    Thanks so much for the quick turnaround :).

  5. Ronald Oussoren repo owner

    Great to hear this fixes the problem for you.

    I won't merge the change into the default branch until the 4.0 release, the expected release of High Sierra is too close for cutting another release.

  6. Log in to comment