Commit a677a8d
authored
remap crates fetched via sparse registry as well (#1888)
on Rust nightlies since about 2023-03-09:
https://github.com/rust-lang/cargo/blob/master/CHANGELOG.md#cargo-168-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:
24bdff6#diff-2b1bde2cf3a858b7bf7424cb8bcbf01f35b94dc80b925d9432cbab3319ca9b4e
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 from `sparse` to `git` 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 a `gimlet-b` that matches the one
[here](https://github.com/oxidecomputer/hubris/releases/tag/gimlet-v1.0.26).1 parent b2b108f commit a677a8d
1 file changed
+10
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
167 | 167 | | |
168 | 168 | | |
169 | 169 | | |
170 | | - | |
| 170 | + | |
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
| |||
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
180 | 189 | | |
181 | 190 | | |
182 | 191 | | |
| |||
0 commit comments