Repository navigation
THRIFT-6397: Build the Windows installer around the voted compiler - #3985
Merged
Merged
Conversation
Client: build The installer of a release has to contain the thrift.exe the vote covered, and a new build of the same source is not the same bytes. The Windows packages workflow could only package a compiler it built itself, so the installer for dist.apache.org had to be built by hand. get-voted-compiler.ps1 downloads a thrift-<version>.exe from a release candidate's or a release's directory on dist.apache.org, with its signature, its checksum files and KEYS. It refuses the file unless every checksum matches and the signature is good and made with a key from KEYS, and it accepts only dist.apache.org URLs naming a thrift-<version>.exe. get-voted-compiler-tests.ps1 tests that with a throwaway key, in a job of its own on every run. The workflow packages that executable when it is started with the new compiler_url input, and, from dist/release, when a GitHub release is published. The installer then carries the LICENSE and NOTICE of the release tag, or of the branch for a release candidate. Pull requests and runs without compiler_url still build the compiler from source. test-installer.ps1 gets -ExpectedSha256, which the workflow uses to check that the installed thrift.exe is the file it packaged. build-installer.ps1 now hands -SourceRoot to Inno Setup as an absolute path; a relative one was resolved against thrift.iss. doc/ReleaseManagement.md and build/windows/README.md describe it. The vote mail template in doc/ReleaseManagement.md named the release candidate's files thrift-1.0.0-rc0.*, but the steps above it produce thrift-1.0.0.*, which is also what get-voted-compiler.ps1 accepts; the template now uses those names. 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-6397
The Windows installer of a release has to contain the
thrift.exethe vote covered, and a new build of the same source is not the same bytes. TheWindows packagesworkflow could only package a compiler it built itself, so the installer for dist.apache.org had to be built by hand with Inno Setup.Changes
build/windows/get-voted-compiler.ps1downloads athrift-<version>.exefrom a release candidate's or a release's directory on dist.apache.org, with its.asc, its.sha512/.sha256andKEYS. It refuses the file unless every checksum matches and the signature is good (GOODSIG) and made with a key fromKEYS. Onlyhttps://dist.apache.org/repos/dist/{dev,release}/thrift/…/thrift-<version>.exeURLs are accepted.build/windows/get-voted-compiler-tests.ps1tests that with a throwaway GPG key. A newdownload-checksjob runs it on every run of the workflow, pull requests included.windows-packages.ymlpackages that executable when it is started with the newcompiler_urlinput, and, fromdist/release, when the GitHub release is published. The installer then carries theLICENSEandNOTICEof the release tag, or of the branch for a release candidate. Pull requests and runs withoutcompiler_urlstill build the compiler from source. If the download or the checks fail, nothing is packaged: a release never falls back to its own build.test-installer.ps1gets-ExpectedSha256, which the workflow uses to check that the installedthrift.exeis the file it packaged. The run summary names the compiler's source and hash.build-installer.ps1hands-SourceRootto Inno Setup as an absolute path. A relative one was resolved againstthrift.iss. With an echo stand-in forISCC.exe,-SourceRoot votedarrived as/DSourceRoot=votedbefore this change and as an absolute path after it.doc/ReleaseManagement.md(the release candidate steps, and adding a missing installer after a release) andbuild/windows/README.md.doc/ReleaseManagement.mdnamed the release candidate's filesthrift-1.0.0-rc0.*. The steps above it producethrift-1.0.0.*, which is what the 0.24.0 and 0.25.0 candidates used and whatget-voted-compiler.ps1accepts. The template now uses those names; the directory stays1.0.0-rc0/.Verification
get-voted-compiler-tests.ps1: 18 checks pass with pwsh 7.6 and gpg 2.4.7, and each refusal fails for its own reason:BADSIGwhen the checksums were redone after the change;ERRSIGfor a key that is not inKEYS;-Url https://dist.apache.org/repos/dist/release/thrift/0.25.0/thrift-0.25.0.exegives SHA-2569e1cb466…af08e, the value in the 0.25.0-rc1 vote mail. The signature is good and fromKEYS.v0.25.0;compiler_urlcompiler_urldist/releaseexe--persona regular, with a token) report nothing.Pull request CI exercises only the build-from-source path, including the new hash check on the Windows runner. The download path first runs on a real Windows runner when the workflow is started with
compiler_url. For 0.25.0, that meanscompiler_url=https://dist.apache.org/repos/dist/release/thrift/0.25.0/thrift-0.25.0.exe, which also produces the 0.25.0 installer to sign.🤖 Generated with Claude Code