Repository navigation
THRIFT-6400: Package the voted compiler in the .NET tool - #3996
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
THRIFT-6400
The
.NET toolworkflow builtthrift.exefrom the release tag and packed that build. A new build of the same source is not the same bytes, soApache.Thrift.Compilerdid not carry thethrift-<version>.exethe release vote covered. The compiler in the published 0.25.0 package has SHA-2563d3f2e8a…03648, the votedthrift-0.25.0.exehas9e1cb466…af08e. #3985 (THRIFT-6397) made the Windows installer package the voted executable, and this does the same for the .NET tool.Changes
dotnet-tool.ymlgets avoted-compilerjob, taken over fromwindows-packages.yml. On a release it:get-voted-compiler-tests.ps1;thrift-<version>.exefromdist/releasewithget-voted-compiler.ps1. Every checksum must match, and the signature must be aGOODSIGagainstKEYS;LICENSEandNOTICEof the release tag.The
packjob packs that file. If the fetch or a check fails,packis skipped and nothing is published.A manual run takes a new
compiler_urlinput 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.ps1gets-ExpectedSha256, which the workflow uses to check that thethrift.exein 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.txtstays.The README shown on nuget.org (Provenance),
build/windows/README.mdand the[nuget]entry indoc/ReleaseManagement.mddescribe it.Verification
test-dotnet-tool.ps1inmcr.microsoft.com/dotnet/sdk:8.0, which takes the test's Linux path:apache.thrift.compiler.0.25.0.nupkgfrom 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.exepasses: the SHA-256 matches and the signature is good. Packed withbuild-dotnet-tool.ps1 -SourceRootholding theLICENSEandNOTICEofv0.25.0, the package passes all 19 checks with-ExpectedSha256 9e1cb466….-ExpectedSha256, 18 checks pass and the hash check does not run.--persona regular, with a token) reports no findings, with the same single suppressed finding as on master.compiler_urlcompiler_urldist/releaseexePull 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 withcompiler_urlset tohttps://dist.apache.org/repos/dist/release/thrift/0.25.0/thrift-0.25.0.execovers 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.mdanddoc/ReleaseManagement.md, and they merge without conflict in either order.🤖 Generated with Claude Code