Skip to content

Commit 2c12d14

Browse files
committed
Change toolchain cache directory layout
1 parent b453892 commit 2c12d14

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

collector/src/toolchain.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,13 @@ impl Sysroot {
4343
triple: &str,
4444
backends: &[CodegenBackend],
4545
) -> Result<Self, SysrootDownloadError> {
46-
let cache_directory = cache_directory.join(&sha).join(triple);
46+
// The structure of this directory is load-bearing.
47+
// We use the commit SHA as the top-level key, to have a quick way of estimating how many
48+
// toolchains have been installed in the cache directory.
49+
// We also use a nested directory below the target tuple, because rustc outputs weird things
50+
// when we query it with `--print sysroot` and its sysroot is located in a directory that
51+
// corresponds to a valid target name.
52+
let cache_directory = cache_directory.join(&sha).join(triple).join("toolchain");
4753
fs::create_dir_all(&cache_directory).map_err(|e| SysrootDownloadError::IO(e.into()))?;
4854

4955
let download = SysrootDownload {

0 commit comments

Comments
 (0)