remap crates fetched via sparse registry as well #1888
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
on Rust nightlies since about 2023-03-09 it seems the default (-on-nightly?) Cargo protocol switched to "sparse". this has a side effect of caching fetched crates at a different path, so the
github.com
path remapping is no longer sufficient to normalize all crate paths.we then picked that change up back at v1.0.14, bumping nightly forward a year and change, so local builds of hubris between then and v1.0.26 have source paths that are not actually remapped :(
thankfully, to make it sufficient we only have to handle the new
index.crates.io-6f17d22bba15001f
path as well. this in fact is where all cargo-fetched crates.io dependencies end up now.technically we could forget about
github.com-1ecc6299db9ec823
at this point, but by keeping it we'll still be correct in the unlikely event someone were to flip away fromsparse
togit
for the Cargo protocol.when i built
gimlet-v1.0.26
with this patch the resulting images no longer have my home directory in them.... i am deeply perplexed that with this change the resulting
gimlet-b
image is 0x2200 bytes larger though???a funny consequence of this is that to reproduce the hubris releases from 1.0.14 to ... now ... you actually have to remap the index.crates.io directory to
/home/runner/.cargo/registry/src/index.crates.io-6f16d22bba15001f
. by doing this i just built agimlet-b
that matches the one here.