AtlatestRepositorysigil-crypto
sigil-crypto / tree / test / wasmpackage.sgl
1
;;; sigil-crypto wasm probe: builds the same checks for the host and for2
;;; wasm32-wasi so test/wasm/run-wasm-test.mjs can compare them. Not3
;;; published; it exists to prove the narrow wasm build (Ed25519, BLAKE2b,4
;;; minisign) works and that the Mbed TLS procedures fail clearly there.5
;;;6
;;; cd test/wasm && sigil deps install7
;;; node run-wasm-test.mjs (builds both configs, runs, compares)8
(package9
name: "sigil-crypto-wasm-probe"10
version: "0.1.0"11
sigil: "0.22"12
description: "wasm and host differential probe for sigil-crypto"13
license: "BSD-3-Clause"14
entry: '(crypto-probe main)16
configs: (list17
;; Host build: the reference output.18
(config19
name: 'host20
output-dir: "build/host"21
debug?: #f22
optimize: 223
bundle?: #t)24
;; Static musl build: the release-binary shape.25
(config26
name: 'static27
output-dir: "build/static"28
toolchain: 'zig29
target: "x86_64-linux-musl"30
static?: #t31
debug?: #f32
optimize: 233
bundle?: #t)34
;; Browser-shaped build: wasm32-wasi through zig with native codegen,35
;; the shape Crash The Stack ships. The eval ABI is force-exported so36
;; the Node harness can call the gated procedures by name.37
(config38
name: 'web39
output-dir: "build/web"40
toolchain: 'zig41
target: "wasm32-wasi"42
backend: 'native43
debug?: #f44
optimize: 245
c-flags: (with-sigil-c-flags '("-std=c99" "-D_GNU_SOURCE" "-D__SIGIL_WASM__" "-Wall" "-O2"))46
link-flags: '("-Wl,--export=sigil_wasm_init"47
"-Wl,--export=sigil_wasm_start"48
"-Wl,--export=sigil_wasm_eval_string_length"49
"-Wl,--export=sigil_wasm_last_result_length"50
"-Wl,--export=sigil_wasm_copy_result"51
"-Wl,--export=malloc"52
"-Wl,--export=free"53
"-lc")54
features: '(web wasm)))56
dependencies: (list57
(from-path dir: "../.." package: "sigil-crypto")58
(from-git url: "codeberg:sigil/sigil" package: "sigil-lib" version: ">=0.22")59
(from-git url: "codeberg:sigil/sigil" package: "sigil-stdlib" version: ">=0.22")60
(from-git url: "codeberg:sigil/sigil" package: "sigil-wasm-runtime" version: ">=0.22"))62
tasks: (list63
(task64
name: 'build65
configs: '(web)66
description: "Build the wasm probe"67
steps: (list68
(compile-sigil-modules sources: "src/**/*.sgl")69
(link-web-application name: "sigil-crypto-wasm-probe")))))