diff --git a/.github/workflows/test-integration.yml b/.github/workflows/test-integration.yml index 96a177a9bde..3abe5c56f13 100644 --- a/.github/workflows/test-integration.yml +++ b/.github/workflows/test-integration.yml @@ -53,7 +53,7 @@ jobs: run: | nix build -L .#wasm mkdir -p ./.packages/noir_wasm - cp -r ./result/* ./.packages/noir_wasm/ + cp -r ./result/noir_wasm/ ./.packages/noir_wasm/ echo "UPLOAD_PATH=$(readlink -f result)" >> $GITHUB_ENV - name: Upload `noir_wasm` artifact @@ -67,7 +67,7 @@ jobs: run: | nix build -L .#noirc_abi_wasm mkdir -p ./.packages/noirc_abi_wasm - cp -r ./result/* ./.packages/noirc_abi_wasm/ + cp -r ./result/noirc_abi_wasm/ ./.packages/noirc_abi_wasm/ echo "UPLOAD_PATH=$(readlink -f result)" >> $GITHUB_ENV - name: Upload `noirc_abi_wasm` artifact diff --git a/compiler/wasm/installPhase.sh b/compiler/wasm/installPhase.sh index 98578059be9..a8f81708b93 100755 --- a/compiler/wasm/installPhase.sh +++ b/compiler/wasm/installPhase.sh @@ -1,15 +1,17 @@ #!/usr/bin/env bash export self_path=$(dirname "$(readlink -f "$0")") -mkdir -p $out +export out_path=$out/noir_wasm + +mkdir -p $out_path cp ${self_path}/README.md ${self_path}/pkg/ cp ${self_path}/package.json ${self_path}/pkg/ -cp -r ${self_path}/pkg/* $out/ +cp -r ${self_path}/pkg/* $out_path/ -echo "" >> $out/README.md -echo "## Tracking" >> $out/README.md -echo "Built from [noir-lang/noir@$GIT_COMMIT](https://github.com/noir-lang/noir/tree/$GIT_COMMIT)" >> $out/README.md +echo "" >> $out_path/README.md +echo "## Tracking" >> $out_path/README.md +echo "Built from [noir-lang/noir@$GIT_COMMIT](https://github.com/noir-lang/noir/tree/$GIT_COMMIT)" >> $out_path/README.md # Cleanup temporary pkg directory rm -r $self_path/pkg diff --git a/compiler/wasm/test/shared.ts b/compiler/wasm/test/shared.ts index 725e4fbd05e..91f47764ef4 100644 --- a/compiler/wasm/test/shared.ts +++ b/compiler/wasm/test/shared.ts @@ -1,5 +1,5 @@ import { initialiseResolver } from "@noir-lang/noir-source-resolver"; -import { compile } from "../result/"; +import { compile } from "../result/noir_wasm"; export const noirSourcePath = "../../noir-script/src/main.nr"; export const nargoArtifactPath = diff --git a/flake.nix b/flake.nix index 35db82187f4..4548a578d3e 100644 --- a/flake.nix +++ b/flake.nix @@ -198,13 +198,15 @@ inherit GIT_COMMIT GIT_DIRTY; cargoArtifacts = native-cargo-artifacts; - doCheck = true; }); }; packages = { - default = nargo; + # Nix flakes cannot build more than one derivation in one command (see https://github.com/NixOS/nix/issues/5591) + # so we use `symlinkJoin` to build everything as our default package. + default = pkgs.symlinkJoin { name = "noir"; paths = [ nargo noir_wasm noirc_abi_wasm ]; }; + # We also export individual packages to enable `nix build .#nargo -L`, etc. inherit nargo; inherit noir_wasm; inherit noirc_abi_wasm; diff --git a/tooling/noirc_abi_wasm/installPhase.sh b/tooling/noirc_abi_wasm/installPhase.sh index 98578059be9..ecd78f527d6 100755 --- a/tooling/noirc_abi_wasm/installPhase.sh +++ b/tooling/noirc_abi_wasm/installPhase.sh @@ -1,15 +1,17 @@ #!/usr/bin/env bash export self_path=$(dirname "$(readlink -f "$0")") -mkdir -p $out +export out_path=$out/noirc_abi_wasm + +mkdir -p $out_path cp ${self_path}/README.md ${self_path}/pkg/ cp ${self_path}/package.json ${self_path}/pkg/ -cp -r ${self_path}/pkg/* $out/ +cp -r ${self_path}/pkg/* $out_path -echo "" >> $out/README.md -echo "## Tracking" >> $out/README.md -echo "Built from [noir-lang/noir@$GIT_COMMIT](https://github.com/noir-lang/noir/tree/$GIT_COMMIT)" >> $out/README.md +echo "" >> $out_path/README.md +echo "## Tracking" >> $out_path/README.md +echo "Built from [noir-lang/noir@$GIT_COMMIT](https://github.com/noir-lang/noir/tree/$GIT_COMMIT)" >> $out_path/README.md # Cleanup temporary pkg directory rm -r $self_path/pkg diff --git a/tooling/noirc_abi_wasm/test/node/abi_encode.test.ts b/tooling/noirc_abi_wasm/test/node/abi_encode.test.ts index 48064aebd68..87c54f377cc 100644 --- a/tooling/noirc_abi_wasm/test/node/abi_encode.test.ts +++ b/tooling/noirc_abi_wasm/test/node/abi_encode.test.ts @@ -1,5 +1,5 @@ import { expect } from "chai"; -import { abiEncode, abiDecode, WitnessMap } from "../../../../result/"; +import { abiEncode, abiDecode, WitnessMap } from "../../../../result/noirc_abi_wasm"; import { DecodedInputs } from "../types"; it("recovers original inputs when abi encoding and decoding", async () => { @@ -16,4 +16,4 @@ it("recovers original inputs when abi encoding and decoding", async () => { BigInt(inputs.bar[1]) ); expect(decoded_inputs.return_value).to.be.null; -}); \ No newline at end of file +});