Skip to content

Commit 50bbda1

Browse files
Jens-Gclaude
andcommitted
THRIFT-6401: Declare the minimum Visual C++ runtime for WinGet and Chocolatey, and drop the dead Chocolatey icon
Client: build The Chocolatey review of the thrift 0.25.0 package flagged the nuspec's iconUrl, which returns 404, and a dependency without a version. There is no square Thrift logo to point at, so the package goes without an icon, as the 0.12.0 package did. The released thrift.exe links the shared Visual C++ runtime, and the installed redistributable has to be at least as new as the build tools the program was built with; thrift-0.25.0.exe reports linker version 14.51. Without a minimum, any vcredist140 that is already installed satisfies the dependency and is not updated, and the WinGet manifest had the same gap. The nuspec now asks for vcredist140 14.51 or later, and the WinGet installer manifest asks for Microsoft.VCRedist.2015+.x64 14.51 or later through MinimumVersion, quoted so that YAML keeps it a string. The tests check both minimums, that the two agree, and that the nuspec names no icon. doc/ReleaseManagement.md says to raise the minimum when the compiler is built with newer build tools, and build/windows/README.md mentions it. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1 parent 11be31c commit 50bbda1

6 files changed

Lines changed: 49 additions & 5 deletions

File tree

‎build/windows/README.md‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,10 @@ redistributable, which the ASF cannot ship. An interactive install says so when
131131
it cannot find `vcruntime140.dll`, rather than letting the first run fail with a
132132
missing-DLL dialog. It never blocks, and a silent install - which is what a
133133
package manager does - shows nothing; the WinGet and Chocolatey packages declare
134-
the redistributable as a dependency instead, so their users never see it.
134+
the redistributable as a dependency instead, so their users never see it. They
135+
ask for version 14.51 or later, because it has to be at least as new as the build
136+
tools the compiler was built with; a version already installed only counts from
137+
there on.
135138

136139
## `installer/test-installer.ps1`
137140

‎build/windows/chocolatey/test-chocolatey-package.ps1‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,25 @@ try {
117117
(@($dependencies | Where-Object { $_.id -eq 'vcredist140' }).Count -eq 1) `
118118
(($dependencies | ForEach-Object { $_.id }) -join ', ')
119119

120+
# The installed redistributable has to be at least as new as the build
121+
# tools the compiler was built with. Without a minimum, any version that is
122+
# already installed satisfies the dependency and is not updated.
123+
$redist = @($dependencies | Where-Object { $_.id -eq 'vcredist140' }) | Select-Object -First 1
124+
$redistMinimum = if ($redist) { [string]$redist.version } else { '' }
125+
Assert-True 'the redistributable dependency names a minimum version' `
126+
($redistMinimum -match '^14\.\d+') "version '$redistMinimum'"
127+
128+
# Both package managers have to ask for the same runtime.
129+
$wingetTemplate = Get-Content -LiteralPath (Join-Path $PSScriptRoot '..\winget\Apache.Thrift.installer.yaml.in') -Raw
130+
$wingetMinimum = ([regex]::Match($wingetTemplate, "MinimumVersion:\s*'([^']*)'")).Groups[1].Value
131+
Assert-True 'the minimum matches the one in the WinGet manifest' `
132+
([bool]$redistMinimum -and ($redistMinimum -eq $wingetMinimum)) "nuspec '$redistMinimum', WinGet '$wingetMinimum'"
133+
134+
# There is no square Thrift logo to point at, and Chocolatey flags a dead
135+
# icon link.
136+
Assert-True 'the nuspec names no icon' (-not $nuspec.package.metadata.iconUrl) `
137+
([string]$nuspec.package.metadata.iconUrl)
138+
120139
$install = Get-Content -LiteralPath $installPath -Raw
121140
Assert-True 'the install script holds no placeholders' ($install -notmatch '__[A-Z0-9_]+__')
122141
Assert-True 'the checksum reaches the install script' ($install -match "checksum64\s*=\s*'$sha'")

‎build/windows/chocolatey/thrift.nuspec.in‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
<mailingListUrl>https://thrift.apache.org/mailing</mailingListUrl>
3737
<licenseUrl>https://www.apache.org/licenses/LICENSE-2.0</licenseUrl>
3838
<requireLicenseAcceptance>false</requireLicenseAcceptance>
39-
<iconUrl>https://thrift.apache.org/assets/images/thrift-logo.svg</iconUrl>
39+
<!-- No iconUrl: there is no square Thrift logo to point at. -->
4040
<copyright>Copyright (c) The Apache Software Foundation</copyright>
4141
<tags>apache thrift rpc idl codegen compiler serialization admin</tags>
4242
<summary>The Apache Thrift IDL compiler</summary>
@@ -64,8 +64,11 @@ shell afterwards.
6464
<dependencies>
6565
<!-- The compiler links the shared runtime, so it needs the Visual C++
6666
redistributable, which the ASF cannot ship. Chocolatey installs
67-
this first. -->
68-
<dependency id="vcredist140" />
67+
this first. It has to be at least as new as the build tools the
68+
compiler was built with, so a version already installed only
69+
counts from that one on. Keep it equal to MinimumVersion in
70+
build/windows/winget/Apache.Thrift.installer.yaml.in. -->
71+
<dependency id="vcredist140" version="14.51" />
6972
</dependencies>
7073
</metadata>
7174
<files>

‎build/windows/winget/Apache.Thrift.installer.yaml.in‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,15 @@ UpgradeBehavior: install
3232
ProductCode: '{064E0C5D-29EE-47DD-BB5E-172FE25FE936}_is1'
3333
ReleaseDate: __RELEASE_DATE__
3434
# The compiler links the shared runtime, so it needs the Visual C++
35-
# redistributable, which the ASF cannot ship. WinGet installs this first.
35+
# redistributable, which the ASF cannot ship. WinGet installs this first. It
36+
# has to be at least as new as the build tools the compiler was built with, so
37+
# a version already installed only counts from that one on. Keep it equal to
38+
# the vcredist140 version in build/windows/chocolatey/thrift.nuspec.in. Quoted,
39+
# so that YAML does not read it as a number.
3640
Dependencies:
3741
PackageDependencies:
3842
- PackageIdentifier: Microsoft.VCRedist.2015+.x64
43+
MinimumVersion: '14.51'
3944
Installers:
4045
- Architecture: x64
4146
InstallerUrl: __INSTALLER_URL__

‎build/windows/winget/test-winget-manifests.ps1‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,13 @@ try {
126126
Assert-True 'the redistributable is declared as a dependency' `
127127
($installer -match 'PackageIdentifier:\s*Microsoft\.VCRedist\.2015\+\.x64') $installer
128128

129+
# The installed redistributable has to be at least as new as the build
130+
# tools the compiler was built with. Without a minimum, any version that is
131+
# already installed satisfies the dependency and is not updated. Quoted, so
132+
# that YAML does not read 14.51 as a number.
133+
Assert-True 'the redistributable dependency names a minimum version' `
134+
($installer -match "PackageIdentifier:\s*Microsoft\.VCRedist\.2015\+\.x64\s*\n\s*MinimumVersion:\s*'14\.\d+'") $installer
135+
129136
# downloads.apache.org only carries the current release, so a manifest
130137
# naming it stops working at the next one.
131138
Assert-True 'the installer URL defaults to the Apache archive' `

‎doc/ReleaseManagement.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,13 @@ All Apache Thrift releases go through a 72-hour final release candidate voting p
205205
Do **not** build a statically linked compiler to make that list shorter. The
206206
project moved away from one deliberately, and the released compiler is expected
207207
to require the Visual C++ redistributable; the check fails if it does not.
208+
209+
The installed redistributable has to be at least as new as the build tools the
210+
compiler was built with, so the WinGet and Chocolatey packages ask for that version
211+
or later: 14.51, what 0.25.0 was built with. If you build with newer build tools -
212+
`dumpbin /headers thrift.exe` shows their version as the linker version - raise
213+
`MinimumVersion` in `build/windows/winget/Apache.Thrift.installer.yaml.in` and the
214+
`vcredist140` version in `build/windows/chocolatey/thrift.nuspec.in` to match.
208215
1. Copy the executable `thrift.exe` to your linux system where the signed tarball lives and rename it to `thrift-1.0.0.exe` (substitute the correct version, of course).
209216
1. Sign the executable the same way you signed the tarball.
210217
1. Build the Windows installer from the very same executable:

0 commit comments

Comments
 (0)