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

feat(flags): add support for feature flags #37

Merged
merged 5 commits into from
Sep 5, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,22 @@ jobs:
- run: nargo new project
- run: nargo check
working-directory: ./project
- run: nargo compile test-circuit
- run: |
TomAFrench marked this conversation as resolved.
Show resolved Hide resolved
if [[ "${{ matrix.toolchain }}" == "stable" || "${{ matrix.toolchain }}" == "nightly" ]]; then
nargo compile
else
minor=$(echo "${{ matrix.toolchain }}" | cut -d '.' -f 2)

# The version in which the compile syntax changed
if [ "$minor" -lt 10 ]; then
nargo compile test-circuit
else
nargo compile
fi
fi
name: nargo compile
working-directory: ./project
shell: bash
- run: nargo test
if: matrix.toolchain != '0.1.0'
working-directory: ./project
8 changes: 6 additions & 2 deletions noirup
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ main() {
-r|--repo) shift; NOIRUP_REPO=$1;;
-b|--branch) shift; NOIRUP_BRANCH=$1;;
-v|--version) shift; NOIRUP_VERSION=$1;;
-f|--features) shift; NOIRUP_FEATURES=$1;;
TomAFrench marked this conversation as resolved.
Show resolved Hide resolved
-p|--path) shift; NOIRUP_LOCAL_REPO=$1;;
-P|--pr) shift; NOIRUP_PR=$1;;
-C|--commit) shift; NOIRUP_COMMIT=$1;;
Expand All @@ -28,6 +29,8 @@ main() {
esac; shift
done

FEATURES=${NOIRUP_FEATURES:-"default"}
TomAFrench marked this conversation as resolved.
Show resolved Hide resolved

if [ -n "$NOIRUP_PR" ]; then
if [ -z "$NOIRUP_BRANCH" ]; then
NOIRUP_BRANCH="refs/pull/$NOIRUP_PR/head"
Expand All @@ -48,7 +51,7 @@ main() {
# Enter local repo and build
say "installing from $NOIRUP_LOCAL_REPO"
cd $NOIRUP_LOCAL_REPO
RUSTFLAGS="-C target-cpu=native" ensure cargo build --release # need 4 speed
RUSTFLAGS="-C target-cpu=native" ensure cargo build --release --features $FEATURES # need 4 speed
TomAFrench marked this conversation as resolved.
Show resolved Hide resolved

# Remove prior installations if they exist
rm -f "$NARGO_BIN_DIR/nargo"
Expand Down Expand Up @@ -146,7 +149,7 @@ main() {
ensure git checkout ${NOIRUP_COMMIT}
fi

RUSTFLAGS="-C target-cpu=native" ensure cargo build --release
RUSTFLAGS="-C target-cpu=native" ensure cargo build --release --features $FEATURES
TomAFrench marked this conversation as resolved.
Show resolved Hide resolved

# Remove prior installations if they exist
rm -f "$NARGO_BIN_DIR/nargo"
Expand Down Expand Up @@ -177,6 +180,7 @@ OPTIONS:
-C, --commit Install a specific commit
-r, --repo Install from a remote GitHub repo (uses default branch if no other options are set)
-p, --path Install a local repository
-f, --features Activates feature flags when building from source
EOF
}

Expand Down