-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Virtualize swift compiler outputs #63206
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
Virtualize swift compiler outputs #63206
Conversation
Please test with following pull request: @swift-ci Please test |
Ah, I break lldb of course. let me try smoke test first. @swift-ci please smoke test |
Please test with following pull request: @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.
Looks good to me.
Cool to have the frontend output determinism tests in-suite.
For deterministic check to be really useful, need to add an option to bypass the laziness when modhash matches. Also thinking I should just put the output backend into |
d940dbe
to
fef81b9
Compare
Please test with following pull request: @swift-ci please smoke test |
fef81b9
to
d3edb11
Compare
Update: fix the tests and remove withOutputFile helper function to encourage use of output backend. Now properly capture swiftdeps output but it is NOT deterministic. |
Please test with following pull request: @swift-ci please smoke test |
d3edb11
to
4a4fda1
Compare
Please test with following pull request: @swift-ci please smoke test |
1 similar comment
Please test with following pull request: @swift-ci please smoke test |
08920e3
to
e73b6f3
Compare
Please test with following pull request: @swift-ci please smoke test |
c6cffe4
to
c148737
Compare
Please test with following pull request: @swift-ci please smoke test |
62b9ce1
to
6674e1b
Compare
Please test with following pull request: @swift-ci please smoke test |
6674e1b
to
11a25b8
Compare
Please test with following pull request: @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.
There were a couple of my minor comments from January that seemed to have been lost, but otherwise LGTM.
@@ -1135,6 +1135,13 @@ def enable_emit_generic_class_ro_t_list : | |||
HelpText<"Enable emission of a section with references to class_ro_t of " | |||
"generic class patterns">; | |||
|
|||
def enable_swift_deterministic_check : | |||
Flag<["-"], "enable-swift-deterministic-check">, |
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.
This comment wasn't addressed
@@ -1135,6 +1135,13 @@ def enable_emit_generic_class_ro_t_list : | |||
HelpText<"Enable emission of a section with references to class_ro_t of " | |||
"generic class patterns">; | |||
|
|||
def enable_swift_deterministic_check : | |||
Flag<["-"], "enable-swift-deterministic-check">, | |||
HelpText<"Check swift compiler output determinisim by run it twice">; |
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.
This comment wasn't addressed
11a25b8
to
b15877b
Compare
Please test with following pull request: @swift-ci please smoke test |
b15877b
to
bfa53ff
Compare
Please test with following pull request: @swift-ci please smoke test |
Using a virutal output backend to capture all the outputs from swift-frontend invocation. This allows future virtualization of swift compiler outputs.
Add option to test swift compiler determinism by running the job twice and compare the output produced.
Add an option to skip module hash checking that checks if swift compiler can skip object file generation because it is going to produce the same result. Always generation object file output when flag is used so we can check for output determinism.
Batch mode depscan also gets diagnostics for output errors.
Support makefile style dependency file and imported modules. Need improvements to virtual backend to allow emit loaded module trace file.
Add unit-tests for already virtualized outputs
bfa53ff
to
9be198f
Compare
Please test with following pull request: @swift-ci please smoke test |
Fix broken test cases on non-macos platforms.
Please test with following pull request: @swift-ci please smoke test |
Using a virutal output backend to capture all the outputs from swift-frontend invocation. This allows redirecting and/or mirroring compiler outputs to multiple location using different OutputBackend. As an example usage for the virtual outputs, teach swift compiler to check its output determinism by running the compiler invocation twice and compare the hash of all its outputs. Virtual output will be used to enable caching in the future.
Step 1 of making swift compiler output cacheable. Virtualize swift compiler outputs (not everything yet, but most of the important output to show feasibility) and add a mechanics to verify the output determinism through the newly added function.
Need some changes in LLVM swiftlang/llvm-project#6112
Feedbacks about how to structurally pass through VirtualBackends in swift compiler is welcomed.