File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
src/bootstrap/src/core/build_steps Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -164,6 +164,16 @@ 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+ if matches ! ( mode, Mode :: ToolBootstrap ) && !builder. config . incremental {
173+ cargo. env ( "RUSTC_WRAPPER" , ccache) ;
174+ }
175+ }
176+
167177 // clippy tests need to know about the stage sysroot. Set them consistently while building to
168178 // avoid rebuilding when running tests.
169179 cargo. env ( "SYSROOT" , builder. sysroot ( compiler) ) ;
You can’t perform that action at this time.
0 commit comments