Skip to content

fix(windows): build rune and install a deck on Windows - #85

Closed
LangrMartin wants to merge 2 commits into
runedeck:mainfrom
LangrMartin:fix/windows-build
Closed

LangrMartin wants to merge 2 commits into
runedeck:mainfrom
LangrMartin:fix/windows-build

Conversation

@LangrMartin

@LangrMartin LangrMartin commented Nov 17, 2026 •

Copy link
Copy Markdown

Make rune build on Windows and install a deck there. Behaviour on macOS and Linux does not change.

Note

Fix Windows build and deck install with slash-separated path handling

  • Fixes the Windows build: Cargo.toml previously placed shared dependencies (including gix) under the Unix-only target table, and rune-docs gains an optional Windows winapi-util dependency in the lifecycle feature
  • Replaces Windows file-identity lookups with handle-based volume-serial and file-index reads in confine and verify, and skips directory syncing on Windows via a shared sync_directory helper
  • Adds paths.rs with slash_separators/slash_text helpers and applies them across assemble, deploy, validate, drift, provenance, and manifest code so paths use slash separators on Windows
  • Manifest reading normalizes backslash-separated keys and provenance paths as slash-separated on Windows, so legacy manifests from Windows installs still resolve
  • Also records the module's source URI for files collected from a single-module .rune source in resolve_sources
  • Risk: non-Windows platforms must reject backslashes in path text — source_snapshot.path_text and bundle.Inventory.walk keep that behavior; check those sites if path validation changes

Macroscope summarized a6139fe.

Plan

Rune compares and splits relative paths as /-separated text. On Windows those paths carried \, so the snapshot and bundle checks refused every path and rune install stopped with source path has an ambiguous separator or control character. One helper now converts a path where it becomes stored or compared text, instead of patching call sites as they fail. docs/decisions/RUST-0015 Portable Path Text.md records the decision.

Changes

  • Adds slash_text and slash_separators in src/services/paths.rs and routes relative paths through them in manifest (snapshot, bundle, provenance paths), assemble/sources, deploy, doctor, drift, provenance/scan, provider/detection, skill_readiness, services/discovery, and validate.
  • Reads a manifest written with \ keys as the same files in src/manifest/read.rs. An install over such a manifest pruned the files it had just deployed.
  • Reads the Windows file identity from the open handle through winapi-util in rune-docs/src/spec/transaction/confine.rs. The windows_by_handle calls did not compile on stable. Skips directory sync on Windows in staging.rs.
  • Moves the [target.'cfg(unix)'.dependencies] table below the shared dependencies in Cargo.toml. It had captured gix, jsonschema, rust-embed, and the dashboard and TUI crates.
  • Gates three symlink tests with #[cfg(unix)] in src/services/atomic.rs and src/services/confine.rs, so the library tests compile on Windows.
  • Records the module name as the provenance source for a single-module source in src/cli/dotrune/resolve.rs. This is a separate commit and not specific to Windows: the source was empty, and every install ended with source snapshot remains unverified.

Testing

Windows 11, stable-x86_64-pc-windows-gnu, Rust 1.94.1, against the runedeck deck in an isolated target directory.

  • rune add --cast all, then rune install --provider claude: deploys, rules land in rules/.
  • Second rune install: every file skipped as unchanged.
  • rune doctor, rune drift, rune provenance: all files ok, identical, verified.
  • A locally edited file is left alone, and a narrower selection moves stale files to .trash/<stamp>/.
  • Install over a .claude whose manifest has \ keys: no file missing afterwards.
  • cargo test -p rune-docs --features lifecycle: passes.
  • cargo test --lib: passes apart from three tests that assert Unix-shaped path text, two in provider::tests and one in target::tests.
  • cargo fmt --check, and Clippy on the touched files: clean.
  • make test and the Linux suite: not run, there is no Linux machine here. The integration tests under tests/ were not run on Windows either: they isolate the home directory through HOME, which dirs::home_dir ignores there, so they would write to the real home directory.

Still open on Windows: symlink assembly and deployment return an explicit error, target::Scope::Project builds its key by replacing / only, and the build prints warnings from the #[cfg(not(unix))] branches in the symlink code.

Try it on Windows
git clone --branch fix/windows-build https://github.com/LangrMartin/cli.git
cd cli
cargo install --path .
git clone https://github.com/runedeck/deck.git ../deck
mkdir ../trial && cd ../trial
rune add --cast all --source ../deck
rune install --provider claude
rune doctor --target .

rune install in a directory that an older tool already deployed into takes over .claude/.manifest. Run it against a copy first.

Release Notes

  • Rune builds on Windows and installs a deck there.

🤖 Generated with Claude Code

Relative paths that become stored or compared text go through services::paths, so manifest keys, provenance paths, and snapshot entries read with a forward slash on every platform. A manifest written with backslash keys is read as the same files.

rune-docs reads the Windows file identity from the open handle through winapi-util, and the Unix target table in Cargo.toml sits below the dependencies that every platform needs.

See docs/decisions/RUST-0015 Portable Path Text.md.
…e-module source

A single-module source in .rune left the provenance source empty, so the installed snapshot check failed and every install ended with a warning that the source snapshot remains unverified. The deck branch already sets it.
@LangrMartin
LangrMartin requested a review from N4M3Z as a code owner November 17, 2026 00:25
@github-actions github-actions Bot added size:large auto: changed-lines bucket area:docs auto: documentation and markdown labels Nov 17, 2026
@macroscopeapp

macroscopeapp Bot commented Nov 17, 2026

Copy link
Copy Markdown

Approvability

Verdict: Approved at a6139fe

Macroscope's review found this PR approvable — Makes Windows builds and deck installs work by normalizing path text and using stable file-identity APIs, while preserving Unix behavior. Local file safeguards remain in place, and reported isolated Windows exercises cover installation and inspection commands.

Notes:

  • Macroscope's correctness review did not run, so approvability was decided on eligibility alone.

You can add or adjust custom eligibility rules. Learn more.

@LangrMartin

Copy link
Copy Markdown
Author

quality and dashboard fail on three clippy::map_unwrap_or findings in files this pull request does not touch:

  • rune-docs/src/adr.rs:468
  • rune-docs/src/spec/fix.rs:171
  • rune-docs/src/spec/terms.rs:225

Clippy 1.94.1 on my machine does not report them, so I assume the CI toolchain is newer. I left them alone to keep this change about Windows. I can add the fix here if you prefer that.

@N4M3Z

N4M3Z commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Thank you for this pull request, LangrMartin. It is closed as superseded by #89, which carries its two fixes that main still lacked.

Most of what this pull request fixes landed on main another way while it waited, in #86, #87, and #88. That is why it conflicts in 24 files. Two of its fixes were in none of them, and #89 brings them over from this pull request:

  • A manifest key and its provenance path that hold \ on Windows now read as their / form, so a manifest a Windows build wrote that way still names the files it deployed (ea57335).
  • A single-module source in .rune now records its module as the provenance source. The source was empty, and every install from one warned that the source snapshot remains unverified (9ca76f4).

The port uses main's own manifest::slash_lossy instead of a new services/paths.rs, and each fix comes with a test that fails without it. Both commits and #89 credit this pull request.

Both fixes shipped in v0.7.1, the first release that builds and runs on Windows. Its rune-cli-windows-x86_64.zip is on the release page, and brew install runedeck/tap/rune installs the prebuilt binary on Apple Silicon macOS and x86-64 Linux.

@N4M3Z N4M3Z closed this Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:docs auto: documentation and markdown size:large auto: changed-lines bucket

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants