Repository navigation
Change/windows release build - #86
Conversation
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>
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
ApprovabilityVerdict: Approved at 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:
You can add or adjust custom eligibility rules. Learn more. |
|
review/correctness round 1 started on |
|
Claude finished @N4M3Z's task in 3m 6s —— View job Correctness review
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.
No blocking findings. Other lanes reported none. |
Runeseer review — cleanLooks 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.
No open findings · Reviewed |
Note
Add Windows release build support to rune-cli and rune-docs
is_same_filenow keeps both handles open during comparisonsync_directoryin staging.rs, which skips the directory flush on Windows;write_file_atomicand conversion installation use it#[cfg(unix)]so the test suite compiles on Windows; bumps rune-cli to 0.7.1 and addswinapi-utilto the rune-docs lifecycle featurehash_file_with_identitynow fail for directories, symlinks, and files without a usable file index;same_entry_semanticsin deploy/mod.rs returns false when one entry is a symlink and the other is notMacroscope summarized 870b32b.
Plan
Changes
Testing
Release Notes