rustc: build rustdoc even when cross compiling

rustdoc is built for native builds, because it's used to run doctests,
but it wasn't built for cross builds, since they don't run doctests.
This inconsistency led to wrapRustc not working for cross-compiled
rustc, because it expected there to be a rustdoc binary.

In the interests of consistency, let's instruct the build system to
always build rustdoc.

Link: https://github.com/NixOS/nixpkgs/pull/292777#issuecomment-2048071969
Fixes: 6f8fa05acf ("wrapRustc: wrap rustdoc")
This commit is contained in:
Alyssa Ross 2024-04-10 23:07:04 +02:00
parent ff0dbd9426
commit 9e0eb58032
No known key found for this signature in database
GPG key ID: F9DBED4859B271C0

View file

@ -93,7 +93,7 @@ in stdenv.mkDerivation (finalAttrs: {
# attempts to download the missing source tarball # attempts to download the missing source tarball
"--set=build.rustfmt=${rustfmt}/bin/rustfmt" "--set=build.rustfmt=${rustfmt}/bin/rustfmt"
] ++ [ ] ++ [
"--tools=rustc,rust-analyzer-proc-macro-srv" "--tools=rustc,rustdoc,rust-analyzer-proc-macro-srv"
"--enable-rpath" "--enable-rpath"
"--enable-vendor" "--enable-vendor"
"--build=${stdenv.buildPlatform.rust.rustcTargetSpec}" "--build=${stdenv.buildPlatform.rust.rustcTargetSpec}"