Drop swift-collections dependency to workaround issues for macCatalyst adopters - #922
Merged
simonjbeaumont merged 1 commit intoJul 2, 2026
Merged
Conversation
czechboy0
approved these changes
Jul 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Archiving an app for Mac Catalyst fails with a build collision when this package (as a build-tool plugin) and
swift-openapi-urlsessionare both in the dependency graph (#921):This is because
swift-collectionsenters the build graph via two independent paths: runtime (URLSession transport) and host (build plugin).During
xcodebuild archivefor Mac Catalyst the app compiles both app and build tool for macOS and uses the sameUninstalledProducts/macosx/path, which produces the collision. iOS archives are fine because the runtime and host are different platforms.The underlying failure to de-duplicate a package shared between the host-tool graph and the product graph is a build-system limitation we can't fix here -- probably needs an Xcode or SwiftPM issue filing.
However, since we've seen this a few times now from different adopters we might be able to mitigate the issue because
swift-collectionsis hardly used by the generator.Modifications
OrderedSet<EnumCase>with a plain[EnumCase]plus aSet<EnumCaseID>membership check, preserving first-seen ordering and the duplicate-value diagnostic.Equatable/Hashableconformances onEnumCase(they existed only to satisfyOrderedSet).swift-collectionspackage dependency.Result
swift-openapi-generatorno longer depends onswift-collections.swift-openapi-urlsessioncan archive for Mac Catalyst.InternalCollectionsUtilities.o#921, Build-tool plugin breaks swift-collections module resolution during xcodebuild archive #890.Test Plan
xcodebuild archiveon theHelloWorldiOSClientAppExampleproject.