Skip to content

Commit 69b0058

Browse files
committed
Merge branch 'master' into remove-keys-from-artifact
* master: (46 commits) chore: Remove `serde` from `noirc_frontend` (#2390) chore: allow parenthesizing in two type locations (#2388) chore(ci): automatically delete cache entries associated with closed PRs (#2342) feat: Perform more checks for compile-time arithmetic (#2380) chore: Remove `noirc_abi::FunctionSignature` and define in terms of HIR (#2372) feat: Update to `acvm` 0.22.0 (#2363) chore: Update committed ACIR artifacts (#2376) feat(ssa): Merge slices in if statements with witness conditions (#2347) chore: Separate frontend `Visibility` and `Distinctness` from the ABI (#2369) feat: add syntax for specifying function type environments (#2357) chore: Remove unused `Directive::Log` (#2366) chore: clippy fixes (#2365) chore: Extract bytecode from artifact files for backend integration test inputs (#2356) feat: Add trait definition representation in DefCollector and HIR (#2338) chore: Remove unused `Intrinsic::Println` (#2358) fix: Remove duplicte `T` in `expected T, found T` error on tuple assignment (#2360) chore(brillig): Fix brillig radix instruction return vector size (#2350) fix: Show types in error message in same order as in source code (#2353) chore: update noir-source-resolver from `1.1.2` to `^1.1.3` (#2349) chore(ci): Avoid writing to cache in workflows triggered by the merge queue (#2341) ...
2 parents d9236f4 + d173a4e commit 69b0058

File tree

439 files changed

+3566
-1333
lines changed

Some content is hidden

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

439 files changed

+3566
-1333
lines changed

.github/workflows/cache-cleanup.yml

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# This workflow cleans up any cache entries associated with a pull request once it has been closed.
2+
# This prevents us from having many refs/pull/PR_NUMBER/merge cache entries which will never be used.
3+
#
4+
# Note that this will affect both PRs being closed with and without being merged.
5+
6+
name: Cleanup closed PR cache entries
7+
8+
on:
9+
pull_request:
10+
types:
11+
- closed
12+
13+
jobs:
14+
cleanup:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- name: Cleanup
18+
run: |
19+
gh extension install actions/gh-actions-cache
20+
21+
echo "Fetching list of cache key"
22+
cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH -L 100 | cut -f 1 )
23+
24+
## Setting this to not fail the workflow while deleting cache keys.
25+
set +e
26+
echo "Deleting caches..."
27+
for cacheKey in $cacheKeysForPR
28+
do
29+
gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm
30+
done
31+
echo "Done"
32+
env:
33+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
REPO: ${{ github.repository }}
35+
BRANCH: refs/pull/${{ github.event.pull_request.number }}/merge

.github/workflows/publish.yml

+48-21
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,12 @@ jobs:
6262
runs-on: macos-latest
6363
env:
6464
CROSS_CONFIG: ${{ github.workspace }}/.github/Cross.toml
65+
CACHED_PATHS: |
66+
~/.cargo/bin/
67+
~/.cargo/registry/index/
68+
~/.cargo/registry/cache/
69+
~/.cargo/git/db/
70+
target/
6571
strategy:
6672
matrix:
6773
target: [x86_64-apple-darwin, aarch64-apple-darwin]
@@ -79,14 +85,10 @@ jobs:
7985
echo "SDKROOT=$(xcrun -sdk macosx$(sw_vers -productVersion) --show-sdk-path)" >> $GITHUB_ENV
8086
echo "MACOSX_DEPLOYMENT_TARGET=$(xcrun -sdk macosx$(sw_vers -productVersion) --show-sdk-platform-version)" >> $GITHUB_ENV
8187
82-
- uses: actions/cache@v3
88+
- uses: actions/cache/restore@v3
89+
id: cache
8390
with:
84-
path: |
85-
~/.cargo/bin/
86-
~/.cargo/registry/index/
87-
~/.cargo/registry/cache/
88-
~/.cargo/git/db/
89-
target/
91+
path: ${{ env.CACHED_PATHS }}
9092
key: ${{ matrix.target }}-cargo-${{ hashFiles('**/Cargo.lock') }}
9193

9294
- name: Download artifact
@@ -106,6 +108,13 @@ jobs:
106108
run: |
107109
cargo build --package nargo_cli --release --target ${{ matrix.target }} --no-default-features --features plonk_bn254_wasm
108110
111+
- uses: actions/cache/save@v3
112+
# Don't create cache entries for the merge queue.
113+
if: ${{ steps.cache.outputs.cache-hit != 'true' && github.event_name != 'merge_group' }}
114+
with:
115+
path: ${{ env.CACHED_PATHS }}
116+
key: ${{ steps.cache.outputs.cache-primary-key }}
117+
109118
- name: Package artifacts
110119
run: |
111120
mkdir dist
@@ -144,6 +153,12 @@ jobs:
144153
runs-on: ubuntu-22.04
145154
env:
146155
CROSS_CONFIG: ${{ github.workspace }}/.github/Cross.toml
156+
CACHED_PATHS: |
157+
~/.cargo/bin/
158+
~/.cargo/registry/index/
159+
~/.cargo/registry/cache/
160+
~/.cargo/git/db/
161+
target/
147162
strategy:
148163
fail-fast: false
149164
matrix:
@@ -161,14 +176,10 @@ jobs:
161176
with:
162177
ref: ${{ inputs.tag || env.GITHUB_REF }}
163178

164-
- uses: actions/cache@v3
179+
- uses: actions/cache/restore@v3
180+
id: cache
165181
with:
166-
path: |
167-
~/.cargo/bin/
168-
~/.cargo/registry/index/
169-
~/.cargo/registry/cache/
170-
~/.cargo/git/db/
171-
target/
182+
path: ${{ env.CACHED_PATHS }}
172183
key: ${{ matrix.target }}-cargo-${{ hashFiles('**/Cargo.lock') }}
173184

174185
- name: Download artifact
@@ -189,6 +200,13 @@ jobs:
189200
cargo install cross --force --git https://github.com/cross-rs/cross
190201
cross build --package nargo_cli --release --target=${{ matrix.target }} --no-default-features --features plonk_bn254_wasm
191202
203+
- uses: actions/cache/save@v3
204+
# Don't create cache entries for the merge queue.
205+
if: ${{ steps.cache.outputs.cache-hit != 'true' && github.event_name != 'merge_group' }}
206+
with:
207+
path: ${{ env.CACHED_PATHS }}
208+
key: ${{ steps.cache.outputs.cache-primary-key }}
209+
192210
- name: Package artifacts
193211
run: |
194212
mkdir dist
@@ -227,6 +245,12 @@ jobs:
227245
runs-on: windows-2022
228246
env:
229247
CROSS_CONFIG: ${{ github.workspace }}/.github/Cross.toml
248+
CACHED_PATHS: |
249+
~/.cargo/bin/
250+
~/.cargo/registry/index/
251+
~/.cargo/registry/cache/
252+
~/.cargo/git/db/
253+
target/
230254
strategy:
231255
matrix:
232256
target: [x86_64-pc-windows-msvc]
@@ -237,14 +261,10 @@ jobs:
237261
with:
238262
ref: ${{ inputs.tag || env.GITHUB_REF }}
239263

240-
- uses: actions/cache@v3
264+
- uses: actions/cache/restore@v3
265+
id: cache
241266
with:
242-
path: |
243-
~/.cargo/bin/
244-
~/.cargo/registry/index/
245-
~/.cargo/registry/cache/
246-
~/.cargo/git/db/
247-
target/
267+
path: ${{ env.CACHED_PATHS }}
248268
key: ${{ matrix.target }}-cargo-${{ hashFiles('**/Cargo.lock') }}
249269

250270
- name: Download artifact
@@ -264,6 +284,13 @@ jobs:
264284
run: |
265285
cargo build --package nargo_cli --release --target ${{ matrix.target }} --no-default-features --features plonk_bn254_wasm
266286
287+
- uses: actions/cache/save@v3
288+
# Don't create cache entries for the merge queue.
289+
if: ${{ steps.cache.outputs.cache-hit != 'true' && github.event_name != 'merge_group' }}
290+
with:
291+
path: ${{ env.CACHED_PATHS }}
292+
key: ${{ steps.cache.outputs.cache-primary-key }}
293+
267294
- name: Package artifacts
268295
run: |
269296
mkdir dist

.github/workflows/release.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363
repo: noir-lang/noir
6464
ref: master
6565
token: ${{ secrets.GITHUB_TOKEN }}
66-
inputs: '{ "noir-ref": "${{ needs.release-please.outputs.tag-name }}", "publish": true }'
66+
inputs: '{ "tag": "${{ needs.release-please.outputs.tag-name }}", "publish": true }'
6767

6868
publish-wasm:
6969
name: Publish noir_wasm package

.github/workflows/test.yml

+17-8
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ jobs:
1414
name: Test on ${{ matrix.os }}
1515
runs-on: ${{ matrix.runner }}
1616
timeout-minutes: 30
17+
env:
18+
CACHED_PATH: /tmp/nix-cache
1719

1820
strategy:
1921
fail-fast: false
@@ -37,27 +39,34 @@ jobs:
3739
name: barretenberg
3840

3941
- name: Restore nix store cache
40-
id: nix-store-cache
41-
uses: actions/cache@v3
42+
uses: actions/cache/restore@v3
43+
id: cache
4244
with:
43-
path: /tmp/nix-cache
45+
path: ${{ env.CACHED_PATH }}
4446
key: ${{ runner.os }}-flake-${{ hashFiles('*.lock') }}
4547

4648
# Based on https://github.com/marigold-dev/deku/blob/b5016f0cf4bf6ac48db9111b70dd7fb49b969dfd/.github/workflows/build.yml#L26
4749
- name: Copy cache into nix store
48-
if: steps.nix-store-cache.outputs.cache-hit == 'true'
50+
if: steps.cache.outputs.cache-hit == 'true'
4951
# We don't check the signature because we're the one that created the cache
5052
run: |
51-
for narinfo in /tmp/nix-cache/*.narinfo; do
53+
for narinfo in ${{ env.CACHED_PATH }}/*.narinfo; do
5254
path=$(head -n 1 "$narinfo" | awk '{print $2}')
53-
nix copy --no-check-sigs --from "file:///tmp/nix-cache" "$path"
55+
nix copy --no-check-sigs --from "file://${{ env.CACHED_PATH }}" "$path"
5456
done
5557
5658
- name: Run `nix flake check`
5759
run: |
5860
nix flake check -L
5961
6062
- name: Export cache from nix store
61-
if: steps.nix-store-cache.outputs.cache-hit != 'true'
63+
if: ${{ always() && steps.cache.outputs.cache-hit != 'true' && github.event_name != 'merge_group' }}
6264
run: |
63-
nix copy --to "file:///tmp/nix-cache?compression=zstd&parallel-compression=true" .#native-cargo-artifacts
65+
nix copy --to "file://${{ env.CACHED_PATH }}?compression=zstd&parallel-compression=true" .#native-cargo-artifacts
66+
67+
- uses: actions/cache/save@v3
68+
# Write a cache entry even if the tests fail but don't create any for the merge queue.
69+
if: ${{ always() && steps.cache.outputs.cache-hit != 'true' && github.event_name != 'merge_group' }}
70+
with:
71+
path: ${{ env.CACHED_PATH }}
72+
key: ${{ steps.cache.outputs.cache-primary-key }}

.github/workflows/wasm.yml

+50-8
Original file line numberDiff line numberDiff line change
@@ -49,19 +49,22 @@ jobs:
4949
build-nargo:
5050
needs: [build-barretenberg]
5151
runs-on: ubuntu-22.04
52+
env:
53+
CACHED_PATHS: |
54+
~/.cargo/bin/
55+
~/.cargo/registry/index/
56+
~/.cargo/registry/cache/
57+
~/.cargo/git/db/
58+
target/
5259
5360
steps:
5461
- name: Checkout Noir repo
5562
uses: actions/checkout@v3
5663

57-
- uses: actions/cache@v3
64+
- uses: actions/cache/restore@v3
65+
id: cache
5866
with:
59-
path: |
60-
~/.cargo/bin/
61-
~/.cargo/registry/index/
62-
~/.cargo/registry/cache/
63-
~/.cargo/git/db/
64-
target/
67+
path: ${{ env.CACHED_PATHS }}
6568
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
6669

6770
- name: Download artifact
@@ -79,6 +82,13 @@ jobs:
7982
run: |
8083
cargo build --package nargo_cli --release --no-default-features --features plonk_bn254_wasm
8184
85+
- uses: actions/cache/save@v3
86+
# Don't create cache entries for the merge queue.
87+
if: ${{ steps.cache.outputs.cache-hit != 'true' && github.event_name != 'merge_group' }}
88+
with:
89+
path: ${{ env.CACHED_PATHS }}
90+
key: ${{ steps.cache.outputs.cache-primary-key }}
91+
8292
- name: Package artifacts
8393
run: |
8494
mkdir dist
@@ -94,6 +104,9 @@ jobs:
94104

95105
build-wasm:
96106
runs-on: ubuntu-latest
107+
env:
108+
CACHED_PATH: /tmp/nix-cache
109+
97110
steps:
98111
- name: Checkout sources
99112
uses: actions/checkout@v3
@@ -104,10 +117,39 @@ jobs:
104117
nix_path: nixpkgs=channel:nixos-22.11
105118
github_access_token: ${{ secrets.GITHUB_TOKEN }}
106119

120+
- name: Restore nix store cache
121+
uses: actions/cache/restore@v3
122+
id: cache
123+
with:
124+
path: ${{ env.CACHED_PATH }}
125+
key: ${{ runner.os }}-flake-wasm-${{ hashFiles('*.lock') }}
126+
127+
# Based on https://github.com/marigold-dev/deku/blob/b5016f0cf4bf6ac48db9111b70dd7fb49b969dfd/.github/workflows/build.yml#L26
128+
- name: Copy cache into nix store
129+
if: steps.cache.outputs.cache-hit == 'true'
130+
# We don't check the signature because we're the one that created the cache
131+
run: |
132+
for narinfo in ${{ env.CACHED_PATH }}/*.narinfo; do
133+
path=$(head -n 1 "$narinfo" | awk '{print $2}')
134+
nix copy --no-check-sigs --from "file://${{ env.CACHED_PATH }}" "$path"
135+
done
136+
107137
- name: Build wasm package
108138
run: |
109139
nix build -L .#wasm
110140
141+
- name: Export cache from nix store
142+
if: ${{ steps.cache.outputs.cache-hit != 'true' && github.event_name != 'merge_group' }}
143+
run: |
144+
nix copy --to "file://${{ env.CACHED_PATH }}?compression=zstd&parallel-compression=true" .#noir-wasm-cargo-artifacts
145+
146+
- uses: actions/cache/save@v3
147+
# Don't create cache entries for the merge queue.
148+
if: ${{ steps.cache.outputs.cache-hit != 'true' && github.event_name != 'merge_group' }}
149+
with:
150+
path: ${{ env.CACHED_PATH }}
151+
key: ${{ steps.cache.outputs.cache-primary-key }}
152+
111153
- name: Dereference symlink
112154
run: echo "UPLOAD_PATH=$(readlink -f result)" >> $GITHUB_ENV
113155

@@ -130,7 +172,7 @@ jobs:
130172
uses: actions/download-artifact@v3
131173
with:
132174
name: noir_wasm
133-
path: ./crates/wasm/dist
175+
path: ./crates/wasm/result
134176

135177
- name: Download nargo binary
136178
uses: actions/download-artifact@v3

.release-please-manifest.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "0.9.0"
2+
".": "0.10.3"
33
}

0 commit comments

Comments
 (0)