-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Add support for swift-collections 1.1 #7607
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
Merged
Merged
Conversation
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
@swift-ci please smoke test |
@swift-ci please test |
MaxDesiatov
approved these changes
May 30, 2024
jmschonfeld
added a commit
to jmschonfeld/swift-package-manager
that referenced
this pull request
May 30, 2024
This PR makes a necessary update to the source in order to support building against swift-collections 1.1 ### Motivation: swift-collections added a new API in v1.1: ```swift extension OrderedSet { @inlinable public func filter( _ isIncluded: (Element) throws -> Bool ) rethrows -> Self } ``` swift-package-manager was previously calling `filter` on an `OrderedSet` and expecting to get back an `Array` (via the extension on `Sequence`) however with this new swift-collections change, the returned value of `filter` became an `OrderedSet`. This caused build failures when the `+=` operator (which exists for `Array` but not `OrderedSet` operands) was used on the return value. We should update this code to support swift-collections 1.1 so that we can begin using swift-collections 1.1 in toolchain builds. ### Modifications: The code is updated to convert the return type of `filter` to an `Array` ### Result: The same source will now successfully compile against both swift-collections 1.0.x and 1.1.x
jmschonfeld
added a commit
that referenced
this pull request
May 31, 2024
Cherry pick of #7607 **Explanation:** SwiftPM fails to build against [email protected], this change allows SwiftPM to be compatible with both [email protected] and [email protected] **Scope:** Isolated to one specific line where the build failure occurred and initializes the return value to an `Array` explicitly **Risk:** Low as the change is minimal and has been validated via testing **Testing:** Existing SwiftPM testing has passed and I have been able to build a toolchain locally with the change **Reviewer:** @MaxDesiatov
finestructure
pushed a commit
to finestructure/swift-package-manager
that referenced
this pull request
Jun 10, 2024
This PR makes a necessary update to the source in order to support building against swift-collections 1.1 ### Motivation: swift-collections added a new API in v1.1: ```swift extension OrderedSet { @inlinable public func filter( _ isIncluded: (Element) throws -> Bool ) rethrows -> Self } ``` swift-package-manager was previously calling `filter` on an `OrderedSet` and expecting to get back an `Array` (via the extension on `Sequence`) however with this new swift-collections change, the returned value of `filter` became an `OrderedSet`. This caused build failures when the `+=` operator (which exists for `Array` but not `OrderedSet` operands) was used on the return value. We should update this code to support swift-collections 1.1 so that we can begin using swift-collections 1.1 in toolchain builds. ### Modifications: The code is updated to convert the return type of `filter` to an `Array` ### Result: The same source will now successfully compile against both swift-collections 1.0.x and 1.1.x
finestructure
pushed a commit
to finestructure/swift-package-manager
that referenced
this pull request
Jun 12, 2024
This PR makes a necessary update to the source in order to support building against swift-collections 1.1 ### Motivation: swift-collections added a new API in v1.1: ```swift extension OrderedSet { @inlinable public func filter( _ isIncluded: (Element) throws -> Bool ) rethrows -> Self } ``` swift-package-manager was previously calling `filter` on an `OrderedSet` and expecting to get back an `Array` (via the extension on `Sequence`) however with this new swift-collections change, the returned value of `filter` became an `OrderedSet`. This caused build failures when the `+=` operator (which exists for `Array` but not `OrderedSet` operands) was used on the return value. We should update this code to support swift-collections 1.1 so that we can begin using swift-collections 1.1 in toolchain builds. ### Modifications: The code is updated to convert the return type of `filter` to an `Array` ### Result: The same source will now successfully compile against both swift-collections 1.0.x and 1.1.x
bnbarham
pushed a commit
that referenced
this pull request
Jun 12, 2024
This PR makes a necessary update to the source in order to support building against swift-collections 1.1 ### Motivation: swift-collections added a new API in v1.1: ```swift extension OrderedSet { @inlinable public func filter( _ isIncluded: (Element) throws -> Bool ) rethrows -> Self } ``` swift-package-manager was previously calling `filter` on an `OrderedSet` and expecting to get back an `Array` (via the extension on `Sequence`) however with this new swift-collections change, the returned value of `filter` became an `OrderedSet`. This caused build failures when the `+=` operator (which exists for `Array` but not `OrderedSet` operands) was used on the return value. We should update this code to support swift-collections 1.1 so that we can begin using swift-collections 1.1 in toolchain builds. ### Modifications: The code is updated to convert the return type of `filter` to an `Array` ### Result: The same source will now successfully compile against both swift-collections 1.0.x and 1.1.x
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
dependencies
Changes to dependencies and relevant checks
dependency resolution
modules graph
Modules dependency resolution
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.
This PR makes a necessary update to the source in order to support building against swift-collections 1.1
Motivation:
swift-collections added a new API in v1.1:
swift-package-manager was previously calling
filter
on anOrderedSet
and expecting to get back anArray
(via the extension onSequence
) however with this new swift-collections change, the returned value offilter
became anOrderedSet
. This caused build failures when the+=
operator (which exists forArray
but notOrderedSet
operands) was used on the return value.We should update this code to support swift-collections 1.1 so that we can begin using swift-collections 1.1 in toolchain builds.
Modifications:
The code is updated to convert the return type of
filter
to anArray
Result:
The same source will now successfully compile against both swift-collections 1.0.x and 1.1.x