Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RTS build: don't vendor Rust deps #2829

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 3 additions & 13 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ let
wasmtime
rust-bindgen
rustfmt
cacert
git
];

llvmEnv = ''
Expand Down Expand Up @@ -175,24 +177,12 @@ rec {
preBuild = ''
export XARGO_HOME=$PWD/xargo-home
export CARGO_HOME=$PWD/cargo-home

# this replicates logic from nixpkgs’ pkgs/build-support/rust/default.nix
mkdir -p $CARGO_HOME
echo "Using vendored sources from ${rustDeps}"
unpackFile ${rustDeps}
cat > $CARGO_HOME/config <<__END__
[source."crates-io"]
"replace-with" = "vendored-sources"

[source."vendored-sources"]
"directory" = "$(stripHash ${rustDeps})"
__END__
export CARGO_HTTP_MULTIPLEXING=false

${llvmEnv}
export TOMMATHSRC=${nixpkgs.sources.libtommath}
export MUSLSRC=${nixpkgs.sources.musl-wasi}/libc-top-half/musl
export MUSL_WASI_SYSROOT=${musl-wasi-sysroot}

'';

doCheck = true;
Expand Down