Skip to content

Commit 22e38e1

Browse files
committed
RTS build: don't vendor Rust deps
Vendoring dependencies is causing a lot of problems in #2761 and other PRs, because `cargo vendor` currently has a bug and cannot vendor standard dependencies (deps of alloc and std, see rust-lang/wg-cargo-std-aware#23). For a long time I thought vendoring is a necessity and tried to work around this issue by vendoring dependencies manually, or using https://github.com/nix-community/naersk. However, it turns out vendoring is not necessary, and we can download dependencies in build step just fine. I also don't see any advantages of vendoring the dependencies. So in this PR we remove vendoring. Unblocks #2761.
1 parent bb14959 commit 22e38e1

File tree

1 file changed

+1
-13
lines changed

1 file changed

+1
-13
lines changed

default.nix

+1-13
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ let
3636
wasmtime
3737
rust-bindgen
3838
rustfmt
39+
cacert
3940
];
4041

4142
llvmEnv = ''
@@ -176,23 +177,10 @@ rec {
176177
export XARGO_HOME=$PWD/xargo-home
177178
export CARGO_HOME=$PWD/cargo-home
178179
179-
# this replicates logic from nixpkgs’ pkgs/build-support/rust/default.nix
180-
mkdir -p $CARGO_HOME
181-
echo "Using vendored sources from ${rustDeps}"
182-
unpackFile ${rustDeps}
183-
cat > $CARGO_HOME/config <<__END__
184-
[source."crates-io"]
185-
"replace-with" = "vendored-sources"
186-
187-
[source."vendored-sources"]
188-
"directory" = "$(stripHash ${rustDeps})"
189-
__END__
190-
191180
${llvmEnv}
192181
export TOMMATHSRC=${nixpkgs.sources.libtommath}
193182
export MUSLSRC=${nixpkgs.sources.musl-wasi}/libc-top-half/musl
194183
export MUSL_WASI_SYSROOT=${musl-wasi-sysroot}
195-
196184
'';
197185

198186
doCheck = true;

0 commit comments

Comments
 (0)