Implement typed plan evidence gates
ober
1e43b3df0ee88fb5b112ebaf6b90fde61d27f42c
--- a/.jerboa-system +++ b/.jerboa-system @@ -61,7 +61,7 @@ (execute ".chez/bin/scheme" "cc" "cargo" "make" "tar" "ln" "rm" "mkdir" "find" "shasum" "sha256sum")) (network - (connect none) + (connect declared) (listen none)) (process (spawn ("scheme" "cc" "cargo" "make" "tar" "ln" "rm" "mkdir" "find" --- a/Makefile +++ b/Makefile @@ -62,21 +62,238 @@ JERBOA_EXT_LDPATH = $(JERBOA_EXT_DIR)/jerboa-ssl:$(JERBOA_EXT_DIR)/chez-zlib:$(J PURE_AUDIT_ROOT ?= $(HOME)/mine PURE_AUDIT_ARGS ?= --summary --discover $(PURE_AUDIT_ROOT) TYPED_SOURCES ?= tests/fixtures/typed/valid-split-tree.ss -TYPED_RUST_SOURCES ?= $(TYPED_SOURCES) +TYPED_RUST_SOURCES ?= $(TYPED_SOURCES) tests/fixtures/typed/rust-lambda.ss tests/fixtures/typed/rust-hashmap.ss tests/fixtures/typed/rust-list.ss tests/fixtures/typed/rust-map.ss tests/fixtures/typed/rust-set.ss tests/fixtures/typed/rust-mutable-list.ss tests/fixtures/typed/rust-pair.ss tests/fixtures/typed/rust-nullable.ss tests/fixtures/typed/rust-string-ops.ss tests/fixtures/typed/rust-jvm-helpers.ss tests/fixtures/typed/rust-jvm-arrays.ss tests/fixtures/typed/rust-jvm-json.ss tests/fixtures/typed/rust-try-throw.ss tests/fixtures/typed/rust-direct-throw.ss tests/fixtures/typed/llvmir-function-ref.ss tests/fixtures/typed/llvmir-function-library.ss TYPED_RUST_DIR ?= build/typed/rust -TYPED_LLVMIR_SOURCES ?= tests/fixtures/typed/llvmir-basic.ss tests/fixtures/typed/llvmir-if.ss tests/fixtures/typed/llvmir-call.ss tests/fixtures/typed/llvmir-float.ss tests/fixtures/typed/llvmir-bitwise.ss tests/fixtures/typed/llvmir-for-fold.ss tests/fixtures/typed/llvmir-bytes.ss tests/fixtures/typed/llvmir-record.ss tests/fixtures/typed/llvmir-option.ss tests/fixtures/typed/llvmir-variant.ss tests/fixtures/typed/llvmir-smoke.ss +TYPED_RUST_METADATA_DIR ?= build/typed/rust-crate-metadata-smoke +TYPED_RUST_HASHMAP_SMOKE_DIR ?= build/typed/rust-hashmap-smoke +TYPED_RUST_HASHMAP_SMOKE_SOURCE ?= tests/fixtures/typed/rust-hashmap.ss +TYPED_RUST_LIST_SMOKE_DIR ?= build/typed/rust-list-smoke +TYPED_RUST_LIST_SMOKE_SOURCE ?= tests/fixtures/typed/rust-list.ss +TYPED_RUST_MAP_SMOKE_DIR ?= build/typed/rust-map-smoke +TYPED_RUST_MAP_SMOKE_SOURCE ?= tests/fixtures/typed/rust-map.ss +TYPED_RUST_SET_SMOKE_DIR ?= build/typed/rust-set-smoke +TYPED_RUST_SET_SMOKE_SOURCE ?= tests/fixtures/typed/rust-set.ss +TYPED_RUST_MUTABLE_LIST_SMOKE_DIR ?= build/typed/rust-mutable-list-smoke +TYPED_RUST_MUTABLE_LIST_SMOKE_SOURCE ?= tests/fixtures/typed/rust-mutable-list.ss +TYPED_RUST_PAIR_SMOKE_DIR ?= build/typed/rust-pair-smoke +TYPED_RUST_PAIR_SMOKE_SOURCE ?= tests/fixtures/typed/rust-pair.ss +TYPED_RUST_NULLABLE_SMOKE_DIR ?= build/typed/rust-nullable-smoke +TYPED_RUST_NULLABLE_SMOKE_SOURCE ?= tests/fixtures/typed/rust-nullable.ss +TYPED_RUST_STRING_OPS_SMOKE_DIR ?= build/typed/rust-string-ops-smoke +TYPED_RUST_STRING_OPS_SMOKE_SOURCE ?= tests/fixtures/typed/rust-string-ops.ss +TYPED_RUST_JVM_HELPERS_SMOKE_DIR ?= build/typed/rust-jvm-helpers-smoke +TYPED_RUST_JVM_HELPERS_SMOKE_SOURCE ?= tests/fixtures/typed/rust-jvm-helpers.ss +TYPED_RUST_JVM_ARRAYS_SMOKE_DIR ?= build/typed/rust-jvm-arrays-smoke +TYPED_RUST_JVM_ARRAYS_SMOKE_SOURCE ?= tests/fixtures/typed/rust-jvm-arrays.ss +TYPED_RUST_JVM_JSON_SMOKE_DIR ?= build/typed/rust-jvm-json-smoke +TYPED_RUST_JVM_JSON_SMOKE_SOURCE ?= tests/fixtures/typed/rust-jvm-json.ss +TYPED_RUST_TRY_THROW_SMOKE_DIR ?= build/typed/rust-try-throw-smoke +TYPED_RUST_TRY_THROW_SMOKE_SOURCE ?= tests/fixtures/typed/rust-try-throw.ss +TYPED_RUST_DIRECT_THROW_SMOKE_DIR ?= build/typed/rust-direct-throw-smoke +TYPED_RUST_DIRECT_THROW_SMOKE_SOURCE ?= tests/fixtures/typed/rust-direct-throw.ss +TYPED_RUST_FOCUSED_SMOKE_SUITE_EXPECTED_TARGETS ?= 16 +TYPED_RUST_FOCUSED_SMOKE_SUITE_TARGETS ?= \ + typed-rust-crate-metadata-smoke \ + typed-rust-hashmap-smoke \ + typed-rust-list-smoke \ + typed-rust-map-smoke \ + typed-rust-set-smoke \ + typed-rust-mutable-list-smoke \ + typed-rust-pair-smoke \ + typed-rust-nullable-smoke \ + typed-rust-string-ops-smoke \ + typed-rust-jvm-helpers-smoke \ + typed-rust-jvm-arrays-smoke \ + typed-rust-jvm-json-smoke \ + typed-rust-try-throw-smoke \ + typed-rust-direct-throw-smoke \ + typed-wrapper-smoke \ + typed-split-tree-smoke +TYPED_JSON_VALUE_SMOKE_DIR ?= build/typed/json-value-smoke +TYPED_JSON_VALUE_SOURCES ?= lib/std/text/json-typed-value.ss tests/fixtures/typed/rust-json-value.ss +TYPED_JSON_VALUE_DIFF_DIR ?= build/typed/json-value-diff +TYPED_JSON_VALUE_DIFF_SEED ?= 20260728 +TYPED_JSON_VALUE_DIFF_ALT_SEED ?= 7 +TYPED_JSON_VALUE_DIFF_REPRO_DIR ?= build/typed/json-value-diff-repro +TYPED_JSON_VALUE_DIFF_FUZZ_CASES ?= 256 +TYPED_JSON_VALUE_BENCH_DIR ?= build/typed/json-value-bench +TYPED_JSON_VALUE_BENCH_ITERS ?= 20000 +TYPED_JSON_VALUE_BENCH_SAMPLES ?= 5 +TYPED_JSON_VALUE_BENCH_MAX_RATIO ?= 1.5 +TYPED_JSON_VALUE_PUBLIC_SMOKE_DIR ?= build/typed/json-value-public-smoke +TYPED_BENCH_DIR ?= build/typed/rust-bench +TYPED_BENCH_SOURCES ?= tests/fixtures/typed/llvmir-function-library.ss +TYPED_BENCH_FN ?= sample_typed_llvmir_function_library::main +TYPED_BENCH_EXPECT ?= 42 +TYPED_BENCH_ITERS ?= 100000 +TYPED_BENCH_SAMPLES ?= 7 +TYPED_BENCH_MAX_CLONE_CALLS ?= 0 +TYPED_LLVMIR_SOURCES ?= tests/fixtures/typed/llvmir-basic.ss tests/fixtures/typed/llvmir-if.ss tests/fixtures/typed/llvmir-call.ss tests/fixtures/typed/llvmir-float.ss tests/fixtures/typed/llvmir-float-parity.ss tests/fixtures/typed/llvmir-bitwise.ss tests/fixtures/typed/llvmir-for-fold.ss tests/fixtures/typed/llvmir-for.ss tests/fixtures/typed/llvmir-bytes.ss tests/fixtures/typed/llvmir-bloom.ss tests/fixtures/typed/llvmir-lambda.ss tests/fixtures/typed/llvmir-capture.ss tests/fixtures/typed/llvmir-function-ref.ss tests/fixtures/typed/llvmir-function-library.ss tests/fixtures/typed/llvmir-try-throw.ss tests/fixtures/typed/llvmir-list.ss tests/fixtures/typed/llvmir-mutable-list.ss tests/fixtures/typed/llvmir-set.ss tests/fixtures/typed/llvmir-map.ss tests/fixtures/typed/llvmir-jvm-arrays.ss tests/fixtures/typed/llvmir-pair.ss tests/fixtures/typed/llvmir-nullable.ss tests/fixtures/typed/llvmir-hashmap-empty.ss tests/fixtures/typed/llvmir-hashmap-single.ss tests/fixtures/typed/llvmir-hashmap-fold.ss tests/fixtures/typed/llvmir-hashmap-multi.ss lib/std/net/uri/typed-core.ss lib/std/text/json-typed-scan.ss tests/fixtures/typed/llvmir-record.ss tests/fixtures/typed/llvmir-option.ss tests/fixtures/typed/llvmir-variant.ss tests/fixtures/typed/llvmir-variant-local-free.ss tests/fixtures/typed/llvmir-smoke.ss TYPED_LLVMIR_DIR ?= build/typed/llvmir -TYPED_LLVMIR_SMOKE_MODULE ?= sample_typed_llvmir_smoke +TYPED_LLVMIR_SMOKE_MODULE ?= sample_typed_llvmir_bloom TYPED_LLVMIR_SMOKE_EXPECT ?= 42 TYPED_LLVMIR_PARITY_DIR ?= build/typed/llvmir-parity -TYPED_LLVMIR_PARITY_SOURCE ?= tests/fixtures/typed/llvmir-smoke.ss -TYPED_LLVMIR_PARITY_FN ?= sample_typed_llvmir_smoke::main +TYPED_LLVMIR_PARITY_SOURCE ?= tests/fixtures/typed/llvmir-bloom.ss +TYPED_LLVMIR_PARITY_FN ?= sample_typed_llvmir_bloom::main +TYPED_LLVMIR_TRY_THROW_PARITY_DIR ?= build/typed/llvmir-try-throw-parity +TYPED_LLVMIR_TRY_THROW_PARITY_SOURCE ?= tests/fixtures/typed/llvmir-try-throw.ss +TYPED_LLVMIR_TRY_THROW_PARITY_FN ?= sample_typed_llvmir_try_throw::main +TYPED_LLVMIR_BYTES_PARITY_DIR ?= build/typed/llvmir-bytes-parity +TYPED_LLVMIR_BYTES_PARITY_SOURCE ?= tests/fixtures/typed/llvmir-bytes.ss +TYPED_LLVMIR_BYTES_PARITY_FN ?= sample_typed_llvmir_bytes::main +TYPED_LLVMIR_FOR_PARITY_DIR ?= build/typed/llvmir-for-parity +TYPED_LLVMIR_FOR_PARITY_SOURCE ?= tests/fixtures/typed/llvmir-for.ss +TYPED_LLVMIR_FOR_PARITY_FN ?= sample_typed_llvmir_for::main +TYPED_LLVMIR_LIST_PARITY_DIR ?= build/typed/llvmir-list-parity +TYPED_LLVMIR_LIST_PARITY_SOURCE ?= tests/fixtures/typed/llvmir-list.ss +TYPED_LLVMIR_LIST_PARITY_FN ?= sample_typed_llvmir_list::main +TYPED_LLVMIR_MUTABLE_LIST_PARITY_DIR ?= build/typed/llvmir-mutable-list-parity +TYPED_LLVMIR_MUTABLE_LIST_PARITY_SOURCE ?= tests/fixtures/typed/llvmir-mutable-list.ss +TYPED_LLVMIR_MUTABLE_LIST_PARITY_FN ?= sample_typed_llvmir_mutable_list::main +TYPED_LLVMIR_SET_PARITY_DIR ?= build/typed/llvmir-set-parity +TYPED_LLVMIR_SET_PARITY_SOURCE ?= tests/fixtures/typed/llvmir-set.ss +TYPED_LLVMIR_SET_PARITY_FN ?= sample_typed_llvmir_set::main +TYPED_LLVMIR_MAP_PARITY_DIR ?= build/typed/llvmir-map-parity +TYPED_LLVMIR_MAP_PARITY_SOURCE ?= tests/fixtures/typed/llvmir-map.ss +TYPED_LLVMIR_MAP_PARITY_FN ?= sample_typed_llvmir_map::main +TYPED_LLVMIR_JVM_ARRAYS_PARITY_DIR ?= build/typed/llvmir-jvm-arrays-parity +TYPED_LLVMIR_JVM_ARRAYS_PARITY_SOURCE ?= tests/fixtures/typed/llvmir-jvm-arrays.ss +TYPED_LLVMIR_JVM_ARRAYS_PARITY_FN ?= sample_typed_llvmir_jvm_arrays::main +TYPED_LLVMIR_PAIR_PARITY_DIR ?= build/typed/llvmir-pair-parity +TYPED_LLVMIR_PAIR_PARITY_SOURCE ?= tests/fixtures/typed/llvmir-pair.ss +TYPED_LLVMIR_PAIR_PARITY_FN ?= sample_typed_llvmir_pair::main +TYPED_LLVMIR_NULLABLE_PARITY_DIR ?= build/typed/llvmir-nullable-parity +TYPED_LLVMIR_NULLABLE_PARITY_SOURCE ?= tests/fixtures/typed/llvmir-nullable.ss +TYPED_LLVMIR_NULLABLE_PARITY_FN ?= sample_typed_llvmir_nullable::main +TYPED_LLVMIR_HASHMAP_EMPTY_PARITY_DIR ?= build/typed/llvmir-hashmap-empty-parity +TYPED_LLVMIR_HASHMAP_EMPTY_PARITY_SOURCE ?= tests/fixtures/typed/llvmir-hashmap-empty.ss +TYPED_LLVMIR_HASHMAP_EMPTY_PARITY_FN ?= sample_typed_llvmir_hashmap_empty::main +TYPED_LLVMIR_HASHMAP_SINGLE_PARITY_DIR ?= build/typed/llvmir-hashmap-single-parity +TYPED_LLVMIR_HASHMAP_SINGLE_PARITY_SOURCE ?= tests/fixtures/typed/llvmir-hashmap-single.ss +TYPED_LLVMIR_HASHMAP_SINGLE_PARITY_FN ?= sample_typed_llvmir_hashmap_single::main +TYPED_LLVMIR_HASHMAP_FOLD_PARITY_DIR ?= build/typed/llvmir-hashmap-fold-parity +TYPED_LLVMIR_HASHMAP_FOLD_PARITY_SOURCE ?= tests/fixtures/typed/llvmir-hashmap-fold.ss +TYPED_LLVMIR_HASHMAP_FOLD_PARITY_FN ?= sample_typed_llvmir_hashmap_fold::main +TYPED_LLVMIR_HASHMAP_MULTI_PARITY_DIR ?= build/typed/llvmir-hashmap-multi-parity +TYPED_LLVMIR_HASHMAP_MULTI_PARITY_SOURCE ?= tests/fixtures/typed/llvmir-hashmap-multi.ss +TYPED_LLVMIR_HASHMAP_MULTI_PARITY_FN ?= sample_typed_llvmir_hashmap_multi::main +TYPED_LLVMIR_FOCUSED_PARITY_SUITE_EXPECTED_TARGETS ?= 14 +TYPED_LLVMIR_FOCUSED_PARITY_SUITE_TARGETS ?= \ + typed-llvmir-try-throw-parity \ + typed-llvmir-bytes-parity \ + typed-llvmir-for-parity \ + typed-llvmir-list-parity \ + typed-llvmir-mutable-list-parity \ + typed-llvmir-set-parity \ + typed-llvmir-map-parity \ + typed-llvmir-jvm-arrays-parity \ + typed-llvmir-pair-parity \ + typed-llvmir-nullable-parity \ + typed-llvmir-hashmap-empty-parity \ + typed-llvmir-hashmap-single-parity \ + typed-llvmir-hashmap-fold-parity \ + typed-llvmir-hashmap-multi-parity +TYPED_LLVMIR_REGEX_PARITY_DIR ?= build/typed/llvmir-regex-parity +TYPED_LLVMIR_REGEX_PARITY_SOURCE ?= tests/fixtures/typed/llvmir-regex.ss +TYPED_LLVMIR_REGEX_PARITY_FN ?= sample_typed_llvmir_regex::main +TYPED_LLVMIR_UNICODE_STRING_PARITY_DIR ?= build/typed/llvmir-unicode-string-parity +TYPED_LLVMIR_UNICODE_STRING_PARITY_SOURCE ?= tests/fixtures/typed/llvmir-unicode-strings.ss +TYPED_LLVMIR_UNICODE_STRING_PARITY_FN ?= sample_typed_llvmir_unicode_strings::main +TYPED_LLVMIR_FLAGS ?= +TYPED_URI_PILOT_SOURCES ?= lib/std/net/uri/typed-core.ss tests/fixtures/typed/llvmir-uri-scan.ss +TYPED_URI_PILOT_SOURCE ?= $(TYPED_URI_PILOT_SOURCES) +TYPED_URI_PILOT_FN ?= sample_typed_llvmir_uri_scan::main +TYPED_URI_DIFF_DIR ?= build/typed/uri-diff +TYPED_URI_DIFF_SEED ?= 424242 +TYPED_URI_DIFF_ALT_SEED ?= 7 +TYPED_URI_DIFF_REPRO_DIR ?= build/typed/uri-diff-repro +TYPED_URI_BENCH_DIR ?= build/typed/uri-bench +TYPED_URI_BENCH_ITERS ?= 20000 +TYPED_URI_BENCH_SAMPLES ?= 5 +TYPED_URI_BENCH_MAX_RATIO ?= 1.5 +TYPED_JSON_SCAN_SOURCES ?= lib/std/text/json-typed-scan.ss +TYPED_JSON_SCAN_DIFF_DIR ?= build/typed/json-scan-diff +TYPED_JSON_SCAN_DIFF_SEED ?= 20260728 +TYPED_JSON_SCAN_DIFF_FUZZ_CASES ?= 256 +TYPED_JSON_SCAN_BENCH_DIR ?= build/typed/json-scan-bench +TYPED_JSON_SCAN_BENCH_ITERS ?= 50000 +TYPED_JSON_SCAN_BENCH_SAMPLES ?= 5 +TYPED_JSON_SCAN_BENCH_MAX_RATIO ?= 1.5 +TYPED_LLVMIR_WHOLE_PROGRAM ?= $(TYPED_LLVMIR_DIR)/whole-program.ll +TYPED_LLVMIR_LEAK_CHECK ?= 0 +TYPED_LLVMIR_SMOKE_LDFLAGS ?= +TYPED_LLVMIR_LEAK_SOURCES ?= $(TYPED_LLVMIR_PARITY_SOURCE) +TYPED_LLVMIR_LEAK_FN ?= jt_llvm_sample_typed_llvmir_bloom__main +TYPED_LLVMIR_LEAK_EXPECT ?= $(TYPED_LLVMIR_SMOKE_EXPECT) +TYPED_LLVMIR_LEAK_STRICT ?= 1 +TYPED_LLVMIR_LEAK_SUITE_EXPECTED_CASES ?= 23 +TYPED_LLVMIR_WASM_DIR ?= build/typed/llvmir-wasm +TYPED_LLVMIR_WASM_SOURCE ?= $(TYPED_LLVMIR_PARITY_SOURCE) +TYPED_LLVMIR_WASM_RUN_SOURCE ?= tests/fixtures/typed/llvmir-basic.ss +TYPED_LLVMIR_WASM_RUN_EXPORT ?= jt_llvm_sample_typed_llvmir_basic__answer +TYPED_LLVMIR_WASM_RUN_RUST_FN ?= sample_typed_llvmir_basic::answer +TYPED_LLVMIR_WASM_RUN_EXPECT ?= 42 +TYPED_LLVMIR_WASM_BROWSER_ENGINE ?= chromium +TYPED_LLVMIR_WASM_BROWSER_ENGINES ?= $(TYPED_LLVMIR_WASM_BROWSER_ENGINE) +TYPED_LLVMIR_WASM_BROWSER_RELEASE_ENGINES ?= chromium firefox webkit +TYPED_LLVMIR_WASM_SUITE_EXPECTED_CASES ?= 23 +TYPED_LLVMIR_WASM_SUITE_EXPECTED_BROWSER_ENGINES ?= $(words $(TYPED_LLVMIR_WASM_BROWSER_ENGINES)) +TYPED_LLVMIR_WASM_RUNTIME_LL ?= support/typed-llvmir-wasm-runtime.ll +TYPED_LLVMIR_WASM_SUITE_CASES ?= \ + tests/fixtures/typed/llvmir-basic.ss@jt_llvm_sample_typed_llvmir_basic__answer@sample_typed_llvmir_basic::answer@42 \ + tests/fixtures/typed/llvmir-bloom.ss@jt_llvm_sample_typed_llvmir_bloom__main@sample_typed_llvmir_bloom::main@42 \ + tests/fixtures/typed/llvmir-bytes.ss@jt_llvm_sample_typed_llvmir_bytes__main@sample_typed_llvmir_bytes::main@42 \ + tests/fixtures/typed/llvmir-capture.ss@jt_llvm_sample_typed_llvmir_capture__main@sample_typed_llvmir_capture::main@42 \ + tests/fixtures/typed/llvmir-float-parity.ss@jt_llvm_sample_typed_llvmir_float_parity__main@sample_typed_llvmir_float_parity::main@42 \ + tests/fixtures/typed/llvmir-function-library.ss@jt_llvm_sample_typed_llvmir_function_library__main@sample_typed_llvmir_function_library::main@42 \ + tests/fixtures/typed/llvmir-function-ref.ss@jt_llvm_sample_typed_llvmir_function_ref__main@sample_typed_llvmir_function_ref::main@42 \ + tests/fixtures/typed/llvmir-hashmap-empty.ss@jt_llvm_sample_typed_llvmir_hashmap_empty__main@sample_typed_llvmir_hashmap_empty::main@42 \ + tests/fixtures/typed/llvmir-hashmap-single.ss@jt_llvm_sample_typed_llvmir_hashmap_single__main@sample_typed_llvmir_hashmap_single::main@42 \ + tests/fixtures/typed/llvmir-hashmap-fold.ss@jt_llvm_sample_typed_llvmir_hashmap_fold__main@sample_typed_llvmir_hashmap_fold::main@42 \ + tests/fixtures/typed/llvmir-hashmap-multi.ss@jt_llvm_sample_typed_llvmir_hashmap_multi__main@sample_typed_llvmir_hashmap_multi::main@42 \ + tests/fixtures/typed/llvmir-list.ss@jt_llvm_sample_typed_llvmir_list__main@sample_typed_llvmir_list::main@42 \ + tests/fixtures/typed/llvmir-mutable-list.ss@jt_llvm_sample_typed_llvmir_mutable_list__main@sample_typed_llvmir_mutable_list::main@42 \ + tests/fixtures/typed/llvmir-set.ss@jt_llvm_sample_typed_llvmir_set__main@sample_typed_llvmir_set::main@42 \ + tests/fixtures/typed/llvmir-map.ss@jt_llvm_sample_typed_llvmir_map__main@sample_typed_llvmir_map::main@42 \ + tests/fixtures/typed/llvmir-jvm-arrays.ss@jt_llvm_sample_typed_llvmir_jvm_arrays__main@sample_typed_llvmir_jvm_arrays::main@42 \ + tests/fixtures/typed/llvmir-pair.ss@jt_llvm_sample_typed_llvmir_pair__main@sample_typed_llvmir_pair::main@42 \ + tests/fixtures/typed/llvmir-nullable.ss@jt_llvm_sample_typed_llvmir_nullable__main@sample_typed_llvmir_nullable::main@42 \ + tests/fixtures/typed/llvmir-lambda.ss@jt_llvm_sample_typed_llvmir_lambda__main@sample_typed_llvmir_lambda::main@42 \ + lib/std/net/uri/typed-core.ss,tests/fixtures/typed/llvmir-uri-scan.ss@jt_llvm_sample_typed_llvmir_uri_scan__main@sample_typed_llvmir_uri_scan::main@42 \ + lib/std/text/json-typed-scan.ss,tests/fixtures/typed/llvmir-json-scan.ss@jt_llvm_sample_typed_llvmir_json_scan__main@sample_typed_llvmir_json_scan::main@42 \ + tests/fixtures/typed/llvmir-regex.ss@jt_llvm_sample_typed_llvmir_regex__main@sample_typed_llvmir_regex::main@42 \ + tests/fixtures/typed/llvmir-variant-local-free.ss@jt_llvm_sample_typed_llvmir_variant_local_free__main@sample_typed_llvmir_variant_local_free::main@42 +TYPED_LLVMIR_LEAK_SUITE_CASES ?= \ + tests/fixtures/typed/llvmir-basic.ss:jt_llvm_sample_typed_llvmir_basic__answer:42 \ + tests/fixtures/typed/llvmir-bloom.ss:jt_llvm_sample_typed_llvmir_bloom__main:42 \ + tests/fixtures/typed/llvmir-bytes.ss:jt_llvm_sample_typed_llvmir_bytes__main:42 \ + tests/fixtures/typed/llvmir-capture.ss:jt_llvm_sample_typed_llvmir_capture__main:42 \ + tests/fixtures/typed/llvmir-float-parity.ss:jt_llvm_sample_typed_llvmir_float_parity__main:42 \ + tests/fixtures/typed/llvmir-function-library.ss:jt_llvm_sample_typed_llvmir_function_library__main:42 \ + tests/fixtures/typed/llvmir-function-ref.ss:jt_llvm_sample_typed_llvmir_function_ref__main:42 \ + tests/fixtures/typed/llvmir-hashmap-empty.ss:jt_llvm_sample_typed_llvmir_hashmap_empty__main:42 \ + tests/fixtures/typed/llvmir-hashmap-single.ss:jt_llvm_sample_typed_llvmir_hashmap_single__main:42 \ + tests/fixtures/typed/llvmir-hashmap-fold.ss:jt_llvm_sample_typed_llvmir_hashmap_fold__main:42 \ + tests/fixtures/typed/llvmir-hashmap-multi.ss:jt_llvm_sample_typed_llvmir_hashmap_multi__main:42 \ + tests/fixtures/typed/llvmir-list.ss:jt_llvm_sample_typed_llvmir_list__main:42 \ + tests/fixtures/typed/llvmir-mutable-list.ss:jt_llvm_sample_typed_llvmir_mutable_list__main:42 \ + tests/fixtures/typed/llvmir-set.ss:jt_llvm_sample_typed_llvmir_set__main:42 \ + tests/fixtures/typed/llvmir-map.ss:jt_llvm_sample_typed_llvmir_map__main:42 \ + tests/fixtures/typed/llvmir-jvm-arrays.ss:jt_llvm_sample_typed_llvmir_jvm_arrays__main:42 \ + tests/fixtures/typed/llvmir-pair.ss:jt_llvm_sample_typed_llvmir_pair__main:42 \ + tests/fixtures/typed/llvmir-nullable.ss:jt_llvm_sample_typed_llvmir_nullable__main:42 \ + tests/fixtures/typed/llvmir-lambda.ss:jt_llvm_sample_typed_llvmir_lambda__main:42 \ + lib/std/net/uri/typed-core.ss,tests/fixtures/typed/llvmir-uri-scan.ss:jt_llvm_sample_typed_llvmir_uri_scan__main:42 \ + lib/std/text/json-typed-scan.ss,tests/fixtures/typed/llvmir-json-scan.ss:jt_llvm_sample_typed_llvmir_json_scan__main:42 \ + tests/fixtures/typed/llvmir-smoke.ss:jt_llvm_sample_typed_llvmir_smoke__main:42 \ + tests/fixtures/typed/llvmir-variant-local-free.ss:jt_llvm_sample_typed_llvmir_variant_local_free__main:42 # LLVM tool discovery for the typed LLVM IR backend: PATH first, then the # Homebrew LLVM keg (Apple Silicon, then Intel). Empty when no LLVM exists. LLVM_BIN ?= $(shell if command -v llvm-as >/dev/null 2>&1; then dirname "$$(command -v llvm-as)"; elif [ -x /opt/homebrew/opt/llvm/bin/llvm-as ]; then echo /opt/homebrew/opt/llvm/bin; elif [ -x /usr/local/opt/llvm/bin/llvm-as ]; then echo /usr/local/opt/llvm/bin; fi) TYPED_WRAPPER_DIR ?= build/typed/jerboa +.PHONY: typed-llvmir-focused-parity-suite typed-llvmir-bytes-parity typed-llvmir-for-parity typed-llvmir-list-parity typed-llvmir-map-parity typed-llvmir-pair-parity typed-llvmir-nullable-parity typed-llvmir-hashmap-empty-parity typed-llvmir-hashmap-single-parity typed-llvmir-hashmap-fold-parity typed-llvmir-hashmap-multi-parity typed-llvmir-regex-parity typed-llvmir-unicode-string-parity -.PHONY: help chez static-supported-check chez-cross build binary binary-typed binary-typed-smoke binary-cross native-cross pure-audit typecheck typed-rust typed-llvmir typed-llvmir-check typed-llvmir-smoke typed-llvmir-parity typed-wrappers typed-build typed-wrapper-smoke typed-split-tree-smoke typed-test typed-clean test test-known-flaky test-reader test-core test-runtime test-try-debug test-stdlib test-ffi test-modules test-expanded test-contract test-ergo test-sqlite-robustness test-limits-primitives test-typed-core test-typed-parser test-typed-checker test-typed-rust test-typed-kotlin test-typed-llvmir test-typed-wrappers test-pure-audit test-features test-wrappers test-phase4a test-phase4b test-phase4c test-phase4d test-phase4e test-phase4f test-phase5 test-phase5e test-phase6 test-phase7 test-phase8 test-functional test-repl test-security test-security-profile test-native test-gaps native clean-native audit audit-native jpkg-audit vendor-jsqlite-security-check native-export-review-check tcb-drift-check import-policy-check source-balance restrict-closure-check security-audit clean security security-production security-profile security-hardware-smoke sbom reproducibility-report reproducibility-compare verify release-evidence fuzz fuzz-smoke fuzz-deep fuzz-reader-fuzz fuzz-json-fuzz fuzz-http2-fuzz fuzz-dns-fuzz fuzz-pregexp-fuzz fuzz-csv-fuzz fuzz-base64-fuzz fuzz-hex-fuzz fuzz-uri-fuzz fuzz-format-fuzz fuzz-router-fuzz fuzz-sandbox-fuzz test-rawstring test-regex test-rx test-peg test-regex-all check-docs check-docs-strict data-check docker-build docker-push lint +.PHONY: help chez static-supported-check chez-cross build binary binary-typed binary-typed-smoke binary-typed-uri-smoke binary-typed-json-smoke binary-cross native-cross pure-audit typecheck typed-rust typed-rust-focused-smoke-suite typed-rust-crate-metadata-smoke typed-rust-hashmap-smoke typed-rust-list-smoke typed-rust-map-smoke typed-rust-set-smoke typed-rust-mutable-list-smoke typed-rust-pair-smoke typed-rust-nullable-smoke typed-rust-string-ops-smoke typed-rust-jvm-helpers-smoke typed-rust-jvm-arrays-smoke typed-rust-jvm-json-smoke typed-rust-try-throw-smoke typed-rust-direct-throw-smoke typed-json-value-smoke typed-json-value-corpus-check typed-json-value-diff typed-json-value-diff-repro typed-json-value-bench typed-json-value-public-smoke typed-json-scan-corpus-check typed-bench typed-uri-pilot typed-uri-corpus-check typed-uri-diff typed-uri-diff-repro typed-uri-bench typed-uri-wrapper-smoke typed-uri-public-smoke typed-json-scan-diff typed-json-scan-bench typed-llvmir typed-llvmir-check typed-llvmir-leak-check typed-llvmir-leak-suite typed-llvmir-wasm-object-smoke typed-llvmir-wasm-runtime-smoke typed-llvmir-wasm-browser-smoke typed-llvmir-wasm-suite typed-llvmir-wasm-suite-release wasm-gc-release-gate typed-llvmir-smoke typed-llvmir-parity typed-llvmir-focused-parity-suite typed-llvmir-try-throw-parity typed-llvmir-bytes-parity typed-llvmir-list-parity typed-llvmir-mutable-list-parity typed-llvmir-set-parity typed-llvmir-map-parity typed-llvmir-jvm-arrays-parity typed-llvmir-pair-parity typed-llvmir-nullable-parity typed-llvmir-regex-parity typed-llvmir-unicode-string-parity typed-wrappers typed-build typed-wrapper-smoke typed-split-tree-smoke typed-test typed-clean test test-known-flaky test-reader test-core test-runtime test-try-debug test-stdlib test-ffi test-modules test-expanded test-contract test-ergo test-sqlite-robustness test-limits-primitives test-typed-core test-typed-parser test-typed-checker test-typed-rust test-typed-kotlin test-typed-llvmir test-typed-wrappers test-pure-audit test-features test-wrappers test-phase4a test-phase4b test-phase4c test-phase4d test-phase4e test-phase5 test-phase5e test-phase6 test-phase7 test-phase8 test-functional test-repl test-security test-security-profile test-native test-gaps native clean-native audit audit-native jpkg-audit vendor-jsqlite-security-check native-export-review-check tcb-drift-check import-policy-check source-balance restrict-closure-check security-audit clean security security-production security-profile security-hardware-smoke sbom reproducibility-report reproducibility-compare verify release-evidence fuzz fuzz-smoke fuzz-deep fuzz-reader-fuzz fuzz-json-fuzz fuzz-http2-fuzz fuzz-dns-fuzz fuzz-pregexp-fuzz fuzz-csv-fuzz fuzz-format-fuzz fuzz-uri-fuzz fuzz-base64-fuzz fuzz-hex-fuzz fuzz-router-fuzz fuzz-sandbox-fuzz test-rawstring test-regex test-rx test-peg test-regex-all check-docs check-docs-strict data-check docker-build docker-push lint .PHONY: check-cross-tools docker fuzz-websocket-fuzz jlsp jlsp-freebsd-amd64 \ jlsp-install jlsp-linux-amd64 jlsp-portable jmcp-freebsd-amd64 \ jmcp-freebsd-arm64 jmcp-linux-amd64 jmcp-linux-arm64 \ @@ -121,14 +338,73 @@ help: @echo " Args: CHEZ_TARGET_MACHINE=<mt> CROSS_CC=<cc> [CROSS_NATIVE_FEATURES=tls,...]" @echo " typecheck Typecheck Typed Jerboa sources" @echo " typed-rust Generate Rust crate sources from Typed Jerboa" + @echo " typed-rust-focused-smoke-suite Run dedicated typed Rust smoke targets with a count guard" + @echo " typed-rust-crate-metadata-smoke Verify typed-library Cargo metadata passthrough" + @echo " typed-rust-hashmap-smoke Verify monomorphic typed HashMap Rust lowering" + @echo " typed-rust-list-smoke Verify typed List Rust lowering" + @echo " typed-rust-map-smoke Verify typed Map/MutableMap Rust lowering" + @echo " typed-rust-set-smoke Verify typed Set/MutableSet Rust lowering" + @echo " typed-rust-mutable-list-smoke Verify typed MutableList Rust lowering" + @echo " typed-rust-pair-smoke Verify typed Pair Rust lowering" + @echo " typed-rust-nullable-smoke Verify typed Nullable Rust lowering" + @echo " typed-rust-string-ops-smoke Verify typed string trim/blank Rust lowering" + @echo " typed-rust-jvm-helpers-smoke Verify typed JVM helper Rust lowering" + @echo " typed-rust-jvm-arrays-smoke Verify typed JVM array Rust lowering" + @echo " typed-rust-jvm-json-smoke Verify typed JVM JSON Rust lowering" + @echo " typed-rust-try-throw-smoke Verify typed try/throw Rust lowering" + @echo " typed-rust-direct-throw-smoke Verify direct typed throw Rust panic lowering" + @echo " typed-json-value-smoke Verify HashMap-backed typed JSON object values" + @echo " typed-json-value-corpus-check Check typed JSON value corpus consistency" + @echo " typed-json-value-diff Compare typed JSON value parser against std/text/json" + @echo " typed-json-value-diff-repro Prove typed JSON value diff corpus seed reproducibility" + @echo " typed-json-value-bench Benchmark typed JSON value parser against std/text/json" + @echo " typed-json-value-public-smoke Run std/text/json through the typed native value-parser gate" + @echo " typed-bench Benchmark a generated typed Rust entry point" + @echo " typed-uri-pilot Run the Typed URI byte-scan Rust/LLVM parity pilot" + @echo " typed-uri-corpus-check Check typed URI deterministic corpus consistency" + @echo " typed-uri-diff Compare typed URI core output against std/net/uri" + @echo " typed-uri-diff-repro Prove typed URI diff corpus seed reproducibility" + @echo " typed-uri-bench Benchmark typed URI parser against std/net/uri" + @echo " typed-uri-wrapper-smoke Build and compare typed URI wrappers through FFI" + @echo " typed-uri-public-smoke Run std/net/uri through the typed native parser gate" + @echo " typed-json-scan-corpus-check Check typed JSON scanner corpus consistency" + @echo " typed-json-scan-diff Compare typed JSON structural scanner against std/text/json" + @echo " typed-json-scan-bench Benchmark typed JSON structural scanner against std/text/json" @echo " typed-llvmir Generate textual LLVM IR (.ll) from Typed Jerboa" @echo " typed-llvmir-check Verify generated .ll with llvm-as + opt" + @echo " typed-llvmir-leak-check Check whole-program LLVM allocation leaks" + @echo " typed-llvmir-leak-suite Run LLVM leak checks for all executable fixtures" + @echo " typed-llvmir-focused-parity-suite Run dedicated typed LLVM parity targets with a count guard" + @echo " typed-llvmir-wasm-object-smoke Compile a typed LLVM fixture to wasm32 object" + @echo " typed-llvmir-wasm-runtime-smoke Link/run typed LLVM wasm under wasmi and Node" + @echo " typed-llvmir-wasm-browser-smoke Run typed LLVM wasm in a browser engine" + @echo " typed-llvmir-wasm-suite Run selected typed LLVM wasm fixtures in wasmi, Node, and a browser" + @echo " typed-llvmir-wasm-suite-release Run selected typed LLVM wasm fixtures across Chromium, Firefox, and WebKit" + @echo " wasm-gc-release-gate Run strict Wasm-GC package and browser release gate" @echo " typed-llvmir-smoke Build and run an LLVM-backend smoke executable" @echo " typed-llvmir-parity Compare LLVM and Rust backend observed results" + @echo " typed-llvmir-try-throw-parity Compare typed try/throw on LLVM and Rust" + @echo " typed-llvmir-bytes-parity Compare bytevector helpers on LLVM and Rust" + @echo " typed-llvmir-for-parity Compare in-place byte fill loops on LLVM and Rust" + @echo " typed-llvmir-list-parity Compare List on LLVM and Rust" + @echo " typed-llvmir-mutable-list-parity Compare MutableList on LLVM and Rust" + @echo " typed-llvmir-set-parity Compare Set/MutableSet on LLVM and Rust" + @echo " typed-llvmir-map-parity Compare Map/MutableMap on LLVM and Rust" + @echo " typed-llvmir-jvm-arrays-parity Compare JVM primitive arrays on LLVM and Rust" + @echo " typed-llvmir-pair-parity Compare Pair on LLVM and Rust" + @echo " typed-llvmir-nullable-parity Compare Nullable on LLVM and Rust" + @echo " typed-llvmir-regex-parity Compare native regex String helpers on LLVM and Rust" + @echo " typed-llvmir-unicode-string-parity Compare native Unicode String helpers on LLVM and Rust" + @echo " typed-llvmir-hashmap-empty-parity Compare empty HashMap on LLVM and Rust" + @echo " typed-llvmir-hashmap-single-parity Compare single-entry HashMap on LLVM and Rust" + @echo " typed-llvmir-hashmap-fold-parity Compare HashMap fold on LLVM and Rust" + @echo " typed-llvmir-hashmap-multi-parity Compare multi-entry HashMap on LLVM and Rust" @echo " typed-wrappers Generate Jerboa wrappers for typed Rust exports" @echo " typed-build Generate Rust crate sources/wrappers and run cargo build" @echo " typed-wrapper-smoke Build and call generated typed wrappers through FFI" @echo " typed-split-tree-smoke Build and call the typed split-tree fixture" + @echo " binary-typed-uri-smoke Prove std/net/uri typed parser resolves from a baked binary" + @echo " binary-typed-json-smoke Prove std/text/json typed parser resolves from a baked binary" @echo " typed-test Run Typed Jerboa front-end tests" @echo " typed-clean Remove generated typed build artifacts" @echo " native Build Rust native library" @@ -282,8 +558,32 @@ transpile: # Override entry script with BINARY_ENTRY=path/to/script.ss BINARY_ENTRY ?= support/binary-entry.ss BINARY_OUTPUT ?= jerboa-bin +BINARY_TYPED_URI ?= 1 +BINARY_TYPED_URI_SOURCES ?= lib/std/net/uri/typed-core.ss +BINARY_TYPED_JSON ?= 1 +BINARY_TYPED_JSON_SOURCES ?= lib/std/text/json-typed-value.ss +BINARY_TYPED_RUST_DIR ?= build/typed/binary-rust +BINARY_TYPED_WRAPPER_DIR ?= build/typed/binary-wrappers +BINARY_TYPED_SOURCES := +ifeq ($(BINARY_TYPED_URI),1) +BINARY_TYPED_SOURCES += $(BINARY_TYPED_URI_SOURCES) +endif +ifeq ($(BINARY_TYPED_JSON),1) +BINARY_TYPED_SOURCES += $(BINARY_TYPED_JSON_SOURCES) +endif binary: chez build +ifneq ($(strip $(BINARY_TYPED_SOURCES)),) + @$(MAKE) --no-print-directory typed-build \ + TYPED_RUST_SOURCES="$(BINARY_TYPED_SOURCES)" \ + TYPED_RUST_DIR="$(BINARY_TYPED_RUST_DIR)" \ + TYPED_WRAPPER_DIR="$(BINARY_TYPED_WRAPPER_DIR)" + @archive="$(BINARY_TYPED_RUST_DIR)/target/debug/libjerboa_typed_generated.a"; \ + test -f "$$archive" || { echo "ERROR: typed Rust .a not found at $$archive" >&2; exit 1; }; \ + JERBOA_TYPED_RUST_ARCHIVE="$$archive" \ + SCHEME=$(SCHEME) JERBOA_CHEZ_PREFIX=$(CHEZ_PREFIX) BINARY_STATIC=$(STATIC) support/build-binary.sh $(BINARY_ENTRY) $(BINARY_OUTPUT) +else SCHEME=$(SCHEME) JERBOA_CHEZ_PREFIX=$(CHEZ_PREFIX) BINARY_STATIC=$(STATIC) support/build-binary.sh $(BINARY_ENTRY) $(BINARY_OUTPUT) +endif # ── jerbuild standalone binary ─────────────────────────────────────────────── # Builds a self-contained ./jerbuild that bundles Chez + the Jerboa stdlib @@ -406,15 +706,16 @@ unification-release-check: system-strict generated-policy-check workspace-health # End-to-end smoke test: all four modes from the single binary + its symlinks. jerboa-smoke: jerboa - @D=$(CURDIR)/dist; fail=0; \ + @D=$(CURDIR)/dist; fail=0; smoke_cache="$(CURDIR)/build/jerboa-smoke-cache"; \ + rm -rf "$$smoke_cache"; mkdir -p "$$smoke_cache"; \ echo '(import (jerboa prelude)) (displayln (+ 40 2))' > /tmp/jms.ss; \ - [ "$$($$D/jerboa /tmp/jms.ss)" = "42" ] && echo " jerboa script: PASS" || { echo " jerboa script: FAIL" >&2; fail=1; }; \ - $$D/jlsp --version >/dev/null 2>&1 && echo " jlsp: PASS" || { echo " jlsp: FAIL" >&2; fail=1; }; \ - echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{}}' | $$D/jmcp 2>/dev/null | grep -q '"jerboa-mcp"' && echo " jmcp: PASS" || { echo " jmcp: FAIL" >&2; fail=1; }; \ - $$D/jerbuild --version | grep -q 'sha256=' && echo " jerbuild: PASS" || { echo " jerbuild: FAIL" >&2; fail=1; }; \ - $$D/jerboa jlsp --version >/dev/null 2>&1 && echo " jerboa jlsp: PASS" || { echo " jerboa jlsp: FAIL" >&2; fail=1; }; \ - echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{}}' | $$D/jerboa jmcp 2>/dev/null | grep -q '"jerboa-mcp"' && echo " jerboa jmcp: PASS" || { echo " jerboa jmcp: FAIL" >&2; fail=1; }; \ - $$D/jerboa jerbuild --version | grep -q 'sha256=' && echo " jerboa build: PASS" || { echo " jerboa build: FAIL" >&2; fail=1; }; \ + [ "$$(XDG_CACHE_HOME="$$smoke_cache" $$D/jerboa /tmp/jms.ss)" = "42" ] && echo " jerboa script: PASS" || { echo " jerboa script: FAIL" >&2; fail=1; }; \ + XDG_CACHE_HOME="$$smoke_cache" $$D/jlsp --version >/dev/null 2>&1 && echo " jlsp: PASS" || { echo " jlsp: FAIL" >&2; fail=1; }; \ + echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{}}' | XDG_CACHE_HOME="$$smoke_cache" $$D/jmcp 2>/dev/null | grep -q '"jerboa-mcp"' && echo " jmcp: PASS" || { echo " jmcp: FAIL" >&2; fail=1; }; \ + XDG_CACHE_HOME="$$smoke_cache" $$D/jerbuild --version | grep -q 'sha256=' && echo " jerbuild: PASS" || { echo " jerbuild: FAIL" >&2; fail=1; }; \ + XDG_CACHE_HOME="$$smoke_cache" $$D/jerboa jlsp --version >/dev/null 2>&1 && echo " jerboa jlsp: PASS" || { echo " jerboa jlsp: FAIL" >&2; fail=1; }; \ + echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{}}' | XDG_CACHE_HOME="$$smoke_cache" $$D/jerboa jmcp 2>/dev/null | grep -q '"jerboa-mcp"' && echo " jerboa jmcp: PASS" || { echo " jerboa jmcp: FAIL" >&2; fail=1; }; \ + XDG_CACHE_HOME="$$smoke_cache" $$D/jerboa jerbuild --version | grep -q 'sha256=' && echo " jerboa build: PASS" || { echo " jerboa build: FAIL" >&2; fail=1; }; \ rm -f /tmp/jms.ss; \ [ $$fail -eq 0 ] && echo "jerboa-smoke: PASS" || { echo "jerboa-smoke: FAIL" >&2; exit 1; } @@ -617,6 +918,37 @@ release-evidence: $(MAKE) jerboa-smoke > "$(EVIDENCE_DIR)/jerboa-smoke.txt" 2>&1 $(MAKE) unification-release-check > "$(EVIDENCE_DIR)/unification-release-check.txt" 2>&1 $(MAKE) security-hardware-smoke > "$(EVIDENCE_DIR)/security-hardware-smoke.txt" 2>&1 + { $(MAKE) check-docs; printf 'check-docs: PASS\n'; } > "$(EVIDENCE_DIR)/check-docs.txt" 2>&1 + { $(MAKE) typed-test; printf 'typed-test: PASS\n'; } > "$(EVIDENCE_DIR)/typed-test.txt" 2>&1 + { $(MAKE) binary-typed-smoke; printf 'binary-typed-smoke: PASS\n'; } > "$(EVIDENCE_DIR)/binary-typed-smoke.txt" 2>&1 + $(MAKE) typed-rust-focused-smoke-suite > "$(EVIDENCE_DIR)/typed-rust-focused-smoke-suite.txt" 2>&1 + $(MAKE) typed-bench > "$(EVIDENCE_DIR)/typed-bench.txt" 2>&1 + $(MAKE) typed-uri-corpus-check > "$(EVIDENCE_DIR)/typed-uri-corpus-check.txt" 2>&1 + $(MAKE) typed-uri-pilot > "$(EVIDENCE_DIR)/typed-uri-pilot.txt" 2>&1 + $(MAKE) typed-uri-diff-repro > "$(EVIDENCE_DIR)/typed-uri-diff-repro.txt" 2>&1 + $(MAKE) typed-uri-bench > "$(EVIDENCE_DIR)/typed-uri-bench.txt" 2>&1 + $(MAKE) typed-uri-wrapper-smoke > "$(EVIDENCE_DIR)/typed-uri-wrapper-smoke.txt" 2>&1 + $(MAKE) typed-uri-public-smoke > "$(EVIDENCE_DIR)/typed-uri-public-smoke.txt" 2>&1 + $(MAKE) binary-typed-uri-smoke > "$(EVIDENCE_DIR)/binary-typed-uri-smoke.txt" 2>&1 + $(MAKE) typed-json-value-corpus-check > "$(EVIDENCE_DIR)/typed-json-value-corpus-check.txt" 2>&1 + $(MAKE) typed-json-value-smoke > "$(EVIDENCE_DIR)/typed-json-value-smoke.txt" 2>&1 + $(MAKE) typed-json-value-diff-repro > "$(EVIDENCE_DIR)/typed-json-value-diff-repro.txt" 2>&1 + $(MAKE) typed-json-value-bench > "$(EVIDENCE_DIR)/typed-json-value-bench.txt" 2>&1 + $(MAKE) typed-json-value-public-smoke > "$(EVIDENCE_DIR)/typed-json-value-public-smoke.txt" 2>&1 + $(MAKE) binary-typed-json-smoke > "$(EVIDENCE_DIR)/binary-typed-json-smoke.txt" 2>&1 + $(MAKE) typed-json-scan-corpus-check > "$(EVIDENCE_DIR)/typed-json-scan-corpus-check.txt" 2>&1 + $(MAKE) typed-json-scan-diff > "$(EVIDENCE_DIR)/typed-json-scan-diff.txt" 2>&1 + $(MAKE) typed-json-scan-bench > "$(EVIDENCE_DIR)/typed-json-scan-bench.txt" 2>&1 + { $(MAKE) typed-llvmir-check; printf 'typed-llvmir-check: PASS\n'; } > "$(EVIDENCE_DIR)/typed-llvmir-check.txt" 2>&1 + $(MAKE) typed-llvmir-parity > "$(EVIDENCE_DIR)/typed-llvmir-parity.txt" 2>&1 + $(MAKE) typed-llvmir-focused-parity-suite > "$(EVIDENCE_DIR)/typed-llvmir-focused-parity-suite.txt" 2>&1 + $(MAKE) typed-llvmir-leak-suite > "$(EVIDENCE_DIR)/typed-llvmir-leak-suite.txt" 2>&1 + $(MAKE) typed-llvmir-regex-parity > "$(EVIDENCE_DIR)/typed-llvmir-regex-parity.txt" 2>&1 + $(MAKE) typed-llvmir-unicode-string-parity > "$(EVIDENCE_DIR)/typed-llvmir-unicode-string-parity.txt" 2>&1 + $(MAKE) typed-llvmir-wasm-object-smoke > "$(EVIDENCE_DIR)/typed-llvmir-wasm-object-smoke.txt" 2>&1 + $(MAKE) typed-llvmir-wasm-runtime-smoke > "$(EVIDENCE_DIR)/typed-llvmir-wasm-runtime-smoke.txt" 2>&1 + $(MAKE) typed-llvmir-wasm-suite-release > "$(EVIDENCE_DIR)/typed-llvmir-wasm-suite-release.txt" 2>&1 + $(MAKE) wasm-gc-release-gate > "$(EVIDENCE_DIR)/wasm-gc-release-gate.txt" 2>&1 $(MAKE) reproducibility-report > "$(EVIDENCE_DIR)/reproducibility-report.txt" 2>&1 $(MAKE) tcb-report > "$(EVIDENCE_DIR)/tcb-report.sexp" 2>&1 $(MAKE) tcb-drift-check > "$(EVIDENCE_DIR)/tcb-drift-check.txt" 2>&1 @@ -625,10 +957,37 @@ release-evidence: $(MAKE) sbom > "$(EVIDENCE_DIR)/sbom.txt" 2>&1 shasum -a 256 Dockerfile Makefile SECURITY.md README.md rust-toolchain.toml \ docs/release-security.md docs/release-artifacts.md \ + docs/typed-final.md docs/typed-uri-pilot.md \ support/container-dependencies.lock support/container-inputs.sh \ support/install.sh support/ensure-jerboa.sh support/sign-release-artifacts.sh \ support/sbom.sh support/sanitize-evidence.sh support/fasl-cache-equivalence.ss \ support/check-release-path-leaks.sh support/reproducibility-report.sh tools/security-audit.sh \ + support/typed-rust.ss support/typed-build.ss support/typed-llvmir.ss support/typed-rust-bench.sh \ + support/typed-rust-focused-smoke-suite.sh \ + support/typed-wrappers.ss support/build-binary.sh support/binary-entry.ss \ + jerboa-native-rs/src/lib.rs jerboa-native-rs/src/regex_native.rs jerboa-native-rs/src/string_native.rs \ + support/typed-uri-corpus-check.py support/typed-uri-diff.sh support/typed-uri-bench.sh \ + support/typed-json-value-corpus-check.py \ + support/typed-json-value-diff.sh support/typed-json-value-bench.sh \ + support/typed-json-scan-corpus-check.py \ + support/typed-json-scan-diff.sh support/typed-json-scan-bench.sh \ + support/typed-llvmir-focused-parity-suite.sh \ + support/typed-llvmir-leak-check.sh support/typed-llvmir-leak-suite.sh \ + support/typed-llvmir-wasm-runtime.ll support/typed-llvmir-wasm-runtime-check.ss \ + support/typed-llvmir-wasm-suite.sh support/typed-llvmir-wasm-browser-smoke.mjs \ + scripts/test-wasm-gc.sh scripts/test-wasm-gc-release.sh \ + support/wasm-gc/browser-smoke.mjs support/wasm-gc/browser-engine.mjs \ + lib/jerboa/typed/parser.ss lib/jerboa/typed/checker.ss lib/jerboa/typed/core.ss \ + lib/jerboa/typed/rust.ss lib/jerboa/typed/llvmir.ss lib/jerboa/typed/wrapper.ss \ + lib/std/net/uri.ss lib/std/net/uri/typed-core.ss \ + lib/std/text/json.ss lib/std/text/json-typed-value.ss lib/std/text/json-typed-scan.ss \ + docs/typed-llvmir-ownership-abi.md tests/fixtures/typed/llvmir-*.ss \ + tests/fixtures/typed/*.ss tests/test-typed-*.ss \ + tests/fixtures/typed/llvmir-function-library.ss \ + tests/fixtures/typed/rust-json-value.ss \ + tests/test-typed-uri-wrapper-e2e.ss tests/test-typed-uri-public-e2e.ss \ + tests/test-typed-uri-public-binary-e2e.ss \ + tests/test-typed-json-value-public-e2e.ss tests/test-typed-json-value-public-binary-e2e.ss \ tools/tcb-report.ss .jerboa-system \ > "$(EVIDENCE_DIR)/release-inputs-sha256.txt" rm -rf "$(EVIDENCE_DIR)/sbom" "$(EVIDENCE_DIR)/reproducibility" @@ -639,6 +998,37 @@ release-evidence: grep -q '^status=match$$' "$(EVIDENCE_DIR)/reproducibility/result.txt" grep -q '^sbom_status=present$$' "$(EVIDENCE_DIR)/sbom/manifest.txt" grep -q '^(tcb-report' "$(EVIDENCE_DIR)/tcb-report.sexp" + grep -q '^check-docs: PASS$$' "$(EVIDENCE_DIR)/check-docs.txt" + grep -q '^typed-test: PASS$$' "$(EVIDENCE_DIR)/typed-test.txt" + grep -q '^binary-typed-smoke: PASS$$' "$(EVIDENCE_DIR)/binary-typed-smoke.txt" + grep -q '^typed-rust-focused-smoke-suite: PASS 16 target(s)$$' "$(EVIDENCE_DIR)/typed-rust-focused-smoke-suite.txt" + grep -q '^typed-bench: PASS ' "$(EVIDENCE_DIR)/typed-bench.txt" + grep -q '^typed-uri-corpus-check: PASS ' "$(EVIDENCE_DIR)/typed-uri-corpus-check.txt" + grep -q '^typed-uri-pilot: PASS' "$(EVIDENCE_DIR)/typed-uri-pilot.txt" + grep -q '^typed-uri-diff-repro: PASS ' "$(EVIDENCE_DIR)/typed-uri-diff-repro.txt" + grep -q '^typed-uri-bench: PASS ' "$(EVIDENCE_DIR)/typed-uri-bench.txt" + grep -q '^Typed URI wrapper smoke: [0-9][0-9]* passed, 0 failed$$' "$(EVIDENCE_DIR)/typed-uri-wrapper-smoke.txt" + grep -q '^Public typed URI smoke: [0-9][0-9]* passed, 0 failed$$' "$(EVIDENCE_DIR)/typed-uri-public-smoke.txt" + grep -q '^Binary public typed URI smoke: [0-9][0-9]* passed, 0 failed$$' "$(EVIDENCE_DIR)/binary-typed-uri-smoke.txt" + grep -q '^typed-json-value-corpus-check: PASS ' "$(EVIDENCE_DIR)/typed-json-value-corpus-check.txt" + grep -q '^typed-json-value-smoke: status=42 expected=42$$' "$(EVIDENCE_DIR)/typed-json-value-smoke.txt" + grep -q '^typed-json-value-diff-repro: PASS ' "$(EVIDENCE_DIR)/typed-json-value-diff-repro.txt" + grep -q '^typed-json-value-bench: PASS ' "$(EVIDENCE_DIR)/typed-json-value-bench.txt" + grep -q '^Public typed JSON value smoke: [0-9][0-9]* passed, 0 failed$$' "$(EVIDENCE_DIR)/typed-json-value-public-smoke.txt" + grep -q '^Binary public typed JSON value smoke: [0-9][0-9]* passed, 0 failed$$' "$(EVIDENCE_DIR)/binary-typed-json-smoke.txt" + grep -q '^typed-json-scan-corpus-check: PASS ' "$(EVIDENCE_DIR)/typed-json-scan-corpus-check.txt" + grep -q '^typed-json-scan-diff: PASS ' "$(EVIDENCE_DIR)/typed-json-scan-diff.txt" + grep -q '^typed-json-scan-bench: PASS ' "$(EVIDENCE_DIR)/typed-json-scan-bench.txt" + grep -q '^typed-llvmir-check: PASS$$' "$(EVIDENCE_DIR)/typed-llvmir-check.txt" + grep -q '^typed-llvmir-parity: PASS ' "$(EVIDENCE_DIR)/typed-llvmir-parity.txt" + grep -q '^typed-llvmir-focused-parity-suite: PASS 14 target(s)$$' "$(EVIDENCE_DIR)/typed-llvmir-focused-parity-suite.txt" + grep -q '^typed-llvmir-leak-suite: PASS 23 case(s)$$' "$(EVIDENCE_DIR)/typed-llvmir-leak-suite.txt" + grep -q '^typed-llvmir-regex-parity: rust=42 llvm=42 expected=42$$' "$(EVIDENCE_DIR)/typed-llvmir-regex-parity.txt" + grep -q '^typed-llvmir-unicode-string-parity: rust=42 llvm=42 expected=42$$' "$(EVIDENCE_DIR)/typed-llvmir-unicode-string-parity.txt" + grep -q '^typed-llvmir-wasm-object-smoke: PASS ' "$(EVIDENCE_DIR)/typed-llvmir-wasm-object-smoke.txt" + grep -q '^typed-llvmir-wasm-runtime-smoke: PASS ' "$(EVIDENCE_DIR)/typed-llvmir-wasm-runtime-smoke.txt" + grep -q '^typed-llvmir-wasm-suite: PASS 23 case(s) 3 browser_engine(s)=chromium firefox webkit$$' "$(EVIDENCE_DIR)/typed-llvmir-wasm-suite-release.txt" + grep -q '^wasm-gc-release-gate: PASS$$' "$(EVIDENCE_DIR)/wasm-gc-release-gate.txt" support/sanitize-evidence.sh "$(EVIDENCE_DIR)" printf 'release_evidence_status=pass\n' > "$(EVIDENCE_DIR)/result.txt" @@ -1144,8 +1534,443 @@ typecheck: typed-rust: @$(SCHEME) --libdirs $(LIBDIRS) --script support/typed-rust.ss $(TYPED_RUST_DIR) $(TYPED_RUST_SOURCES) +typed-rust-focused-smoke-suite: + @sh support/typed-rust-focused-smoke-suite.sh "$(MAKE)" \ + "$(TYPED_RUST_FOCUSED_SMOKE_SUITE_EXPECTED_TARGETS)" \ + $(TYPED_RUST_FOCUSED_SMOKE_SUITE_TARGETS) + +typed-rust-crate-metadata-smoke: + @rm -rf "$(TYPED_RUST_METADATA_DIR)" + @$(SCHEME) --libdirs $(LIBDIRS) --script support/typed-rust.ss \ + "$(TYPED_RUST_METADATA_DIR)" \ + tests/fixtures/typed/rust-crate-metadata.ss + @grep -q 'name = "jerboa-crate-metadata-smoke"' "$(TYPED_RUST_METADATA_DIR)/Cargo.toml" + @grep -q 'version = "0.2.5-alpha.1+typed"' "$(TYPED_RUST_METADATA_DIR)/Cargo.toml" + @grep -q 'description = "Typed Jerboa generated crate metadata smoke fixture"' "$(TYPED_RUST_METADATA_DIR)/Cargo.toml" + @grep -q 'license = "MIT OR Apache-2.0"' "$(TYPED_RUST_METADATA_DIR)/Cargo.toml" + @grep -q 'repository = "https://example.invalid/jerboa-crate-metadata-smoke"' "$(TYPED_RUST_METADATA_DIR)/Cargo.toml" + @cargo metadata --format-version 1 --no-deps --manifest-path "$(TYPED_RUST_METADATA_DIR)/Cargo.toml" >/dev/null + @cargo package --allow-dirty --no-verify --manifest-path "$(TYPED_RUST_METADATA_DIR)/Cargo.toml" >/dev/null + +typed-rust-hashmap-smoke: + @$(SCHEME) --libdirs $(LIBDIRS) --script support/typed-rust.ss \ + "$(TYPED_RUST_HASHMAP_SMOKE_DIR)" \ + "$(TYPED_RUST_HASHMAP_SMOKE_SOURCE)" + @cargo build --manifest-path "$(TYPED_RUST_HASHMAP_SMOKE_DIR)/Cargo.toml" >/dev/null + @rlib="$(TYPED_RUST_HASHMAP_SMOKE_DIR)/target/debug/libjerboa_typed_generated.rlib"; \ + test -f "$$rlib" || { echo "typed-rust-hashmap-smoke: missing $$rlib" >&2; exit 1; }; \ + printf '%s\n' 'fn main() { std::process::exit(jerboa_typed_generated::sample_typed_rust_hashmap::main() as i32); }' \ + | rustc --edition 2021 - \ + --extern jerboa_typed_generated="$$rlib" \ + -L dependency="$(TYPED_RUST_HASHMAP_SMOKE_DIR)/target/debug/deps" \ + -o "$(TYPED_RUST_HASHMAP_SMOKE_DIR)/hashmap-main"; \ + if "$(TYPED_RUST_HASHMAP_SMOKE_DIR)/hashmap-main"; then status=0; else status=$$?; fi; \ + echo "typed-rust-hashmap-smoke: status=$$status expected=42"; \ + test "$$status" -eq 42 + +typed-rust-list-smoke: + @$(SCHEME) --libdirs $(LIBDIRS) --script support/typed-rust.ss \ + "$(TYPED_RUST_LIST_SMOKE_DIR)" \ + "$(TYPED_RUST_LIST_SMOKE_SOURCE)" + @cargo build --manifest-path "$(TYPED_RUST_LIST_SMOKE_DIR)/Cargo.toml" >/dev/null + @rlib="$(TYPED_RUST_LIST_SMOKE_DIR)/target/debug/libjerboa_typed_generated.rlib"; \ + test -f "$$rlib" || { echo "typed-rust-list-smoke: missing $$rlib" >&2; exit 1; }; \ + printf '%s\n' 'fn main() { std::process::exit(jerboa_typed_generated::sample_typed_rust_list::main() as i32); }' \ + | rustc --edition 2021 - \ + --extern jerboa_typed_generated="$$rlib" \ + -L dependency="$(TYPED_RUST_LIST_SMOKE_DIR)/target/debug/deps" \ + -o "$(TYPED_RUST_LIST_SMOKE_DIR)/list-main"; \ + if "$(TYPED_RUST_LIST_SMOKE_DIR)/list-main"; then status=0; else status=$$?; fi; \ + echo "typed-rust-list-smoke: status=$$status expected=42"; \ + test "$$status" -eq 42 + +typed-rust-mutable-list-smoke: + @$(SCHEME) --libdirs $(LIBDIRS) --script support/typed-rust.ss \ + "$(TYPED_RUST_MUTABLE_LIST_SMOKE_DIR)" \ + "$(TYPED_RUST_MUTABLE_LIST_SMOKE_SOURCE)" + @cargo build --manifest-path "$(TYPED_RUST_MUTABLE_LIST_SMOKE_DIR)/Cargo.toml" >/dev/null + @rlib="$(TYPED_RUST_MUTABLE_LIST_SMOKE_DIR)/target/debug/libjerboa_typed_generated.rlib"; \ + test -f "$$rlib" || { echo "typed-rust-mutable-list-smoke: missing $$rlib" >&2; exit 1; }; \ + printf '%s\n' 'fn main() { std::process::exit(jerboa_typed_generated::sample_typed_rust_mutable_list::main() as i32); }' \ + | rustc --edition 2021 - \ + --extern jerboa_typed_generated="$$rlib" \ + -L dependency="$(TYPED_RUST_MUTABLE_LIST_SMOKE_DIR)/target/debug/deps" \ + -o "$(TYPED_RUST_MUTABLE_LIST_SMOKE_DIR)/mutable-list-main"; \ + if "$(TYPED_RUST_MUTABLE_LIST_SMOKE_DIR)/mutable-list-main"; then status=0; else status=$$?; fi; \ + echo "typed-rust-mutable-list-smoke: status=$$status expected=42"; \ + test "$$status" -eq 42 + +typed-rust-pair-smoke: + @$(SCHEME) --libdirs $(LIBDIRS) --script support/typed-rust.ss \ + "$(TYPED_RUST_PAIR_SMOKE_DIR)" \ + "$(TYPED_RUST_PAIR_SMOKE_SOURCE)" + @cargo build --manifest-path "$(TYPED_RUST_PAIR_SMOKE_DIR)/Cargo.toml" >/dev/null + @rlib="$(TYPED_RUST_PAIR_SMOKE_DIR)/target/debug/libjerboa_typed_generated.rlib"; \ + test -f "$$rlib" || { echo "typed-rust-pair-smoke: missing $$rlib" >&2; exit 1; }; \ + printf '%s\n' 'fn main() { std::process::exit(jerboa_typed_generated::sample_typed_rust_pair::main() as i32); }' \ + | rustc --edition 2021 - \ + --extern jerboa_typed_generated="$$rlib" \ + -L dependency="$(TYPED_RUST_PAIR_SMOKE_DIR)/target/debug/deps" \ + -o "$(TYPED_RUST_PAIR_SMOKE_DIR)/pair-main"; \ + if "$(TYPED_RUST_PAIR_SMOKE_DIR)/pair-main"; then status=0; else status=$$?; fi; \ + echo "typed-rust-pair-smoke: status=$$status expected=42"; \ + test "$$status" -eq 42 + +typed-rust-nullable-smoke: + @$(SCHEME) --libdirs $(LIBDIRS) --script support/typed-rust.ss \ + "$(TYPED_RUST_NULLABLE_SMOKE_DIR)" \ + "$(TYPED_RUST_NULLABLE_SMOKE_SOURCE)" + @cargo build --manifest-path "$(TYPED_RUST_NULLABLE_SMOKE_DIR)/Cargo.toml" >/dev/null + @rlib="$(TYPED_RUST_NULLABLE_SMOKE_DIR)/target/debug/libjerboa_typed_generated.rlib"; \ + test -f "$$rlib" || { echo "typed-rust-nullable-smoke: missing $$rlib" >&2; exit 1; }; \ + printf '%s\n' 'fn main() { std::process::exit(jerboa_typed_generated::sample_typed_rust_nullable::main() as i32); }' \ + | rustc --edition 2021 - \ + --extern jerboa_typed_generated="$$rlib" \ + -L dependency="$(TYPED_RUST_NULLABLE_SMOKE_DIR)/target/debug/deps" \ + -o "$(TYPED_RUST_NULLABLE_SMOKE_DIR)/nullable-main"; \ + if "$(TYPED_RUST_NULLABLE_SMOKE_DIR)/nullable-main"; then status=0; else status=$$?; fi; \ + echo "typed-rust-nullable-smoke: status=$$status expected=42"; \ + test "$$status" -eq 42 + +typed-rust-string-ops-smoke: + @$(SCHEME) --libdirs $(LIBDIRS) --script support/typed-rust.ss \ + "$(TYPED_RUST_STRING_OPS_SMOKE_DIR)" \ + "$(TYPED_RUST_STRING_OPS_SMOKE_SOURCE)" + @cargo build --manifest-path "$(TYPED_RUST_STRING_OPS_SMOKE_DIR)/Cargo.toml" >/dev/null + @rlib="$(TYPED_RUST_STRING_OPS_SMOKE_DIR)/target/debug/libjerboa_typed_generated.rlib"; \ + test -f "$$rlib" || { echo "typed-rust-string-ops-smoke: missing $$rlib" >&2; exit 1; }; \ + printf '%s\n' 'fn main() { std::process::exit(jerboa_typed_generated::sample_typed_rust_string_ops::main() as i32); }' \ + | rustc --edition 2021 - \ + --extern jerboa_typed_generated="$$rlib" \ + -L dependency="$(TYPED_RUST_STRING_OPS_SMOKE_DIR)/target/debug/deps" \ + -o "$(TYPED_RUST_STRING_OPS_SMOKE_DIR)/string-ops-main"; \ + if "$(TYPED_RUST_STRING_OPS_SMOKE_DIR)/string-ops-main"; then status=0; else status=$$?; fi; \ + echo "typed-rust-string-ops-smoke: status=$$status expected=42"; \ + test "$$status" -eq 42 + +typed-rust-jvm-helpers-smoke: + @$(SCHEME) --libdirs $(LIBDIRS) --script support/typed-rust.ss \ + "$(TYPED_RUST_JVM_HELPERS_SMOKE_DIR)" \ + "$(TYPED_RUST_JVM_HELPERS_SMOKE_SOURCE)" + @cargo build --manifest-path "$(TYPED_RUST_JVM_HELPERS_SMOKE_DIR)/Cargo.toml" >/dev/null + @rlib="$(TYPED_RUST_JVM_HELPERS_SMOKE_DIR)/target/debug/libjerboa_typed_generated.rlib"; \ + test -f "$$rlib" || { echo "typed-rust-jvm-helpers-smoke: missing $$rlib" >&2; exit 1; }; \ + printf '%s\n' 'fn main() { std::process::exit(jerboa_typed_generated::sample_typed_rust_jvm_helpers::main() as i32); }' \ + | rustc --edition 2021 - \ + --extern jerboa_typed_generated="$$rlib" \ + -L dependency="$(TYPED_RUST_JVM_HELPERS_SMOKE_DIR)/target/debug/deps" \ + -o "$(TYPED_RUST_JVM_HELPERS_SMOKE_DIR)/jvm-helpers-main"; \ + if "$(TYPED_RUST_JVM_HELPERS_SMOKE_DIR)/jvm-helpers-main"; then status=0; else status=$$?; fi; \ + echo "typed-rust-jvm-helpers-smoke: status=$$status expected=42"; \ + test "$$status" -eq 42 + +typed-rust-jvm-arrays-smoke: + @$(SCHEME) --libdirs $(LIBDIRS) --script support/typed-rust.ss \ + "$(TYPED_RUST_JVM_ARRAYS_SMOKE_DIR)" \ + "$(TYPED_RUST_JVM_ARRAYS_SMOKE_SOURCE)" + @cargo build --manifest-path "$(TYPED_RUST_JVM_ARRAYS_SMOKE_DIR)/Cargo.toml" >/dev/null + @rlib="$(TYPED_RUST_JVM_ARRAYS_SMOKE_DIR)/target/debug/libjerboa_typed_generated.rlib"; \ + test -f "$$rlib" || { echo "typed-rust-jvm-arrays-smoke: missing $$rlib" >&2; exit 1; }; \ + printf '%s\n' 'fn main() { std::process::exit(jerboa_typed_generated::sample_typed_rust_jvm_arrays::main() as i32); }' \ + | rustc --edition 2021 - \ + --extern jerboa_typed_generated="$$rlib" \ + -L dependency="$(TYPED_RUST_JVM_ARRAYS_SMOKE_DIR)/target/debug/deps" \ + -o "$(TYPED_RUST_JVM_ARRAYS_SMOKE_DIR)/jvm-arrays-main"; \ + if "$(TYPED_RUST_JVM_ARRAYS_SMOKE_DIR)/jvm-arrays-main"; then status=0; else status=$$?; fi; \ + echo "typed-rust-jvm-arrays-smoke: status=$$status expected=42"; \ + test "$$status" -eq 42 + +typed-rust-jvm-json-smoke: + @$(SCHEME) --libdirs $(LIBDIRS) --script support/typed-rust.ss \ + "$(TYPED_RUST_JVM_JSON_SMOKE_DIR)" \ + "$(TYPED_RUST_JVM_JSON_SMOKE_SOURCE)" + @cargo build --manifest-path "$(TYPED_RUST_JVM_JSON_SMOKE_DIR)/Cargo.toml" >/dev/null + @rlib="$(TYPED_RUST_JVM_JSON_SMOKE_DIR)/target/debug/libjerboa_typed_generated.rlib"; \ + test -f "$$rlib" || { echo "typed-rust-jvm-json-smoke: missing $$rlib" >&2; exit 1; }; \ + printf '%s\n' 'fn main() { std::process::exit(jerboa_typed_generated::sample_typed_rust_jvm_json::main() as i32); }' \ + | rustc --edition 2021 - \ + --extern jerboa_typed_generated="$$rlib" \ + -L dependency="$(TYPED_RUST_JVM_JSON_SMOKE_DIR)/target/debug/deps" \ + -o "$(TYPED_RUST_JVM_JSON_SMOKE_DIR)/jvm-json-main"; \ + if "$(TYPED_RUST_JVM_JSON_SMOKE_DIR)/jvm-json-main"; then status=0; else status=$$?; fi; \ + echo "typed-rust-jvm-json-smoke: status=$$status expected=42"; \ + test "$$status" -eq 42 + +typed-rust-try-throw-smoke: + @$(SCHEME) --libdirs $(LIBDIRS) --script support/typed-rust.ss \ + "$(TYPED_RUST_TRY_THROW_SMOKE_DIR)" \ + "$(TYPED_RUST_TRY_THROW_SMOKE_SOURCE)" + @cargo build --manifest-path "$(TYPED_RUST_TRY_THROW_SMOKE_DIR)/Cargo.toml" >/dev/null + @rlib="$(TYPED_RUST_TRY_THROW_SMOKE_DIR)/target/debug/libjerboa_typed_generated.rlib"; \ + test -f "$$rlib" || { echo "typed-rust-try-throw-smoke: missing $$rlib" >&2; exit 1; }; \ + printf '%s\n' 'fn main() { std::process::exit(jerboa_typed_generated::sample_typed_rust_try_throw::main() as i32); }' \ + | rustc --edition 2021 - \ + --extern jerboa_typed_generated="$$rlib" \ + -L dependency="$(TYPED_RUST_TRY_THROW_SMOKE_DIR)/target/debug/deps" \ + -o "$(TYPED_RUST_TRY_THROW_SMOKE_DIR)/try-throw-main"; \ + if "$(TYPED_RUST_TRY_THROW_SMOKE_DIR)/try-throw-main"; then status=0; else status=$$?; fi; \ + echo "typed-rust-try-throw-smoke: status=$$status expected=42"; \ + test "$$status" -eq 42 + +typed-rust-direct-throw-smoke: + @$(SCHEME) --libdirs $(LIBDIRS) --script support/typed-rust.ss \ + "$(TYPED_RUST_DIRECT_THROW_SMOKE_DIR)" \ + "$(TYPED_RUST_DIRECT_THROW_SMOKE_SOURCE)" + @cargo build --manifest-path "$(TYPED_RUST_DIRECT_THROW_SMOKE_DIR)/Cargo.toml" >/dev/null + @rlib="$(TYPED_RUST_DIRECT_THROW_SMOKE_DIR)/target/debug/libjerboa_typed_generated.rlib"; \ + test -f "$$rlib" || { echo "typed-rust-direct-throw-smoke: missing $$rlib" >&2; exit 1; }; \ + printf '%s\n' 'fn main() { std::panic::set_hook(Box::new(|_| {})); let caught = std::panic::catch_unwind(|| jerboa_typed_generated::sample_typed_rust_direct_throw::direct_throw()).is_err(); let ok = caught && jerboa_typed_generated::sample_typed_rust_direct_throw::main() == 42u64; std::process::exit(if ok { 42 } else { 1 }); }' \ + | rustc --edition 2021 - \ + --extern jerboa_typed_generated="$$rlib" \ + -L dependency="$(TYPED_RUST_DIRECT_THROW_SMOKE_DIR)/target/debug/deps" \ + -o "$(TYPED_RUST_DIRECT_THROW_SMOKE_DIR)/direct-throw-main"; \ + if "$(TYPED_RUST_DIRECT_THROW_SMOKE_DIR)/direct-throw-main"; then status=0; else status=$$?; fi; \ + echo "typed-rust-direct-throw-smoke: status=$$status expected=42"; \ + test "$$status" -eq 42 + +typed-rust-map-smoke: + @$(SCHEME) --libdirs $(LIBDIRS) --script support/typed-rust.ss \ + "$(TYPED_RUST_MAP_SMOKE_DIR)" \ + "$(TYPED_RUST_MAP_SMOKE_SOURCE)" + @cargo build --manifest-path "$(TYPED_RUST_MAP_SMOKE_DIR)/Cargo.toml" >/dev/null + @rlib="$(TYPED_RUST_MAP_SMOKE_DIR)/target/debug/libjerboa_typed_generated.rlib"; \ + test -f "$$rlib" || { echo "typed-rust-map-smoke: missing $$rlib" >&2; exit 1; }; \ + printf '%s\n' 'fn main() { std::process::exit(jerboa_typed_generated::sample_typed_rust_map::main() as i32); }' \ + | rustc --edition 2021 - \ + --extern jerboa_typed_generated="$$rlib" \ + -L dependency="$(TYPED_RUST_MAP_SMOKE_DIR)/target/debug/deps" \ + -o "$(TYPED_RUST_MAP_SMOKE_DIR)/map-main"; \ + if "$(TYPED_RUST_MAP_SMOKE_DIR)/map-main"; then status=0; else status=$$?; fi; \ + echo "typed-rust-map-smoke: status=$$status expected=42"; \ + test "$$status" -eq 42 + +typed-rust-set-smoke: + @$(SCHEME) --libdirs $(LIBDIRS) --script support/typed-rust.ss \ + "$(TYPED_RUST_SET_SMOKE_DIR)" \ + "$(TYPED_RUST_SET_SMOKE_SOURCE)" + @cargo build --manifest-path "$(TYPED_RUST_SET_SMOKE_DIR)/Cargo.toml" >/dev/null + @rlib="$(TYPED_RUST_SET_SMOKE_DIR)/target/debug/libjerboa_typed_generated.rlib"; \ + test -f "$$rlib" || { echo "typed-rust-set-smoke: missing $$rlib" >&2; exit 1; }; \ + printf '%s\n' 'fn main() { std::process::exit(jerboa_typed_generated::sample_typed_rust_set::main() as i32); }' \ + | rustc --edition 2021 - \ + --extern jerboa_typed_generated="$$rlib" \ + -L dependency="$(TYPED_RUST_SET_SMOKE_DIR)/target/debug/deps" \ + -o "$(TYPED_RUST_SET_SMOKE_DIR)/set-main"; \ + if "$(TYPED_RUST_SET_SMOKE_DIR)/set-main"; then status=0; else status=$$?; fi; \ + echo "typed-rust-set-smoke: status=$$status expected=42"; \ + test "$$status" -eq 42 + +typed-json-value-smoke: + @$(SCHEME) --libdirs $(LIBDIRS) --script support/typed-rust.ss \ + "$(TYPED_JSON_VALUE_SMOKE_DIR)" \ + $(TYPED_JSON_VALUE_SOURCES) + @cargo build --manifest-path "$(TYPED_JSON_VALUE_SMOKE_DIR)/Cargo.toml" >/dev/null + @rlib="$(TYPED_JSON_VALUE_SMOKE_DIR)/target/debug/libjerboa_typed_generated.rlib"; \ + test -f "$$rlib" || { echo "typed-json-value-smoke: missing $$rlib" >&2; exit 1; }; \ + printf '%s\n' 'fn main() { std::process::exit(jerboa_typed_generated::sample_typed_rust_json_value::main() as i32); }' \ + | rustc --edition 2021 - \ + --extern jerboa_typed_generated="$$rlib" \ + -L dependency="$(TYPED_JSON_VALUE_SMOKE_DIR)/target/debug/deps" \ + -o "$(TYPED_JSON_VALUE_SMOKE_DIR)/json-value-main"; \ + if "$(TYPED_JSON_VALUE_SMOKE_DIR)/json-value-main"; then status=0; else status=$$?; fi; \ + echo "typed-json-value-smoke: status=$$status expected=42"; \ + test "$$status" -eq 42 + +typed-bench: + @rm -rf "$(TYPED_BENCH_DIR)" + @$(SCHEME) --libdirs $(LIBDIRS) --script support/typed-rust.ss $(TYPED_BENCH_DIR) $(TYPED_BENCH_SOURCES) + @sh support/typed-rust-bench.sh \ + "$(TYPED_BENCH_DIR)" \ + "$(TYPED_BENCH_FN)" \ + "$(TYPED_BENCH_EXPECT)" \ + "$(TYPED_BENCH_ITERS)" \ + "$(TYPED_BENCH_SAMPLES)" \ + "$(TYPED_BENCH_MAX_CLONE_CALLS)" + +typed-uri-pilot: + @command -v rustc >/dev/null 2>&1 \ + || { echo "typed-uri-pilot: rustc not found (needed for the Rust reference build)" >&2; exit 1; } + @if [ -z "$(LLVM_BIN)" ]; then \ + echo "typed-uri-pilot: LLVM tools not found (need llvm-as/opt/llc on PATH or in a Homebrew llvm keg)" >&2; \ + exit 1; \ + fi + @mkdir -p "$(TYPED_LLVMIR_PARITY_DIR)" + @$(SCHEME) --libdirs $(LIBDIRS) --script support/typed-rust.ss \ + $(TYPED_LLVMIR_PARITY_DIR)/rust $(TYPED_URI_PILOT_SOURCE) + @rustc --edition 2021 --crate-type rlib \ + $(TYPED_LLVMIR_PARITY_DIR)/rust/src/lib.rs \ + --crate-name jt_uri_pilot -o $(TYPED_LLVMIR_PARITY_DIR)/libjt_uri_pilot.rlib \ + || { echo "typed-uri-pilot: rustc rlib build failed" >&2; exit 1; } + @printf 'fn main() {\n std::process::exit(jt_uri_pilot::$(TYPED_URI_PILOT_FN)() as i32);\n}\n' \ + > $(TYPED_LLVMIR_PARITY_DIR)/uri-main.rs + @rustc --edition 2021 $(TYPED_LLVMIR_PARITY_DIR)/uri-main.rs \ + --extern jt_uri_pilot=$(TYPED_LLVMIR_PARITY_DIR)/libjt_uri_pilot.rlib \ + -o $(TYPED_LLVMIR_PARITY_DIR)/uri-pilot-rust \ + || { echo "typed-uri-pilot: rustc harness build failed" >&2; exit 1; } + @$(SCHEME) --libdirs $(LIBDIRS) --script support/typed-llvmir.ss \ + --whole-program $(TYPED_LLVMIR_PARITY_DIR)/uri-pilot.ll $(TYPED_URI_PILOT_SOURCE) + @"$(LLVM_BIN)/llvm-as" $(TYPED_LLVMIR_PARITY_DIR)/uri-pilot.ll \ + -o $(TYPED_LLVMIR_PARITY_DIR)/uri-pilot.bc \ + || { echo "typed-uri-pilot: llvm-as failed" >&2; exit 1; } + @"$(LLVM_BIN)/opt" -passes=verify $(TYPED_LLVMIR_PARITY_DIR)/uri-pilot.bc -o /dev/null \ + || { echo "typed-uri-pilot: verifier failed" >&2; exit 1; } + @"$(LLVM_BIN)/opt" -O2 $(TYPED_LLVMIR_PARITY_DIR)/uri-pilot.bc \ + -o $(TYPED_LLVMIR_PARITY_DIR)/uri-pilot.opt.bc \ + || { echo "typed-uri-pilot: opt -O2 failed" >&2; exit 1; } + @"$(LLVM_BIN)/llc" -filetype=obj $(TYPED_LLVMIR_PARITY_DIR)/uri-pilot.opt.bc \ + -o $(TYPED_LLVMIR_PARITY_DIR)/uri-pilot.o \ + || { echo "typed-uri-pilot: llc failed" >&2; exit 1; } + @cc $(TYPED_LLVMIR_PARITY_DIR)/uri-pilot.o \ + -o $(TYPED_LLVMIR_PARITY_DIR)/uri-pilot-llvm \ + || { echo "typed-uri-pilot: link failed" >&2; exit 1; } + @if "$(TYPED_LLVMIR_PARITY_DIR)/uri-pilot-rust"; then rust_status=0; else rust_status=$$?; fi; \ + if "$(TYPED_LLVMIR_PARITY_DIR)/uri-pilot-llvm"; then llvm_status=0; else llvm_status=$$?; fi; \ + echo "typed-uri-pilot: rust=$$rust_status llvm=$$llvm_status expected=42"; \ + if [ "$$rust_status" -eq "$$llvm_status" ] && [ "$$rust_status" -eq 42 ]; then \ + echo "typed-uri-pilot: PASS — backends agree"; \ + else \ + echo "typed-uri-pilot: FAIL — backend results differ" >&2; \ + exit 1; \ + fi + +typed-uri-corpus-check: + @python3 support/typed-uri-corpus-check.py + +typed-uri-diff: typed-uri-corpus-check + @TYPED_URI_DIFF_SEED="$(TYPED_URI_DIFF_SEED)" \ + sh support/typed-uri-diff.sh "$(SCHEME)" "$(LIBDIRS)" \ + "$(TYPED_URI_DIFF_DIR)" $(TYPED_URI_PILOT_SOURCE) + +typed-uri-diff-repro: + @$(MAKE) --no-print-directory typed-uri-diff \ + TYPED_URI_DIFF_DIR="$(TYPED_URI_DIFF_REPRO_DIR)/default-a" \ + TYPED_URI_DIFF_SEED="$(TYPED_URI_DIFF_SEED)" + @$(MAKE) --no-print-directory typed-uri-diff \ + TYPED_URI_DIFF_DIR="$(TYPED_URI_DIFF_REPRO_DIR)/default-b" \ + TYPED_URI_DIFF_SEED="$(TYPED_URI_DIFF_SEED)" + @$(MAKE) --no-print-directory typed-uri-diff \ + TYPED_URI_DIFF_DIR="$(TYPED_URI_DIFF_REPRO_DIR)/alt" \ + TYPED_URI_DIFF_SEED="$(TYPED_URI_DIFF_ALT_SEED)" + @hash_a="$$(shasum -a 256 "$(TYPED_URI_DIFF_REPRO_DIR)/default-a/cases.hex" | cut -d ' ' -f 1)"; \ + hash_b="$$(shasum -a 256 "$(TYPED_URI_DIFF_REPRO_DIR)/default-b/cases.hex" | cut -d ' ' -f 1)"; \ + hash_alt="$$(shasum -a 256 "$(TYPED_URI_DIFF_REPRO_DIR)/alt/cases.hex" | cut -d ' ' -f 1)"; \ + if [ "$$hash_a" != "$$hash_b" ]; then \ + echo "typed-uri-diff-repro: FAIL default seed hashes differ: $$hash_a $$hash_b" >&2; \ + exit 1; \ + fi; \ + if [ "$$hash_a" = "$$hash_alt" ]; then \ + echo "typed-uri-diff-repro: FAIL alternate seed produced default corpus hash: $$hash_a" >&2; \ + exit 1; \ + fi; \ + echo "typed-uri-diff-repro: PASS default_seed=$(TYPED_URI_DIFF_SEED) hash=$$hash_a alt_seed=$(TYPED_URI_DIFF_ALT_SEED) alt_hash=$$hash_alt" + +typed-uri-bench: typed-uri-corpus-check + @sh support/typed-uri-bench.sh "$(SCHEME)" "$(LIBDIRS)" \ + "$(TYPED_URI_BENCH_DIR)" "$(TYPED_URI_BENCH_MAX_RATIO)" \ + "$(TYPED_URI_BENCH_ITERS)" "$(TYPED_URI_BENCH_SAMPLES)" \ + $(TYPED_URI_PILOT_SOURCE) + +typed-json-scan-corpus-check: + @python3 support/typed-json-scan-corpus-check.py + +typed-json-scan-diff: typed-json-scan-corpus-check + @TYPED_JSON_SCAN_DIFF_SEED="$(TYPED_JSON_SCAN_DIFF_SEED)" \ + TYPED_JSON_SCAN_DIFF_FUZZ_CASES="$(TYPED_JSON_SCAN_DIFF_FUZZ_CASES)" \ + sh support/typed-json-scan-diff.sh \ + "$(SCHEME)" \ + "$(LIBDIRS)" \ + "$(TYPED_JSON_SCAN_DIFF_DIR)" \ + $(TYPED_JSON_SCAN_SOURCES) + +typed-json-value-corpus-check: + @python3 support/typed-json-value-corpus-check.py + +typed-json-value-diff: typed-json-value-corpus-check + @TYPED_JSON_VALUE_DIFF_SEED="$(TYPED_JSON_VALUE_DIFF_SEED)" \ + TYPED_JSON_VALUE_DIFF_FUZZ_CASES="$(TYPED_JSON_VALUE_DIFF_FUZZ_CASES)" \ + sh support/typed-json-value-diff.sh \ + "$(SCHEME)" \ + "$(LIBDIRS)" \ + "$(TYPED_JSON_VALUE_DIFF_DIR)" \ + $(TYPED_JSON_VALUE_SOURCES) + +typed-json-value-diff-repro: + @$(MAKE) --no-print-directory typed-json-value-diff \ + TYPED_JSON_VALUE_DIFF_DIR="$(TYPED_JSON_VALUE_DIFF_REPRO_DIR)/default-a" \ + TYPED_JSON_VALUE_DIFF_SEED="$(TYPED_JSON_VALUE_DIFF_SEED)" + @$(MAKE) --no-print-directory typed-json-value-diff \ + TYPED_JSON_VALUE_DIFF_DIR="$(TYPED_JSON_VALUE_DIFF_REPRO_DIR)/default-b" \ + TYPED_JSON_VALUE_DIFF_SEED="$(TYPED_JSON_VALUE_DIFF_SEED)" + @$(MAKE) --no-print-directory typed-json-value-diff \ + TYPED_JSON_VALUE_DIFF_DIR="$(TYPED_JSON_VALUE_DIFF_REPRO_DIR)/alt" \ + TYPED_JSON_VALUE_DIFF_SEED="$(TYPED_JSON_VALUE_DIFF_ALT_SEED)" + @hash_a="$$(shasum -a 256 "$(TYPED_JSON_VALUE_DIFF_REPRO_DIR)/default-a/cases.hex" | cut -d ' ' -f 1)"; \ + hash_b="$$(shasum -a 256 "$(TYPED_JSON_VALUE_DIFF_REPRO_DIR)/default-b/cases.hex" | cut -d ' ' -f 1)"; \ + hash_alt="$$(shasum -a 256 "$(TYPED_JSON_VALUE_DIFF_REPRO_DIR)/alt/cases.hex" | cut -d ' ' -f 1)"; \ + if [ "$$hash_a" != "$$hash_b" ]; then \ + echo "typed-json-value-diff-repro: FAIL default seed hashes differ: $$hash_a $$hash_b" >&2; \ + exit 1; \ + fi; \ + if [ "$$hash_a" = "$$hash_alt" ]; then \ + echo "typed-json-value-diff-repro: FAIL alternate seed produced default corpus hash: $$hash_a" >&2; \ + exit 1; \ + fi; \ + echo "typed-json-value-diff-repro: PASS default_seed=$(TYPED_JSON_VALUE_DIFF_SEED) hash=$$hash_a alt_seed=$(TYPED_JSON_VALUE_DIFF_ALT_SEED) alt_hash=$$hash_alt" + +typed-json-value-bench: typed-json-value-corpus-check + @sh support/typed-json-value-bench.sh \ + "$(SCHEME)" \ + "$(LIBDIRS)" \ + "$(TYPED_JSON_VALUE_BENCH_DIR)" \ + "$(TYPED_JSON_VALUE_BENCH_MAX_RATIO)" \ + "$(TYPED_JSON_VALUE_BENCH_ITERS)" \ + "$(TYPED_JSON_VALUE_BENCH_SAMPLES)" \ + $(TYPED_JSON_VALUE_SOURCES) + +typed-json-value-public-smoke: typed-json-value-corpus-check + @$(MAKE) --no-print-directory typed-build TYPED_RUST_SOURCES=lib/std/text/json-typed-value.ss TYPED_WRAPPER_DIR=$(TYPED_JSON_VALUE_PUBLIC_SMOKE_DIR) + @lib="$$(find $(TYPED_RUST_DIR)/target/debug -maxdepth 1 \( -name 'libjerboa_typed_generated.dylib' -o -name 'libjerboa_typed_generated.so' \) -print | head -n 1)"; \ + test -n "$$lib" || { echo "ERROR: generated typed Rust dynamic library not found" >&2; exit 1; }; \ + lib="$$(cd "$$(dirname "$$lib")" && pwd -P)/$$(basename "$$lib")"; \ + DYLD_INSERT_LIBRARIES="$$lib" \ + LD_PRELOAD="$$lib" \ + JERBOA_TYPED_JSON_ENABLE=1 \ + $(SCHEME) --libdirs $(LIBDIRS) --script tests/test-typed-json-value-public-e2e.ss + +typed-json-scan-bench: typed-json-scan-corpus-check + @sh support/typed-json-scan-bench.sh \ + "$(SCHEME)" \ + "$(LIBDIRS)" \ + "$(TYPED_JSON_SCAN_BENCH_DIR)" \ + "$(TYPED_JSON_SCAN_BENCH_MAX_RATIO)" \ + "$(TYPED_JSON_SCAN_BENCH_ITERS)" \ + "$(TYPED_JSON_SCAN_BENCH_SAMPLES)" \ + $(TYPED_JSON_SCAN_SOURCES) + +typed-uri-wrapper-smoke: typed-uri-corpus-check + @$(MAKE) --no-print-directory typed-build TYPED_RUST_SOURCES=lib/std/net/uri/typed-core.ss TYPED_WRAPPER_DIR=build/typed/uri-wrapper-smoke + @lib="$$(find $(TYPED_RUST_DIR)/target/debug -maxdepth 1 \( -name 'libjerboa_typed_generated.dylib' -o -name 'libjerboa_typed_generated.so' \) -print | head -n 1)"; \ + test -n "$$lib" || { echo "ERROR: generated typed Rust dynamic library not found" >&2; exit 1; }; \ + lib="$$(cd "$$(dirname "$$lib")" && pwd -P)/$$(basename "$$lib")"; \ + JERBOA_TYPED_RUST_DEV_NATIVE=1 \ + JERBOA_TYPED_RUST_LIB="$$lib" \ + TYPED_URI_WRAPPER_FILE="build/typed/uri-wrapper-smoke/std_net_uri_typed_core.ss" \ + $(SCHEME) --libdirs $(LIBDIRS) --script tests/test-typed-uri-wrapper-e2e.ss + +typed-uri-public-smoke: typed-uri-corpus-check + @$(MAKE) --no-print-directory typed-build TYPED_RUST_SOURCES=lib/std/net/uri/typed-core.ss TYPED_WRAPPER_DIR=build/typed/uri-public-smoke + @lib="$$(find $(TYPED_RUST_DIR)/target/debug -maxdepth 1 \( -name 'libjerboa_typed_generated.dylib' -o -name 'libjerboa_typed_generated.so' \) -print | head -n 1)"; \ + test -n "$$lib" || { echo "ERROR: generated typed Rust dynamic library not found" >&2; exit 1; }; \ + lib="$$(cd "$$(dirname "$$lib")" && pwd -P)/$$(basename "$$lib")"; \ + DYLD_INSERT_LIBRARIES="$$lib" \ + LD_PRELOAD="$$lib" \ + JERBOA_TYPED_URI_ENABLE=1 \ + $(SCHEME) --libdirs $(LIBDIRS) --script tests/test-typed-uri-public-e2e.ss + typed-llvmir: - @$(SCHEME) --libdirs $(LIBDIRS) --script support/typed-llvmir.ss $(TYPED_LLVMIR_DIR) $(TYPED_LLVMIR_SOURCES) + @mkdir -p "$(TYPED_LLVMIR_DIR)" + @rm -f "$(TYPED_LLVMIR_DIR)"/*.ll "$(TYPED_LLVMIR_DIR)"/*.bc "$(TYPED_LLVMIR_DIR)"/*.opt.bc + @$(SCHEME) --libdirs $(LIBDIRS) --script support/typed-llvmir.ss $(TYPED_LLVMIR_FLAGS) $(TYPED_LLVMIR_DIR) $(TYPED_LLVMIR_SOURCES) # Assemble and verify every generated .ll, then make sure it survives -O2. # Failures print the offending .ll path so the IR can be inspected directly. @@ -1155,6 +1980,7 @@ typed-llvmir-check: typed-llvmir exit 1; \ fi @for f in $(TYPED_LLVMIR_DIR)/*.ll; do \ + [ "$$f" = "$(TYPED_LLVMIR_WHOLE_PROGRAM)" ] && continue; \ "$(LLVM_BIN)/llvm-as" "$$f" -o "$${f%.ll}.bc" \ || { echo "typed-llvmir-check: llvm-as failed on $$f" >&2; exit 1; }; \ "$(LLVM_BIN)/opt" -passes=verify "$${f%.ll}.bc" -o /dev/null \ @@ -1163,6 +1989,146 @@ typed-llvmir-check: typed-llvmir || { echo "typed-llvmir-check: opt -O2 failed on $$f" >&2; exit 1; }; \ echo "typed-llvmir-check: OK $$f"; \ done + @if [ "$(TYPED_LLVMIR_LEAK_CHECK)" = "1" ]; then \ + $(SCHEME) --libdirs $(LIBDIRS) --script support/typed-llvmir.ss \ + --whole-program $(TYPED_LLVMIR_WHOLE_PROGRAM) $(TYPED_LLVMIR_LEAK_SOURCES) \ + || { echo "typed-llvmir-check: whole-program LLVM IR generation failed" >&2; exit 1; }; \ + sh support/typed-llvmir-leak-check.sh "$(LLVM_BIN)" \ + "$(TYPED_LLVMIR_WHOLE_PROGRAM)" \ + "$(TYPED_LLVMIR_LEAK_FN)" \ + "$(TYPED_LLVMIR_LEAK_EXPECT)" \ + "$(TYPED_LLVMIR_LEAK_STRICT)" \ + "$(TYPED_LLVMIR_DIR)/leak-check"; \ + fi + +typed-llvmir-leak-check: + @$(MAKE) --no-print-directory typed-llvmir-check \ + TYPED_LLVMIR_LEAK_CHECK=1 \ + TYPED_LLVMIR_LEAK_SOURCES="$(TYPED_LLVMIR_LEAK_SOURCES)" \ + TYPED_LLVMIR_LEAK_FN="$(TYPED_LLVMIR_LEAK_FN)" \ + TYPED_LLVMIR_LEAK_EXPECT="$(TYPED_LLVMIR_LEAK_EXPECT)" \ + TYPED_LLVMIR_LEAK_STRICT="$(TYPED_LLVMIR_LEAK_STRICT)" + +typed-llvmir-leak-suite: + @sh support/typed-llvmir-leak-suite.sh "$(SCHEME)" "$(LIBDIRS)" "$(LLVM_BIN)" \ + "$(TYPED_LLVMIR_DIR)/leak-suite" "$(TYPED_LLVMIR_LEAK_STRICT)" \ + "$(TYPED_LLVMIR_LEAK_SUITE_EXPECTED_CASES)" \ + $(TYPED_LLVMIR_LEAK_SUITE_CASES) + +typed-llvmir-wasm-object-smoke: + @if [ -z "$(LLVM_BIN)" ]; then \ + echo "typed-llvmir-wasm-object-smoke: LLVM tools not found (need llvm-as/opt/llc on PATH or in a Homebrew llvm keg)" >&2; \ + exit 1; \ + fi + @mkdir -p "$(TYPED_LLVMIR_WASM_DIR)" + @$(SCHEME) --libdirs $(LIBDIRS) --script support/typed-llvmir.ss \ + --whole-program "$(TYPED_LLVMIR_WASM_DIR)/smoke.ll" $(TYPED_LLVMIR_WASM_SOURCE) + @"$(LLVM_BIN)/llvm-as" "$(TYPED_LLVMIR_WASM_DIR)/smoke.ll" \ + -o "$(TYPED_LLVMIR_WASM_DIR)/smoke.bc" \ + || { echo "typed-llvmir-wasm-object-smoke: llvm-as failed" >&2; exit 1; } + @"$(LLVM_BIN)/opt" -passes=verify "$(TYPED_LLVMIR_WASM_DIR)/smoke.bc" -o /dev/null \ + || { echo "typed-llvmir-wasm-object-smoke: verifier failed" >&2; exit 1; } + @"$(LLVM_BIN)/opt" -O2 "$(TYPED_LLVMIR_WASM_DIR)/smoke.bc" \