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

chore: update bash script shebangs and dockerfiles #3875

Merged
merged 10 commits into from
Dec 19, 2023
2 changes: 1 addition & 1 deletion .github/actions/docs/build-status/script.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

BRANCH_NAME=$(echo "$BRANCH_NAME" | sed -e "s#refs/[^/]*/##")
DEPLOY_STATUS=$(curl -X GET "https://api.netlify.com/api/v1/sites/$SITE_ID/deploys?branch=$BRANCH_NAME" | jq -r '.[] | select(.created_at != null) | .state' | head -1)
Expand Down
17 changes: 7 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
FROM rust:alpine3.17
RUN apk update \
&& apk upgrade \
&& apk add --no-cache \
build-base \
bash
FROM rust:bookworm
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
# When running the container, mount the users home directory to same location.
FROM ubuntu:lunar
# Install Tini as nargo doesn't handle signals properly.
# Install git as nargo needs it to clone.
RUN apt-get update && apt-get install -y git tini && rm -rf /var/lib/apt/lists/* && apt-get clean
COPY --from=0 /usr/src/noir/target/release/nargo /usr/src/noir/target/release/nargo
WORKDIR /project
ENTRYPOINT ["/usr/src/noir/target/release/nargo"]
ENTRYPOINT ["/usr/bin/tini", "--", "/usr/src/noir/target/release/nargo"]
2 changes: 1 addition & 1 deletion bootstrap.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -eu

cd $(dirname "$0")
Expand Down
2 changes: 1 addition & 1 deletion compiler/integration-tests/scripts/codegen-verifiers.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash

self_path=$(dirname "$(readlink -f "$0")")

Expand Down
8 changes: 6 additions & 2 deletions scripts/bootstrap_native.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -eu

cd $(dirname "$0")/..
Expand All @@ -13,4 +13,8 @@ else
fi

# Build native.
cargo build --release
if [ -n "${DEBUG:-}" ]; then
cargo build
else
cargo build --release
fi
2 changes: 1 addition & 1 deletion scripts/bootstrap_packages.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -eu

cd $(dirname "$0")/..
Expand Down
2 changes: 1 addition & 1 deletion scripts/install_wasm-bindgen.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -eu

cd $(dirname "$0")/..
Expand Down
2 changes: 1 addition & 1 deletion test_programs/gates_report.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -e

# These tests are incompatible with gas reporting
Expand Down
4 changes: 2 additions & 2 deletions test_programs/rebuild.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
set -e

process_dir() {
Expand All @@ -14,7 +14,7 @@ process_dir() {
if [ -d ./target/ ]; then
rm -r ./target/
fi
cargo run compile --only-acir && cargo run execute witness
nargo compile --only-acir && nargo execute witness
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm. I made this change, but not sure if this is safe to bring back to noir. 🤔


if [ -d "$current_dir/acir_artifacts/$dir_name/target" ]; then
rm -r "$current_dir/acir_artifacts/$dir_name/target"
Expand Down
Loading