Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: build & run primer-benchmark for Wasm32 targets #1190

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ wasm32 = wasm32-build wasm32-build-opt wasm32-configure wasm32-check wasm32-test
$(wasm32):
$(MAKE) -C primer $@
$(MAKE) -C primer-api $@
$(MAKE) -C primer-benchmark $@

weeder:
cabal build all --enable-benchmarks --enable-tests
Expand Down
35 changes: 30 additions & 5 deletions primer-benchmark/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,51 @@
# Most commands assume you're running this from the top-level `nix
# develop` shell.

# Note: no libs or exes to build in this project.
wasm32-primer-benchmark-test = $(shell wasm32-wasi-cabal list-bin -v0 test:primer-benchmark-test)
wasm32-primer-benchmark-test-opt = $(shell wasm32-wasi-cabal list-bin -O2 -v0 test:primer-benchmark-test)

build:
cabal build

wasm32-build:
wasm32-wasi-cabal build

wasm32-build-opt:
wasm32-wasi-cabal build -O2

configure:
cabal configure

wasm32-configure:
wasm32-wasi-cabal configure

check: test

# Note: no tests to run in this project.
wasm32-check: wasm32-test

test:
cabal test

wasm32-test:
wasm32-wasi-cabal build test:primer-benchmark-test
wasmtime --dir test::test "$(wasm32-primer-benchmark-test)"

wasm32-test-opt:
wasm32-wasi-cabal build -O2 test:primer-benchmark-test
wasmtime --dir test::test "$(wasm32-primer-benchmark-test-opt)"

bench:
cabal bench

wasm32-bench: wasm32-build-opt
wasmtime "$(wasm32-primer-benchmark-test-opt)"

docs:
cabal haddock

clean:
cabal clean

bench:
cabal bench

realclean:

deps:
Expand Down