Skip to content
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

Support SUPPORTED_PLATFORMS dynamically with intelligent parsing from xcodebuild -showsdks -json. #3001

Merged
merged 4 commits into from
Jun 18, 2020

Conversation

jdhealy
Copy link
Member

@jdhealy jdhealy commented Jun 17, 2020

Previously, Carthage would propagate errors upon reading non-compiled-in values from SUPPORTED_PLATFORMS or PLATFORM_NAME.

Carthage’s --platform argument takes the same input of 2019-era SDKs — however, in alignment with the above: the default (a.k.a. “all”) parameter will allow dynamically-parsed SDKs to propagate.

CarthageKit’s BuildOptions.platforms provides even more control — now, takes a true set of dynamically-parsed SDKs where empty set means empty set, and nil means use various default values.

Eliminate usage of XCDBLD.Platform — we were using Platform wrong, twisting it into a simulatorless instance of the SDK.
 • instead, we just derive a method for that — SDK.platformSimulatorlessFromHeuristic
  • all the info needed for that gets parsed from -showsdks -json and stored in the SDK type

carthage archive still uses the hardcoded four 2019-era SDKs.

The carthage cleanup command — existing on-master, but unshipped-in-tags — no longer makes sense (when set of SDKs are non-fixed across Xcode versions.)
The crucial function removeUnneededItems now functionlessly returns an empty signal.
• That function and the entire command will be removed in a subsequent commit.
  • Again, to note once more, this command never shipped in a tagged Carthage release.

The previous hardcoded XCDBLD.SDK remains for illustrative effect (renamed to XCDBLD.SD_K) and will be removed in a subsequent commit.

Dynamic SDK Parsing 📮

Dynamic SDK parsing can occur from xcodebuild -showsdks -json with fallbacks to BuildSetting extraction from a Xcode-bundled xcodeproj, beyond falling back to hardcoded 2019-era values.

Will omit SDKs — such as DriverKit — where JSON-derived canonicalName and platform do not share a common prefix · DriverKit has an ouptut canonicalName similar to «driverkit.macosx19.0».

…om `xcodebuild -showsdks -json`.

Previously, Carthage would propagate errors upon reading non-compiled-in values from `SUPPORTED_PLATFORMS` or `PLATFORM_NAME`.

Carthage’s `--platform` argument takes the same input of 2019-era SDKs — however, in alignment with the above: the default (a.k.a. “all”) parameter will allow dynamically-parsed SDKs to propagate.

CarthageKit’s `BuildOptions.platforms` provides even more control — now, takes a true set of dynamically-parsed SDKs where empty set means empty set, and `nil` means use various default values.

Eliminate usage of `XCDBLD.Platform` — we were using Platform wrong, twisting it into a simulatorless instance of the SDK.
 • instead, we just derive a method for that — `SDK.platformSimulatorlessFromHeuristic`
  • all the info needed for that gets parsed from -showsdks -json and stored in the SDK type

`carthage archive` still uses the hardcoded four 2019-era SDKs.

The `carthage cleanup` command — existing on-master, but unshipped-in-tags — no longer makes sense (when set of SDKs are non-fixed across Xcode versions.)
• The crucial function `removeUnneededItems` now functionlessly returns an empty signal.
• That function and the entire command will be removed in a subsequent commit.
  • Again, to note once more, this command never shipped in a tagged Carthage release.

The previous hardcoded `XCDBLD.SDK` remains for illustrative effect (renamed to `XCDBLD.SD_K`) and will be removed in a subsequent commit.

Dynamic SDK parsing can occur from `xcodebuild -showsdks -json` with fallbacks to `BuildSetting` extraction from a Xcode-bundled `xcodeproj`, beyond falling back to hardcoded 2019-era values.

Will omit SDKs — such as DriverKit — where JSON-derived `canonicalName` and `platform` do not share a common prefix · DriverKit has an ouptut `canonicalName` similar to «driverkit.macosx19.0».
…-in-tags — which no longer makes sense (when set of SDKs are non-fixed across Xcode versions.)

See also <github.com/Carthage/pull/2872> — and major thanks to @sidepelican and @chuganzy for developing it…
〜 sorry that the new system of dynamically parsed SDKs makes it nonviable; maybe it's viable in some future way…

See commit 883f1c8.
…c SDK enum.

The non-dynamic SDK enum has replacement in commit 883f1c8.

Eliminate declaration of `XCDBLD.Platform` — we were using Platform wrong, twisting it into a simulatorless instance of the SDK.
 • instead, we just derive a method for that — `SDK.platformSimulatorlessFromHeuristic`
  • all the info needed for that gets parsed from -showsdks -json and stored in the SDK type

See `SDK.platformSimulatorlessFromHeuristic` from commit 883f1c8.
@jdhealy jdhealy requested a review from ikesyo June 18, 2020 12:09
Copy link
Member

@tmspzz tmspzz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had already reviewed this code privately and reviewed it again now. Looks good to me.

@jdhealy jdhealy merged commit d337254 into Carthage:master Jun 18, 2020
philipphofmann added a commit to getsentry/sentry-cocoa that referenced this pull request Jan 29, 2024
Fix Sources/Configuration/SDK.xcconfig by removing the workaround added with #491 so CI can build Carthage XCFrameworks to include VisionOS. The workaround seems to be fixed with Carthage/Carthage#3001 in Carthage 0.35.0 released in Jun 2020. Therefore, we can remove the SDKROOT__CARTHAGE settings in Sources/Configuration/SDK.xcconfig, which caused problems when building the SDK for visionOS see #3410 (comment). We never removed the workaround #491, as it didn't cause any problems.

Furthermore, bump pre-commit action https://github.com/python-jsonschema/check-jsonschema to 0.27.3, so it allows macos-13-xlarge as a valid runner.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants