-
Notifications
You must be signed in to change notification settings - Fork 204
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: ludamad <[email protected]> Co-authored-by: ludamad <[email protected]> Co-authored-by: kevaundray <[email protected]>
- Loading branch information
1 parent
7c823fa
commit 2cd6dc3
Showing
12 changed files
with
138 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
Dockerfile* | ||
.dockerignore | ||
|
||
packages | ||
**/package.tgz | ||
**/target | ||
**/node_modules | ||
**/outputs | ||
|
||
# Source resolver | ||
compiler/source-resolver/lib | ||
compiler/source-resolver/lib-node | ||
|
||
# Noir.js | ||
tooling/noir_js/lib | ||
|
||
# Wasm build artifacts | ||
compiler/wasm/nodejs | ||
compiler/wasm/web | ||
tooling/noirc_abi_wasm/nodejs | ||
tooling/noirc_abi_wasm/web | ||
tooling/noir_js/lib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
FROM rust:alpine3.17 | ||
RUN apk update \ | ||
&& apk upgrade \ | ||
&& apk add --no-cache \ | ||
build-base \ | ||
bash | ||
WORKDIR /usr/src/noir | ||
COPY . . | ||
RUN ./scripts/bootstrap_native.sh | ||
|
||
# When running the container, mount the current working directory to /project. | ||
FROM alpine:3.17 | ||
COPY --from=0 /usr/src/noir/target/release/nargo /usr/src/noir/target/release/nargo | ||
WORKDIR /project | ||
ENTRYPOINT ["/usr/src/noir/target/release/nargo"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
FROM rust:alpine3.17 | ||
RUN apk update \ | ||
&& apk upgrade \ | ||
&& apk add --no-cache \ | ||
build-base \ | ||
pkgconfig \ | ||
openssl-dev \ | ||
npm \ | ||
yarn \ | ||
bash \ | ||
jq | ||
WORKDIR /usr/src/noir | ||
COPY . . | ||
RUN ./scripts/bootstrap_packages.sh | ||
|
||
FROM scratch | ||
COPY --from=0 /usr/src/noir/packages /usr/src/noir/packages | ||
# For some unknown reason, on alpine only, we need this to exist. | ||
COPY --from=0 /usr/src/noir/node_modules/@noir-lang /usr/src/noir/node_modules/@noir-lang |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
set -eu | ||
|
||
cd $(dirname "$0") | ||
|
||
CMD=${1:-} | ||
|
||
if [ -n "$CMD" ]; then | ||
if [ "$CMD" = "clean" ]; then | ||
git clean -fdx | ||
exit 0 | ||
else | ||
echo "Unknown command: $CMD" | ||
exit 1 | ||
fi | ||
fi | ||
|
||
./scripts/bootstrap_native.sh | ||
./scripts/bootstrap_packages.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
set -eu | ||
|
||
cd $(dirname "$0")/.. | ||
|
||
# If this project has been subrepod into another project, set build data manually. | ||
if [ -f ".gitrepo" ]; then | ||
export SOURCE_DATE_EPOCH=$(date +%s) | ||
export GIT_DIRTY=false | ||
export GIT_COMMIT=$(awk '/commit =/ {print $3}' .gitrepo) | ||
fi | ||
|
||
# Build native. | ||
cargo build --features="noirc_frontend/aztec" --release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/bin/bash | ||
set -eu | ||
|
||
cd $(dirname "$0")/.. | ||
|
||
./scripts/install_wasm-bindgen.sh | ||
|
||
# If this project has been subrepod into another project, set build data manually. | ||
if [ -f ".gitrepo" ]; then | ||
export SOURCE_DATE_EPOCH=$(date +%s) | ||
export GIT_DIRTY=false | ||
export GIT_COMMIT=$(awk '/commit =/ {print $3}' .gitrepo) | ||
fi | ||
|
||
export cargoExtraArgs="--features noirc_frontend/aztec" | ||
|
||
yarn | ||
yarn build | ||
|
||
# We create a folder called packages, that contains each package as it would be published to npm, named correctly. | ||
# These can be useful for testing, or portaling into other projects. | ||
yarn workspaces foreach pack | ||
|
||
rm -rf packages && mkdir -p packages | ||
tar zxfv acvm-repo/acvm_js/package.tgz -C packages && mv packages/package packages/acvm_js | ||
tar zxfv compiler/source-resolver/package.tgz -C packages && mv packages/package packages/source-resolver | ||
tar zxfv compiler/wasm/package.tgz -C packages && mv packages/package packages/noir_wasm | ||
tar zxfv tooling/noir_codegen/package.tgz -C packages && mv packages/package packages/noir_codegen | ||
tar zxfv tooling/noir_js/package.tgz -C packages && mv packages/package packages/noir_js | ||
tar zxfv tooling/noir_js_backend_barretenberg/package.tgz -C packages && mv packages/package packages/backend_barretenberg | ||
tar zxfv tooling/noir_js_types/package.tgz -C packages && mv packages/package packages/types | ||
tar zxfv tooling/noirc_abi_wasm/package.tgz -C packages && mv packages/package packages/noirc_abi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/bash | ||
set -eu | ||
|
||
cd $(dirname "$0")/.. | ||
|
||
# Install wasm-bindgen-cli. | ||
if [ "$(wasm-bindgen --version | cut -d' ' -f2)" != "0.2.86" ]; then | ||
echo "Building wasm-bindgen..." | ||
RUSTFLAGS="-Ctarget-feature=-crt-static" cargo install -f wasm-bindgen-cli --version 0.2.86 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters