Skip to content

Move regenerate-native change detection into build.sh to match ClangSharp#272

Merged
tannergooding merged 1 commit into
dotnet:mainfrom
tannergooding:fix-regenerate-native-major-minor
Jul 16, 2026
Merged

Move regenerate-native change detection into build.sh to match ClangSharp#272
tannergooding merged 1 commit into
dotnet:mainfrom
tannergooding:fix-regenerate-native-major-minor

Conversation

@tannergooding

@tannergooding tannergooding commented Jul 16, 2026

Copy link
Copy Markdown
Member

The regenerate-native detect job inlined its change-detection and package-version verification in YAML, and referenced an unassigned ${major_minor} in a diagnostic echo:

/home/runner/work/_temp/....sh: line 40: major_minor: unbound variable

Under set -euo pipefail that aborts the whole workflow at detect before any build/pack leg runs. It started failing on the push that landed the native libLLVMSharp helpers.

Rather than just patch the stray variable, this converges on how ClangSharp handles the same job: the change-detection and version-verification logic moves into scripts/build.sh as DetectChanges / VerifyPackages (invoked via --detectchanges --base <ref> and --verifypackages), so it is reproducible and testable locally, and the detect job just delegates to it. No major_minor anywhere.

LLVMSharp keeps its one genuine divergence from ClangSharp: libLLVM regenerates on a change to the full patch LLVM version (e.g. 21.1.8), not major.minor, since the libLLVM package version tracks the full patch.

Validated locally with git-bash:

  • --verifypackages -> Package versions verified against LLVM 21.1.8
  • --detectchanges real branch -> libllvm=false libllvmsharp=false
  • unresolvable --base -> libllvm=true libllvmsharp=true (conservative)
  • base before the native helpers -> libllvm=false libllvmsharp=true
  • missing --base -> errors with exit 1
  • bash -n scripts/build.sh passes; workflow YAML parses.

Failing run: https://github.com/dotnet/LLVMSharp/actions/runs/29474949179/job/87545843218

…harp

The detect job inlined its change-detection and package-version verification
in YAML and referenced an unassigned `major_minor` in a diagnostic echo, which
under `set -u` aborted the whole regenerate-native workflow.

Mirror ClangSharp instead: the change-detection and version-verification logic
now lives in scripts/build.sh as DetectChanges/VerifyPackages (invoked via
--detectchanges --base <ref> and --verifypackages), so it is reproducible and
testable locally, and the detect job just delegates to it. LLVMSharp keeps its
genuine divergence of comparing the full patch version for libLLVM.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@tannergooding
tannergooding force-pushed the fix-regenerate-native-major-minor branch from 0edf4f7 to 4027a4e Compare July 16, 2026 06:02
@tannergooding tannergooding changed the title Fix unbound major_minor variable in regenerate-native detect job Move regenerate-native change detection into build.sh to match ClangSharp Jul 16, 2026
@tannergooding
tannergooding merged commit 54dc243 into dotnet:main Jul 16, 2026
12 checks passed
@tannergooding
tannergooding deleted the fix-regenerate-native-major-minor branch July 16, 2026 06:09
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.

1 participant