-
Notifications
You must be signed in to change notification settings - Fork 341
Swift MCCAS object files are 0 bytes on cache miss #9164
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
Swift MCCAS object files are 0 bytes on cache miss #9164
Conversation
@swift-ci please test |
@swift-ci please test llvm |
a000352
to
d839dbd
Compare
@cachemeifyoucan I added a test for the The code is now
In file-based caching, if In file-based caching, if In MCCAS, if In MCCAS, if if CompileJobCache.cpp:449
So we always write the casid to the object file stream when Now this patch also ensures that whether swift caching or clang caching is used with MCCAS. The |
@swift-ci please test |
When clang caching and MCCAS are enabled, on a cache miss, the object file is not written to in MachOCASWriter, instead the replay code is rerun and the object file is serialized and written out. However, in swift, the replay code isn't run on a cache miss at all, and it expects the object writer to write to the object file. This patch makes it so that on a cache miss, the MachOCASWriter always writes to the raw_ostream buffer for the object file and doesn't serialize the object file in the replay code.
d839dbd
to
ce65bfa
Compare
@swift-ci please test |
@swift-ci please test macOS |
Cherry-pick #9164 to stable/20240723
Cherry-pick #9164 to next
When clang caching and MCCAS are enabled, on a cache miss, the object file is not written to in MachOCASWriter, instead the replay code is rerun and the object file is serialized and written out. However, in swift, the replay code isn't run on a cache miss at all, and it expects the object writer to write to the object file.
This patch makes it so that on a cache miss, the MachOCASWriter always writes to the raw_ostream buffer for the object file and doesn't serialize the object file in the replay code.
rdar://134425492 ([MCCAS] Fix bug with swift caching where object files are 0 bytes in size)