diff --git a/.envrc b/.envrc index 758584977c..79a1ec7f27 100644 --- a/.envrc +++ b/.envrc @@ -1,5 +1 @@ -#!/usr/bin/env bash - -export GIT_LFS_SKIP_SMUDGE=1 -./pin.sh -use flake o1js#default +use flake . --refresh --no-eval-cache diff --git a/.github/actions/build/action.yml b/.github/actions/build/action.yml index 34c74d4d1c..6005c4b0a9 100644 --- a/.github/actions/build/action.yml +++ b/.github/actions/build/action.yml @@ -9,17 +9,57 @@ inputs: description: 'proof_systems commit to use' required: false default: '' + cache_id: + description: 'AWS access key ID for nix cache' + required: false + default: '' + nar_secret: + description: 'NAR signing secret key' + required: false + default: '' + gcp_secret: + description: 'GCP secret access key' + required: false + default: '' runs: using: "composite" steps: - - uses: nixbuild/nix-quick-install-action@v30 + - name: Create post-build hook for continuous cache upload + shell: bash + run: | + # Create script with embedded credentials (no echoing) + cat > /tmp/upload-to-cache.sh << EOF + #!/bin/bash + set -eu + echo "=== Post-build hook triggered ===" + if [ -n "\${OUT_PATHS:-}" ] && [ -n "${{ inputs.cache_id }}" ] && [ -n "${{ inputs.nar_secret }}" ]; then + echo "Signing and uploading \$(echo \$OUT_PATHS | wc -w) derivations" + export AWS_ACCESS_KEY_ID="${{ inputs.cache_id }}" + export AWS_SECRET_ACCESS_KEY="${{ inputs.gcp_secret }}" + # Create temporary key file + temp_key=\$(mktemp) + echo "${{ inputs.nar_secret }}" > "\$temp_key" + # Sign the outputs + nix store sign --key-file "\$temp_key" --recursive \$OUT_PATHS 2>/dev/null || true + # Upload to cache + nix copy --to "s3://mina-nix-cache?endpoint=https://storage.googleapis.com" \$OUT_PATHS 2>/dev/null || true + # Clean up + rm "\$temp_key" + echo "Upload completed" + else + echo "Skipping upload - missing credentials or no outputs" + fi + EOF + chmod +x /tmp/upload-to-cache.sh + - uses: nixbuild/nix-quick-install-action@v32 continue-on-error: true with: nix_conf: | keep-env-derivations = true keep-outputs = true require-sigs = false + post-build-hook = /tmp/upload-to-cache.sh - name: Disable smudging shell: bash run: echo "GIT_LFS_SKIP_SMUDGE=1" >> $GITHUB_ENV @@ -51,8 +91,7 @@ runs: shell: bash run: | set -Eeu - ./pin.sh - nix run o1js#generate-bindings --max-jobs auto + nix run .#generate-bindings --max-jobs auto - name: Cache dependencies and build uses: actions/cache@v4 id: cache @@ -81,4 +120,3 @@ runs: with: path: . key: repo-${{ github.sha }} - diff --git a/.github/actions/upload/action.yml b/.github/actions/upload/action.yml deleted file mode 100644 index df7d927736..0000000000 --- a/.github/actions/upload/action.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: Build and upload bindings -on: - workflow_dispatch: - workflow_call: - -inputs: - cache_id: - required: true - nar_secret: - required: true - gcp_secret: - required: true - -runs: - using: "composite" - steps: - - name: Build - uses: ./.github/actions/build - - name: Build the o1js bindings - if: steps.bindings-cache.outputs.cache-hit != 'true' - env: - AWS_ACCESS_KEY_ID: ${{ inputs.cache_id }} - AWS_SECRET_ACCESS_KEY: ${{ inputs.gcp_secret }} - shell: bash - run: | - set -Eeu - ./pin.sh - nix build o1js#bindings --accept-flake-config - temp_key=$(mktemp) - echo ${{ inputs.nar_secret }} > "$temp_key" - nix store sign --key-file "$temp_key" --recursive ./result - outs=$(nix-store --query --requisites --include-outputs $(nix path-info --derivation ./result)) - nix copy --to "s3://mina-nix-cache?endpoint=https://storage.googleapis.com" $outs - rm "$temp_key" - - name: generate tar - shell: bash - run: | - set -Eeu - ./pin.sh - nix build o1js#bindings-tar --out-link bindings.tar.gz - - name: Upload bindings - uses: actions/upload-artifact@v4 - with: - name: bindings.tar.gz - path: bindings.tar.gz diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 40120acd2d..36d9913404 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -50,6 +50,82 @@ jobs: repository: ${{ inputs.target_repo || github.repository }} ref: ${{ inputs.target_ref || github.ref }} proof_systems_commit: ${{ inputs.proof_systems_commit }} + cache_id: ${{ secrets.NIX_CACHE_GCP_ID }} + nar_secret: ${{ secrets.NIX_CACHE_NAR_SECRET }} + gcp_secret: ${{ secrets.NIX_CACHE_GCP_SECRET }} + + # TODO move to nightly maybe? it's a lot of builds to run + BuildMatrix: + strategy: + fail-fast: false + matrix: + method: ["default"] # ,"devshell" + #TODO enable devshell + #Currently disabled because the free runners don't have enough disk space + system: [ "ubuntu-latest"] # TODO macos here + nix_version: ["2.29.1","2.28.4"] # We require nix 2.28+ + runs-on: ${{ matrix.system }} + steps: + - name: Checkout repository with submodules + uses: actions/checkout@v4 + with: + submodules: recursive + repository: ${{ inputs.target_repo || github.repository }} + ref: ${{ inputs.target_ref || github.ref }} + - name: Disable smudging + run: echo "GIT_LFS_SKIP_SMUDGE=1" >> $GITHUB_ENV + - name: Create post-build hook for continuous cache upload + run: | + # Create script with embedded credentials (no echoing) + cat > /tmp/upload-to-cache.sh << EOF + #!/bin/bash + set -eu + echo "=== Post-build hook triggered ===" + if [ -n "\${OUT_PATHS:-}" ] && [ -n "${{ secrets.NIX_CACHE_GCP_ID }}" ] && [ -n "${{ secrets.NIX_CACHE_NAR_SECRET }}" ]; then + echo "Signing and uploading \$(echo \$OUT_PATHS | wc -w) derivations" + export AWS_ACCESS_KEY_ID="${{ secrets.NIX_CACHE_GCP_ID }}" + export AWS_SECRET_ACCESS_KEY="${{ secrets.NIX_CACHE_GCP_SECRET }}" + # Create temporary key file + temp_key=\$(mktemp) + echo "${{ secrets.NIX_CACHE_NAR_SECRET }}" > "\$temp_key" + # Sign the outputs + nix store sign --key-file "\$temp_key" --recursive \$OUT_PATHS 2>/dev/null || true + # Upload to cache + nix copy --to "s3://mina-nix-cache?endpoint=https://storage.googleapis.com" \$OUT_PATHS 2>/dev/null || true + # Clean up + rm "\$temp_key" + echo "Upload completed" + else + echo "Skipping upload - missing credentials or no outputs" + fi + EOF + chmod +x /tmp/upload-to-cache.sh + - name: Install nix + uses: nixbuild/nix-quick-install-action@v32 + with: + nix_version: ${{ matrix.nix_version }} + nix_conf: | + keep-env-derivations = true + keep-outputs = true + require-sigs = false + post-build-hook = /tmp/upload-to-cache.sh + - name: Build the o1js bindings (default) + if: ${{ matrix.method == 'default' }} + run: | + set -Eeu + nix run .#generate-bindings --max-jobs auto + - name: Build the o1js bindings (devshell) + if: ${{ matrix.method == 'devshell' }} + run: | + set -Eeu + nix develop . --command npm run build:update-bindings + - name: Build o1js + run: | + nix develop --command npm ci + nix develop --command npm run build + - name: Run some tests + run: | + nix develop --command npm run test Lint-Format-and-TypoCheck: strategy: @@ -109,23 +185,6 @@ jobs: check_hidden: false ignore_words_list: "tHi,modul,optin,deriver,PRing,toWords,iSelf" - Upload-bindings: - name: upload bindings artifact - if: ${{ inputs.proof_systems_commit == '' }} - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - submodules: recursive - repository: ${{ inputs.target_repo || github.repository }} - ref: ${{ inputs.target_ref || github.ref }} - - name: upload - uses: ./.github/actions/upload - with: - cache_id: ${{ secrets.NIX_CACHE_GCP_ID }} - nar_secret: ${{ secrets.NIX_CACHE_NAR_SECRET }} - gcp_secret: ${{ secrets.NIX_CACHE_GCP_SECRET }} - Build-And-Test-Server: needs: [Prepare] timeout-minutes: 210 @@ -158,6 +217,9 @@ jobs: repository: ${{ inputs.target_repo || github.repository }} ref: ${{ inputs.target_ref || github.ref }} proof_systems_commit: ${{ inputs.proof_systems_commit }} + cache_id: ${{ secrets.NIX_CACHE_GCP_ID }} + nar_secret: ${{ secrets.NIX_CACHE_NAR_SECRET }} + gcp_secret: ${{ secrets.NIX_CACHE_GCP_SECRET }} - name: Prepare for tests run: touch profiling.md - name: Execute tests @@ -192,6 +254,9 @@ jobs: repository: ${{ inputs.target_repo || github.repository }} ref: ${{ inputs.target_ref || github.ref }} proof_systems_commit: ${{ inputs.proof_systems_commit }} + cache_id: ${{ secrets.NIX_CACHE_GCP_ID }} + nar_secret: ${{ secrets.NIX_CACHE_NAR_SECRET }} + gcp_secret: ${{ secrets.NIX_CACHE_GCP_SECRET }} - name: Count tests id: count_tests run: | @@ -306,7 +371,7 @@ jobs: needs: [Prepare] timeout-minutes: 45 runs-on: ubuntu-latest - if: github.event.pull_request.base.ref != 'develop' + if: github.event.pull_request.base.ref != 'develop' services: mina-local-network: image: o1labs/mina-local-network:master-latest-lightnet @@ -333,6 +398,9 @@ jobs: repository: ${{ inputs.target_repo || github.repository }} ref: ${{ inputs.target_ref || github.ref }} proof_systems_commit: ${{ inputs.proof_systems_commit }} + cache_id: ${{ secrets.NIX_CACHE_GCP_ID }} + nar_secret: ${{ secrets.NIX_CACHE_NAR_SECRET }} + gcp_secret: ${{ secrets.NIX_CACHE_GCP_SECRET }} - name: Use shared steps for live testing jobs uses: ./.github/actions/live-tests-shared with: @@ -342,7 +410,7 @@ jobs: needs: [Prepare] timeout-minutes: 45 runs-on: ubuntu-latest - if: github.event.pull_request.base.ref != 'develop' + if: github.event.pull_request.base.ref != 'develop' services: mina-local-network: image: o1labs/mina-local-network:compatible-latest-lightnet @@ -369,6 +437,9 @@ jobs: repository: ${{ inputs.target_repo || github.repository }} ref: ${{ inputs.target_ref || github.ref }} proof_systems_commit: ${{ inputs.proof_systems_commit }} + cache_id: ${{ secrets.NIX_CACHE_GCP_ID }} + nar_secret: ${{ secrets.NIX_CACHE_NAR_SECRET }} + gcp_secret: ${{ secrets.NIX_CACHE_GCP_SECRET }} - name: Use shared steps for live testing jobs uses: ./.github/actions/live-tests-shared with: @@ -405,7 +476,10 @@ jobs: repository: ${{ inputs.target_repo || github.repository }} ref: ${{ inputs.target_ref || github.ref }} proof_systems_commit: ${{ inputs.proof_systems_commit }} + cache_id: ${{ secrets.NIX_CACHE_GCP_ID }} + nar_secret: ${{ secrets.NIX_CACHE_NAR_SECRET }} + gcp_secret: ${{ secrets.NIX_CACHE_GCP_SECRET }} - name: Use shared steps for live testing jobs uses: ./.github/actions/live-tests-shared with: - mina-branch-name: develop \ No newline at end of file + mina-branch-name: develop diff --git a/.github/workflows/pull_requests.yml b/.github/workflows/pull_requests.yml index d7d9385b2f..3f60790984 100644 --- a/.github/workflows/pull_requests.yml +++ b/.github/workflows/pull_requests.yml @@ -22,7 +22,7 @@ jobs: - uses: actions/checkout@v4 with: submodules: recursive - - uses: nixbuild/nix-quick-install-action@v30 + - uses: nixbuild/nix-quick-install-action@v32 continue-on-error: true with: nix_conf: | @@ -32,8 +32,7 @@ jobs: - name: fix npmDepsHash run: | set -Eeu - ./pin.sh - nix run o1js#update-npm-deps + nix run .#update-npm-deps # if the npmDepsHash is out of date auto commit the new one - uses: stefanzweifel/git-auto-commit-action@v5 with: diff --git a/.github/workflows/remote_bindings.yml b/.github/workflows/remote_bindings.yml index 6b0a0f69f5..5e296876e3 100644 --- a/.github/workflows/remote_bindings.yml +++ b/.github/workflows/remote_bindings.yml @@ -12,7 +12,7 @@ jobs: with: submodules: recursive - name: upload - uses: ./.github/actions/upload + uses: ./.github/actions/build with: cache_id: ${{ secrets.NIX_CACHE_ID }} nar_secret: ${{ secrets.NIX_CACHE_NAR_SECRET }} diff --git a/README-dev.md b/README-dev.md index 4ae8f9d102..69fe45dced 100644 --- a/README-dev.md +++ b/README-dev.md @@ -79,11 +79,9 @@ build the bindings for your commit and download them once it finishes. ## Building with nix -Much like the mina repo, we use the nix registry to conveniently handle git -submodules. You can enter the devshell with `./pin.sh` and -`nix develop o1js#default` or by using direnv with the `.envrc` provided. This -devshell provides all the dependencies required for npm scripts including -`npm run build:update-bindings`. +You can build with nix in two ways: Using a flake app +`nix run .#generate-bindings` or using a devshell `nix develop`, and inside that +devshell `npm run build:update-bindings`. ## Building Bindings diff --git a/README-nix.md b/README-nix.md index 9239db4e4c..16de1a45b9 100644 --- a/README-nix.md +++ b/README-nix.md @@ -14,6 +14,8 @@ required across the codebase, including npm scripts. ## Installing Nix +We require nix 2.28+ + The following command will install Nix on your machine. ```console @@ -79,13 +81,11 @@ cd o1js # npm install ``` -From a new shell, go to `{REPO_PATH}/o1js` and from there execute `./pin.sh` to -update the submodules and add the flakes entries. Then, you can open a Nix shell -with all the dependencies required executing `nix develop o1js#default`. +From a new shell, go to `{REPO_PATH}/o1js` then, you can open a Nix shell with +all the dependencies required executing `nix develop`. ```console -./pin.sh -nix develop o1js#default +nix develop ``` On macos the first time you run this command, you can expect it to take hours @@ -132,7 +132,7 @@ This can be mitigated with [direnv](https://github.com/direnv/direnv) and garbage collector roots, keeping one gc-root to the latest build of the dev shell so that `nix-store --gc` won't remove it. You can also create a gc root any time you run `nix build` (until you remove `./result`) so running -`nix build o1js#bindings` before `nix-store --gc` may also help. +`nix build .#bindings` before `nix-store --gc` may also help. ### Runtime optimization @@ -164,6 +164,13 @@ This section should be read as a starting roadmap, and engineers are highly enco and possible fixes to improve the helpfulness of this document. ``` +### Flake caching + +The way nix caches flake evaluations can be really unhelpfull. If you expect any +changes in mina or the bindings it's recomended to add +`--refresh --no-eval-cache` to all your nix commands. If you use direnv this +should be automatic. + ### Compiling _export_test_vectors_ When trying to update the bindings for o1js in MacOS, Nix might fail at @@ -305,27 +312,4 @@ Then, the error message would still contain old directories. #### Fix -Rerun `pin.sh` and `src/mina/nix/pin.sh`. - -### Changes to nix flakes aren't taking effect - -On MacOS, nix may ignore changes to files when nix commands are run and reuse -the flake cached in its registry. Running commands like `nix develop o1js` and -`nix run o1js#update-bindings` will reuse the cached version of the flake. As a -result: - -- The devshell could be missing newly added dependencies. -- Builds executed directly with `nix run` could be generated from old source - files. - -#### Fix - -There are two ways to ensure Nix recognizes flake changes: - -- Rerun `pin.sh` to force an update to the registry, then run your command. -- Reference the flake by its directory path rather than its registry name. This - forces Nix to use the current contents of the directory: - -```bash -nix develop .'?submodules=1#default' -``` +Rerun `src/mina/nix/pin.sh`. diff --git a/flake.lock b/flake.lock index 01ea295f97..5b8fb86428 100644 --- a/flake.lock +++ b/flake.lock @@ -58,40 +58,16 @@ ] }, "locked": { - "lastModified": 1723653683, - "narHash": "sha256-n7h3X1PCp+pPOu/bwUQ0Gwv0yXrdjA+h3Zp6CQSS4jQ=", + "lastModified": 1753462905, + "narHash": "sha256-6AtfyAkiVQKQYQlxj5r770qPvizkyhM4PkUO/dynlpM=", "owner": "o1-labs", "repo": "dune-nix", - "rev": "303e4cea2e035c84d4067754a9275a053dac1564", - "type": "github" - }, - "original": { - "owner": "o1-labs", - "repo": "dune-nix", - "type": "github" - } - }, - "dune-nix_2": { - "inputs": { - "flake-utils": [ - "mina", - "utils" - ], - "nixpkgs": [ - "mina", - "nixpkgs" - ] - }, - "locked": { - "lastModified": 1742933757, - "narHash": "sha256-FI8sVvIJuKscrnOUj/cqbZRVOxTzgBwYMyZSNcXq+58=", - "owner": "o1-labs", - "repo": "dune-nix", - "rev": "5eedc211a4cfc3bae1833c5a85542be49b4a9f6b", + "rev": "3db28322f3225c56d591e66d2b9a728eedc18e52", "type": "github" }, "original": { "owner": "o1-labs", + "ref": "brian/relative-flakes-fix", "repo": "dune-nix", "type": "github" } @@ -248,7 +224,9 @@ "mina": { "inputs": { "describe-dune": "describe-dune_2", - "dune-nix": "dune-nix_2", + "dune-nix": [ + "dune-nix" + ], "flake-buildkite-pipeline": "flake-buildkite-pipeline", "flake-compat": "flake-compat", "flockenzeit": "flockenzeit", @@ -266,16 +244,14 @@ "utils": "utils" }, "locked": { - "lastModified": 1751976294, - "narHash": "sha256-iQiich3yamIKYSq+zRKcs7zWNUC22/Bi33swjwcfc5g=", "path": "src/mina", "type": "path" }, "original": { - "submodules": true, - "type": "git", - "url": "file:src/mina" - } + "path": "src/mina", + "type": "path" + }, + "parent": [] }, "mirage-opam-overlays": { "flake": false, diff --git a/flake.nix b/flake.nix index ba7923e8a2..9f450ad3a1 100644 --- a/flake.nix +++ b/flake.nix @@ -1,14 +1,16 @@ { description = "o1js - TypeScript framework for zk-SNARKs and zkApps"; inputs = { + self.submodules = true; nixpkgs-mina.url = "github:nixos/nixpkgs/nixos-24.11-small"; - mina.url = "git+file:src/mina?submodules=1"; + mina.url = ./src/mina; + mina.inputs.dune-nix.follows = "dune-nix"; nixpkgs-mozilla.url = "github:mozilla/nixpkgs-mozilla"; nixpkgs-mozilla.flake = false; describe-dune.url = "github:o1-labs/describe-dune"; describe-dune.inputs.nixpkgs.follows = "nixpkgs-mina"; describe-dune.inputs.flake-utils.follows = "flake-utils"; - dune-nix.url = "github:o1-labs/dune-nix"; + dune-nix.url = "github:o1-labs/dune-nix?ref=brian/relative-flakes-fix"; dune-nix.inputs.nixpkgs.follows = "nixpkgs-mina"; dune-nix.inputs.flake-utils.follows = "flake-utils"; flake-utils.url = "github:numtide/flake-utils"; @@ -128,7 +130,7 @@ [ nodejs nodePackages.npm - #nodePackages.prettier + nodePackages.prettier typescript nodePackages.typescript-language-server rustup @@ -137,38 +139,6 @@ dune_3 ] ++ commonOverrides.buildInputs; - inherit (pkgs) lib; - # All the submodules required by .gitmodules - submodules = map builtins.head (builtins.filter lib.isList - (map (builtins.match " path = (.*)") - (lib.splitString "\n" (builtins.readFile ./.gitmodules)))); - - # Warn about missing submodules - requireSubmodules = - let - ref = r: "${r}"; - command = c: "${c}"; - in - lib.warnIf - ( - !builtins.all (x: x) - (map (x: builtins.pathExists ./${x} && builtins.readDir ./${x} != { }) - submodules) - ) '' - Some submodules are missing, you may get errors. Consider one of the following: - - run ${command "./pin.sh"} and use "${ - ref "o1js" - }" flake ref, e.g. ${command "nix develop o1js"} or ${ - command "nix build o1js" - }; - - use "${ref "git+file://$PWD?submodules=1"}"; - - use "${ - ref "git+https://github.com/o1-labs/o1js?submodules=1" - }"; - - use non-flake commands like ${command "nix-build"} and ${ - command "nix-shell" - }. - ''; o1js-npm-deps = pkgs.buildNpmPackage { name = "o1js"; @@ -181,7 +151,7 @@ ]; }); # If you get ERROR: npmDepsHash is out of date - # you can update the hash with `nix run o1js#update-npm-deps`. + # you can update the hash with `nix run .#update-npm-deps`. # Failing that you can remove the hash from ./npmDepsHash and try again # which should get an error message with the correct hash # You can also just push and CI should suggest a fix which updates the hash @@ -205,7 +175,7 @@ checkPhase = if pkgs.stdenv.isDarwin then "" else null; text = '' - if [ "$1" = run ] && { [ "$2" = nightly-2024-09-05 ] || [[ "$2" =~ 1.79-x86_64* ]]; } + if [ "$1" = run ] && [ "$2" = nightly-2024-09-05 ] then echo using nix toolchain ${rustup}/bin/rustup run nix "''${@:3}" @@ -230,7 +200,7 @@ CARGO_TARGET_DIR = "./target"; cargoLock = { lockFile = ./src/mina/src/lib/crypto/proof-systems/Cargo.lock; }; }; - bindings = requireSubmodules (pkgs.stdenv.mkDerivation { + bindings = pkgs.stdenv.mkDerivation { name = "o1js_bindings"; src = with pkgs.lib.fileset; (toSource { @@ -301,27 +271,32 @@ cp -Lr ./mina-transaction/gen $out/mina-transaction/ popd ''; - }); + }; in { formatter = pkgs.nixfmt; inherit mina; devShells = { # This seems to work better for macos - mina-shell = requireSubmodules inputs.mina.devShells."${system}".with-lsp; - default = requireSubmodules (pkgs.mkShell + mina-shell = inputs.mina.devShells."${system}".with-lsp; + default = pkgs.mkShell (if pkgs.stdenv.isDarwin # on macos use plain rustup then { packages = bindings-pkgs; } # on linux wrap rustup like in the derivation else { - packages = [ rustupWrapper ] ++ bindings-pkgs; + packages = [ rustupWrapper mina.base-libs ] ++ bindings-pkgs; + shellHook = '' RUSTUP_HOME=$(pwd)/.rustup export RUSTUP_HOME + # fixes linking issue with wasm-pack + export LD_LIBRARY_PATH="${pkgs.bzip2.out}/lib:$LD_LIBRARY_PATH" + # TODO ideally we shouldn't install toolchains like this in a devshell + rustup toolchain install nightly-x86_64-unknown-linux-gnu rustup toolchain link nix ${rust-channel'} ''; - })); + }); }; diff --git a/pin.sh b/pin.sh deleted file mode 100755 index 4007b0d180..0000000000 --- a/pin.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env bash -# Set up flake registry to get o1js with all the submodules - -# Find the root of the o1js repo -ROOT=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) -pushd "$ROOT" -# Update the submodules -git submodule sync && git submodule update --init --recursive -# Add the flake registry entry -nix registry add o1js "git+file://$ROOT?submodules=1" -# update mina input to local submodule -# --override-input seems redundant but fixes a caching issue with local paths -nix flake update mina --override-input mina 'path:src/mina' --flake '.?submodules=1' -popd diff --git a/src/bindings/scripts/build-o1js-node-artifacts.sh b/src/bindings/scripts/build-o1js-node-artifacts.sh index e58143f08b..84170573bd 100755 --- a/src/bindings/scripts/build-o1js-node-artifacts.sh +++ b/src/bindings/scripts/build-o1js-node-artifacts.sh @@ -41,6 +41,8 @@ dune b src/bindings/mina-transaction/gen/v1/js-layout.ts \ src/bindings/crypto/constants.ts \ || exit 1 +prettier -w src/bindings/mina-transaction/gen src/bindings/crypto/constants.ts + # Cleanup mina config files rm -rf "src/config" \ && rm "src/config.mlh" || exit 1 diff --git a/src/bindings/scripts/update-o1js-bindings.sh b/src/bindings/scripts/update-o1js-bindings.sh index 683f83183d..e0c5a0ef1b 100755 --- a/src/bindings/scripts/update-o1js-bindings.sh +++ b/src/bindings/scripts/update-o1js-bindings.sh @@ -40,6 +40,7 @@ then dune b "${DUNE_PATH}"/o1js_web.bc.js cp "_build/o1js_node.bc.map" "$BUILD_PATH/o1js_node.bc.map" + mkdir -p "${WEB_BINDINGS}" cp _build/default/"${KIMCHI_BINDINGS}"/js/web/plonk_wasm* "${WEB_BINDINGS}"/ cp "${BUILD_PATH}"/o1js_web*.js "${WEB_BINDINGS}"/ chmod -R 666 "${WEB_BINDINGS}"/*