@@ -70,7 +70,7 @@ arbitrator_cases=arbitrator/prover/test-cases
70
70
arbitrator_tests_wat =$(wildcard $(arbitrator_cases ) /* .wat)
71
71
arbitrator_tests_rust =$(wildcard $(arbitrator_cases ) /rust/src/bin/* .rs)
72
72
73
- arbitrator_test_wasms =$(patsubst % .wat,% .wasm, $(arbitrator_tests_wat ) ) $(patsubst $(arbitrator_cases ) /rust/src/bin/% .rs,$(arbitrator_cases ) /rust/target/wasm32-wasi /release/% .wasm, $(arbitrator_tests_rust ) ) $(arbitrator_cases ) /go/testcase.wasm
73
+ arbitrator_test_wasms =$(patsubst % .wat,% .wasm, $(arbitrator_tests_wat ) ) $(patsubst $(arbitrator_cases ) /rust/src/bin/% .rs,$(arbitrator_cases ) /rust/target/wasm32-wasip1 /release/% .wasm, $(arbitrator_tests_rust ) ) $(arbitrator_cases ) /go/testcase.wasm
74
74
75
75
arbitrator_tests_link_info = $(shell cat $(arbitrator_cases ) /link.txt | xargs)
76
76
arbitrator_tests_link_deps = $(patsubst % ,$(arbitrator_cases ) /% .wasm, $(arbitrator_tests_link_info ) )
@@ -103,7 +103,7 @@ stylus_files = $(wildcard $(stylus_dir)/*.toml $(stylus_dir)/src/*.rs) $(wasm_li
103
103
jit_dir = arbitrator/jit
104
104
jit_files = $(wildcard $(jit_dir ) /* .toml $(jit_dir ) /* .rs $(jit_dir ) /src/* .rs $(jit_dir ) /src/* /* .rs) $(stylus_files )
105
105
106
- wasm32_wasi = target/wasm32-wasi /release
106
+ wasm32_wasi = target/wasm32-wasip1 /release
107
107
wasm32_unknown = target/wasm32-unknown-unknown/release
108
108
109
109
stylus_dir = arbitrator/stylus
@@ -157,7 +157,14 @@ stylus_benchmarks = $(wildcard $(stylus_dir)/*.toml $(stylus_dir)/src/*.rs) $(st
157
157
158
158
espresso_crypto_dir = ./espressocrypto/lib/espresso-crypto-helper
159
159
espresso_crypto_files = $(wildcard $(espresso_crypto_dir ) /* .toml $(espresso_crypto_dir ) /src/* .rs)
160
- espresso_crypto_lib = $(output_root ) /lib/libespresso_crypto_helper.a
160
+ espresso_crypto_lib = $(output_root ) /lib/libespresso_crypto_helper
161
+ espresso_crypto_filename = libespresso_crypto_helper.so
162
+ ifeq ($(UNAME_S ) , Darwin)
163
+ espresso_crypto_filename = libespresso_crypto_helper.dylib
164
+ else
165
+ export LD_LIBRARY_PATH := $(shell pwd)/target/lib:$LD_LIBRARY_PATH
166
+ endif
167
+
161
168
CBROTLI_WASM_BUILD_ARGS ?=-d
162
169
163
170
# user targets
@@ -167,7 +174,7 @@ build-espresso-crypto-lib: $(espresso_crypto_lib)
167
174
$(espresso_crypto_lib ) : $(DEP_PREDICATE ) $(espresso_crypto_files )
168
175
mkdir -p ` dirname $( espresso_crypto_lib) `
169
176
cargo build --release --manifest-path $(espresso_crypto_dir ) /Cargo.toml
170
- install $(espresso_crypto_dir ) /target/release/libespresso_crypto_helper.a $@
177
+ install $(espresso_crypto_dir ) /target/release/$( espresso_crypto_filename ) $( output_root ) /lib/ $( espresso_crypto_filename )
171
178
172
179
.PHONY : push
173
180
push : lint test-go .make/fmt
@@ -355,6 +362,7 @@ $(output_root)/bin/dbconv: $(DEP_PREDICATE) build-node-deps
355
362
$(replay_wasm ) : $(DEP_PREDICATE ) $(go_source ) .make/solgen
356
363
mkdir -p ` dirname $( replay_wasm) `
357
364
GOOS=wasip1 GOARCH=wasm go build -o $@ ./cmd/replay/...
365
+ ./scripts/remove_reference_types.sh $@
358
366
359
367
$(prover_bin ) : $(DEP_PREDICATE ) $(rust_prover_files )
360
368
mkdir -p ` dirname $( prover_bin) `
@@ -372,7 +380,8 @@ $(arbitrator_jit): $(DEP_PREDICATE) $(jit_files)
372
380
install arbitrator/target/release/jit $@
373
381
374
382
$(arbitrator_cases ) /rust/$(wasm32_wasi ) /% .wasm : $(arbitrator_cases ) /rust/src/bin/% .rs $(arbitrator_cases ) /rust/src/lib.rs $(arbitrator_cases ) /rust/.cargo/config.toml
375
- cargo build --manifest-path $(arbitrator_cases ) /rust/Cargo.toml --release --target wasm32-wasi --config $(arbitrator_cases ) /rust/.cargo/config.toml --bin $(patsubst $(arbitrator_cases ) /rust/$(wasm32_wasi ) /% .wasm,% , $@ )
383
+ cargo build --manifest-path $(arbitrator_cases ) /rust/Cargo.toml --release --target wasm32-wasip1 --config $(arbitrator_cases ) /rust/.cargo/config.toml --bin $(patsubst $(arbitrator_cases ) /rust/$(wasm32_wasi ) /% .wasm,% , $@ )
384
+ ./scripts/remove_reference_types.sh $@
376
385
377
386
$(arbitrator_cases ) /go/testcase.wasm : $(arbitrator_cases ) /go/* .go .make/solgen
378
387
cd $(arbitrator_cases ) /go && GOOS=wasip1 GOARCH=wasm go build -o testcase.wasm
@@ -386,6 +395,7 @@ $(arbitrator_generated_header): $(DEP_PREDICATE) $(stylus_files)
386
395
$(output_latest ) /wasi_stub.wasm : $(DEP_PREDICATE ) $(call wasm_lib_deps,wasi-stub)
387
396
cargo build --manifest-path arbitrator/wasm-libraries/Cargo.toml --release --target wasm32-unknown-unknown --config $(wasm_lib_cargo ) --package wasi-stub
388
397
install arbitrator/wasm-libraries/$(wasm32_unknown ) /wasi_stub.wasm $@
398
+ ./scripts/remove_reference_types.sh $@
389
399
390
400
arbitrator/wasm-libraries/soft-float/SoftFloat/build/Wasm-Clang/softfloat.a : $(DEP_PREDICATE ) \
391
401
arbitrator/wasm-libraries/soft-float/SoftFloat/build/Wasm-Clang/Makefile \
@@ -397,10 +407,10 @@ arbitrator/wasm-libraries/soft-float/SoftFloat/build/Wasm-Clang/softfloat.a: $(D
397
407
cd arbitrator/wasm-libraries/soft-float/SoftFloat/build/Wasm-Clang && make $(MAKEFLAGS )
398
408
399
409
arbitrator/wasm-libraries/soft-float/bindings32.o : $(DEP_PREDICATE ) arbitrator/wasm-libraries/soft-float/bindings32.c
400
- clang arbitrator/wasm-libraries/soft-float/bindings32.c --sysroot $(WASI_SYSROOT ) -I arbitrator/wasm-libraries/soft-float/SoftFloat/source/include -target wasm32-wasi -Wconversion -c -o $@
410
+ clang arbitrator/wasm-libraries/soft-float/bindings32.c --sysroot $(WASI_SYSROOT ) -I arbitrator/wasm-libraries/soft-float/SoftFloat/source/include -target wasm32-wasip1 -Wconversion -c -o $@
401
411
402
412
arbitrator/wasm-libraries/soft-float/bindings64.o : $(DEP_PREDICATE ) arbitrator/wasm-libraries/soft-float/bindings64.c
403
- clang arbitrator/wasm-libraries/soft-float/bindings64.c --sysroot $(WASI_SYSROOT ) -I arbitrator/wasm-libraries/soft-float/SoftFloat/source/include -target wasm32-wasi -Wconversion -c -o $@
413
+ clang arbitrator/wasm-libraries/soft-float/bindings64.c --sysroot $(WASI_SYSROOT ) -I arbitrator/wasm-libraries/soft-float/SoftFloat/source/include -target wasm32-wasip1 -Wconversion -c -o $@
404
414
405
415
$(output_latest ) /soft-float.wasm : $(DEP_PREDICATE ) \
406
416
arbitrator/wasm-libraries/soft-float/bindings32.o \
@@ -426,24 +436,29 @@ $(output_latest)/soft-float.wasm: $(DEP_PREDICATE) \
426
436
--export wavm__f64_promote_f32
427
437
428
438
$(output_latest ) /host_io.wasm : $(DEP_PREDICATE ) $(call wasm_lib_deps,host-io) $(wasm_lib_go_abi )
429
- cargo build --manifest-path arbitrator/wasm-libraries/Cargo.toml --release --target wasm32-wasi --config $(wasm_lib_cargo ) --package host-io
439
+ cargo build --manifest-path arbitrator/wasm-libraries/Cargo.toml --release --target wasm32-wasip1 --config $(wasm_lib_cargo ) --package host-io
430
440
install arbitrator/wasm-libraries/$(wasm32_wasi ) /host_io.wasm $@
441
+ ./scripts/remove_reference_types.sh $@
431
442
432
443
$(output_latest ) /user_host.wasm : $(DEP_PREDICATE ) $(wasm_lib_user_host ) $(rust_prover_files ) $(output_latest ) /forward_stub.wasm .make/machines
433
- cargo build --manifest-path arbitrator/wasm-libraries/Cargo.toml --release --target wasm32-wasi --config $(wasm_lib_cargo ) --package user-host
444
+ cargo build --manifest-path arbitrator/wasm-libraries/Cargo.toml --release --target wasm32-wasip1 --config $(wasm_lib_cargo ) --package user-host
434
445
install arbitrator/wasm-libraries/$(wasm32_wasi ) /user_host.wasm $@
446
+ ./scripts/remove_reference_types.sh $@
435
447
436
448
$(output_latest ) /program_exec.wasm : $(DEP_PREDICATE ) $(call wasm_lib_deps,program-exec) $(rust_prover_files ) .make/machines
437
- cargo build --manifest-path arbitrator/wasm-libraries/Cargo.toml --release --target wasm32-wasi --config $(wasm_lib_cargo ) --package program-exec
449
+ cargo build --manifest-path arbitrator/wasm-libraries/Cargo.toml --release --target wasm32-wasip1 --config $(wasm_lib_cargo ) --package program-exec
438
450
install arbitrator/wasm-libraries/$(wasm32_wasi ) /program_exec.wasm $@
451
+ ./scripts/remove_reference_types.sh $@
439
452
440
453
$(output_latest ) /user_test.wasm : $(DEP_PREDICATE ) $(call wasm_lib_deps,user-test) $(rust_prover_files ) .make/machines
441
- cargo build --manifest-path arbitrator/wasm-libraries/Cargo.toml --release --target wasm32-wasi --config $(wasm_lib_cargo ) --package user-test
454
+ cargo build --manifest-path arbitrator/wasm-libraries/Cargo.toml --release --target wasm32-wasip1 --config $(wasm_lib_cargo ) --package user-test
442
455
install arbitrator/wasm-libraries/$(wasm32_wasi ) /user_test.wasm $@
456
+ ./scripts/remove_reference_types.sh $@
443
457
444
458
$(output_latest ) /arbcompress.wasm : $(DEP_PREDICATE ) $(call wasm_lib_deps,brotli) $(wasm_lib_go_abi )
445
- cargo build --manifest-path arbitrator/wasm-libraries/Cargo.toml --release --target wasm32-wasi --config $(wasm_lib_cargo ) --package arbcompress
459
+ cargo build --manifest-path arbitrator/wasm-libraries/Cargo.toml --release --target wasm32-wasip1 --config $(wasm_lib_cargo ) --package arbcompress
446
460
install arbitrator/wasm-libraries/$(wasm32_wasi ) /arbcompress.wasm $@
461
+ ./scripts/remove_reference_types.sh $@
447
462
448
463
$(output_latest ) /forward.wasm : $(DEP_PREDICATE ) $(wasm_lib_forward ) .make/machines
449
464
cargo run --manifest-path $(forward_dir ) /Cargo.toml -- --path $(forward_dir ) /forward.wat
@@ -465,84 +480,72 @@ $(stylus_test_dir)/%.wasm: $(stylus_test_dir)/%.b $(stylus_lang_bf)
465
480
466
481
$(stylus_test_keccak_wasm ) : $(stylus_test_keccak_src )
467
482
$(cargo_nightly ) --manifest-path $< --release --config $(stylus_cargo )
468
- wasm2wat $@ > $@ .wat # removing reference types
469
- wat2wasm $@ .wat -o $@
483
+ ./scripts/remove_reference_types.sh $@
470
484
@touch -c $@ # cargo might decide to not rebuild the binary
471
485
472
486
$(stylus_test_keccak-100_wasm ) : $(stylus_test_keccak-100_src )
473
487
$(cargo_nightly ) --manifest-path $< --release --config $(stylus_cargo )
474
- wasm2wat $@ > $@ .wat # removing reference types
475
- wat2wasm $@ .wat -o $@
488
+ ./scripts/remove_reference_types.sh $@
476
489
@touch -c $@ # cargo might decide to not rebuild the binary
477
490
478
491
$(stylus_test_fallible_wasm ) : $(stylus_test_fallible_src )
479
492
$(cargo_nightly ) --manifest-path $< --release --config $(stylus_cargo )
480
- wasm2wat $@ > $@ .wat # removing reference types
481
- wat2wasm $@ .wat -o $@
493
+ ./scripts/remove_reference_types.sh $@
482
494
@touch -c $@ # cargo might decide to not rebuild the binary
483
495
484
496
$(stylus_test_storage_wasm ) : $(stylus_test_storage_src )
485
497
$(cargo_nightly ) --manifest-path $< --release --config $(stylus_cargo )
486
- wasm2wat $@ > $@ .wat # removing reference types
487
- wat2wasm $@ .wat -o $@
498
+ ./scripts/remove_reference_types.sh $@
488
499
@touch -c $@ # cargo might decide to not rebuild the binary
489
500
490
501
$(stylus_test_multicall_wasm ) : $(stylus_test_multicall_src )
491
502
$(cargo_nightly ) --manifest-path $< --release --config $(stylus_cargo )
492
- wasm2wat $@ > $@ .wat # removing reference types
493
- wat2wasm $@ .wat -o $@
503
+ ./scripts/remove_reference_types.sh $@
494
504
@touch -c $@ # cargo might decide to not rebuild the binary
495
505
496
506
$(stylus_test_log_wasm ) : $(stylus_test_log_src )
497
507
$(cargo_nightly ) --manifest-path $< --release --config $(stylus_cargo )
498
- wasm2wat $@ > $@ .wat # removing reference types
499
- wat2wasm $@ .wat -o $@
508
+ ./scripts/remove_reference_types.sh $@
500
509
@touch -c $@ # cargo might decide to not rebuild the binary
501
510
502
511
$(stylus_test_create_wasm ) : $(stylus_test_create_src )
503
512
$(cargo_nightly ) --manifest-path $< --release --config $(stylus_cargo )
504
- wasm2wat $@ > $@ .wat # removing reference types
505
- wat2wasm $@ .wat -o $@
513
+ ./scripts/remove_reference_types.sh $@
506
514
@touch -c $@ # cargo might decide to not rebuild the binary
507
515
508
516
$(stylus_test_math_wasm ) : $(stylus_test_math_src )
509
517
$(cargo_nightly ) --manifest-path $< --release --config $(stylus_cargo )
510
- wasm2wat $@ > $@ .wat # removing reference types
511
- wat2wasm $@ .wat -o $@
518
+ ./scripts/remove_reference_types.sh $@
512
519
@touch -c $@ # cargo might decide to not rebuild the binary
513
520
514
521
$(stylus_test_evm-data_wasm ) : $(stylus_test_evm-data_src )
515
522
$(cargo_nightly ) --manifest-path $< --release --config $(stylus_cargo )
516
- wasm2wat $@ > $@ .wat # removing reference types
517
- wat2wasm $@ .wat -o $@
523
+ ./scripts/remove_reference_types.sh $@
518
524
@touch -c $@ # cargo might decide to not rebuild the binary
519
525
520
526
$(stylus_test_read-return-data_wasm ) : $(stylus_test_read-return-data_src )
521
527
$(cargo_nightly ) --manifest-path $< --release --config $(stylus_cargo )
522
- wasm2wat $@ > $@ .wat # removing reference types
523
- wat2wasm $@ .wat -o $@
528
+ ./scripts/remove_reference_types.sh $@
524
529
@touch -c $@ # cargo might decide to not rebuild the binary
525
530
526
531
$(stylus_test_sdk-storage_wasm ) : $(stylus_test_sdk-storage_src )
527
532
$(cargo_nightly ) --manifest-path $< --release --config $(stylus_cargo )
528
- wasm2wat $@ > $@ .wat # removing reference types
529
- wat2wasm $@ .wat -o $@
533
+ ./scripts/remove_reference_types.sh $@
530
534
@touch -c $@ # cargo might decide to not rebuild the binary
531
535
532
536
$(stylus_test_erc20_wasm ) : $(stylus_test_erc20_src )
533
537
$(cargo_nightly ) --manifest-path $< --release --config $(stylus_cargo )
534
- wasm2wat $@ > $@ .wat # removing reference types
535
- wat2wasm $@ .wat -o $@
538
+ ./scripts/remove_reference_types.sh $@
536
539
@touch -c $@ # cargo might decide to not rebuild the binary
537
540
538
541
$(stylus_test_hostio-test_wasm ) : $(stylus_test_hostio-test_src )
539
542
$(cargo_nightly ) --manifest-path $< --release --config $(stylus_cargo )
540
- wasm2wat $@ > $@ .wat # removing reference types
541
- wat2wasm $@ .wat -o $@
543
+ ./scripts/remove_reference_types.sh $@
542
544
@touch -c $@ # cargo might decide to not rebuild the binary
543
545
544
546
$(stylus_test_hostio-test_wasm ) : $(stylus_test_hostio-test_src )
545
547
$(cargo_nightly ) --manifest-path $< --release --config $(stylus_cargo )
548
+ ./scripts/remove_reference_types.sh $@
546
549
@touch -c $@ # cargo might decide to not rebuild the binary
547
550
548
551
contracts/test/prover/proofs/float% .json : $(arbitrator_cases ) /float% .wasm $(prover_bin ) $(output_latest ) /soft-float.wasm
0 commit comments