Skip to content

Add support for -disable-upcoming-feature and -disable-experimental-feature #1730

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 1 commit into from
Nov 18, 2024

Conversation

tshortli
Copy link
Contributor

Synchronize Options.swift with swiftlang/swift#77662 and update the driver to pass all feature related flags down to the frontend together, preserving the order the flags were specified.

@tshortli
Copy link
Contributor Author

@swift-ci please test

@@ -52,6 +52,13 @@ extension Driver {
case computed
}

func checkFrontendSupportsOptionIfNecessary(_ option: Option) throws {
if parsedOptions.hasArgument(option) && !isFrontendArgSupported(option) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: This is a nice utility, but the name made me do a double-take once I realized it can fail the build.
Not sure I have a better suggestion other than to reference that in Driver.swift we have a couple of instances of verify*Options methods, but those do slightly different things than this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like verify as prefix here better, I'll switch to that.

@@ -275,14 +285,11 @@ extension Driver {
if isFrontendArgSupported(.compilerAssertions) {
try commandLine.appendLast(.compilerAssertions, from: &parsedOptions)
}
if isFrontendArgSupported(.enableExperimentalFeature) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're alright dropping isFrontendArgSupported(.enableExperimentalFeature) && isFrontendArgSupported(.enableUpcomingFeature) at this point and rely on them always being supported?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was my thinking since they've been around for multiple releases at this point. My impression was that we only check for a flag being supported for the interim period where it is conceivable that the a frontend and driver are slightly out of sync on support for a particular flag, and that supporting mixing and matching a new driver with a much older frontend is a non-goal. Optionally dropping feature flags doesn't really seem safe to me, as they have important semantic effects.

…eature.

Synchronize Options.swift with swiftlang/swift#77662
and update the driver to pass all feature related flags down to the frontend
together, preserving the order the flags were specified.
@tshortli tshortli force-pushed the disable-upcoming-feature branch from b72eaad to e6010be Compare November 18, 2024 17:46
@tshortli
Copy link
Contributor Author

@swift-ci please test

@tshortli
Copy link
Contributor Author

@swift-ci please test Windows

@tshortli tshortli merged commit 68c1b1f into swiftlang:main Nov 18, 2024
3 checks passed
@tshortli tshortli deleted the disable-upcoming-feature branch November 18, 2024 23:21
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