-
Notifications
You must be signed in to change notification settings - Fork 202
File Hashing for Incremental Builds #1923
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
@swift-ci please smoke test Broken tree state because swiftlang/swift#82153 had not landed yet. |
@swift-ci please smoke test |
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, just had a few minor comments
@@ -44,6 +45,14 @@ extension Driver.ErrorDiagnostics: CustomStringConvertible { | |||
} | |||
} | |||
|
|||
public struct FileMetadata { |
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.
Could this be marked @_spi(Testing)
? I don't think it needs to be API
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 afraid this needs to be exposed in the DriverExecutor protocol, so I think it needs to be public
.
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.
Ah, I forgot this showed up in that API. We may need a strategy to stage in the changes to the DriverExecutor protocol so they don't break https://github.com/swiftlang/swift-build, or make synchronized changes to the repos. Maybe you could keep the old execute
requirements around temporarily for default implementations of the new ones to call?
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.
Ah, I didn't realise there was an API here exposed to swift-build.
I've added a commit that restores the original methods to DriverExecutor
, with an extension that gives default implementations of the new methods, and added in definitions with fatalError()
if these legacy methods are called on the implementations defined in swift-driver itself.
I had to fix the added tests - the old logic stopped working after rebasing this branch past 7c709c5 Honestly, I'm not sure my tests are the right approach, however the majority of tests in IncrementalCompilationTests are failing for me locally on main, so I don't want to copy those approaches directly. Maybe I am doing something wrong locally? Most other tests are passing for me, though. |
What kinds of failures are you seeing? I recommend building and running tests against most-recent |
I'll try with a snapshot. |
I'm still getting lots of failures in IncrementalCompilationTests on current main (8c130e3):
Although I see strictly speaking there are '0 unexpected' failures, but I'm not sure how or why these are defined as being 'expected'. |
This PR:
--enable-incremental-file-hashing
, and a corresponding--disable-incremental-file-hashing
, defaulting to disabledRFC discussion here: https://forums.swift.org/t/rfc-file-hashes-for-swift-incremental-compilation/