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 custom platforms in conditionals #6794

Merged
merged 1 commit into from Aug 11, 2023

Conversation

neonichu
Copy link
Member

In #3742, support for custom platforms was added and I think everyone understood it as supporting custom deployment targets, but it actually also added API for custom platform conditionals. Those never actually worked, though, because any platform that the platform registry doesn't know about was dropped when going from TargetDescription to Target. This fixes it and adds a unit test.

See also RevenueCat/purchases-ios#2998

rdar://113709387

In #3742, support for custom platforms was added and I think everyone understood it as supporting custom deployment targets, but it actually also added API for custom platform conditionals. Those never actually worked, though, because any platform that the platform registry doesn't know about was dropped when going from `TargetDescription` to `Target`. This fixes it and adds a unit test.

See also RevenueCat/purchases-ios#2998

rdar://113709387
@neonichu
Copy link
Member Author

@swift-ci please smoke test

@MaxDesiatov
Copy link
Member

MaxDesiatov commented Aug 10, 2023

How are these platform names applied when evaluating a condition? Could someone use it to match against an arbitrary target triple? If so, which triple component does it match against?

@neonichu
Copy link
Member Author

neonichu commented Aug 10, 2023

How are these platform names applied when evaluating a condition? Could someone use it to match against an arbitrary target triple? If so, which triple component does it match against?

It's up to the build system to apply them, SwiftPM's build system doesn't do anything with custom conditions, I think (as in, they should always be false).

@neonichu neonichu enabled auto-merge (squash) August 11, 2023 00:35
@neonichu neonichu merged commit a088168 into main Aug 11, 2023
5 checks passed
@neonichu neonichu deleted the support-custom-platforms-in-conditionals branch August 11, 2023 01:55
NachoSoto added a commit to RevenueCat/purchases-ios that referenced this pull request Aug 11, 2023
…sion`

Fixes #2998.
This is now fixed in SPM: apple/swift-package-manager#6794, but we need a workaround for now.

Since `.custom` doesn't work properly, this splits `Package.swift` based on Xcode version.
NachoSoto added a commit to RevenueCat/purchases-ios that referenced this pull request Aug 11, 2023
…3005)

Fixes #2998. See #2989 for why this is needed in the first place.
This is now fixed in SPM:
apple/swift-package-manager#6794, but we need a
workaround for now.

Since `.custom` doesn't work properly (it gets evaluated in Xcode even
outside of that platform), this splits `Package.swift` based on Xcode
version.

Thanks @neonichu for helping with this.
MarkVillacampa pushed a commit to RevenueCat/purchases-ios that referenced this pull request Sep 6, 2023
…3005)

Fixes #2998. See #2989 for why this is needed in the first place.
This is now fixed in SPM:
apple/swift-package-manager#6794, but we need a
workaround for now.

Since `.custom` doesn't work properly (it gets evaluated in Xcode even
outside of that platform), this splits `Package.swift` based on Xcode
version.

Thanks @neonichu for helping with this.
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.

None yet

3 participants