You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[PackageModel] Toolchain: A few fixes for features supported by Swift compiler (#8761)
### Motivation:
- 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.
### Modifications:
- Update `Toolchain.swiftCompilerSupportedFeatures` to use `try?` when
querying JSON for an optional "optional" key.
- Update `Toolchain.swiftCompilerSupportedFeatures` to attempt to
retrieve "enabled_in" key as a String first and if that fails - as an
integer.
### Result:
`swift package migrate` can now support older toolchains that have
"enabled_in" printed as an integer and have no "optional features"
section in their `-print-supported-features` output.
0 commit comments