Skip to content

Commit 404ec34

Browse files
authored
chore: Move barretenberg to top of repo. Make circuits build off barretenberg build. (#2221)
This moves barretenberg out of circuits project, to the top level of the repo, and cleans up a lot of build-system stuff. ## BB and Circuits * Circuits expects barretenberg to still be where it was before (root of its repo), but it has a symlink now to the top level. * Docker scoping is handled by ingesting barretenberg from prior build, which outputs both the source code, and libraries needed for circuits (libbarretenberg, libenv, libwasi). * Circuits not longer builds barretenberg itself. * barretenberg now does a formatting check over it's code as part of build. `./format.sh check` * Remove some refs to openmp in containers as we're phasing it out.... * Remove some cmake around installing barretenberg, as this isn't needed anymore. ## Build System * Remove hacks around e2e running locally. Use now official `cond_run_script` script. * Remove superfluous scripts and normalise around the `cond_spot_run_script` and `remote_runner` script. * `cond_spot_run_build` and `cond_spot_run_test` both implemented in terms of above. * Now test runs are handled by `remote_runner` they perform a full checkout of code and fit in the general pattern of the build system. No more hacky arbitrary script folder to remote copies. * Added `yarn-project-base` as dep in `build-manifest.json` to all TS projects so rebuilds are correctly computed. * Improved performance of `dependencies` command in `query_manifest` and also `rebuildPatterns`. * `query_manifest` outputs absolute paths by default, meaning can remove various assumptions in other scripts as to current working directory.
1 parent 9f1a3a5 commit 404ec34

File tree

1,957 files changed

+1285
-1613
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,957 files changed

+1285
-1613
lines changed

.circleci/config.yml

+86-117
Large diffs are not rendered by default.

.github/workflows/mirror_barretenberg_repo.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ on:
55
branches:
66
- master
77
paths:
8-
- 'circuits/cpp/barretenberg/**'
9-
- '!circuits/cpp/barretenberg/.gitrepo'
8+
- "barretenberg/**"
9+
- "!barretenberg/.gitrepo"
1010

1111
jobs:
1212
build:
@@ -23,7 +23,7 @@ jobs:
2323
run: |
2424
# we push using git subrepo (https://github.com/ingydotnet/git-subrepo)
2525
# with some logic to recover from squashed parent commits
26-
SUBREPO_PATH=circuits/cpp/barretenberg
26+
SUBREPO_PATH=barretenberg
2727
# identify ourselves, needed to commit
2828
git config --global user.name AztecBot
2929
git config --global user.email tech@aztecprotocol.com

.github/workflows/publish-bb.yml

+14-14
Original file line numberDiff line numberDiff line change
@@ -49,21 +49,21 @@ jobs:
4949
5050
- name: Compile Barretenberg
5151
run: |
52-
cd circuits/cpp/barretenberg/cpp
52+
cd barretenberg/cpp
5353
5454
cmake --preset default -DCMAKE_BUILD_TYPE=RelWithAssert
5555
cmake --build --preset default --target bb
5656
5757
- name: Tar and GZip bb Binary (Ubuntu)
58-
working-directory: circuits/cpp/barretenberg/cpp/build/bin
58+
working-directory: barretenberg/cpp/build/bin
5959
run: tar -cvzf barretenberg-x86_64-linux-gnu.tar.gz bb
6060

6161
- name: Upload artifacts
6262
uses: actions/upload-artifact@v2
6363
with:
6464
name: release-linux
6565
path: |
66-
./circuits/cpp/barretenberg/cpp/build/bin/barretenberg-x86_64-linux-gnu.tar.gz
66+
./barretenberg/cpp/build/bin/barretenberg-x86_64-linux-gnu.tar.gz
6767
6868
build-wasm-ts:
6969
name: Build WASM and deploy to TS
@@ -100,21 +100,21 @@ jobs:
100100
sudo apt -y update && sudo apt -y install yarn
101101
- name: Install WASI-SDK
102102
run: |
103-
cd circuits/cpp/barretenberg/cpp
103+
cd barretenberg/cpp
104104
105105
./scripts/install-wasi-sdk.sh
106106
107107
- name: Compile Typescript
108108
run: |
109-
cd circuits/cpp/barretenberg/ts
109+
cd barretenberg/ts
110110
yarn install && yarn && yarn build
111111
112112
- name: Tar and GZip barretenberg.wasm
113-
working-directory: circuits/cpp/barretenberg/cpp/build-wasm/bin
113+
working-directory: barretenberg/cpp/build-wasm/bin
114114
run: tar -cvzf barretenberg.wasm.tar.gz barretenberg.wasm
115115

116116
- name: Tar and GZip acvm_backend.wasm
117-
working-directory: circuits/cpp/barretenberg/cpp/build-wasm/bin
117+
working-directory: barretenberg/cpp/build-wasm/bin
118118
run: tar -cvzf acvm_backend.wasm.tar.gz acvm_backend.wasm
119119

120120
- name: Setup Node.js
@@ -126,7 +126,7 @@ jobs:
126126
- name: Deploy Typescript to NPM
127127
if: github.event.inputs.tag != 'nightly' && github.event.inputs.tag != '' # Do not deploy to npm if it is a nightly build
128128
run: |
129-
cd circuits/cpp/barretenberg/ts
129+
cd barretenberg/ts
130130
yarn deploy
131131
env:
132132
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
@@ -136,8 +136,8 @@ jobs:
136136
with:
137137
name: release-wasm
138138
path: |
139-
./circuits/cpp/barretenberg/cpp/build-wasm/bin/barretenberg.wasm.tar.gz
140-
./circuits/cpp/barretenberg/cpp/build-wasm/bin/acvm_backend.wasm.tar.gz
139+
./barretenberg/cpp/build-wasm/bin/barretenberg.wasm.tar.gz
140+
./barretenberg/cpp/build-wasm/bin/acvm_backend.wasm.tar.gz
141141
142142
build-mac:
143143
name: Build on Mac (${{ matrix.target }})
@@ -163,20 +163,20 @@ jobs:
163163

164164
- name: Compile Barretenberg (x86_64)
165165
if: matrix.target == 'x86_64-apple-darwin'
166-
working-directory: circuits/cpp/barretenberg/cpp
166+
working-directory: barretenberg/cpp
167167
run: |
168168
cmake --preset default -DCMAKE_BUILD_TYPE=RelWithAssert
169169
cmake --build --preset default --target bb
170170
171171
- name: Compile Barretenberg (ARM)
172172
if: matrix.target == 'aarch64-apple-darwin'
173-
working-directory: circuits/cpp/barretenberg/cpp
173+
working-directory: barretenberg/cpp
174174
run: |
175175
cmake --toolchain ./cmake/toolchains/aarch64-darwin.cmake --preset default -DCMAKE_BUILD_TYPE=RelWithAssert
176176
cmake --build --preset default --target bb
177177
178178
- name: Package barretenberg artifact
179-
working-directory: circuits/cpp/barretenberg/cpp/build/bin
179+
working-directory: barretenberg/cpp/build/bin
180180
run: |
181181
mkdir dist
182182
cp ./bb ./dist/bb
@@ -186,7 +186,7 @@ jobs:
186186
uses: actions/upload-artifact@v3
187187
with:
188188
name: barretenberg-${{ matrix.target }}
189-
path: ./circuits/cpp/barretenberg/cpp/build/bin/barretenberg-${{ matrix.target }}.tar.gz
189+
path: ./barretenberg/cpp/build/bin/barretenberg-${{ matrix.target }}.tar.gz
190190
retention-days: 3
191191

192192
release:

.gitmodules

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
[submodule "legacy-barretenberg-build-system"]
2-
path = circuits/cpp/barretenberg/build-system
2+
path = barretenberg/build-system
33
url = https://github.com/AztecProtocol/build-system
44
[submodule "l1-contracts/lib/openzeppelin-contracts"]
55
path = l1-contracts/lib/openzeppelin-contracts
66
url = https://github.com/openzeppelin/openzeppelin-contracts
77
[submodule "l1-contracts/lib/forge-std"]
88
path = l1-contracts/lib/forge-std
99
url = https://github.com/foundry-rs/forge-std
10-
[submodule "circuits/cpp/barretenberg/sol/lib/forge-std"]
11-
path = circuits/cpp/barretenberg/sol/lib/forge-std
10+
[submodule "barretenberg/sol/lib/forge-std"]
11+
path = barretenberg/sol/lib/forge-std
1212
url = https://github.com/foundry-rs/forge-std
13-
[submodule "circuits/cpp/barretenberg/sol/lib/solidity-stringutils"]
14-
path = circuits/cpp/barretenberg/sol/lib/solidity-stringutils
13+
[submodule "barretenberg/sol/lib/solidity-stringutils"]
14+
path = barretenberg/sol/lib/solidity-stringutils
1515
url = https://github.com/Arachnid/solidity-stringutils
16-
[submodule "circuits/cpp/barretenberg/sol/lib/openzeppelin-contracts"]
17-
path = circuits/cpp/barretenberg/sol/lib/openzeppelin-contracts
16+
[submodule "barretenberg/sol/lib/openzeppelin-contracts"]
17+
path = barretenberg/sol/lib/openzeppelin-contracts
1818
url = https://github.com/OpenZeppelin/openzeppelin-contracts

.ignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
/circuits/cpp/barretenberg/ts
2-
/circuits/cpp/barretenberg/foundation
1+
/barretenberg/ts
2+
/barretenberg/foundation

.release-please-manifest.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
".": "0.7.0",
3-
"circuits/cpp/barretenberg": "0.7.0",
4-
"circuits/cpp/barretenberg/ts": "0.7.0"
3+
"barretenberg": "0.7.0",
4+
"barretenberg/ts": "0.7.0"
55
}

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ All packages need to be included in the [build manifest](`build_manifest.json`),
2828

2929
## Debugging
3030

31-
Logging goes through the [`info` and `debug`](circuits/cpp/barretenberg/cpp/src/barretenberg/common/log.hpp) functions in C++, and through the [DebugLogger](yarn-project/foundation/src/log/debug.ts) module in Typescript. To see the log output, set a `DEBUG` environment variable to the name of the module you want to debug, to `aztec:*`, or to `*` to see all logs.
31+
Logging goes through the [`info` and `debug`](barretenberg/cpp/src/barretenberg/common/log.hpp) functions in C++, and through the [DebugLogger](yarn-project/foundation/src/log/debug.ts) module in Typescript. To see the log output, set a `DEBUG` environment variable to the name of the module you want to debug, to `aztec:*`, or to `*` to see all logs.
3232

3333
## Releases
3434

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)