From 22e38e1dc246838fa26a40bdb946c76aaca5156f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96mer=20Sinan=20A=C4=9Facan?= Date: Wed, 6 Oct 2021 09:17:27 +0300 Subject: [PATCH 1/3] 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 https://github.com/rust-lang/wg-cargo-std-aware/issues/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. --- default.nix | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/default.nix b/default.nix index ddbd022641d..8e3226f301d 100644 --- a/default.nix +++ b/default.nix @@ -36,6 +36,7 @@ let wasmtime rust-bindgen rustfmt + cacert ]; llvmEnv = '' @@ -176,23 +177,10 @@ rec { 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__ - ${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; From 02cca7354666e63cb392006779db038692c983cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96mer=20Sinan=20A=C4=9Facan?= Date: Wed, 6 Oct 2021 11:14:54 +0300 Subject: [PATCH 2/3] Set CARGO_HTTP_MULTIPLEXING=false --- default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/default.nix b/default.nix index 8e3226f301d..feb5eb8e61e 100644 --- a/default.nix +++ b/default.nix @@ -176,6 +176,7 @@ rec { preBuild = '' export XARGO_HOME=$PWD/xargo-home export CARGO_HOME=$PWD/cargo-home + export CARGO_HTTP_MULTIPLEXING=false ${llvmEnv} export TOMMATHSRC=${nixpkgs.sources.libtommath} From 391a8da2f694b26d8336508161cf9c8bd68814a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=96mer=20Sinan=20A=C4=9Facan?= Date: Wed, 6 Oct 2021 12:15:27 +0300 Subject: [PATCH 3/3] Add git as rts dep --- default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/default.nix b/default.nix index feb5eb8e61e..67e96b89f26 100644 --- a/default.nix +++ b/default.nix @@ -37,6 +37,7 @@ let rust-bindgen rustfmt cacert + git ]; llvmEnv = ''