Skip to content

Conversation

omochi
Copy link
Contributor

@omochi omochi commented Sep 22, 2025

Use custom notation for platform conditions where necessary in manifest code generation

Motivation:

Currently, for platform cases that are known but not yet available, or entirely unknown, the generated code becomes invalid.

Modifications:

Change the implementation so that such cases are expressed using custom notation.

Result:

Manifest code generation will correctly handle known-but-unavailable and unknown platform conditions by outputting them with custom notation.

Additional Context:

In practice, swift-subprocess includes .custom("freebsd") in its manifest.
When this is imported, source code is generated, and then reloaded with SwiftPM, the following error occurs:

PackageDescription.Platform.freebsd:3:21: note: 'freebsd' was introduced in PackageDescription 999.0

This change prevents such errors by ensuring unsupported or future platforms are represented as custom.

@omochi
Copy link
Contributor Author

omochi commented Sep 22, 2025

@swift-ci test

@omochi
Copy link
Contributor Author

omochi commented Sep 28, 2025

@swift-ci test windows

@omochi
Copy link
Contributor Author

omochi commented Sep 29, 2025

@jakepetroules Could you please merge this since the CI has passed?

@jakepetroules jakepetroules merged commit d8ae00b into swiftlang:main Sep 29, 2025
6 checks passed
@omochi
Copy link
Contributor Author

omochi commented Sep 29, 2025

Thank you!

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.

2 participants