Skip to content

Commit 1b99258

Browse files
committed
tooling: add just, some scripts, .envrc, small setup cleanups
1 parent f4b1a26 commit 1b99258

File tree

7 files changed

+43
-5
lines changed

7 files changed

+43
-5
lines changed

.envrc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# shellcheck shell=bash
2+
if ! has nix_direnv_version || ! nix_direnv_version 3.0.4; then
3+
source_url "https://raw.githubusercontent.com/nix-community/nix-direnv/3.0.4/direnvrc" "sha256-DzlYZ33mWF/Gs8DDeyjr8mnVmQGx7ASYqA5WlxwvBG4="
4+
fi
5+
6+
dotenv_if_exists
7+
8+
# watch_file "$(find ./nix -name "*.nix" -type f)"
9+
10+
OS_AND_SYSTEM=$(uname -a)
11+
12+
if [[ "${NO_NIX:-}" == "1" || $OS_AND_SYSTEM == "Darwin"* ]]; then
13+
source non-nix-build/env.sh
14+
else
15+
use flake
16+
fi

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,6 @@ spec/target
88
**/fuzz/artifacts/
99
**/fuzz/crash-inputs/
1010
**/fuzz/Cargo.lock
11+
12+
*.wasm
13+
.direnv/

Cargo.lock

Lines changed: 0 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ members = [
1010
"crates/ir",
1111
"crates/fuzz",
1212
"crates/wast",
13-
"fuzz", "wasm-test", "crates/tracer",
13+
"fuzz", "crates/tracer",
14+
# "wasm-test",
1415
]
1516
exclude = []
1617
resolver = "2"

justfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
build-wasm-test-c:
2+
emcc -O0 -g3 -o wasm_test.wasm wasm_test.c
3+
4+
dwarfdump wasm-path:
5+
# from llvm
6+
llvm-dwarfdump {{wasm-path}}
7+
8+
dis wasm-path:
9+
# from binaryen
10+
wasm-dis {{wasm-path}}

shell.nix

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,15 @@ mkShell {
2626
emscripten
2727
binaryen
2828
llvm
29+
just
2930
rust-analyzer
31+
32+
figlet
3033
];
3134

35+
shellHook = ''
36+
export EM_CACHE=/tmp/emcc/
37+
38+
figlet "welcome to wasmi recorder"
39+
'';
3240
}

wasm_test.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
int main() {
2+
int x = 1;
3+
int y = 2;
4+
}

0 commit comments

Comments
 (0)