Skip to content

THRIFT-6314: Publish the Windows Thrift compiler through WinGet - #3897

Merged
Jens-G merged 1 commit into
apache:masterfrom
Jens-G:THRIFT-6314
Sep 20, 2026
Merged

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

Conversation

@Jens-G

@Jens-G Jens-G commented Sep 20, 2026 •

Copy link
Copy Markdown
Member

Based directly on master. Everything this depended on (#3901, #3893, #3895) is merged, so this no longer sits on another PR.

Windows has a package manager and the Thrift compiler is not in it.

winget install Apache.Thrift

The identifier

Apache.Thrift is free. I swept the whole winget-pkgs manifest tree — 695k paths — and there is no Thrift manifest anywhere. Apache is the publisher folder the ASF already uses there, for Directory Studio, Groovy, NetBeans and OpenOffice.

Two decoys live in the same folder and are not the ASF: ApacheFriends (XAMPP) and ApacheLounge (third-party httpd builds).

Why the manifest points at the archive

InstallerUrl has to keep resolving for as long as the manifest is in winget-pkgs — including for old versions, which stay there. downloads.apache.org only carries the current release, so a manifest naming it stops working at the next release and takes every older Thrift version with it. archive.apache.org is permanent.

That is what makes this a post-release step: it cannot run until the release is promoted to dist.apache.org and the archive has picked it up. Same wait the Docker Official Image update already has, and doc/ReleaseManagement.md now says so and how to re-run it.

The checksum is computed from the file downloaded from that exact URL, so the manifest cannot claim a checksum the published file does not have.

What is checked, and where

Two different questions, so two different checks:

  • winget/validate_manifests.py — do the rendered manifests match the WinGet JSON schemas? It reads the ManifestType/ManifestVersion out of each file and fetches the matching schema from Microsoft, so it follows the manifests instead of pinning a version here. Without this, a mistake is found only after the PR against winget-pkgs is already open.

    I ran this against the real published schemas: the three manifests validate. I also confirmed it fails properly — a bad InstallerType, a malformed InstallerSha256 and a missing defaultLocale manifest are each reported.

  • winget/test-winget-manifests.ps1 — does the renderer do its job? Values land where they belong; no placeholder survives into a file that would be submitted verbatim; output is UTF-8 without a BOM and with LF endings; a malformed version, checksum or date is refused. 18 checks, no network needed.

Both run in CI, including on pull requests, where the manifests are rendered with an obviously fake checksum so the templates and the schema check are still exercised.

The Visual C++ redistributable

The manifest declares Microsoft.VCRedist.2015+.x64 as a PackageDependency. The compiler links the shared runtime and the ASF cannot ship the redistributable, so WinGet installs it first — a winget install Apache.Thrift does not end in a compiler that will not start. The dependency validates against the published installer schema, and a test pins it.

Submission

wingetcreate, which forks winget-pkgs itself — no fork setup on our side. It needs a classic PAT with public_repo scope; fine-grained tokens are not supported. It is read from WINGET_CREATE_GITHUB_TOKEN rather than passed as --token, which is what Microsoft's own release workflows do so it cannot land in a log.

Needed before the first release: a secret WINGET_TOKEN in the release environment.

Without it nothing breaks: the manifests are still rendered, validated and uploaded as an artifact, and the run prints a warning plus the exact command to submit them by hand. I chose that over failing the release workflow over a missing secret.

Notes

  • The render/validate job runs on ubuntu-latest; only the submission needs Windows, because wingetcreate is Windows-only.
  • One installer entry, Scope: user — the installer is per-user by default. A machine-scope entry using /ALLUSERS can be added later if wanted.
  • ProductCode is {AppId}_is1, Inno Setup's uninstall key. The AppId is fixed in thrift.iss and must never change; both files say so.
  • zizmor is clean on the new workflow.

JIRA: THRIFT-6314


Merge note. #3897 (WinGet) and #3898 (Chocolatey) are siblings off #3895 and both append a subsection to doc/ReleaseManagement.md at the same anchor. Whichever merges second will conflict there; the resolution is to keep both subsections. Nothing else overlaps.

🤖 Generated with Claude Code

@mergeable mergeable Bot added build and general CI cmake, automake and build system changes github_actions Pull requests that update GitHub Actions code labels Sep 20, 2026
@Jens-G
Jens-G force-pushed the THRIFT-6314 branch 2 times, most recently from 0ce6327 to b442a32 Compare September 20, 2026 11:02
@Jens-G
Jens-G force-pushed the THRIFT-6314 branch 4 times, most recently from 69df8b2 to 3611f75 Compare September 20, 2026 12:00
@Jens-G
Jens-G force-pushed the THRIFT-6314 branch 5 times, most recently from ba7efd4 to dd65d1d Compare September 20, 2026 21:10
Client: build

Windows has a package manager, and the Thrift compiler is not in it.

    winget install Apache.Thrift

Apache.Thrift is free: the whole winget-pkgs manifest tree was swept and
holds no Thrift manifest. Apache is the publisher folder the ASF already
uses there, for Directory Studio, Groovy, NetBeans and OpenOffice. Note
the two decoys in that folder: ApacheFriends is XAMPP and ApacheLounge
is a third party httpd build, and neither is the ASF.

The manifest points at archive.apache.org rather than
downloads.apache.org. The latter only carries the current release, so a
manifest naming it stops resolving at the next release, and takes every
older version in winget-pkgs with it. The archive is permanent.

That makes this a post release step: it cannot run until the release has
been promoted and the archive has picked it up, the same wait the Docker
Official Image update has. The workflow runs when the release is
published and can be run again from the Actions tab once the archive has
the file. ReleaseManagement.md says so.

The checksum is computed from the file downloaded from the very URL that
goes into the manifest, so a manifest cannot claim a checksum the
published file does not have.

The manifest records when the release came out, taken from the release
event, or given on the Actions tab when the workflow is run again later.
Defaulting to today would be wrong on exactly the runs the documentation
asks for: the re-run, days after the release, once the archive has the
file.

The manifest declares Microsoft.VCRedist.2015+.x64 as a dependency. The
compiler links the shared runtime and needs the Visual C++
redistributable, which the ASF cannot ship; WinGet installs it first, so
a "winget install Apache.Thrift" does not end in a compiler that will
not start.

The rendered manifests are validated against the WinGet JSON schemas,
fetched for the schema version each manifest names. Without that a
mistake is only found after the pull request against winget-pkgs has
been opened. test-winget-manifests.ps1 covers the renderer separately:
that values land where they belong, that no placeholder survives into a
file that would be submitted verbatim, that the output is UTF-8 with no
BOM and LF endings, and that a malformed version, checksum or date is
refused.

Submission uses wingetcreate, which forks winget-pkgs itself, so nothing
has to be set up there. It needs a classic personal access token with
the public_repo scope - fine grained tokens are not supported - read
from the environment rather than passed on the command line, which is
what Microsoft's own release workflows do so that it cannot reach a log.
Without the token the manifests are still rendered, validated and
uploaded, and the run says in its summary how to submit them by hand.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@Jens-G
Jens-G merged commit d289329 into apache:master Sep 20, 2026
23 of 24 checks passed
@Jens-G
Jens-G deleted the THRIFT-6314 branch September 20, 2026 21:20
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.

2 participants