Skip to content

Add package targets, build profiles, and unified artifact layouts - #175

Merged
LunaStev merged 1 commit into
wavefnd:masterfrom
LunaStev:feat/package-targets-profiles
Oct 19, 2026
Merged

LunaStev merged 1 commit into
wavefnd:masterfrom
LunaStev:feat/package-targets-profiles

Conversation

@LunaStev

Copy link
Copy Markdown
Member

Summary

Add manifest-owned package targets, build profiles, and one artifact layout for ordinary and native builds. A package can now expose its canonical Wave library alongside multiple named binaries, and Vex validates every selected build plan before compiling the first target.

Closes #46
Closes #47
Closes #48
Closes #54

Why

The previous single lib switch could not represent a library plus CLI or multiple binaries. Ordinary builds delegated artifact placement to wavec while native builds used a separate target/profile layout, and --release was only a hard-coded optimization flag. These differences prevented a consistent package build contract and reliable tooling output.

Behavior

  • Manifest format 3 declares one optional targets.lib, explicit targets.bins, default_run, profiles, a default compiler target, and exact-triple platform settings. Formats 1 and 2 retain their parsing/string meanings and are not rewritten automatically. Lockfile v3 and locked/offline graph semantics remain unchanged.
  • build/check default to all root targets, with --lib and repeatable --bin <name> selectors. run chooses an explicit binary, default_run, or the only binary; ambiguity is an error. Dependencies contribute their source library, not their binaries or separately emitted library objects.
  • Profiles support dev/release and custom profiles inheriting one builtin, with optimization levels 0–3. --release aliases --profile release. Debug information, overflow/assertion switches, LTO, and size-optimization policies without a guaranteed compiler contract are rejected rather than silently ignored. Wave language entry/main semantics remain compiler-owned.
  • All manifests now emit into target/<compiler-triple>/<profile>/bin/ or lib/, with separate intermediates and protected Windows companion files. Old artifacts are not automatically moved or deleted. Compiler plans must honor the selected output kind, final destination, and intermediate namespace.
  • Hosted, freestanding ELF, WASI and bare Wasm configurations use typed mode/entry/startup/linker-script settings. Root-owned linker/sysroot settings do not propagate from dependencies. Unsupported compiler combinations fail explicitly; external SDK contents are not pinned by the Wave dependency lockfile.
  • Every selected target is planned and checked for output collisions/ownership before compilation. Execution stops at the first failure and keeps earlier successful artifacts. Run generations and their leases remain isolated; the project build guard is released before spawning the program.
  • Metadata adds --format-version 2 for target/profile/platform declarations without compiler queries. The default remains schema 1, which rejects packages it cannot represent accurately. Doctor checks every root target.
  • Dry-run stdout changes for all manifests: it is now one versioned vex.build-plan envelope containing the selected profile and per-target compiler plans. Each selected target invokes the planner once; dry-run creates no build outputs or message file.

The migration and command contracts are documented in docs/targets-and-profiles.md, the reference pages, and JSON schemas. Existing required real-compiler CI smokes now exercise format 3 mixed targets, self-imports, profiles, metadata and native exports. Contributor good first issue tasks are not included or linked for automatic closure.

Validation

  • cargo fmt --check
  • cargo test --workspace --locked — 289 passed; one existing subprocess-fixture test is intentionally ignored and invoked by supervision tests.
  • cargo clippy --workspace --locked --all-targets -- -D warnings
  • cargo build --workspace --locked
  • python3 x.py check — includes the checks above and 38 Python tests.
  • Parser mutation corpus: 20,000 cases, seed 20261018, including the new format 3 model.
  • CLI reference, Markdown links/anchors, JSON schema parsing and repository platform-contract checks.
  • Workspace cross checks: x86_64-pc-windows-gnu, aarch64-unknown-linux-gnu, riscv64gc-unknown-linux-gnu.
  • Linux real-compiler wave_compatibility.py and native_interop.py, including persisted format 3 cases, C/C++/Rust inputs and C consumers of Wave object/shared artifacts.
  • Additional real-compiler build/check of freestanding ELF, WASI, bare wasm32/wasm64, and mixed library/binary Wasm artifacts.

The local compiler reports 0.2.1-pre-beta; its executable SHA-256 is e4439dc77b0a142dd38e22406cf489c2ee123bcf2ec474afbefd072078a0e504. Its exact build source commit was not inferred from its version. Cross checks establish compilation, not native runtime acceptance; all nine platform CI lanes must pass on this PR before merge.

Checklist

  • The change is focused and targets wavefnd/Vex:master.
  • User-facing behavior and recovery instructions are documented.
  • Dependency changes preserve lockfile reproducibility.
  • --locked and --offline behavior remains correct.
  • No raw wavec flags were added to the Vex CLI.
  • New commits include a DCO Signed-off-by: line.

Signed-off-by: LunaStev <luna@lunastev.org>
@LunaStev
LunaStev merged commit 3e92ec5 into wavefnd:master Oct 19, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant