oxalica / rust-overlay

Pure and reproducible nix overlay of binary distributed rust toolchains
MIT License
814 stars 50 forks source link

Provide access to commit hash of a toolchain #144

Open Nemo157 opened 7 months ago

Nemo157 commented 7 months ago

I would like to setup remapping of rust toolchain's CI paths to the local rust-src component, something similar to

rust-toolchain = pkgs.rust-bin.selectLatestNightlyWith (toolchain:
  toolchain.default.override {
    extensions = ["rust-src"];
  }
);

"--remap-path-prefix=/rustc/${rust-toolchain.commit}=/${rust-toolchain}/lib/rustlib/src/rust"

But afaict there's no way to access the commit hash of a selected toolchain.

Nemo157 commented 7 months ago

Hmmm, turns out this is maybe supposed to work automatically without config like this (https://github.com/rust-lang/rust/issues/105907) and the config doesn't actually appear to work for these paths anyway. So :shrug: this does seem useful to have available still.

oxalica commented 7 months ago

I don't think it's possible currently, since we stripped all commit hashes from manifest to save space initially. They would add an additional ~100KB to the repo size, which seems acceptable to me. Just that we need a full refetch of manifests to include them for each versions.

Nadrieril commented 2 weeks ago

I would quite like that as well. I currently get the toolchain commit by parsing ${toolchain}/share/doc/rust/html/version_info.html x)