On Sat, Feb 17, 2024 at 9:27 AM Miguel Ojeda <ojeda@xxxxxxxxxx> wrote: > > `rustc` (like Cargo) may take advantage of the jobserver at any time > (e.g. for backend parallelism, or eventually frontend too). In the kernel, > we call `rustc` with `-Ccodegen-units=1` (and `-Zthreads` is 1 so far), > so we do not expect parallelism. However, in the upcoming Rust 1.76.0, a > warning is emitted by `rustc` when it cannot connect to the jobserver it > was passed (in many cases, but not all: compiling and `--print sysroot` > do, but `--version` does not). And given GNU Make always passes > the jobserver in the environment variable (even when a line is deemed > non-recursive), `rustc` will end up complaining about it (in particular > in Make 4.3 where there is only the simple pipe jobserver style). > > One solution is to remove the jobserver from `MAKEFLAGS`. However, we > can mark the lines with calls to `rustc` (and Cargo) as recursive, which > looks simpler. This is what is now documented and recommended by `rustc` > and allows us to be ready for the time we may use parallelism inside > `rustc` (potentially now, if a user passes `-Zthreads`). Thus do so. > > Similarly, do the same for `rustdoc` and `cargo` calls. > > Finally, there is one case that the solution does not cover, which is the > `$(shell ...)` call we have. Thus, for that one, set an empty `MAKEFLAGS` > environment variable. > > Link: https://github.com/rust-lang/rust/issues/120515 > Signed-off-by: Miguel Ojeda <ojeda@xxxxxxxxxx> Acked-by: Masahiro Yamada <masahiroy@xxxxxxxxxx> -- Best Regards Masahiro Yamada