Skip to content

Port upstream #664: translate refuses a VIPORT_EMIT_DUMP directory inside the repo - #42

Merged
DesertGamer merged 1 commit into
DesertGamer:mainfrom
lcg007xd-c:port/upstream-664-emit-dump-outside-repo
Nov 25, 2026
Merged

DesertGamer merged 1 commit into
DesertGamer:mainfrom
lcg007xd-c:port/upstream-664-emit-dump-outside-repo

Conversation

@lcg007xd-c

Copy link
Copy Markdown
Contributor

What this changes

This ports Marvisak/VIctory#664 by LF2000 Builder. It is cherry-picked with -x, so the commit keeps their authorship. It is on the list in #12 ("in our history but not in the tree").

viport translate writes emitted DXIL and validator reports into the VIPORT_EMIT_DUMP directory (apps/viport/src/translate.rs, around lines 674 and 730 on main). Both are derived from the game's shaders, but the directory is never checked against the source tree. With VIPORT_EMIT_DUMP=. run from the checkout, the reports land in the repository. Rule #1 forbids that, and .txt files pass both git and cargo xtask policy.

The fix calls viport_core::ensure_outside_repo on the directory once at the start of translate::run, as Config already does for the cache and data directories. #664's test comes with it.

The only conflict was in the test module. VIPort's validator_reason and listing tests are kept, and #664's test is added after them, with the names renamed (VIPORT_EMIT_DUMP, viport_core).

Checked

  • No game data of any kind (files, extracts, screenshots, dumps, saves): see docs/asset-policy.md
  • No binary files or archives
  • No new dependency, build.rs, git hook, .cargo config, CI change or script (or an issue explains why)
  • No download, no started program, no network connection added (or an issue explains why)
  • cargo test --workspace passes (not run, see below)
  • cargo clippy --workspace --all-targets --locked -- -D warnings passes (for the viport app, with CI: clear the clippy errors that keep main red since a3e7f17 #21 merged in locally)
  • The code I wrote is formatted with rustfmt; I did not reformat lines I did not change

What I ran

  • cargo clippy -p viport --all-targets --locked --target x86_64-pc-windows-msvc -- -D warnings, cross-checked from Linux with CI: clear the clippy errors that keep main red since a3e7f17 #21 merged in: clean, so the new test type-checks.
  • cargo test -p viport-core --locked on Linux: passes. That crate holds ensure_outside_repo and its InsideRepo error, which the new test expects.

Not run: cargo test -p viport (the app builds only for Windows). The new test emit_dump_inside_repo_is_refused sets an environment variable, as upstream's did. CI runs the tests with --test-threads=1, and no other test in this binary touches the environment.

Overlaps

None. No open PR touches apps/viport/src/translate.rs.

🤖 Generated with Claude Code

translate writes emitted DXIL and validator reports to the
VICTORY_EMIT_DUMP directory. Both are derived from the game's shaders,
but the directory was never checked against the source tree. With
VICTORY_EMIT_DUMP=. run from the checkout, the .txt reports land in the
repo, and git and cargo xtask policy both let them through.

Check the directory once at the start of translate::run, as Config
already does for the cache and data directories.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 988fd9a)
@DesertGamer
DesertGamer merged commit 5f095ed into DesertGamer:main Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants