Skip to content

fix(build): apply patches on pipefail, dedupe optimum types in donor csproj - #97

Closed
dxcvvxd wants to merge 1 commit into
StratumServer:mainfrom
dxcvvxd:fix/patch-application-and-overlay-csproj
Closed

dxcvvxd wants to merge 1 commit into
StratumServer:mainfrom
dxcvvxd:fix/patch-application-and-overlay-csproj

Conversation

@dxcvvxd

@dxcvvxd dxcvvxd commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

fixes #94, #90, #96

fix 1 (issue #94 & #90): csproj owned by both sources/ overlay and old patches/ file

  • sources/VintagestoryApi/VintagestoryAPI.csproj overlay now canonical owner of donor csproj.
  • delete stale patches/VintagestoryApi/VintagestoryAPI.csproj.patch, its 2 <Compile Remove> lines merged into overlay.
  • one file, one owner. bootstrap no longer dies on ownership-conflict check.

fix 2 (issue #96, first part): patch gate die on sigpipe

  • bootstrap runs set -o pipefail. gate find "$patches_dir" -name '*.patch' -print | head -n 1 | grep -q .. head exits after first line, find gets SIGPIPE (141), pipeline fails, else branch runs. "No patches/ to apply." every run.
  • fix: find "$patches_dir" -name '*.patch' -print -quit >/dev/null 2>&1. -quit stops find after first match, no broken pipe. all 118 patches apply.

fix 3 (issue #96, second part): cs0433 same type in two dll

  • overlay csproj removed 18 of 21 Optimum files from donor compile. missed 3: OptimumCompatibilityGuard, OptimumFrustumCullSimd, OptimumKometGuard.
  • those, plus OptimumMeshPartPool and OptimumChunkVisibilityBfs (taken from deleted patch), compiled into both VintagestoryAPI.dll and Optimum.Api.Contracts.dll, so mods referencing both get cs0433.
  • add all 5 missing <Compile Remove> entries to overlay. Optimum types compile only in contracts.

verify

  • make refresh prints "Patches: 118 applied, 0 skipped, 0 failed"
  • dotnet build VintageStory.slnx -c Release succeeds, 0 errors
  • dotnet test passes 1042 tests

…csproj

fixes StratumServer#94, StratumServer#96

- bootstrap.sh: find|head|grep sigpipe under set -o pipefail skipped all
  patches. use find -print -quit.
- sources/VintagestoryApi/VintagestoryAPI.csproj: overlay now owns
  csproj, remove stale patches/VintagestoryApi/VintagestoryAPI.csproj.patch.
  add missing Compile Removes (OptimumMeshPartPool, OptimumChunkVisibilityBfs,
  OptimumCompatibilityGuard, OptimumFrustumCullSimd, OptimumKometGuard) so
  Optimum types compile only in Optimum.Api.Contracts, not also in
  VintagestoryAPI.dll (cs0433).
@meelock

meelock commented Sep 16, 2026 •

Copy link
Copy Markdown

getting ```
At K:\Github\Optimum\Optimum\scripts\bootstrap.ps1:663 char:60

  • ... throw "SHA-256 verification failed for $assetName: expecte ...

Variable reference is not valid. ':' was not followed by a valid variable name character. Consider using ${}
to delimit the name.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : InvalidVariableReferenceWithDrive

But adding {} around assetName seems to fix it.

@Zaldaryon

Copy link
Copy Markdown
Collaborator

Thanks for this. Every fix here already landed on main through #99, so I am closing this as superseded rather than merging it.

Checking each part against current main:

Fix 1 (issue #94, #90): patches/VintagestoryApi/VintagestoryAPI.csproj.patch is already deleted on main and the two <Compile Remove> lines live in the sources/VintagestoryApi/VintagestoryAPI.csproj overlay. One file, one owner, as you described.

Fix 2 (issue #96, SIGPIPE): the patch gate no longer dies on SIGPIPE. main wraps the probe in a subshell with pipefail disabled: (set +o pipefail; find "$patches_dir" -name '*.patch' -print 2>/dev/null | head -n 1 | grep -q .). I went with that over -print -quit because BSD find on macOS does not support -quit, and the bootstrap has to run on both Linux and macOS. Same result: all 118 patches detected and applied.

Fix 3 (issue #96, CS0433): the overlay already carries all five previously missing removes (OptimumMeshPartPool, OptimumChunkVisibilityBfs, OptimumFrustumCullSimd, OptimumKometGuard, OptimumCompatibilityGuard), so the Optimum types compile only into Optimum.Api.Contracts.dll.

Your diagnosis on all three was correct and it matched what we found independently. Appreciate the detailed writeup on #96.

@Zaldaryon Zaldaryon closed this Sep 16, 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.

[Bug] csproj owned by both sources/ overlay and old patches/ file

3 participants