rust/src/tools/opt-dist/src
Weihang Lo e24be071e3
feat: vendor crates required by opt-dist to collect profiles
These are the default package set required by opt-dist to correctly work,
hence for people wanting to build a production grade of rustc in a
sandboxed / air-gapped environment, these need to be vendored.

The size of `rustc-src-nightly.tar.xz` before and after this change:

* Before: 298M
* After: 323M (+8%)

These crates are the default set of packages required by opt-dist
to correctly work, hence for people wanting to build a production grade
of rustc in an sandboxed / air-gapped environment, these need to be vendored.

The size of `rustc-src-nightly.tar.xz` before and after this change:

* Before: 298M
* After: 323M (+8%)

Size change might or might not be a concern.
See the previous discussion: https://github.com/rust-lang/rust/pull/125166#issuecomment-2113626468

Previous efforts on making:

* https://github.com/rust-lang/rust/pull/125125
* https://github.com/rust-lang/rust/pull/125166

---

Note that extra works still need to be done to make it fully vendored.

* The current pinned rustc-perf uses `tempfile::Tempdir` as the working
  directory when collecting profiles from some of these packages.
  This "tmp" working directory usage make it impossible for Cargo to pick
  up the correct vendor sources setting in `.cargo/config.toml` bundled
  in the rustc-src tarball. [^1]
* opt-dist verifies the final built rustc against a subset of rustc test
  suite. However it rolls out its own `config.toml` without setting
  `vendor = true`, and that results in `./vendor/` directory removed.
  [^2]

[^1]: 4f313add60/collector/src/compile/benchmark/mod.rs (L164-L173)
[^2]: 606afbb617/src/tools/opt-dist/src/tests.rs (L62-L77)
2024-06-09 12:33:11 -04:00
..
utils Include all library files in artifact summary on CI 2024-03-07 12:19:13 +01:00
bolt.rs [BOLT] Use CDSort and CDSplit 2023-12-29 11:41:44 -08:00
environment.rs feat(opt-dist): new flag --benchmark-cargo-config 2024-06-03 17:15:52 -04:00
exec.rs Add --enable-bolt-settings bootstrap flag 2023-10-09 22:00:17 +02:00
main.rs feat(opt-dist): new flag --benchmark-cargo-config 2024-06-03 17:15:52 -04:00
metrics.rs Port PGO/LTO/BOLT optimized build pipeline to Rust 2023-07-09 08:39:50 +02:00
tests.rs opt-dist: dont overrwite config.toml when verifying 2024-05-25 23:23:47 -04:00
timer.rs Port PGO/LTO/BOLT optimized build pipeline to Rust 2023-07-09 08:39:50 +02:00
training.rs feat: vendor crates required by opt-dist to collect profiles 2024-06-09 12:33:11 -04:00