Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
5 changes: 4 additions & 1 deletion avm-transpiler/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
/target
.DS_Store
.DS_Store

# Generated Cargo.toml from template
Cargo.toml
17 changes: 17 additions & 0 deletions avm-transpiler/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 0 additions & 33 deletions avm-transpiler/Cargo.toml

This file was deleted.

33 changes: 33 additions & 0 deletions avm-transpiler/Cargo.toml.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
[package]
name = "avm-transpiler"
version = "0.1.0"
authors = ["The Aztec Team <[email protected]>"]
edition = "2024"
license = "MIT OR Apache-2.0"

[lib]
name = "avm_transpiler"
crate-type = ["staticlib", "rlib"]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
# noir dependencies - dynamically generated from noir-repo-ref
acvm = { git = "{{NOIR_GIT_URL}}", {{NOIR_REF_TYPE}} = "{{NOIR_REF_VALUE}}", features = ["bn254"] }
noirc_errors = { git = "{{NOIR_GIT_URL}}", {{NOIR_REF_TYPE}} = "{{NOIR_REF_VALUE}}" }
noirc_abi = { git = "{{NOIR_GIT_URL}}", {{NOIR_REF_TYPE}} = "{{NOIR_REF_VALUE}}" }
noirc_evaluator = { git = "{{NOIR_GIT_URL}}", {{NOIR_REF_TYPE}} = "{{NOIR_REF_VALUE}}", features = ["bn254"] }
noirc_frontend = { git = "{{NOIR_GIT_URL}}", {{NOIR_REF_TYPE}} = "{{NOIR_REF_VALUE}}", features = ["test_utils"] }

# FFI
libc = "0.2"

# external
base64 = "0.21"
env_logger = "0.11"
log = "0.4"
serde_json = "1.0"
serde = { version = "1.0.136", features = ["derive"] }
regex = "1.11.1"
fxhash = "0.2.1"
once_cell = "1.20.3"
50 changes: 50 additions & 0 deletions avm-transpiler/bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,55 @@ export SOURCE_DATE_EPOCH=0
export GIT_DIRTY=false
export RUSTFLAGS="-Dwarnings"

# Generate Cargo.toml from template based on noir-repo-ref
function generate_cargo_toml {
local ref_content=$(head -n 1 ../noir/noir-repo-ref)
local noir_git_url
local noir_ref_type
local noir_ref_value

# Detect if noir-repo-ref contains a URL (has ://) or is a simple tag/version
if [[ "$ref_content" == *"://"* ]]; then
# Unhappy path: Custom repository URL
if [[ "$ref_content" == *"#"* ]]; then
noir_git_url="${ref_content%#*}"
noir_ref_value="${ref_content##*#}"
# Determine if it's a branch or commit hash
if [[ "$noir_ref_value" =~ ^[0-9a-f]{40}$ ]]; then
noir_ref_type="rev"
else
noir_ref_type="branch"
fi
else
noir_git_url="$ref_content"
noir_ref_type="branch"
noir_ref_value="master"
fi
else
# Happy path: Official release tag
noir_git_url="https://github.com/noir-lang/noir"
noir_ref_type="tag"
noir_ref_value="$ref_content"
fi

echo "Generating Cargo.toml from template..."
echo " Git URL: $noir_git_url"
echo " Ref type: $noir_ref_type"
echo " Ref value: $noir_ref_value"

# Generate Cargo.toml from template using sed
sed -e "s|{{NOIR_GIT_URL}}|$noir_git_url|g" \
-e "s|{{NOIR_REF_TYPE}}|$noir_ref_type|g" \
-e "s|{{NOIR_REF_VALUE}}|$noir_ref_value|g" \
Cargo.toml.template > Cargo.toml
}

function build_native {
echo_header "avm-transpiler build_native"

# Generate Cargo.toml from template before building
generate_cargo_toml

artifact=avm-transpiler-$hash.tar.gz
if ! cache_download $artifact; then
# Serialize cargo/rustup operations to avoid race conditions when running parallel builds
Expand All @@ -33,6 +80,9 @@ function build_cross {
local target=$1
echo_header "avm-transpiler build_cross $target"

# Generate Cargo.toml from template before building
generate_cargo_toml

cross_compile_artifact=avm-transpiler-cross-$target-$hash.tar.gz
if ! cache_download $cross_compile_artifact; then
# We build libraries to be linked by barretenberg
Expand Down
12 changes: 1 addition & 11 deletions bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,6 @@ export NUM_TXES=8
cmd=${1:-}
[ -n "$cmd" ] && shift

if [ ! -v NOIR_HASH ] && [ "$cmd" != "clean" ]; then
export NOIR_HASH=$(./noir/bootstrap.sh hash)
[ -n "$NOIR_HASH" ]
fi

function encourage_dev_container {
echo -e "${bold}${red}ERROR: Toolchain incompatibility. We encourage use of our dev container. See build-images/README.md.${reset}"
}
Expand Down Expand Up @@ -139,11 +134,9 @@ function install_hooks {
set -euo pipefail
(cd barretenberg/cpp && ./format.sh staged)
./yarn-project/precommit.sh
./noir-projects/precommit.sh
./yarn-project/constants/precommit.sh
EOF
chmod +x $hooks_dir/pre-commit
echo "(cd noir && ./postcheckout.sh \$@)" >$hooks_dir/post-checkout
chmod +x $hooks_dir/post-checkout
}

Expand All @@ -169,7 +162,7 @@ function sort_by_cpus {
function test_cmds {
if [ "$#" -eq 0 ]; then
# Ordered with longest running first, to ensure they get scheduled earliest.
set -- spartan yarn-project/end-to-end aztec-up yarn-project noir-projects boxes playground barretenberg l1-contracts noir docs
set -- spartan yarn-project/end-to-end aztec-up yarn-project noir-projects boxes playground barretenberg l1-contracts docs
fi
parallel -k --line-buffer './{}/bootstrap.sh test_cmds' ::: $@ | filter_test_cmds | sort_by_cpus
}
Expand Down Expand Up @@ -231,7 +224,6 @@ function build {

# These projects are dependent on each other and must be built linearly.
serial_projects=(
noir
avm-transpiler
barretenberg
noir-projects
Expand Down Expand Up @@ -363,14 +355,12 @@ function release {
projects=(
barretenberg/cpp
barretenberg/ts
noir
l1-contracts
noir-projects/aztec-nr
yarn-project
boxes
aztec-up
playground
# docs # released as part of ci
release-image
)
if [ $(arch) == arm64 ]; then
Expand Down
1 change: 0 additions & 1 deletion noir/.noir-repo.rebuild_patterns_tests

This file was deleted.

40 changes: 0 additions & 40 deletions noir/README.md

This file was deleted.

Loading
Loading