-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Driver: flip the flag of whether tracking system dependencies #28579
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 Build Toolchain macOS Platform |
@swift-ci Please Build Toolchain macOS Platform |
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 should probably have -track-system-dependencies
take an optional parameter that says true|false
. Removing the flag would be a compatibility break. Also, is there a test case for the .d
files and the system deps? Maybe this commit should include a small test case where we see that the size of the .d
files does indeed reduce (also as a regression thing in case someone changes the defaults again in the future).
include/swift/Option/Options.td
Outdated
@@ -293,9 +293,9 @@ def profile_stats_entities: Flag<["-"], "profile-stats-entities">, | |||
def emit_dependencies : Flag<["-"], "emit-dependencies">, | |||
Flags<[FrontendOption, NoInteractiveOption, DoesNotAffectIncrementalBuild]>, | |||
HelpText<"Emit basic Make-compatible dependencies files">; | |||
def track_system_dependencies : Flag<["-"], "track-system-dependencies">, |
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 don't think we can remove this flag so easily, that would be a breaking change.
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 understand the concern. However, it seems the build system doesn't specify this flag at all. Also, this driver flag never populates to front-end invocation flags, meaning even if some one specifies the flag, it doesn't change any behavior of the compiler. It should be pretty safe to remove the flag.
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.
However, it seems the build system doesn't specify this flag at all.
I don't understand which build system are you referring to. Maybe we are not using it but someone external could very well be using it?
Also, this driver flag never populates to front-end invocation flags, meaning even if some one specifies the flag, it doesn't change any behavior of the compiler.
In that case, we should have the doc comment say something like "[Deprecated] We track system dependencies by default, so this flag doesn't do anything. If you want to avoid tracking system dependencies, use -skip-system-dependencies.". We could even add a warning saying that the flag is a no-op and asking the user to remove it.
I don't see what we gain by removing the flag -- we're potentially breaking someone's code for (IMO) no benefit at all.
macOS Toolchain Install command |
Using the CI-built toolchain, I've verified that |
Talking with @jrose-apple more about this, it seems risky to flip the flag at this point and the default value of NOT tracking system dependencies is consistent with Clang's behavior. So it seem the only bug worths fixing here is to pass down |
3f6e06e
to
9b49a4c
Compare
@swift-ci please smoke test |
So the flag works but the driver wasn't passing it down? |
@DougGregor that's correct. The flag didn't pass down to front-end invocation from driver. |
Tracking system dependencies should be the default setting so we always rebuild after
headers from SDK changes. We should also provide a way to opt-out so builders could reduce
the size of .d files if they are certain SDKs are stable.
rdar://57361722