Skip to content

[6.2][PackageModel] Toolchain: A few fixes for features supported by Swift compiler #8762

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

Conversation

xedin
Copy link
Contributor

@xedin xedin commented Jun 4, 2025

  • Explanation:

    swift package migrate is broken when used with older toolchains.

    • Fix "supported features" parsing with older toolchains. -print-supported-features flag used to output "enabled_in" version as an integer (major only).
    • Handle absence of optional features section. JSON.get would throw if the key couldn't be found, let's handle that gracefully for an optional "optional features" section.
  • Main Branch PR: [PackageModel] Toolchain: A few fixes for features supported by Swift compiler #8761

  • Risk: Low (only swift package migrate is affected by this changes).

  • Resolves: rdar://152533205

  • Reviewed By: @dschaefer2

  • Testing: Updated existing tests in the suite, added new test-cases.

xedin added 2 commits June 3, 2025 18:16
…nteger

Older versions of `-print-supported-features` emitted `enabled_in`
field as an integer (major compiler version only), newer ones emit
it as a string to support major+minor.

(cherry picked from commit 40a0396)
… section

`JSON.get` would throw if the key couldn't be found, let's handle
that gracefully for an optional "optional features" section.

(cherry picked from commit 4c964b1)
@xedin
Copy link
Contributor Author

xedin commented Jun 4, 2025

@swift-ci please test

@xedin
Copy link
Contributor Author

xedin commented Jun 4, 2025

@swift-ci please clean test Linux platform

1 similar comment
@xedin
Copy link
Contributor Author

xedin commented Jun 4, 2025

@swift-ci please clean test Linux platform

@xedin xedin force-pushed the support-both-string-and-number-in-enabled-in-feature-6.2 branch from 5485148 to 7832495 Compare June 4, 2025 07:17
@xedin
Copy link
Contributor Author

xedin commented Jun 4, 2025

swiftlang/swift#81971
@swift-ci please test

@xedin
Copy link
Contributor Author

xedin commented Jun 4, 2025

swiftlang/swift#81971
@swift-ci please test Windows platform

@xedin
Copy link
Contributor Author

xedin commented Jun 4, 2025

Swift-side PR landed earlier this morning. Merging.

@xedin xedin merged commit e198274 into swiftlang:release/6.2 Jun 4, 2025
6 checks passed
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.

3 participants