CI: build and test the host-independent crates on Linux #1241
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!1241
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1241"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@MIchiel1234 on GitHub · 2026-11-24 16:45 UTC · original
MIchiel1234:ci/linux-host-independent-crates→main· +167 −21 · 8 files · 1 commits · openBuild and test the host-independent crates on Linux
Nothing checked that the crates carrying no Windows dependency still build off Windows, and they did not: on a Linux host seven tests failed and
victory-gpudid not compile at all. CI runs onlywindows-latest, andrust-toolchain.tomllists only the MSVC target, so there was nowhere for this to show up.After this change the six crates in the new job are clean: 50 tests pass, 0 fail on
ubuntu-latest.current_exe()is not a PE on other hostsvictory-peandvictory-loaderreadcurrent_exe()when they needed a real PE32+ image:That holds only when the tests are built for Windows. On any other host the test binary is an ELF, which
ImageInfo::parserightly rejects, so four tests invictory-peand three invictory-loaderfailed for reasons unrelated to the code under test. The parser was never at fault.They now use a PE32+ image assembled in a new
victory-pe::fixturesmodule, behind afixturesfeature thatvictory-loaderenables as a dev-dependency. It has two sections, an entry point, one KERNEL32 import with a real import name table and IAT, a TLS directory with no callbacks, and a one-entry exception table.Building the image also pins down what the tests assert — the import count, the TLS directory RVA, an empty callback array — rather than depending on whatever the current linker emits.
rejects_iat_outside_imagestill drives the real overflow path it was written for.The one test that needs a genuinely loadable image,
windows_assigns_static_tls_to_a_prepared_dll, stayscfg(windows)and keeps usingcurrent_exe(), now with a comment saying why.A
cfg(windows)function called from ungated coderesource::view_formatinvictory-gpucallshost_resource, which is#[cfg(windows)], from an ungated function — oneE0425that stopped the crate compiling anywhere else. Its only caller,host_desc, is already gated, so gatingview_formattoo is a no-op on Windows and lets the crate build elsewhere.Scope of the CI job
The job covers the six crates that are clean today. Deliberately not the whole workspace yet, and the job's comment records why so the list can be widened:
victory-core,victory-pe,victory-formats,victory-pipeline,victory-game,victory-loader-D warningscleanvictory-gpu,victory-shadercfgfix, but still warn in this configurationvictory-hlexmem,lifecycle,filesreferenced from ungated code)Checks
cargo clippy -D warningsandcargo teston the six crates: clean, 50 passedcargo test -p xtask(asset policy, incl.repository_passes_policy): 4 passed.githooks/pre-commit(cargo xtask policy --staged): 8 files okvictory-peforx86_64-pc-windows-msvc, clippy-D warnings, default and--all-features: clean, so the fixture compiles on Windows tooNo game files, no assets and no generated data are added. The full workspace could not be typechecked for the MSVC target from Linux because
blake3's build script wantscl.exe; thevictory-gpuchange is inert on Windows by construction, as described above.@Zipettte on GitHub · 2026-11-24 17:59 UTC · original
Tested on AMD Radeon RX 7700 XT (RDNA3, gfx1101), driver 32.0.32029.2010, Windows 11, Rust 1.98.1 MSVC at
f02c702:cargo test -p victory-gpu -p victory-loader -p victory-pepasses, 82 passed / 0 failed. Workspace baseline on main (ffe310e) is green on the same machine (342 passed).Tested with AI assistance (Claude).
@Headache3318 on GitHub · 2026-11-25 00:59 UTC · original
Independent Linux verification at PR head
f02c70246c(not merged with main: unrelated histories, 93 add/add conflicts).cargo check --workspace --all-targets: 10 errors, all in victory-hle. 4× E0433 missing
windows_syscrate (imported in xgameui.rs but not in Cargo.toml); 6× E0433 non-gated references to cfg(windows) modules (xmemin d3d12x.rs,lifecyclein xgame.rs,filesin storage.rs).cargo test --workspace --locked: 0 tests run (build failed first). Same 9 compilation errors as check.
cargo clippy --workspace --all-targets -- -D warnings: 50 errors (23 in victory-gpu lib, 25 in victory-gpu lib test, 2 in victory-shader lib test) — unused imports/variables/unused_mut/dead_code. Build failed before reaching victory-hle.
Verdict: the workspace does not build or test on Linux as the title claims. victory-hle needs proper cross-platform guards and the missing windows_sys dependency. Clippy lints would fail even if compilation succeeded.
Arch Linux, kernel 7.3.5-arch1-1, 8 cores, rustc 1.98.1 (pinned), AI-assisted.
@Marvisak on GitHub · 2026-11-25 01:27 UTC · original
Automated triage for the maintainers.
Needs work. Needs the maintainer's decision. This PR changes the CI workflow.
What it does:
linuxjob to.github/workflows/ci.ymlthat runs clippy and tests for six crates (core, pe, formats, pipeline, game, loader). It uses the same actions as the existing job.resource::view_formatinvictory-gpuwith#[cfg(windows)]. Its only caller,host_desc, is already gated, so Windows builds are unchanged.current_exe()images in thevictory-peandvictory-loadertests with a PE32+ image built by hand in the newvictory_pe::fixturesmodule. It is plain header construction, with no copied bytes.Points for the maintainer:
keeps_iat_slots_when_import_size_excludes_the_terminatorandparses_a_synthetic_executableno longer see a real MSVC-linked layout. The first one's own comment ("This linker layout counts the descriptors for real modules only") now describes the fixture rather than a linker. Consider keeping thecurrent_exe()variants undercfg(windows)next to the fixture tests.CI: no checks have run on this head.
Generated by Claude Code
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.