Skip to content

iOS compiler stubs override environment-based minimum version specifications #133183

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
freakboy3742 opened this issue Apr 30, 2025 · 0 comments
Closed
Labels
OS-ios type-bug An unexpected behavior, bug, or error

Comments

@freakboy3742
Copy link
Contributor

freakboy3742 commented Apr 30, 2025

Bug report

Bug description:

Python includes shims for compiler tools on iOS to match GNU conventions for compiler names (e.g., arm64-apple-ios-clang) to avoid encoding a user-specific location to a compiler in sysconfig, and to avoid issues with UNIX build tools that expect CC/CXX to be single arguments without spaces.

Using this approach arm64-apple-ios-clang expands internal as xcrun --sdk iphoneos clang -target arm64-apple-ios-clang

Unfortunately, Apple has 3 ways to define a minimum iOS version, in order of priority:

  1. the IPHONEOS_DEPLOYMENT_TARGET=12.0 environment variable
  2. the -mios-min-version=12.0 command line argument
  3. a version number encoded in a -target arm64-apple-ios12.0-simulator argument

If you specify all three options, (1) will be ignored, and (2) will raise a warning if the version it specifies doesn't match the version specified by (3).

The problem arises if you specify -target arm64-apple-ios-simulator- which is what the shim currently encodes.

If the -target doesn't specify a version, this is interpreted as "no min version". An explicitly provided -mios-version-min definition will override this minimum without warning; but any IPHONEOS_DEPLOYMENT_VERSION value will be ignored.

Thus, using the compiler shims in an environment where IPHONEOS_DEPLOYMENT_VERSION is defined will result in this value being ignored unless the minimum version is also passed in as a -mios-version-min argument.

CPython versions tested on:

3.13

Operating systems tested on:

Other

Linked PRs

@freakboy3742 freakboy3742 added OS-ios type-bug An unexpected behavior, bug, or error labels Apr 30, 2025
freakboy3742 added a commit that referenced this issue May 1, 2025
…133184)

Include IPHONEOS_DEPLOYMENT_TARGET in iOS shim targets.
miss-islington pushed a commit to miss-islington/cpython that referenced this issue May 1, 2025
…ts. (pythonGH-133184)

Include IPHONEOS_DEPLOYMENT_TARGET in iOS shim targets.
(cherry picked from commit 6e907c4)

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
freakboy3742 added a commit that referenced this issue May 1, 2025
…ets. (GH-133184) (#133234)

Include IPHONEOS_DEPLOYMENT_TARGET in iOS shim targets.
(cherry picked from commit 6e907c4)

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OS-ios type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

1 participant