Skip to content

Commit

Permalink
move /kimchi/{wasm,js} to kimchi_bindings
Browse files Browse the repository at this point in the history
  • Loading branch information
mitschabaude committed Dec 18, 2023
1 parent d4314b0 commit b6a14e0
Show file tree
Hide file tree
Showing 58 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion dockerfiles/stages/1-build-deps
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ ARG GO_CAPNP_VERSION=v3.0.0-alpha.5
# - src/lib/crypto/proof-systems/rust-toolchain.toml
ARG RUST_VERSION=1.72
# Nightly Rust Version used for WebAssembly builds
# - src/lib/snarkyjs/src/bindings/kimchi/wasm/rust-toolchain.toml
# - src/lib/crypto/kimchi_bindings/wasm/rust-toolchain.toml
ARG RUST_NIGHTLY=2023-09-01
# wasm-pack version
ARG WASM_PACK_VERSION=v0.12.1
Expand Down
6 changes: 3 additions & 3 deletions nix/rust.nix
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ in
};

kimchi-rust = rustChannelFromToolchainFileOf
../src/lib/crypto/kimchi/wasm/rust-toolchain.toml;
../src/lib/crypto/kimchi_bindings/wasm/rust-toolchain.toml;

# TODO: raise issue on nixpkgs and remove workaround when fix is applied
kimchi-rust-wasm = (final.kimchi-rust.rust.override {
Expand All @@ -124,7 +124,7 @@ in
plonk_wasm =
let

lock = ../src/lib/crypto/kimchi/wasm/Cargo.lock;
lock = ../src/lib/crypto/kimchi_bindings/wasm/Cargo.lock;

deps = builtins.listToAttrs (map
(pkg: {
Expand Down Expand Up @@ -168,7 +168,7 @@ in
"^lib(/crypto(/kimchi(/wasm(/.*)?)?)?)?$"
"^lib(/crypto(/proof-systems(/.*)?)?)?$"
];
sourceRoot = "source/lib/crypto/kimchi/wasm";
sourceRoot = "source/lib/crypto/kimchi_bindings/wasm";
nativeBuildInputs = [ final.wasm-pack wasm-bindgen-cli ];
buildInputs = with final; lib.optional stdenv.isDarwin libiconv;
cargoLock.lockFile = lock;
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -euo pipefail

if [[ -z "${PLONK_WASM_NODEJS-}" ]]; then
export RUSTFLAGS="-C target-feature=+atomics,+bulk-memory,+mutable-globals -C link-arg=--no-check-features -C link-arg=--max-memory=4294967296"
# The version should stay in line with the one in kimchi/wasm/rust-toolchain.toml
# The version should stay in line with the one in kimchi_bindings/wasm/rust-toolchain.toml
rustup run nightly-2023-09-01 wasm-pack build --target nodejs --out-dir ../js/node_js ../../wasm -- -Z build-std=panic_abort,std --features nodejs
else
cp "$PLONK_WASM_NODEJS"/* -R .
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ set -euo pipefail

if [[ -z "${PLONK_WASM_WEB-}" ]]; then
export RUSTFLAGS="-C target-feature=+atomics,+bulk-memory,+mutable-globals -C link-arg=--no-check-features -C link-arg=--max-memory=4294967296"
# The version should stay in line with the one in kimchi/wasm/rust-toolchain.toml
# The version should stay in line with the one in kimchi_bindings/wasm/rust-toolchain.toml
rustup run nightly-2023-09-01 wasm-pack build --target web --out-dir ../js/web ../../wasm -- -Z build-std=panic_abort,std
else
cp "$PLONK_WASM_WEB"/* -R .
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# A nightly is necessary to enable the use of #![feature]
[toolchain]
# This should stay in line with the versions in
# - kimchi/js/node_js/build.sh
# - kimchi/js/web/build.sh
# - kimchi_bindings/js/node_js/build.sh
# - kimchi_bindings/js/web/build.sh
channel = "nightly-2023-09-01" # roughly matches 1.72
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions src/lib/o1js_stub/dune
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
(link_flags
(-noautolink -g))
(link_deps
../crypto/kimchi/js/node_js/plonk_wasm.js
../crypto/kimchi/js/node_js/plonk_wasm_bg.wasm)
../crypto/kimchi_bindings/js/node_js/plonk_wasm.js
../crypto/kimchi_bindings/js/node_js/plonk_wasm_bg.wasm)
(libraries
;; opam libraries ;;
core_kernel
Expand Down Expand Up @@ -75,4 +75,4 @@
(backend bisect_ppx))
(forbidden_libraries async core re2 ctypes)
(preprocess
(pps ppx_custom_printf ppx_version js_of_ocaml-ppx)))
(pps ppx_custom_printf ppx_version js_of_ocaml-ppx)))

0 comments on commit b6a14e0

Please sign in to comment.