Skip to content

Commit

Permalink
attempt to combine wasm deps
Browse files Browse the repository at this point in the history
  • Loading branch information
phated committed Sep 14, 2023
1 parent c00d89a commit 7f8ba13
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@
wasmConfig = environment // config // {
CARGO_TARGET_DIR = "./target";

CARGO_BUILD_TARGET = "wasm32-unknown-unknown";

nativeBuildInputs = with pkgs; [
which
git
Expand All @@ -117,13 +119,10 @@

# Build *just* the cargo dependencies, so we can reuse all of that work between runs
native-cargo-artifacts = craneLib.buildDepsOnly (nativeConfig // {
pname = "nargo";
pname = "native";
});
noir-wasm-cargo-artifacts = craneLib.buildDepsOnly (wasmConfig // {
pname = "noir_wasm";
});
noirc-abi-wasm-cargo-artifacts = craneLib.buildDepsOnly (wasmConfig // {
pname = "noirc_abi_wasm";
wasm-cargo-artifacts = craneLib.buildDepsOnly (wasmConfig // {
pname = "wasm";
});

nargo = craneLib.buildPackage (nativeConfig // {
Expand All @@ -142,9 +141,9 @@

inherit GIT_COMMIT GIT_DIRTY;

cargoArtifacts = noir-wasm-cargo-artifacts;
cargoArtifacts = wasm-cargo-artifacts;

cargoExtraArgs = "--package ${pname} --target wasm32-unknown-unknown";
cargoExtraArgs = "--package ${pname}";

buildPhaseCargoCommand = ''
bash compiler/wasm/buildPhaseCargoCommand.sh release
Expand All @@ -163,9 +162,9 @@

inherit GIT_COMMIT GIT_DIRTY;

cargoArtifacts = noirc-abi-wasm-cargo-artifacts;
cargoArtifacts = wasm-cargo-artifacts;

cargoExtraArgs = "--package ${pname} --target wasm32-unknown-unknown";
cargoExtraArgs = "--package ${pname}";

buildPhaseCargoCommand = ''
bash tooling/noirc_abi_wasm/buildPhaseCargoCommand.sh release
Expand Down Expand Up @@ -218,8 +217,7 @@

# We expose the `*-cargo-artifacts` derivations so we can cache our cargo dependencies in CI
inherit native-cargo-artifacts;
inherit noir-wasm-cargo-artifacts;
inherit noirc-abi-wasm-cargo-artifacts;
inherit wasm-cargo-artifacts;
};

# Setup the environment to match the environment settings, the inputs from our checks derivations,
Expand Down

0 comments on commit 7f8ba13

Please sign in to comment.