File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
src/bootstrap/src/core/build_steps Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -164,6 +164,20 @@ pub fn prepare_tool_cargo(
164164 }
165165 }
166166
167+ // The stage0 compiler changes infrequently and does not directly depend on code
168+ // in the current working directory. Therefore, caching it with sccache should be
169+ // useful.
170+ // This is only performed for non-incremental builds, as ccache cannot deal with these.
171+ if let Some ( ref ccache) = builder. config . ccache {
172+ eprintln ! (
173+ "TOOL SCCACHE CONFIGURED at {}, mode: {:?}, incremental: {}" ,
174+ ccache, mode, builder. config. incremental
175+ ) ;
176+ if matches ! ( mode, Mode :: ToolBootstrap ) && !builder. config . incremental {
177+ cargo. env ( "RUSTC_WRAPPER" , ccache) ;
178+ }
179+ }
180+
167181 // clippy tests need to know about the stage sysroot. Set them consistently while building to
168182 // avoid rebuilding when running tests.
169183 cargo. env ( "SYSROOT" , builder. sysroot ( compiler) ) ;
You can’t perform that action at this time.
0 commit comments