-
Notifications
You must be signed in to change notification settings - Fork 199
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
Conversation
@swift-ci please test |
@@ -52,6 +52,13 @@ extension Driver { | |||
case computed | |||
} | |||
|
|||
func checkFrontendSupportsOptionIfNecessary(_ option: Option) throws { | |||
if parsedOptions.hasArgument(option) && !isFrontendArgSupported(option) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
b72eaad
to
e6010be
Compare
@swift-ci please test |
@swift-ci please test Windows |
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.