Stabilize constant expressions, std installation and platform boundaries - #804
Merged
LunaStev merged 2 commits intoSep 27, 2026
Merged
Conversation
Signed-off-by: LunaStev <luna@lunastev.org>
Signed-off-by: LunaStev <luna@lunastev.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Evaluate supported global constant and static initializer expressions in HIR using ordered conversions and exact
utilsinteger arithmetic. Preserve short-circuiting, diagnose invalid operations duringcheck, and share integer-literal floating conversion with runtime lowering.Record an immutable std revision in the compiler. Make
install stdandupdate stduse that revision by default, with an explicit--refoverride that still validates compatibility and preserves the existing installation on failure.Convert Windows environment blocks from UTF-16 to UTF-8, validate Windows access modes and probe permissions without modifying files, reject unsupported wasm64 mmap requests before allocation, and preserve Unix child signal exit codes.
Gate RISC-V CRT and networking checks on successful release compiler creation, including after unrelated test failures.
Motivation
const N: i32 = 1 + 2previously passedcheckbut failed during LLVM emission. Installing a moving std branch could select a tree unrelated to the compiler. Platform providers also silently accepted unsupported access/mmap requests or lost environment encoding and child termination information.Fixes #750
Fixes #768
Fixes #526
Fixes #528
Fixes #705
Fixes #785
Fixes #650
Target and compatibility impact
WAVE_STD_REVISION; without Git metadata or that setting, installation requires an explicit--ref. CLI help and errors describe the new behavior.F_OKchecks existence;R_OK/W_OKuse non-destructive native opens, with readonly regular files rejecting writes.X_OKreturns -95; unknown mode bits return -22. Environment conversion preserves embedded separators, the final double NUL and special drive entries.Validation
Commands used
LLVM_SYS_211_PREFIX=/usr/lib64/llvm21locally.cargo test --locked --workspace --no-default-features --features llvm-target-core64 --jobs 2 --no-fail-fast: 320 tests exercised. Three socket-dependent failures passed when rerun outside the network sandbox. A new fixture was adjusted to avoid requiring external native i128 runtime helpers; its final regression suite passed.WAVE_RUN_WASM_RUNTIME_TESTS=1 cargo test --locked --jobs 2 --test release_constants --test frontend_regressions --test io_constant_regressions: all 29 tests passed, including O0/O2 constant/runtime comparisons and real wasm64 mmap execution in Node memory64.Focused
native_boundaries(8),stabilization_17(9), and driver library (11) tests passed. Windows amd64/ARM64 objects and mocked native API failure/cleanup paths were covered.Local Git installation tests covered pinned older revisions, explicit refs, incompatible manifests, missing refs/repositories, validation failure, replacement and rollback.
cargo clippy --locked --workspace --all-targets --jobs 2 -- -D warnings,cargo fmt --all --check, andgit diff --checkpassed.With the CI-pinned Rust 1.89 toolchain:
cargo +1.89 clippy --locked --all-targets --jobs 2 -- -D warnings,cargo +1.89 test --locked --jobs 2 --lib std::tests(4 tests), andcargo +1.89 fmt --all --checkpassed. The std revision tests exercise both recorded and missing revisions without build-time-constant conditionals. Workflow YAML and dependent-step success/failure/skipped/cancelled conditions were checked.Native wide-division helper provisioning is outside this change: wide constant quotients are checked against exact expected values; runtime wrapping and bitwise tests cover every integer width.
Checklist
Signed-off-byline.std/.