]> git.lizzy.rs Git - rust.git/commit
Fix `x build library/std compiler/rustc`
authorJoshua Nelson <jnelson@cloudflare.com>
Sun, 10 Jul 2022 22:24:43 +0000 (17:24 -0500)
committerJoshua Nelson <jnelson@cloudflare.com>
Sun, 10 Jul 2022 22:50:09 +0000 (17:50 -0500)
commit7d4bd54f751db36a32a7d4594f075bf1a0b92bbf
tree741d63651584b541533641e7a2aad6268170fdb2
parent17355a3b9f30e16870a1890033bd13463c664f81
Fix `x build library/std compiler/rustc`

Previously, this was broken because of improper caching:
1. `StepDescription::maybe_run` builds `Compile::Std`, which only built `std` and not `proc_macro`
1. `Std` calls `builder.ensure(StdLink)`
1. `Rustc` calls `ensure(Std)`, which builds all crates, including `proc_macro`
1. `Rustc` calls `ensure(StdLink)`. `ensure` would see that it had already been run and do nothing.  <-- bug is here
1. Cargo gives an error that `proc_macro` doesn't exist.

This fixes the caching by adding `crates` to `StdLink`, so it will get rerun if the crates that are
built change.  This also does the same for `RustcLink`; it doesn't matter in practice currently
because nothing uses it except `impl Step for Rustc`, but it will avoid bugs if we start using it in
the future (e.g. to build individual crates for rustfmt).
src/bootstrap/compile.rs