Commit 9a9af0c
upgrade ar crate so we can do less copying when trimming rlibs
The current trimming of rlibs in the dist-sccache case looks like:
1. Find the `rust.metadata.bin` file in the rlib (archive).
2. Read its data.
3. Create a new archive that will only contain said file.
4. Copy the data into the new archive.
We can do better than this, by doing the following:
1. Find the `rust.metadata.bin` file in the rlib (archive).
2. Create a new archive that will only contain said file.
3. Copy the data from the original rlib directly into the new archive.
We thus save a copy.
All that being said, it looks like recent versions of Rust don't
actually output `rust.metadata.bin` files into rlibs...unless we ought
to be only taking the `lib.rmeta` file that lives inside the archive.
But that would be a separate fix. (It's also great that we're seemingly
copying the rmeta file twice, once because it lives in the rlib and once
because it lives on disk as a separate file...)1 parent 68c94c9 commit 9a9af0c
3 files changed
Lines changed: 5 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1873 | 1873 | | |
1874 | 1874 | | |
1875 | 1875 | | |
1876 | | - | |
1877 | | - | |
1878 | 1876 | | |
1879 | 1877 | | |
1880 | 1878 | | |
1881 | | - | |
| 1879 | + | |
| 1880 | + | |
1882 | 1881 | | |
1883 | 1882 | | |
1884 | 1883 | | |
| |||
0 commit comments