-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Prevent unnecessary rebuilds when modifying swiftc arguments #8803
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
base: main
Are you sure you want to change the base?
Conversation
@plemarquand This is huge in certain situations. Does this also cover env vars, or only command line arguments? |
@MahdiBM This patch just covers |
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.
LGTM, but it would be nice to have a test for this if we can
Great find. Thanks @plemarquand ! |
cebebe3
to
8ef9f11
Compare
@swift-ci please test |
try RelativePath(validating: ".build") | ||
.appending(triple) | ||
.appending("Products") | ||
.appending("Debug") |
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'm pretty sure this path component will have a platform suffix everywhere except macOS, otherwise lgtm
Many arguments for the compiler are marked as `doesNotAffectIncrementalBuild` in `swift-driver`. Use the argument hashing in swift-driver to hash the swift compiler flags and incorporate that in to the build hash signature used to determine if SwiftPM should do a full rebuild. This prevents unnecssary rebuilds when adding or changing arguments like `-Xswiftc -diagnostic-style=llvm`. For a list of arguments that no longer affect rebuilds, search for `doesNotAffectIncrementalBuild` in https://github.com/swiftlang/swift-driver/blob/main/Sources/SwiftOptions/Options.swift. This builds on the work introduced in swiftlang#8717 which avoided unnecessary rebuilds when SwiftPM arguments changed.
8ef9f11
to
f59dcee
Compare
@swift-ci please test |
@swift-ci test windows |
Many arguments for the compiler are marked as
doesNotAffectIncrementalBuild
inswift-driver
. Use the argument hashing in swift-driver to hash the swift compiler flags and incorporate that in to the build hash signature used to determine if SwiftPM should do a full rebuild.This prevents unnecssary rebuilds when adding or changing arguments like
-Xswiftc -diagnostic-style=llvm
. For a list of arguments that no longer affect rebuilds, search fordoesNotAffectIncrementalBuild
in https://github.com/swiftlang/swift-driver/blob/main/Sources/SwiftOptions/Options.swift.This builds on the work introduced in #8717 which avoided unnecessary rebuilds when SwiftPM arguments changed.