-
Notifications
You must be signed in to change notification settings - Fork 30.5k
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
Enable ccache on Windows #56705
base: main
Are you sure you want to change the base?
Enable ccache on Windows #56705
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -41,6 +41,14 @@ void WriteBytecode(std::ofstream& out, Bytecode bytecode, | |||
void WriteHeader(const char* header_filename) { | ||||
std::ofstream out(header_filename); | ||||
|
||||
#ifdef CCACHE_USED | ||||
// Write a cache invalidator to ensure that ccache does not cache this file. | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder why is it not a problem for non-Windows. Does it have to do with the fact that we only use PCH on Windows? What happens if you just mix Line 51 in 4573231
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, this is connected to PCH usage. The idea of disabling PCH when wanting to use ccache did cross my mind, but from what I recall, the time for compilation without PCH was much greater than with it. Not sure about the numbers. Let me reiterate it and then I'll share the exact numbers from my machine here together with the PCH error I get from cache. Thanks for the suggestion. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My understanding is that PCH would help a deal when there's no good caching but wouldn't matter as much when there is caching? Especially when dealing with V8 which uses templates very extensively, and headers change quite often... |
||||
out << "#ifndef CACHE_INVALIDATOR\n" | ||||
<< "#define CACHE_INVALIDATOR\n" | ||||
<< "inline const char* cache_invalidator = __TIME__;\n" | ||||
<< "#endif\n\n"; | ||||
#endif | ||||
|
||||
out << "// Automatically generated from interpreter/bytecodes.h\n" | ||||
<< "// The following list macro is used to populate the builtins list\n" | ||||
<< "// with the bytecode handlers\n\n" | ||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<Project> | ||
<PropertyGroup> | ||
<UseMultiToolTask>true</UseMultiToolTask> | ||
<TrackFileAccess>false</TrackFileAccess> | ||
</PropertyGroup> | ||
<ItemDefinitionGroup> | ||
<ClCompile> | ||
<!-- /Z7 of cl.exe, ref: https://learn.microsoft.com/en-us/cpp/build/reference/z7-zi-zi-debug-information-format --> | ||
<DebugInformationFormat>OldStyle</DebugInformationFormat> | ||
<ObjectFileName>$(IntDir)%(FileName).obj</ObjectFileName> | ||
</ClCompile> | ||
</ItemDefinitionGroup> | ||
</Project> |
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.
IIUC, thinks means that if your ccache is installed at
c:\path\to\ccache
, then you can just do?
(We recommend installing Git and the UNIX tools added to PATH on Windows, so it seems fine to assume
cp
is available).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 yes, that makes sense. I'll add the command about the
cp
command to the doc.