Skip to content

Commit c970b4f

Browse files
committed
Merge branch 'master' into abi-wasm
* master: (25 commits) 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) chore(noir): Release 0.10.3 (#2344) feat(lsp): Add `Execute` code lens for `main` functions (#2330) feat(lsp): Add `Compile` code lens for `main` function and contracts (#2309) feat: Allow calling higher-order functions with closures (#2335) fix: Display warning if last expression of block is unused (#2314) chore(noir): Release 0.10.2 (#2343) fix: Prevent dead instruction elimination of brillig functions which may contain side-effects (#2340) chore: Separate integration tests for contracts and programs (#2339) chore: move orphaned integration tests to new directory (#2331) chore(noir): Release 0.10.1 (#2328) feat(ssa): Switch mem2reg pass to be per function rather than per block (#2243) feat(ssa): Perform dead instruction elimination on intrinsic functions (#2276) feat: Add full call stacks to runtime errors (#2310) chore(ci): fix mismatched input name to publish workflow (#2327) chore: add README for integration test structure (#2277) feat: Improved error message for unexpected return type (#2302) feat(stdlib): Implement `str` `as_bytes` and `into_bytes` function (#2298) chore(ci): automatically convert changelog entries to sentence case (#2325) ...
2 parents e0edbd6 + 8b99061 commit c970b4f

File tree

141 files changed

+1869
-541
lines changed

Some content is hidden

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

141 files changed

+1869
-541
lines changed

.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

+49-7
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

.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)