Add a Nix flake for Windows cross-builds #609

Open
github-bot wants to merge 1 commit from github-bot/gh-609 into main AGit
Owner

@⁠colonelpanic8 on GitHub · 2026-11-25 03:12 UTC · original
colonelpanic8:dev/nix-flake → main · +160 −0 · 7 files · 1 commits · open

Summary

  • Add an opt-in Nix flake for building the Windows MSVC CLI from x86-64 Linux. Fenix reads the existing Rust toolchain pin, and cargo-xwin uses pinned Windows SDK and CRT versions.
  • Document the build and asset-free Wine smoke tests. Add optional direnv integration with ignored local cache overrides.
  • Allow the new text configuration files in the asset policy and make the existing pre-commit hook executable on Linux.

Validation

  • Built the locked release CLI for x86_64-pc-windows-msvc and repeated the build with empty Cargo build directories.
  • Ran victory.exe --help in Wine and passed 19 focused tests across victory, victory-core, and victory-pe.
  • Passed the four native xtask tests, the asset-policy check, Nix formatting and flake evaluation, and strict Clippy for xtask and the Windows CLI with diagnostics enabled.
**@⁠colonelpanic8** on GitHub · 2026-11-25 03:12 UTC · [original](https://github.com/fxceless/victory-fork/pull/609) `colonelpanic8:dev/nix-flake` → `main` · +160 −0 · 7 files · 1 commits · open ## Summary - Add an opt-in Nix flake for building the Windows MSVC CLI from x86-64 Linux. Fenix reads the existing Rust toolchain pin, and cargo-xwin uses pinned Windows SDK and CRT versions. - Document the build and asset-free Wine smoke tests. Add optional direnv integration with ignored local cache overrides. - Allow the new text configuration files in the asset policy and make the existing pre-commit hook executable on Linux. ## Validation - Built the locked release CLI for `x86_64-pc-windows-msvc` and repeated the build with empty Cargo build directories. - Ran `victory.exe --help` in Wine and passed 19 focused tests across `victory`, `victory-core`, and `victory-pe`. - Passed the four native `xtask` tests, the asset-policy check, Nix formatting and flake evaluation, and strict Clippy for `xtask` and the Windows CLI with diagnostics enabled.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:47:22 +00:00
Author
Owner

@⁠avt0m4t48 on GitHub · 2026-11-25 03:22 UTC · original · edited 2026-11-25 05:59 UTC

I reproduced a bootstrap failure in the optional direnv path on 62b8c7317cde7133f245603acbfe20a2bd0c073c. With direnv 2.32.1 and no preloaded nix-direnv, direnv allow . followed by direnv exec . /bin/true logs a hash mismatch for the source URL in .envrc. Check stderr because the command itself can return zero.

url=https://raw.githubusercontent.com/nix-community/nix-direnv/3.0.6/direnvrc
curl -fsSL "$url" | openssl dgst -sha256 -binary | base64

The downloaded bytes have the SRI hash sha256-RYcUJaRMf8oF5LznDrlCXbkOQrywm0HDv1VjYGaJGdM=. I confirmed that direnv fetchurl accepts this value and returns the same bytes. Updating the pin would fix the observed fetch failure.

On the same head, all four Linux xtask tests passed. The installed pre-commit hook accepted the 172 staged repository files and rejected a staged file with an unapproved synthetic extension. The CLI and test targets passed Windows MSVC cross-target cargo check with diagnostics and blake3/pure. Nix parsed the flake and the Rust manifest matched its hash. Full shell evaluation stopped because the isolated Debian Nix package expected /usr/bin/bash-static. The linked cargo-xwin build and Wine execution remain unverified in this check.

Recheck on 606811b5d85948a18138db494b0b075a5188bee3

The direnv mismatch still occurs with a clean direnv 2.32.1 configuration. In a separate fixture, changing only the pin to the hash above let both .envrc.override and .envrc.local load without the mismatch.

Default shell derivation evaluation now passes in an isolated store with Nix 2.26.3. I primed the store with the byte-verified Rust 1.98.1 manifest using nix store add-file channel-rust-1.98.1.toml. Its flat store path matched the Fenix fetch output, and the shell evaluated to /nix/store/ganc1wixymkxs5haz1hvx9g0sls3mkvn-nix-shell.drv. A dry run reported 17 derivations to build and 3,831.20 MiB of unpacked downloads, which exceeded available local space.

The revised head passed four Linux xtask tests, the asset policy and staged hook over 174 files, and locked Windows MSVC CLI/test cargo check with diagnostics and blake3/pure. Full shell realization, Windows linking and Wine execution remain unverified here. No game files were used.

AI-assisted using Codex.

**@⁠avt0m4t48** on GitHub · 2026-11-25 03:22 UTC · [original](https://github.com/fxceless/victory-fork/pull/609#issuecomment-7151850531) · edited 2026-11-25 05:59 UTC I reproduced a bootstrap failure in the optional direnv path on `62b8c7317cde7133f245603acbfe20a2bd0c073c`. With direnv 2.32.1 and no preloaded nix-direnv, `direnv allow .` followed by `direnv exec . /bin/true` logs a hash mismatch for the source URL in `.envrc`. Check stderr because the command itself can return zero. ```sh url=https://raw.githubusercontent.com/nix-community/nix-direnv/3.0.6/direnvrc curl -fsSL "$url" | openssl dgst -sha256 -binary | base64 ``` The downloaded bytes have the SRI hash `sha256-RYcUJaRMf8oF5LznDrlCXbkOQrywm0HDv1VjYGaJGdM=`. I confirmed that `direnv fetchurl` accepts this value and returns the same bytes. Updating the pin would fix the observed fetch failure. On the same head, all four Linux xtask tests passed. The installed pre-commit hook accepted the 172 staged repository files and rejected a staged file with an unapproved synthetic extension. The CLI and test targets passed Windows MSVC cross-target `cargo check` with diagnostics and `blake3/pure`. Nix parsed the flake and the Rust manifest matched its hash. Full shell evaluation stopped because the isolated Debian Nix package expected `/usr/bin/bash-static`. The linked cargo-xwin build and Wine execution remain unverified in this check. **Recheck on `606811b5d85948a18138db494b0b075a5188bee3`** The direnv mismatch still occurs with a clean direnv 2.32.1 configuration. In a separate fixture, changing only the pin to the hash above let both `.envrc.override` and `.envrc.local` load without the mismatch. Default shell derivation evaluation now passes in an isolated store with Nix 2.26.3. I primed the store with the byte-verified Rust 1.98.1 manifest using `nix store add-file channel-rust-1.98.1.toml`. Its flat store path matched the Fenix fetch output, and the shell evaluated to `/nix/store/ganc1wixymkxs5haz1hvx9g0sls3mkvn-nix-shell.drv`. A dry run reported 17 derivations to build and 3,831.20 MiB of unpacked downloads, which exceeded available local space. The revised head passed four Linux xtask tests, the asset policy and staged hook over 174 files, and locked Windows MSVC CLI/test `cargo check` with diagnostics and `blake3/pure`. Full shell realization, Windows linking and Wine execution remain unverified here. No game files were used. AI-assisted using Codex.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/609/head:github-bot/gh-609'
git switch 'github-bot/gh-609'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-609'
git switch 'github-bot/gh-609'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-609'
git switch 'github-bot/gh-609'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-609'
git switch 'main'
git merge --squash 'github-bot/gh-609'
git switch 'main'
git merge --ff-only 'github-bot/gh-609'
git switch 'main'
git merge 'github-bot/gh-609'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.