Skip to content

build: drop /XO from robocopy auto-deploy#37

Merged
alandtse merged 1 commit into
devfrom
build/fix-deploy-xo-skip
May 25, 2026
Merged

build: drop /XO from robocopy auto-deploy#37
alandtse merged 1 commit into
devfrom
build/fix-deploy-xo-skip

Conversation

@alandtse
Copy link
Copy Markdown
Owner

@alandtse alandtse commented May 24, 2026

Summary

  • Drop /XO (eXclude Older) from the three robocopy invocations under AUTO_PLUGIN_DEPLOYMENT so changed source files actually reach the install
  • Update inline comments to document the trap (any prior touch to dest can give it a newer mtime than git-checkout source, which silently disables deploy)

Why

/XO skips files where source is older than dest. In a normal git workflow that's usually safe — but as soon as anything else touches the destination (a manual cp during debugging, a package install, even a previous build that ran later in wall time than the source's git checkout), dest gets a newer mtime and /XO then refuses to overwrite even when the source file's size and content have changed.

Concrete failure that prompted this

While debugging SLF I had RunGrass.hlsl fixed in source (commit f11bfaa32, source size 33287 bytes with the corrected ShadowSampling include order), but the deployed file stayed at the previous 31877 bytes across multiple full builds. Mtime on dest (from a manual cp during earlier diagnostics) was newer than the git-checkout mtime on source, so /XO skipped the copy. Grass and Particle pixel shaders failed to compile in-game:

LightLimitFix/LightLimitFix.hlsli(85,3-28): error X3000: unrecognized identifier 'DirectionalShadowLightData'

Same shape of bug can hit any contributor who: tests a package install over their dev build, copies files manually for any reason, or just has clock skew across filesystem boundaries.

What this changes

Before After
`/E /XD ... /COPY:DAT /XO /R:1 /W:1 ...` `/E /XD ... /COPY:DAT /R:1 /W:1 ...`

Without /XO, robocopy uses its default name + size + timestamp delta — copies whenever any of those differ. Catches both newer-source and size-mismatch cases. The git-HEAD-change block above the deploy commands already clears AIO and deploy stamps on branch switch, so the bulk-redeploy story is unchanged.

Trade-off

The property /XO nominally provided ("don't clobber files the user intentionally edited in-game between builds at the same HEAD") was fragile anyway — broken by any external touch to dest. Removing it costs ~100ms of extra IO per build on unchanged files (robocopy still skips matching name+size+timestamp). Correctness wins.

Test plan

  • `BuildRelease.bat ALL-WITH-AUTO-DEPLOYMENT` produces a deployed install that matches `build//aio` byte-for-byte
  • Manually `touch` a file in the deployed install to give it a newer mtime, rebuild, confirm the source file overwrites it
  • Verify unchanged files still skip on subsequent builds (robocopy's default behavior)

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Adjusted Windows plugin deployment configuration to improve synchronization between deployed and built files. Updated build system documentation comments.

Review Change Stack

The three robocopy invocations under AUTO_PLUGIN_DEPLOYMENT used /XO
("eXclude Older source") to skip files where the source is older than
the destination. In practice this silently lost real updates: any prior
deploy that touches the destination -- a manual `cp` for testing, a
package install, a previous build that ran later in wall time than the
source's git-checkout mtime -- leaves dest with a newer timestamp than
source, and /XO then refuses to overwrite even when source size and
content have changed.

Concrete failure: a fix to RunGrass.hlsl (commit f11bfaa) had source
size 33287 but the deployed file stayed at the previous 31877 bytes
across multiple full builds, because dest mtime was newer than source.
Compile errors in-game (Grass / Particle pixel shaders) followed.

Removing /XO falls back to robocopy's default detection (name + size
+ timestamp delta), which copies whenever any of those differ. The
git-HEAD-change block above already clears AIO and stamps on branch
switch, so the "protect intentional in-game edits across rebuilds"
property /XO was nominally providing was fragile anyway -- breaking
on any external touch to dest. Per-build cost increase is ~100ms of
extra IO on unchanged files; correctness wins.
Copilot AI review requested due to automatic review settings May 24, 2026 21:46
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 24, 2026

📝 Walkthrough

Walkthrough

This PR modifies Windows incremental deployment behavior in CMakeLists.txt by removing the /XO robocopy flag across multiple deploy steps to prevent timestamp-based file skips, and updates related comments to document the cleanup logic and the timestamp-avoidance rationale.

Changes

Windows Incremental Deployment Robustness

Layer / File(s) Summary
git-HEAD-change section timestamp and cleanup comments
CMakeLists.txt
Comments describing AIO clearing and stamp invalidation are updated to explain timestamp refresh behavior and why DLL redeployment is not needed given C++ rebuild.
Robocopy timestamp-aware updates across deploy commands
CMakeLists.txt
The /XO robocopy flag is removed from non-shader, shader-only, and full shader deploy custom commands, with updated comments explaining how this avoids robocopy skipping files when destination mtimes are newer than sources.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

A rabbit adjusts deployment paths with care,
Removing old flags that skip with a stare.
Timestamps now guide, not mislead the way,
Fresh shadows in light help binaries stay. 🐰✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely summarizes the main change: removing the /XO flag from robocopy auto-deploy commands, which is the core modification throughout the CMakeLists.txt file.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch build/fix-deploy-xo-skip

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown

No actionable suggestions for changed features.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a Windows auto-deploy correctness issue in the CMake AUTO_PLUGIN_DEPLOYMENT workflow by removing Robocopy’s /XO (“exclude older”) flag so modified source files reliably overwrite deployed files even when the destination has a newer mtime.

Changes:

  • Remove /XO from the three Robocopy invocations used for incremental deploy (non-shaders, shader-only, and full-shader deploy).
  • Update inline comments to document the failure mode and explain the intended incremental-copy behavior.
  • Clarify the git-HEAD-change invalidation behavior (clearing AIO + deploy stamps) as the mechanism for bulk redeploys.

@github-actions
Copy link
Copy Markdown

✅ A pre-release build is available for this PR:
Download

@alandtse alandtse changed the title build(deploy): drop /XO from robocopy auto-deploy commands build: drop /XO from robocopy auto-deploy May 25, 2026
@alandtse alandtse merged commit 5c00a38 into dev May 25, 2026
24 checks passed
alandtse added a commit that referenced this pull request May 25, 2026
Brings in:
- 045e72e refactor: unify restart-required infrastructure (#39)
- 5c00a38 build: drop /XO from robocopy auto-deploy (#37)

The /XO drop is identical to our local cc65edc -- merge auto-resolved
cleanly. The restart-required infrastructure (BootSnapshot, RestartSettings)
will be adopted into ShadowCasterManager in a follow-up commit.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
alandtse added a commit that referenced this pull request May 28, 2026
Sync 13 upstream commits since bb6460d. Notable upstream changes:
unified-water LOD/cell-transition fixes + move to core (drops the
globals::game::waterSystem global), TAA banding/oversharpening fix,
emat complex-material detection fix, ssgi specular depth-fade fix,
IBL interior disable, and CI hygiene (cmake pin + useCloudCache=false,
robocopy /XO drop already mirrored by our #37).

Conflict resolutions:
- Effect.hlsl: union — keep our relocated LLF/ISL includes (now after
  ShadowSampling) AND upstream's new GetEffectAmbientLighting /
  ExtractEffectLighting helpers; all call sites use the new API.
- LightLimitFix.ini / VolumetricShadows.ini / VR.ini: keep our higher
  versions and (where present) the fork's [Nexus] autoupload section;
  upstream only stripped that metadata and did not change settings.

Auto-merges kept fork-divergent CI intact:
- nexus-upload.yaml unchanged (fork aio/matrix design; still uses
  alandtse/nexus-workflows). Upstream's migration to the official
  Nexus-Mods/upload-action was NOT adopted — tracked as a follow-up.
- CMakeLists.txt kept (fork superset: MCP, exprtk, autoupload AIO
  filtering, cpp tests, Open Shaders branding).
- release-build.yaml: upstream's UNEX_NEXUSMODS_SESSION_COOKIE removal
  landed on the dry-run call only (upload job is skipped in dry-run and
  the secret is optional, so this is safe).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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