Skip to content

THRIFT-6400: Package the voted compiler in the .NET tool - #3996

Merged
Jens-G merged 1 commit into
apache:masterfrom
Jens-G:THRIFT-6400
Oct 1, 2026
Merged

Jens-G merged 1 commit into
apache:masterfrom
Jens-G:THRIFT-6400

Conversation

@Jens-G

@Jens-G Jens-G commented Oct 1, 2026

Copy link
Copy Markdown
Member

THRIFT-6400

The .NET tool workflow built thrift.exe from the release tag and packed that build. A new build of the same source is not the same bytes, so Apache.Thrift.Compiler did not carry the thrift-<version>.exe the release vote covered. The compiler in the published 0.25.0 package has SHA-256 3d3f2e8a…03648, the voted thrift-0.25.0.exe has 9e1cb466…af08e. #3985 (THRIFT-6397) made the Windows installer package the voted executable, and this does the same for the .NET tool.

Changes

  • dotnet-tool.yml gets a voted-compiler job, taken over from windows-packages.yml. On a release it:

    • runs get-voted-compiler-tests.ps1;
    • fetches thrift-<version>.exe from dist/release with get-voted-compiler.ps1. Every checksum must match, and the signature must be a GOODSIG against KEYS;
    • collects the LICENSE and NOTICE of the release tag.

    The pack job packs that file. If the fetch or a check fails, pack is skipped and nothing is published.

  • A manual run takes a new compiler_url input and packs the executable at that URL, for example a release candidate's on dist/dev. A manual run never publishes. The input exists so that the voted path can run on a Windows runner without a release.

  • Pull requests, and manual runs without compiler_url, still build the compiler from source.

  • test-dotnet-tool.ps1 gets -ExpectedSha256, which the workflow uses to check that the thrift.exe in the package is the file it packed. The run summary names the compiler's source and both hashes.

  • On a release, the version of the voted executable must match the tag. The existing check that the tag matches CMakeLists.txt stays.

  • The README shown on nuget.org (Provenance), build/windows/README.md and the [nuget] entry in doc/ReleaseManagement.md describe it.

Verification

  • test-dotnet-tool.ps1 in mcr.microsoft.com/dotnet/sdk:8.0, which takes the test's Linux path:
    • The published apache.thrift.compiler.0.25.0.nupkg from nuget.org, with -ExpectedSha256 9e1cb466…, fails "the bundled compiler is the expected file" (3d3f2e8a…): 1 of 19 checks.
    • get-voted-compiler.ps1 -Url https://dist.apache.org/repos/dist/release/thrift/0.25.0/thrift-0.25.0.exe passes: the SHA-256 matches and the signature is good. Packed with build-dotnet-tool.ps1 -SourceRoot holding the LICENSE and NOTICE of v0.25.0, the package passes all 19 checks with -ExpectedSha256 9e1cb466….
    • The same package with the other hash fails 1 of 19.
    • Without -ExpectedSha256, 18 checks pass and the hash check does not run.
  • actionlint reports nothing. zizmor (--persona regular, with a token) reports no findings, with the same single suppressed finding as on master.
  • Job plan, derived from the job conditions:
Run voted-compiler pack publish
pull request skipped builds from source skipped
manual, no compiler_url skipped builds from source skipped
manual, compiler_url runs packs the download skipped
manual, download refused fails skipped skipped
release runs packs the dist/release exe runs, except for a pre-release
release, download refused or the checks fail their tests fails skipped skipped

Pull request CI exercises only the build-from-source path, including the new hash check on the Windows runner. The voted path first runs on a Windows runner when the workflow is started with compiler_url. After the merge, a manual run with compiler_url set to https://dist.apache.org/repos/dist/release/thrift/0.25.0/thrift-0.25.0.exe covers it and publishes nothing. The 0.25.0 package on nuget.org cannot be replaced, so the change applies from the next release.

This PR and #3995 touch different sections of build/windows/README.md and doc/ReleaseManagement.md, and they merge without conflict in either order.

🤖 Generated with Claude Code

Client: build

The .NET tool workflow built thrift.exe from the release tag and packed
that build. A new build of the same source is not the same bytes, so
Apache.Thrift.Compiler did not carry the thrift-<version>.exe the
release vote covered: the compiler in the 0.25.0 package has SHA-256
3d3f2e8a..., the voted one 9e1cb466.... THRIFT-6397 made the Windows
installer package the voted executable, and the .NET tool now does the
same.

When the GitHub release is published, a new voted-compiler job runs the
tests of get-voted-compiler.ps1 and then uses it to fetch
thrift-<version>.exe from dist/release, checking its checksums and its
signature against KEYS. The package carries that file and the LICENSE
and NOTICE of the release tag. If the fetch or a check fails, nothing is
packed or published: a release does not fall back to building its own
compiler. A manual run with the new compiler_url input packs the
executable at that URL, for example a release candidate's, and never
publishes. Pull requests, and manual runs without compiler_url, still
build the compiler from source.

test-dotnet-tool.ps1 gets -ExpectedSha256, which the workflow uses to
check that the thrift.exe in the package is the file it packed. The run
summary names the compiler's source and hash.

The README shown on nuget.org, build/windows/README.md and
doc/ReleaseManagement.md describe it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@Jens-G
Jens-G requested review from fishy and jimexist as code owners October 1, 2026 22:35
@mergeable mergeable Bot added build and general CI cmake, automake and build system changes github_actions Pull requests that update GitHub Actions code labels Oct 1, 2026
@Jens-G
Jens-G merged commit 16768cf into apache:master Oct 1, 2026
119 of 121 checks passed
@Jens-G
Jens-G deleted the THRIFT-6400 branch October 1, 2026 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

build and general CI cmake, automake and build system changes github_actions Pull requests that update GitHub Actions code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant