o1js icon indicating copy to clipboard operation
o1js copied to clipboard

replace src/bindings submodule with contents

Open Geometer1729 opened this issue 1 year ago • 1 comments

  • Replaces the o1js-bindings submodule with the same files but not as a submodle

  • changes linting rules to be consistent with previous behavior

  • Gitignore precompiled code

  • remove MINA_COMMIT file entirely

  • npm run build:bindings-download downloads compiled artifacts from github

  • npm run build:bindings-remote triggers a github workflow to build the compiled artifacts then downloads them

  • Remove the Building the o1js bindings section from src/bindings/README.md (it's outdated and redundant to README-dev anyway)

  • replace the github suggestion for npmDepsHash with the auto-commit action I tried forking the action to allow changes in files not in the pr but it turns out github doesn't support that.

npm run:build also now downloads the bindings if src/bindings/compiled does not exist. This should make contributing fairly painless, but if you do commit before running npm run:build you get:

bindings have not been built for this commit
you may want to:
- switch to a commit where they have been built
- trigger a remote build with npm run build:bindings-remote
- open a pr and run ci
- if you are running remote-build you may not have pushed your latest commit

You do also now need the gh cli tool, but I confirmed that for npm run:build and npm run build:bindings-download you do not need to be in the o1labs org.

I apologize for the lengthy commit history (lots of troubleshooting ci) and for the large number of files. The majority of the file changes are just adding files from o1js-bindings. Here are some diff command outputs to make that more reviewable:

$diff -rq src/bindings ../o1js-bindings
Only in ../o1js-bindings: CODEOWNERS
Only in ../o1js-bindings/compiled: .gitignore
Files src/bindings/compiled/node_bindings/plonk_wasm_bg.wasm and ../o1js-bindings/compiled/node_bindings/plonk_wasm_bg.wasm differ
Files src/bindings/compiled/node_bindings/plonk_wasm_bg.wasm.d.ts and ../o1js-bindings/compiled/node_bindings/plonk_wasm_bg.wasm.d.ts differ
Files src/bindings/compiled/node_bindings/plonk_wasm.cjs and ../o1js-bindings/compiled/node_bindings/plonk_wasm.cjs differ
Files src/bindings/compiled/node_bindings/plonk_wasm.d.cts and ../o1js-bindings/compiled/node_bindings/plonk_wasm.d.cts differ
Files src/bindings/compiled/web_bindings/plonk_wasm_bg.wasm and ../o1js-bindings/compiled/web_bindings/plonk_wasm_bg.wasm differ
Files src/bindings/compiled/web_bindings/plonk_wasm_bg.wasm.d.ts and ../o1js-bindings/compiled/web_bindings/plonk_wasm_bg.wasm.d.ts differ
Files src/bindings/compiled/web_bindings/plonk_wasm.d.ts and ../o1js-bindings/compiled/web_bindings/plonk_wasm.d.ts differ
Files src/bindings/compiled/web_bindings/plonk_wasm.js and ../o1js-bindings/compiled/web_bindings/plonk_wasm.js differ
Only in ../o1js-bindings: .git
Only in ../o1js-bindings: .gitattributes
Only in ../o1js-bindings: .gitconfig
Only in ../o1js-bindings: .github
Only in ../o1js-bindings: LICENSE
Only in ../o1js-bindings: MINA_COMMIT
Only in ../o1js-bindings: .prettierrc.cjs
Only in ../o1js-bindings/scripts: check-commit.sh
Only in src/bindings/scripts: download-bindings.sh
Only in src/bindings/scripts: remote-build-bindings.sh
Files src/bindings/scripts/update-o1js-bindings.sh and ../o1js-bindings/scripts/update-o1js-bindings.sh differ
$diff src/bindings/scripts/update-o1js-bindings.sh ../o1js-bindings/scripts/update-o1js-bindings.sh
81a82,90
>
> # 3. update MINA_COMMIT file in o1js
>
> if [ -z "${SKIP_MINA_COMMIT}" ]
> then
> MINA_COMMIT=$(git -C src/mina rev-parse HEAD)
> echo "The mina commit used to generate the backends for node and web is" "$MINA_COMMIT" \
>   > src/bindings/MINA_COMMIT
> fi

Closes #2080 Closes #2133

Geometer1729 avatar Mar 11 '25 17:03 Geometer1729

@richardpringle

Is it also possible that we use curl as the default when fetching instead of gh? If I want to run the tests on main with a fresh clone, I shouldn't need to install gh, right?

Unfortunately github requires credentials to download artifacts. I think gh is the easiest way to do that. To me it doesn't seem worth hosting the artifacts separately to avoid. Maybe there's a better option I'm not seeing.

Geometer1729 avatar Apr 15 '25 15:04 Geometer1729

45930 avatar Apr 22 '25 21:04 45930