-
Notifications
You must be signed in to change notification settings - Fork 349
[CAS] gmodule support for caching build #11026
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: next
Are you sure you want to change the base?
Conversation
2bbc405
to
075be6d
Compare
075be6d
to
2a1ffca
Compare
2a1ffca
to
d5d9a15
Compare
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 would potentially fit better into llvm-project/lldb/packages/Python/lldbsuite/
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 is a compiler launcher type of script and requires a just built clang (because it needs clang-scan-deps next to it). I don't what is a good way to hack into lldbsuite or driven from makefile. Let me know if you have any good idea.
d5d9a15
to
0173e49
Compare
8063aee
to
512a886
Compare
512a886
to
cb036bf
Compare
@adrian-prantl @benlangmuir Ping for review |
@@ -6150,7 +6168,7 @@ bool ASTReader::readASTFileControlBlock( | |||
auto Filename = ResolveImportedPath(PathBuf, FilenameStr, ModuleDir); | |||
StringRef CacheKey = ReadStringBlob(Record, Idx, Blob); | |||
if (!CacheKey.empty()) | |||
Listener.readModuleCacheKey(ModuleName, *Filename, CacheKey); | |||
Listener.readModuleCASID(ModuleName, *Filename, CacheKey); |
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.
How do we know here that this is not a key?
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 code path is never used tor read scanning module. I will rename the variable. Let me think if there is a way to guard it against using it to read scanning module (other than this callback will fail).
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.
Would it make sense to store a bit in the pcm for whether it's a key or just an id? Even if it's not strictly necessary it might make it less likely we screw it up in the future
cb036bf
to
4ae6ba2
Compare
@swift-ci please test llvm |
4ae6ba2
to
5e96cdf
Compare
@swift-ci please test llvm |
88f25d5
to
479c33e
Compare
Teach clang to encode CASID as splitDwarfFilename for gmodule when clang caching is enabled. This allows the outputs from compiler do not contain paths to the clang module files, thus allows distributed caching without the need of a unified clang module cache directory path.
Teach dsymutil how to use CAS and how to load clang modules from CAS when building dSYM when gmodule is used.
Teach lldb to load clang modules when gmodule + clang caching is used.
Teach SwiftASTContext to load clang module dependencies from CAS instead of FileSystem.
479c33e
to
5c6f640
Compare
@swift-ci please test llvm |
} | ||
llvm::sys::path::append(PCM, Mod.getASTFile()); | ||
|
||
// FIXME: Prefer CASID if exists. |
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 not clear what this FIXME means
HelpText<"Specify a directory that contain dSYM files to search for.">, | ||
Group<grp_general>; | ||
|
||
def cas : Separate<["-", "--"], "cas">, |
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.
Should we provide the additional options needed to configure plugin path and plugin options?
Prototype for gmodule support by switching
splitDwarf
references to CASIDs of the module/PCHAlso teach dsymutil to support reading from CAS as a prototype for lldb support.