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

refactor: renaming noir-compiler as builder #5951

Merged
merged 5 commits into from
Apr 23, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
8 changes: 0 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,6 @@ Alternatively, to just hack on Noir contracts and Typescript, run `./bootstrap.s

To build Typescript code, make sure to have [`nvm`](https://github.com/nvm-sh/nvm) (node version manager) installed.

To build noir code, make sure that you are using the version from `yarn-project/noir-compiler/src/noir-version.json`.

Install nargo by running

```
noirup -v TAG_FROM_THE_FILE
```

## Continuous Integration

This repository uses CircleCI for continuous integration. Build steps are managed using [`build-system`](https://github.com/AztecProtocol/build-system). Small packages are built and tested as part of a docker build operation, while larger ones and end-to-end tests spin up a large AWS spot instance. Each successful build step creates a new docker image that gets tagged with the package name and commit.
Expand Down
2 changes: 1 addition & 1 deletion boxes/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ COPY --from=noir-projects /usr/src/noir-projects/noir-protocol-circuits/crates/t
WORKDIR /usr/src/boxes
COPY . .
ENV AZTEC_NARGO=/usr/src/noir/noir-repo/target/release/nargo
ENV AZTEC_COMPILE=/usr/src/yarn-project/noir-compiler/aztec-compile-dest
ENV AZTEC_BUILDER=/usr/src/yarn-project/builder/aztec-builder-dest
RUN yarn
RUN npx -y playwright@1.42 install --with-deps
ENTRYPOINT ["/bin/sh", "-c"]
2 changes: 1 addition & 1 deletion boxes/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ build:
WORKDIR /usr/src/boxes
COPY . .
ENV AZTEC_NARGO=/usr/src/noir/noir-repo/target/release/nargo
ENV AZTEC_COMPILE=/usr/src/yarn-project/noir-compiler/aztec-compile-dest
ENV AZTEC_BUILDER=/usr/src/yarn-project/builder/aztec-builder-dest
RUN yarn && yarn build
RUN npx -y playwright@1.42 install --with-deps
ENTRYPOINT ["/bin/sh", "-c"]
2 changes: 1 addition & 1 deletion boxes/boxes/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"main": "./dist/index.js",
"scripts": {
"compile": "cd src/contracts && ${AZTEC_NARGO:-aztec-nargo} compile",
"codegen": "${AZTEC_COMPILE:-aztec-compile} codegen src/contracts/target -o artifacts",
"codegen": "${AZTEC_BUILDER:-aztec-builder} codegen src/contracts/target -o artifacts",
"clean": "rm -rf ./dist .tsbuildinfo ./artifacts ./src/contracts/target",
"prep": "yarn clean && yarn compile && yarn codegen",
"dev": "yarn prep && webpack serve --mode development",
Expand Down
2 changes: 1 addition & 1 deletion boxes/boxes/vanilla/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"type": "module",
"scripts": {
"compile": "cd src/contracts && ${AZTEC_NARGO:-aztec-nargo} compile",
"codegen": "${AZTEC_COMPILE:-aztec-compile} codegen src/contracts/target -o artifacts",
"codegen": "${AZTEC_BUILDER:-aztec-builder} codegen src/contracts/target -o artifacts",
"clean": "rm -rf ./dest .tsbuildinfo ./artifacts ./src/contracts/target",
"prep": "yarn clean && yarn compile && yarn codegen && tsc -b",
"dev": "yarn prep && webpack serve --mode development",
Expand Down
2 changes: 1 addition & 1 deletion boxes/contract-only/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"type": "module",
"scripts": {
"compile": "cd src && ${AZTEC_NARGO:-aztec-nargo} compile",
"codegen": "${AZTEC_COMPILE:-aztec-compile} codegen target -o artifacts",
"codegen": "${AZTEC_BUILDER:-aztec-builder} codegen target -o artifacts",
"clean": "rm -rf ./dest .tsbuildinfo ./artifacts ./target",
"prep": "yarn clean && yarn compile && yarn codegen && tsc -b",
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules $(yarn bin jest) --runInBand",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ This will output a JSON [artifact](./artifacts.md) for each contract in the proj

:::note
This command looks for `Nargo.toml` files by ascending up the parent directories, and will compile the top-most Nargo.toml file it finds.
Eg: if you are in `/hobbies/cool-game/contracts/easter-egg/`, and both `cool-game` and `easter-egg` contain a Nargo.toml file, then `aztec-compile` will be performed on `cool-game/Nargo.toml` and compile the project(s) specified within it. Eg
Eg: if you are in `/hobbies/cool-game/contracts/easter-egg/`, and both `cool-game` and `easter-egg` contain a Nargo.toml file, then `aztec-nargo compile` will be performed on `cool-game/Nargo.toml` and compile the project(s) specified within it. Eg
```
[workspace]
members = [
Expand Down
22 changes: 11 additions & 11 deletions yarn-project/.earthlyignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,17 @@ end-to-end/src/web/main.js
end-to-end/src/web/main.js.LICENSE.txt
entry-points/src/artifacts
l1-contracts/generated
noir-compiler/target/
noir-compiler/proofs/
noir-compiler/Prover.toml
noir-compiler/Verifier.toml
noir-compiler/noir-protocol-circuits-types/.gitignore wow
noir-compiler/proofs/
noir-compiler/Prover.toml
noir-compiler/Verifier.toml
noir-compiler/src/target
noir-compiler/src/crs
noir-compiler/src/types
builder/target/
builder/proofs/
builder/Prover.toml
builder/Verifier.toml
builder/noir-protocol-circuits-types/.gitignore wow
builder/proofs/
builder/Prover.toml
builder/Verifier.toml
builder/src/target
builder/src/crs
builder/src/types
protocol-contracts/src/artifacts
scripts/tmp
noir-contracts.js/src
Expand Down
22 changes: 11 additions & 11 deletions yarn-project/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,17 @@ end-to-end/src/web/main.js.LICENSE.txt
entry-points/src/artifacts
l1-artifacts/generated
l1-contracts/generated
noir-compiler/target/
noir-compiler/proofs/
noir-compiler/Prover.toml
noir-compiler/Verifier.toml
noir-compiler/noir-protocol-circuits-types/.gitignore wow
noir-compiler/proofs/
noir-compiler/Prover.toml
noir-compiler/Verifier.toml
noir-compiler/src/target
noir-compiler/src/crs
noir-compiler/src/types
builder/target/
builder/proofs/
builder/Prover.toml
builder/Verifier.toml
builder/noir-protocol-circuits-types/.gitignore wow
builder/proofs/
builder/Prover.toml
builder/Verifier.toml
builder/src/target
builder/src/crs
builder/src/types
noir-protocol-circuits-types/src/types/
protocol-contracts/src/artifacts
scripts/tmp
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/aztec/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@
"@aztec/archiver": "workspace:^",
"@aztec/aztec-node": "workspace:^",
"@aztec/aztec.js": "workspace:^",
"@aztec/builder": "workspace:^",
"@aztec/circuit-types": "workspace:^",
"@aztec/circuits.js": "workspace:^",
"@aztec/entrypoints": "workspace:^",
"@aztec/ethereum": "workspace:^",
"@aztec/foundation": "workspace:^",
"@aztec/kv-store": "workspace:^",
"@aztec/l1-artifacts": "workspace:^",
"@aztec/noir-compiler": "workspace:^",
"@aztec/noir-contracts.js": "workspace:^",
"@aztec/p2p": "workspace:^",
"@aztec/protocol-contracts": "workspace:^",
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/aztec/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"path": "../l1-artifacts"
},
{
"path": "../noir-compiler"
"path": "../builder"
},
{
"path": "../noir-contracts.js"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
# Aztec.nr compiler

The Aztec.nr compiler compiles Aztec.nr contracts using nargo and outputs Aztec formatted contract ABIs. The compiler can also generate typescript classes for each contract, as well as Aztec.nr interfaces for calling external functions.
The Aztec.nr compiler compiles Aztec.nr contracts using nargo and outputs Aztec formatted contract ABIs.
The compiler can also generate typescript classes for each contract, as well as Aztec.nr interfaces for calling external functions.
it can also be used to update aztec project dependencies.
benesjan marked this conversation as resolved.
Show resolved Hide resolved

## Installation

To install the package, run:

```bash
yarn add @aztec/noir-compiler
yarn add @aztec/builder
```

## Usage

To run the compiler as a CLI tool, first install the package and then run:

```bash
yarn aztec-compile compile --help
yarn aztec-builder compile --help
```

You can also run the compiler from the [main Aztec CLI](../cli/README.md), which includes several other features for interacting with the Aztec Network:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "@aztec/noir-compiler",
"name": "@aztec/builder",
"version": "0.1.0",
"type": "module",
"exports": {
Expand All @@ -14,7 +14,7 @@
"tsconfig": "./tsconfig.json"
},
"bin": {
"aztec-compile": "dest/cli.js"
"aztec-builder": "dest/cli.js"
},
"scripts": {
"build": "yarn clean && tsc -b",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const main = async () => {
.default(`http://${LOCALHOST}:8080`)
.makeOptionMandatory(true);

program.name('aztec-compile');
program.name('aztec-builder');
program
.command('codegen')
.argument('<noir-abi-path>', 'Path to the Noir ABI or project dir.')
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/deploy_npm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ deploy_package entrypoints
deploy_package accounts
deploy_package l1-artifacts
deploy_package ethereum
deploy_package noir-compiler
deploy_package builder
deploy_package noir-contracts.js
deploy_package kv-store
deploy_package merkle-tree
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/end-to-end/src/e2e_slow_tree.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { SlowTreeContract } from '@aztec/noir-contracts.js/SlowTree';

import { setup } from './fixtures/utils.js';

describe('e2e_slow_tree', () => {
describe.skip('e2e_slow_tree', () => {
let logger: DebugLogger;
let wallet: Wallet;
let teardown: () => Promise<void>;
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/noir-contracts.js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"tslib": "^2.4.0"
},
"devDependencies": {
"@aztec/noir-compiler": "workspace:^",
"@aztec/builder": "workspace:^",
"@jest/globals": "^29.5.0",
"@types/jest": "^29.5.0",
"jest": "^29.5.0",
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/noir-contracts.js/scripts/generate-types.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ for ABI in $(find ../../noir-projects/noir-contracts/target -maxdepth 1 -type f
done

# Generate types for the contracts
node --no-warnings ../noir-compiler/dest/cli.js codegen -o $OUT_DIR artifacts
node --no-warnings ../builder/dest/cli.js codegen -o $OUT_DIR artifacts

# Append exports for each generated TypeScript file to index.ts
find "$OUT_DIR" -maxdepth 1 -type f -name '*.ts' ! -name 'index.ts' | while read -r TS_FILE; do
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/noir-contracts.js/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"path": "../aztec.js"
},
{
"path": "../noir-compiler"
"path": "../builder"
}
],
"include": [
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/noir-protocol-circuits-types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@
}
},
"dependencies": {
"@aztec/builder": "workspace:^",
"@aztec/circuits.js": "workspace:^",
"@aztec/foundation": "workspace:^",
"@aztec/noir-compiler": "workspace:^",
"@aztec/types": "workspace:^",
"@noir-lang/acvm_js": "portal:../../noir/packages/acvm_js",
"@noir-lang/noirc_abi": "portal:../../noir/packages/noirc_abi",
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/noir-protocol-circuits-types/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"path": "../foundation"
},
{
"path": "../noir-compiler"
"path": "../builder"
},
{
"path": "../types"
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"kv-store",
"l1-artifacts",
"merkle-tree",
"noir-compiler",
"builder",
"noir-contracts.js",
"noir-protocol-circuits-types",
"p2p",
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/pxe/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@
]
},
"dependencies": {
"@aztec/builder": "workspace:^",
"@aztec/circuit-types": "workspace:^",
"@aztec/circuits.js": "workspace:^",
"@aztec/ethereum": "workspace:^",
"@aztec/foundation": "workspace:^",
"@aztec/key-store": "workspace:^",
"@aztec/kv-store": "workspace:^",
"@aztec/noir-compiler": "workspace:^",
"@aztec/noir-protocol-circuits-types": "workspace:^",
"@aztec/protocol-contracts": "workspace:^",
"@aztec/simulator": "workspace:^",
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/pxe/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"path": "../kv-store"
},
{
"path": "../noir-compiler"
"path": "../builder"
},
{
"path": "../noir-protocol-circuits-types"
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
{ "path": "l1-artifacts/tsconfig.json" },
{ "path": "merkle-tree/tsconfig.json" },
{ "path": "noir-contracts.js/tsconfig.json" },
{ "path": "noir-compiler/tsconfig.json" },
{ "path": "builder/tsconfig.json" },
{ "path": "noir-protocol-circuits-types/tsconfig.json" },
{ "path": "p2p/tsconfig.json" },
{ "path": "p2p-bootstrap/tsconfig.json" },
Expand Down
2 changes: 1 addition & 1 deletion yarn-project/typedoc.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"aztec.js",
"key-store",
"noir-contracts.js",
"noir-compiler",
"builder",
"p2p",
"prover-client",
"aztec-node",
Expand Down
Loading
Loading