Skip to content

Fix native providers and add Darwin and FreeBSD runtime validation - #800

Merged
LunaStev merged 3 commits into
wavefnd:masterfrom
LunaStev:fix/native-provider-validation
Sep 26, 2026
Merged

LunaStev merged 3 commits into
wavefnd:masterfrom
LunaStev:fix/native-provider-validation

Conversation

@LunaStev

Copy link
Copy Markdown
Member

Summary

Fix native provider defects and add execution coverage for supported OS targets:

  • Validate equal Linux dup2 descriptors, normalize the loong64 target alias, and export Darwin MAP_ANONYMOUS.
  • Preserve pre-1970 Windows timestamps and propagate macOS kqueue deletion failures without silently leaving the other filter behind.
  • Implement Windows system randomness with BCryptGenRandom and automatic bcrypt linking, plus FreeBSD amd64 randomness through the raw getrandom syscall. Preserve partial-fill progress and failures.
  • Execute bidirectional C/Wave ABI fixtures on both native macOS runners at O0/O2, including narrow values, odd-sized and aligned aggregates, register exhaustion, indirect returns, and variadic promotions.
  • Run FreeBSD amd64 provider fixtures in an isolated VM using a SHA-256-pinned official image. Bound provisioning, boot, commands and cases; preserve logs and machine-readable failures.

Motivation

These defects report invalid operations as successful, lose native error information, misrepresent Windows timestamps, and leave system randomness unavailable on supported targets. Existing compile-only checks also leave gaps in Darwin ABI and FreeBSD kernel validation.

Closes #779
Closes #780
Closes #781
Closes #782
Closes #783
Closes #786
Closes #787
Closes #788
Closes #789

Target and compatibility impact

Public API shapes remain unchanged. Windows applications using the default native link gain the system bcrypt dependency. FreeBSD entropy support is scoped to amd64. Darwin MAP_ANON remains available alongside its alias. Missing kqueue registrations return ENOENT consistently with the existing FreeBSD provider.

Native macOS, Windows and FreeBSD execution is intentionally assigned to this PR's CI; local cross-compilation and mocked OS calls are not claimed as native verification. No libc FFI is added. The mirror workflow and active contributor changes are untouched.

Validation

Checkout compiler/std, LLVM 21, Cargo --locked --jobs 2:

  • cargo test --workspace --all-targets: 304 passed.
  • cargo test --test native_providers: 4 passed, including O0/O2 OS-boundary failures, native Linux descriptor checks, and cross-target provider/ABI compilation.
  • 13 FreeBSD provider fixtures statically linked at O0/O2: 26 binaries; no local VM execution.
  • cargo build --release and python3 tools/check_wave_corpus.py --wavec target/release/wavec --run-std-examples: 291 corpus checks and 26 examples passed.
  • Python tooling suites: 46 tests, 45 passed and one existing platform skip; includes six FreeBSD reporting/failure-path tests.
  • Workspace Clippy and rustdoc with -D warnings, formatting, std policy, case manifest and diff checks passed.
  • Changed workflows passed actionlint 1.7.7, excluding its two unknown pre-existing runner labels. ShellCheck was unavailable.

Checklist

  • Commits include a DCO Signed-off-by line.
  • Tests cover new behavior or the PR explains why no test is needed.
  • User-facing changes include documentation or diagnostics updates: existing errno contracts are preserved, and runtime failures include target, optimization, fixture, command and process result.
  • The change preserves the license boundary between the compiler and std/.

@LunaStev
LunaStev merged commit 3904223 into wavefnd:master Sep 26, 2026
26 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment