Skip to content

Commit 0f4c55b

Browse files
committed
cmd/releasebot, cmd/release: add windows-arm64 target for Go 1.17
Support for Windows on ARM is only available in the newer WiX v3.14 development release, so start using that for windows/arm64 release. Remove the unused ProdId variable in installer.wxs. For the windows/arm64 installer, increase InstallerVersion property to 500, since 300 is below the minimum for the arm64 platform per https://wixtoolset.org/documentation/manual/v3/xsd/wix/package.html. Remove the test that a godoc shortcut isn't included. This test was useful back when that shortcut was conditionally included depending on the Go version, but no supported release includes godoc by now. Fixes golang/go#46355. Change-Id: I9273e764d73d0a941f6300d2b761653eb09b977e Reviewed-on: https://go-review.googlesource.com/c/build/+/324069 Trust: Dmitri Shuralyov <[email protected]> Run-TryBot: Dmitri Shuralyov <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Heschi Kreinick <[email protected]> Reviewed-by: Carlos Amedee <[email protected]>
1 parent 8adac88 commit 0f4c55b

File tree

5 files changed

+83
-20
lines changed

5 files changed

+83
-20
lines changed

cmd/release/release.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,17 @@ var builds = []*Build{
201201
Race: true,
202202
Builder: "windows-amd64-2008",
203203
},
204+
{
205+
GoQuery: ">= go1.17beta1", // Go 1.17 Beta 1 is the first Go (pre-)release with the windows/arm64 port.
206+
OS: "windows",
207+
Arch: "arm64",
208+
Race: false, // Not supported as of 2021-06-01.
209+
Builder: "windows-arm64-aws",
210+
211+
// TODO(golang.org/issue/46406, golang.org/issue/46502): Fix or skip failing tests,
212+
// ensure the builder is fast enough to complete tests, then remove SkipTests here.
213+
SkipTests: true,
214+
},
204215
{
205216
GoQuery: ">= go1.17beta1",
206217
OS: "darwin",
@@ -598,6 +609,11 @@ func (b *Build) make() error {
598609
if b.OS == "windows" {
599610
cleanFiles = append(cleanFiles, "msi")
600611
}
612+
if b.OS == "windows" && b.Arch == "arm64" {
613+
// At least on windows-arm64, 'wix/winterop.dll' gets created.
614+
// Delete the entire wix directory since it's unrelated to Go.
615+
cleanFiles = append(cleanFiles, "wix")
616+
}
601617

602618
// Need to delete everything except the final "go" directory,
603619
// as we make the tarball relative to workdir.

cmd/release/releaselet.go

Lines changed: 39 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,15 @@ func windowsMSI() error {
9090
// Install Wix tools.
9191
wix := filepath.Join(cwd, "wix")
9292
defer os.RemoveAll(wix)
93-
if err := installWix(wix); err != nil {
94-
return err
93+
switch runtime.GOARCH {
94+
default:
95+
if err := installWix(wixRelease311, wix); err != nil {
96+
return err
97+
}
98+
case "arm64":
99+
if err := installWix(wixRelease314, wix); err != nil {
100+
return err
101+
}
95102
}
96103

97104
// Write out windows data that is used by the packaging process.
@@ -125,6 +132,8 @@ func windowsMSI() error {
125132
return "x86"
126133
case "amd64":
127134
return "x64"
135+
case "arm64":
136+
return "arm64"
128137
}
129138
}
130139

@@ -159,20 +168,33 @@ func windowsMSI() error {
159168
)
160169
}
161170

162-
const wixBinaries = "https://storage.googleapis.com/go-builder-data/wix311-binaries.zip"
163-
const wixSha256 = "da034c489bd1dd6d8e1623675bf5e899f32d74d6d8312f8dd125a084543193de"
171+
type wixRelease struct {
172+
BinaryURL string
173+
SHA256 string
174+
}
175+
176+
var (
177+
wixRelease311 = wixRelease{
178+
BinaryURL: "https://storage.googleapis.com/go-builder-data/wix311-binaries.zip",
179+
SHA256: "da034c489bd1dd6d8e1623675bf5e899f32d74d6d8312f8dd125a084543193de",
180+
}
181+
wixRelease314 = wixRelease{
182+
BinaryURL: "https://storage.googleapis.com/go-builder-data/wix314-binaries.zip",
183+
SHA256: "34dcbba9952902bfb710161bd45ee2e721ffa878db99f738285a21c9b09c6edb", // WiX v3.14.0.4118 release, SHA 256 of wix314-binaries.zip from https://wixtoolset.org/releases/v3-14-0-4118/.
184+
}
185+
)
164186

165187
// installWix fetches and installs the wix toolkit to the specified path.
166-
func installWix(path string) error {
188+
func installWix(wix wixRelease, path string) error {
167189
// Fetch wix binary zip file.
168-
body, err := httpGet(wixBinaries)
190+
body, err := httpGet(wix.BinaryURL)
169191
if err != nil {
170192
return err
171193
}
172194

173-
// Verify sha256
195+
// Verify sha256.
174196
sum := sha256.Sum256(body)
175-
if fmt.Sprintf("%x", sum) != wixSha256 {
197+
if fmt.Sprintf("%x", sum) != wix.SHA256 {
176198
return errors.New("sha256 mismatch for wix toolkit")
177199
}
178200

@@ -358,19 +380,24 @@ var windowsData = map[string]string{
358380
"installer.wxs": `<?xml version="1.0" encoding="UTF-8"?>
359381
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
360382
<!--
361-
# Copyright 2010 The Go Authors. All rights reserved.
383+
# Copyright 2010 The Go Authors. All rights reserved.
362384
# Use of this source code is governed by a BSD-style
363385
# license that can be found in the LICENSE file.
364386
-->
365387
366388
<?if $(var.Arch) = 386 ?>
367-
<?define ProdId = {FF5B30B2-08C2-11E1-85A2-6ACA4824019B} ?>
368389
<?define UpgradeCode = {1C3114EA-08C3-11E1-9095-7FCA4824019B} ?>
390+
<?define InstallerVersion="300" ?>
369391
<?define SysFolder=SystemFolder ?>
370392
<?define ArchProgramFilesFolder="ProgramFilesFolder" ?>
393+
<?elseif $(var.Arch) = arm64 ?>
394+
<?define UpgradeCode = {21ade9a3-3fdd-4ba6-bea6-c85abadc9488} ?>
395+
<?define InstallerVersion="500" ?>
396+
<?define SysFolder=System64Folder ?>
397+
<?define ArchProgramFilesFolder="ProgramFiles64Folder" ?>
371398
<?else?>
372-
<?define ProdId = {716c3eaa-9302-48d2-8e5e-5cfec5da2fab} ?>
373399
<?define UpgradeCode = {22ea7650-4ac6-4001-bf29-f4b8775db1c0} ?>
400+
<?define InstallerVersion="300" ?>
374401
<?define SysFolder=System64Folder ?>
375402
<?define ArchProgramFilesFolder="ProgramFiles64Folder" ?>
376403
<?endif?>
@@ -388,7 +415,7 @@ var windowsData = map[string]string{
388415
Keywords='Installer'
389416
Description="The Go Programming Language Installer"
390417
Comments="The Go programming language is an open source project to make programmers more productive."
391-
InstallerVersion="300"
418+
InstallerVersion="$(var.InstallerVersion)"
392419
Compressed="yes"
393420
InstallScope="perMachine"
394421
Languages="1033" />
@@ -627,11 +654,5 @@ func runSelfTests() {
627654
}
628655
}
629656

630-
// GoDoc binary is no longer bundled with the binary distribution
631-
// as of Go 1.13, so there should not be a shortcut to it.
632-
if strings.Contains(windowsData["installer.wxs"], "GODOC_SHORTCUT") {
633-
log.Fatal("expected GODOC_SHORTCUT to be gone")
634-
}
635-
636657
fmt.Println("ok")
637658
}

0 commit comments

Comments
 (0)