Skip to content

Change/windows release build - #86

Merged
N4M3Z merged 7 commits into
mainfrom
change/windows-release-build
Nov 18, 2026
Merged

N4M3Z merged 7 commits into
mainfrom
change/windows-release-build

Conversation

@N4M3Z

@N4M3Z N4M3Z commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Note

Add Windows release build support to rune-cli and rune-docs

  • Adds a Windows CI job in test.yaml that runs workspace checks, builds the release binary, and runs rune-docs tests, treating warnings as errors
  • Rewrites Windows file-identity logic in confine.rs to use open handles, reject symlinks and non-regular files, and reject file indexes that do not uniquely name one file; is_same_file now keeps both handles open during comparison
  • Adds sync_directory in staging.rs, which skips the directory flush on Windows; write_file_atomic and conversion installation use it
  • Restricts Unix-only tests and helpers with #[cfg(unix)] so the test suite compiles on Windows; bumps rune-cli to 0.7.1 and adds winapi-util to the rune-docs lifecycle feature
  • Behavioral Change: Windows identity lookup and hash_file_with_identity now fail for directories, symlinks, and files without a usable file index; same_entry_semantics in deploy/mod.rs returns false when one entry is a symlink and the other is not

Macroscope summarized 870b32b.

Plan

Changes

Testing

Release Notes

  • N/A

Claude Fable 5.2 (claude-fable-5-2) and others added 7 commits November 17, 2026 14:09
The table header for nix sat above gix, rust-embed, jsonschema, and
every dashboard and terminal UI dependency. A dependency written below
a target table header belongs to that target, so a Windows build had
none of them and could not compile.

The nix table now comes after every shared dependency, with a comment
that says why it has to stay there.

Co-Authored-By: Martin Zeman <N4M3Z@users.noreply.github.com>
The Windows identity used Metadata::volume_serial_number and
Metadata::file_index, which are unstable, so the release build for
x86_64-pc-windows-msvc failed on stable Rust.

The identity now comes from GetFileInformationByHandle through
winapi-util, which the lock file already holds. A path is opened
without following a symlink and with no access right. The metadata of
that handle classifies the path as symlink_metadata does, so a symlink,
a junction, or a directory is refused. A deduplicated file or a cloud
file also carries a reparse point, but it is a regular file and keeps
its identity: a followed open of the same path reads the same index,
so the replacement checks agree with the hash step.

A path and an open file go through one function, so both refuse a
console, a pipe, or another device in the same way.

The comparison of two paths keeps both handles open, because a file
index is unique only while the file exists.

The identity holds plain numbers, not options: two empty options would
compare equal and every replacement check would pass.

The index is the 64-bit one. ReFS gives it only where it can map its
128-bit identifier to 64 bits without loss, and reports all bits set
for every other file. A file system with no index reports zero. Two
files with one of these values would compare equal, so the identity is
refused with an error and the transaction keeps its state.

New tests run on Unix and on Windows: two files differ, a hard link
equals its target, the handle and the path agree, and a replaced file
gets a new identity. A Windows test covers the two refused index
values.

Co-Authored-By: Martin Zeman <N4M3Z@users.noreply.github.com>
Several tests create a symbolic link or set a file mode through
std::os::unix with no platform condition, so the test targets did not
compile for Windows. Those tests are now Unix-only, as their neighbours
already are. The plugin tests run shell scripts with the executable
bit, so the whole file is Unix-only.

confirmation_of in the run tests was Unix-only while a test for every
platform calls it. Helpers that only Unix-only tests call are now
Unix-only too, so Windows reports no dead code.

Co-Authored-By: Martin Zeman <N4M3Z@users.noreply.github.com>
The Windows build warned about unreachable statements, unused
variables, and dead code where a Unix branch sits beside a Windows
branch that returns early or does nothing. The continuous integration
job for Windows denies warnings, so each one is removed.

Symbolic link creation in assemble and deploy moves into one function
per command, with a Unix form and a form that returns the same error
as before. The remaining changes name a value the Windows branch does
not use, or allow a lint on a function whose Unix form needs the
signature. No behavior changes on any platform.

Co-Authored-By: Martin Zeman <N4M3Z@users.noreply.github.com>
A spec transaction flushes a directory after it renames a file into
it and after it hard links a destination into it. Both places opened
the directory with File::open, which fails on Windows with an access
error, because a directory opens there only with
FILE_FLAG_BACKUP_SEMANTICS. Every spec transaction failed on Windows.

Both places now call one function, sync_directory. On Windows it
returns without a flush. The flush behind sync_all is FlushFileBuffers.
Microsoft documents it for a file, a volume, a pipe, and a
communications device, and says nothing about a directory handle or
about how a file system answers one. A flush that one file system
refuses would fail every transaction on that file system, so a flush
with no documented result is worse than none. The content of each
file is still flushed before the rename or the link.

Other platforms open and flush the directory as before.

Co-Authored-By: Martin Zeman <N4M3Z@users.noreply.github.com>
The release workflow builds for Windows only on a signed tag, and the
release rehearsal runs only when the manifest, the lock file, or a
release workflow changes. A pull request that changed Rust code alone
never compiled for Windows, and the v0.7.0 release build failed after
the tag existed.

A Windows job in the test workflow now checks every target of the
workspace with all features on each pull request and each push to
main, with warnings denied. It then runs the release build command of
the release matrix, because a check in the debug profile does not
compile code that only the release profile enables and does not link
rune.exe. It also runs the rune-docs tests with all features. Code
that compiles for Windows can still fail there: a spec transaction
and file identity both depend on Windows file calls, and only a
Windows runner can prove them.

Co-Authored-By: Martin Zeman <N4M3Z@users.noreply.github.com>
The v0.7.0 release build for Windows did not compile. This version
carries the Windows build fix and nothing else.

Co-Authored-By: Martin Zeman <N4M3Z@users.noreply.github.com>
@github-actions github-actions Bot added size:large auto: changed-lines bucket area:docs auto: documentation and markdown area:workflows auto: CI and automation under .github and removed size:large auto: changed-lines bucket labels Nov 18, 2026
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-18T00:34:02.708618Z 870b32b PR opened
🔒 Security Review ✅ Completed 2026-11-18T00:37:46.752416Z 870b32b PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions github-actions Bot added the size:large auto: changed-lines bucket label Nov 18, 2026
@macroscopeapp

macroscopeapp Bot commented Nov 18, 2026

Copy link
Copy Markdown

Approvability

Verdict: Approved at 870b32b

Macroscope's review found this PR approvable — Restores Windows builds and handle-based file identity checks, with dedicated Windows CI coverage. Local spec operations retain confinement, content verification, backups, and recovery; Unix behavior remains substantially unchanged.

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.

@runeseer

runeseer Bot commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

review/correctness round 1 started on 870b32b4 at ledger generation 1.

@runeseer

runeseer Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @N4M3Z's task in 3m 6s —— View job


Correctness review

  • Read lane inputs and ledger
  • Review the diff against origin/main
  • Judge the other lanes' findings
  • Write verdict files

Looks good. The Windows file identity now comes from an open handle that rejects a zero or all-bits-set index, so two files can no longer compare equal and pass a replacement check.

  • The cfg refactors in assemble, deploy, and hook keep their Unix behaviour: same_entry_semantics and executable still answer exactly as before.
  • open_without_following opens with no access right and FILE_FLAG_OPEN_REPARSE_POINT, so file_identity classifies a path as symlink_metadata does and refuses a symlink, a junction, and a directory.
  • Nonblocking: Windows skips the directory flush, so a rename is durable only once the file system writes it. The comment at rune-docs/src/spec/transaction/staging.rs:127 and the changelog state this.

No blocking findings. Other lanes reported none.
· change/windows-release-build

@runeseer

runeseer Bot commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Runeseer review — clean

Looks good. The Windows file identity now comes from an open handle that rejects a zero or all-bits-set index, so two files can no longer compare equal and pass a replacement check.

  • The cfg refactors in assemble, deploy, and hook keep their Unix behaviour: same_entry_semantics and executable still answer exactly as before.
  • Nonblocking: Windows skips the directory flush, so a rename is durable only once the file system writes it. The comment and changelog state this.

No open findings · Reviewed 870b32b4 · review run · $1.34 · 3m6s · 20 turns

@runeseer runeseer Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Earned approval: review/correctness returned a clean verdict for 870b32b at ledger generation 1. Dismissed automatically on any new push or generation.

@N4M3Z
N4M3Z merged commit c235996 into main Nov 18, 2026
29 of 37 checks passed
@N4M3Z
N4M3Z deleted the change/windows-release-build branch November 18, 2026 14:50
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 area:workflows auto: CI and automation under .github size:large auto: changed-lines bucket

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant