Skip to content

Commit

Permalink
Merge branch 'master' into phated/lsp-wasm
Browse files Browse the repository at this point in the history
* master: (85 commits)
  feat: Add noir types package (#2893)
  chore: add scripts for testing (#2890)
  chore(noir-js): Add program API (#2856)
  feat(traits): multi module support for traits (#2844)
  chore(noir): Release (master) (#2879)
  chore: set up noir_js in integration tests (#2871)
  chore!: update to `bb` version 0.7.3 (#2729)
  chore: remove additional yarn install in `acvm_js` (#2885)
  chore: remove messagepack serialization logic (#2865)
  chore: improve workspace clean (#2870)
  fix: finer bit size in bound constrain (#2869)
  feat: Contract events in artifacts (#2873)
  chore: remove leftover files from `acvm-repo` (#2861)
  chore: miscellaneous ACVM fixups (#2864)
  chore(noir): Release (master) (#2875)
  fix: Remove cast for field comparisons in brillig (#2874)
  fix: remove duplication of code to load stdlib files (#2868)
  chore(noir_js): remove unnecessary input validation in JS (#2841)
  chore: build yarn packages in parallel (#2867)
  chore(ci): remove `toml2json` dependency (#2862)
  ...
  • Loading branch information
TomAFrench committed Sep 29, 2023
2 parents 05b2af6 + e8fc868 commit 4781f10
Show file tree
Hide file tree
Showing 538 changed files with 22,697 additions and 1,974 deletions.
22 changes: 11 additions & 11 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
module.exports = {
root: true,
parser: "@typescript-eslint/parser",
plugins: ["@typescript-eslint", "prettier"],
extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint', 'prettier'],
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended'],
rules: {
"comma-spacing": ["error", { before: false, after: true }],
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"warn", // or "error"
'comma-spacing': ['error', { before: false, after: true }],
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': [
'warn', // or "error"
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_",
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
},
],
"prettier/prettier": "error",
'prettier/prettier': 'error',
},
};
2 changes: 1 addition & 1 deletion .github/NIGHTLY_TEST_FAILURE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "nightly test-integration failed"
assignees: kobyhallx, phated, tomafrench, jonybur
assignees: kobyhallx, tomafrench, jonybur
labels: bug
---

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-abi_wasm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ jobs:
- name: Publish to npm
working-directory: ./temp_publish_dir
run: |
npm publish --tag latest
yarn npm publish --tag latest
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
54 changes: 54 additions & 0 deletions .github/workflows/publish-acvm-js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Publish acvm_js

on:
workflow_dispatch:
inputs:
acvm-ref:
description: The acvm reference to checkout
required: true

jobs:
publish-acvm-js-package:
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
ref: ${{ inputs.acvm-ref }}

- name: Setup Node.js
uses: actions/setup-node@v3
with:
registry-url: "https://registry.npmjs.org"
node-version: 18.15

- uses: cachix/install-nix-action@v22
with:
nix_path: nixpkgs=channel:nixos-23.05
github_access_token: ${{ secrets.GITHUB_TOKEN }}

- uses: cachix/cachix-action@v12
with:
name: barretenberg
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"

- name: Build acvm-js
working-directory: acvm-repo
run: |
nix build .#
- name: Discover Build Output Path
working-directory: acvm-repo
run: echo "BUILD_OUTPUT_PATH=$(readlink -f ./result)" >> $GITHUB_ENV

- name: Copy Build Output to Temporary Directory
working-directory: acvm-repo
run: |
mkdir temp_publish_dir
cp -r ${{ env.BUILD_OUTPUT_PATH }}/* temp_publish_dir/
- name: Publish to NPM
working-directory: ./acvm-repo/temp_publish_dir
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
72 changes: 72 additions & 0 deletions .github/workflows/publish-acvm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Publish ACVM crates

on:
workflow_dispatch:
inputs:
acvm-ref:
description: The acvm reference to checkout
required: true

jobs:
publish:
name: Publish in order
runs-on: ubuntu-latest
steps:
- name: Checkout sources
uses: actions/checkout@v4
with:
ref: ${{ inputs.acvm-ref }}

- name: Setup toolchain
uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.66.0

# These steps are in a specific order so crate dependencies are updated first
- name: Publish acir_field
run: |
cargo publish --package acir_field
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.ACVM_CRATES_IO_TOKEN }}

- name: Publish brillig
run: |
cargo publish --package brillig
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.ACVM_CRATES_IO_TOKEN }}

- name: Publish acir
run: |
cargo publish --package acir
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.ACVM_CRATES_IO_TOKEN }}

- name: Publish acvm_blackbox_solver
run: |
cargo publish --package acvm_blackbox_solver
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.ACVM_CRATES_IO_TOKEN }}

- name: Publish barretenberg_blackbox_solver
run: |
cargo publish --package barretenberg_blackbox_solver
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.ACVM_CRATES_IO_TOKEN }}

- name: Publish acvm_stdlib
run: |
cargo publish --package acvm_stdlib
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.ACVM_CRATES_IO_TOKEN }}

- name: Publish brillig_vm
run: |
cargo publish --package brillig_vm
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.ACVM_CRATES_IO_TOKEN }}

- name: Publish acvm
run: |
cargo publish --package acvm
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.ACVM_CRATES_IO_TOKEN }}
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@ jobs:
source $HOME/.cargo/env
cargo install -f wasm-bindgen-cli --version 0.2.86
- name: Install toml2json
run: |
source $HOME/.cargo/env
cargo install toml2json
- name: Install wasm-opt
run: |
npm i wasm-opt -g
Expand All @@ -47,6 +42,6 @@ jobs:

- name: Publish to NPM
working-directory: ./tooling/noir_js
run: npm publish --access public
run: yarn npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: Release and Publish Source Resolver
name: Publish Source Resolver

on:
workflow_dispatch:

jobs:
release-source-resolver:
name: Release and Publish Source Resolver
name: Publish Source Resolver
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -19,6 +19,6 @@ jobs:

- name: Publish to NPM
working-directory: ./compiler/source-resolver
run: npm publish
run: yarn npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
File renamed without changes.
36 changes: 31 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
- name: Dispatch to publish workflow
uses: benc-uk/workflow-dispatch@v1
with:
workflow: publish.yml
workflow: publish-nargo.yml
repo: noir-lang/noir
ref: master
token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -74,7 +74,7 @@ jobs:
- name: Dispatch to noir_wasm
uses: benc-uk/workflow-dispatch@v1
with:
workflow: release-noir-wasm.yml
workflow: publish-noir-wasm.yml
ref: master
token: ${{ secrets.NOIR_REPO_TOKEN }}

Expand All @@ -87,7 +87,7 @@ jobs:
- name: Dispatch to noir_wasm
uses: benc-uk/workflow-dispatch@v1
with:
workflow: noir-js.yml
workflow: publish-noir-js.yml
ref: master
token: ${{ secrets.NOIR_REPO_TOKEN }}

Expand All @@ -100,11 +100,11 @@ jobs:
- name: Dispatch to source resolver
uses: benc-uk/workflow-dispatch@v1
with:
workflow: release-source-resolver.yml
workflow: publish-source-resolver.yml
ref: master
token: ${{ secrets.NOIR_REPO_TOKEN }}

dispatch-publish-abi-wasm:
publish-abi-wasm:
name: Dispatch to publish-abi_wasm workflow
needs: [release-please]
if: ${{ needs.release-please.outputs.tag-name }}
Expand All @@ -117,3 +117,29 @@ jobs:
repo: ${{ github.repository }}
token: ${{ secrets.GITHUB_TOKEN }}
inputs: '{ "noir-ref": "${{ needs.release-please.outputs.tag-name }}" }'

publish-acvm:
name: Publish crates
needs: [release-please]
if: ${{ needs.release-please.outputs.tag-name }}
runs-on: ubuntu-latest
steps:
- name: Dispatch to publish workflow
uses: benc-uk/workflow-dispatch@v1
with:
workflow: publish-acvm.yml
ref: master
inputs: '{ "acvm-ref": "${{ needs.release-please.outputs.tag-name }}" }'

publish-acvm-js:
name: Dispatch to publish-acvm-js workflow
needs: [release-please]
if: ${{ needs.release-please.outputs.tag-name }}
runs-on: ubuntu-latest
steps:
- name: Trigger publish-acvm-js.yml workflow
uses: benc-uk/workflow-dispatch@v1
with:
workflow: publish-acvm-js.yml
ref: master
inputs: '{ "acvm-ref": "${{ needs.release-please.outputs.tag-name }}" }'
Original file line number Diff line number Diff line change
Expand Up @@ -22,46 +22,23 @@ jobs:
- name: Checkout sources
uses: actions/checkout@v3

- uses: cachix/install-nix-action@v20
- name: Setup Nix
uses: cachix/install-nix-action@v22
with:
nix_path: nixpkgs=channel:nixos-23.05
github_access_token: ${{ secrets.GITHUB_TOKEN }}

- name: Restore nix store cache
uses: actions/cache/restore@v3
id: cache
- uses: cachix/cachix-action@v12
with:
path: ${{ env.CACHED_PATH }}
key: ${{ runner.os }}-flake-abi-wasm-${{ hashFiles('*.lock') }}

# Based on https://github.com/marigold-dev/deku/blob/b5016f0cf4bf6ac48db9111b70dd7fb49b969dfd/.github/workflows/build.yml#L26
- name: Copy cache into nix store
if: steps.cache.outputs.cache-hit == 'true'
# We don't check the signature because we're the one that created the cache
run: |
for narinfo in ${{ env.CACHED_PATH }}/*.narinfo; do
path=$(head -n 1 "$narinfo" | awk '{print $2}')
nix copy --no-check-sigs --from "file://${{ env.CACHED_PATH }}" "$path"
done
name: barretenberg
authToken: "${{ secrets.CACHIX_AUTH_TOKEN }}"

- name: Build noirc_abi_wasm
run: |
nix build -L .#noirc_abi_wasm
cp -r ./result/noirc_abi_wasm/nodejs ./tooling/noirc_abi_wasm
cp -r ./result/noirc_abi_wasm/web ./tooling/noirc_abi_wasm
- name: Export cache from nix store
if: ${{ steps.cache.outputs.cache-hit != 'true' && github.event_name != 'merge_group' }}
run: |
nix copy --to "file://${{ env.CACHED_PATH }}?compression=zstd&parallel-compression=true" .#noirc-abi-wasm-cargo-artifacts
- uses: actions/cache/save@v3
# Don't create cache entries for the merge queue.
if: ${{ steps.cache.outputs.cache-hit != 'true' && github.event_name != 'merge_group' }}
with:
path: ${{ env.CACHED_PATH }}
key: ${{ steps.cache.outputs.cache-primary-key }}

- name: Dereference symlink
run: echo "UPLOAD_PATH=$(readlink -f ./result/noirc_abi_wasm)" >> $GITHUB_ENV

Expand Down
Loading

0 comments on commit 4781f10

Please sign in to comment.