rustc-wasm32: merge into rustc

Since wasm32-unknown-unknown doesn't require any extra
platform-specific dependencies (e.g. libc), we might as well just
always include in with rustc.  We could also include other targets
fitting these criteria, but I wasn't able to find any others that
actually build (not even wasm64-unknown-unknown).

The old rustc-wasm32 package disabled documentation, but we don't
actually need to do that — we just need to allow for some broken links
in the wasm32-unknown-unknown documentation.  Broken links in
documentation are an upstream issue anyway.  There's no need we need
to fail our build for them.
This commit is contained in:
Alyssa Ross 2023-11-18 12:19:27 +01:00
parent 7386ca48e3
commit 989723ecf2
6 changed files with 14 additions and 21 deletions

View file

@ -4,7 +4,7 @@
, rocksdb
, rust-jemalloc-sys-unprefixed
, rustPlatform
, rustc-wasm32
, rustc
, stdenv
, Security
, SystemConfiguration
@ -61,8 +61,8 @@ rustPlatform.buildRustPackage rec {
nativeBuildInputs = [
rustPlatform.bindgenHook
rustc-wasm32
rustc-wasm32.llvmPackages.lld
rustc
rustc.llvmPackages.lld
];
# NOTE: jemalloc is used by default on Linux with unprefixed enabled

View file

@ -7,7 +7,7 @@
, binaryen
, gzip
, nodejs
, rustc-wasm32
, rustc
, wasm-bindgen-cli
, wasm-pack
}:
@ -66,8 +66,8 @@ rustPlatform.buildRustPackage rec {
binaryen
gzip
nodejs
rustc-wasm32
rustc-wasm32.llvmPackages.lld
rustc
rustc.llvmPackages.lld
wasm-bindgen-84
wasm-pack
];

View file

@ -65,6 +65,8 @@ in stdenv.mkDerivation (finalAttrs: {
# Increase codegen units to introduce parallelism within the compiler.
RUSTFLAGS = "-Ccodegen-units=10";
RUSTDOCFLAGS = "-A rustdoc::broken-intra-doc-links";
# We need rust to build rust. If we don't provide it, configure will try to download it.
# Reference: https://github.com/rust-lang/rust/blob/master/src/bootstrap/configure.py
configureFlags = let
@ -100,6 +102,10 @@ in stdenv.mkDerivation (finalAttrs: {
"--target=${concatStringsSep "," ([
stdenv.targetPlatform.rust.rustcTargetSpec
# Other targets that don't need any extra dependencies to build.
] ++ optionals (!fastCross) [
"wasm32-unknown-unknown"
# (build!=target): When cross-building a compiler we need to add
# the build platform as well so rustc can compile build.rs
# scripts.

View file

@ -7,7 +7,6 @@
, nixosTests
, rustPlatform
, rustc
, rustc-wasm32
, stdenv
, wasm-bindgen-cli
, wasm-pack
@ -48,7 +47,7 @@ let
pname = commonDerivationAttrs.pname + "-frontend";
nativeBuildInputs = [
wasm-pack wasm-bindgen-84 binaryen which rustc-wasm32 rustc-wasm32.llvmPackages.lld
wasm-pack wasm-bindgen-84 binaryen which rustc rustc.llvmPackages.lld
];
buildPhase = ''

View file

@ -829,6 +829,7 @@ mapAliases ({
rtsp-simple-server = throw "rtsp-simple-server is rebranded as mediamtx, including default config path update"; # Added 2023-04-11
runCommandNoCC = runCommand;
runCommandNoCCLocal = runCommandLocal;
rustc-wasm32 = rustc; # Added 2023-12-01
rxvt_unicode = rxvt-unicode-unwrapped; # Added 2020-02-02
rxvt_unicode-with-plugins = rxvt-unicode; # Added 2020-02-02

View file

@ -16925,19 +16925,6 @@ with pkgs;
inherit (rustPackages) cargo cargo-auditable cargo-auditable-cargo-wrapper clippy rustc rustPlatform;
# https://github.com/NixOS/nixpkgs/issues/89426
rustc-wasm32 = wrapRustc ((rustc.unwrapped.override {
stdenv = stdenv.override {
targetPlatform = lib.systems.elaborate {
# lib.systems.elaborate won't recognize "unknown" as the last component.
config = "wasm32-unknown-wasi";
rust.rustcTarget = "wasm32-unknown-unknown";
};
};
}).overrideAttrs (old: {
configureFlags = old.configureFlags ++ ["--set=build.docs=false"];
}));
makeRustPlatform = callPackage ../development/compilers/rust/make-rust-platform.nix { };
buildRustCrate = callPackage ../build-support/rust/build-rust-crate { };