From 33c8709439ed54779ada79910a9432d509ddeea6 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Thu, 18 Jun 2020 15:01:33 +0100 Subject: [PATCH] build: fix windows/amd64 build and icon/version embedding #4304 The parameters were being passed to goversioninfo in the wrong order so that the 64 bit .syso was actually a 32 bit .syso thus calling the linker to fail. --- bin/cross-compile.go | 6 +++--- bin/win-build.bat | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bin/cross-compile.go b/bin/cross-compile.go index dd541fec3..b8f874c53 100644 --- a/bin/cross-compile.go +++ b/bin/cross-compile.go @@ -172,7 +172,7 @@ func buildDebAndRpm(dir, version, goarch string) []string { } // generate system object (syso) file to be picked up by a following go build for embedding icon and version info resources into windows executable -func buildWindowsResourceSyso(goarch string, versionTag string) (string) { +func buildWindowsResourceSyso(goarch string, versionTag string) string { type M map[string]interface{} version := strings.TrimPrefix(versionTag, "v") semanticVersion := semver.New(version) @@ -238,11 +238,11 @@ func buildWindowsResourceSyso(goarch string, versionTag string) (string) { "goversioninfo", "-o", sysoPath, - jsonPath, } if goarch == "amd64" { - args = append(args, "-64") // Make the syso a 64-bit coff file (but does not matter, results are identical) + args = append(args, "-64") // Make the syso a 64-bit coff file } + args = append(args, jsonPath) err = runEnv(args, nil) if err != nil { return "" diff --git a/bin/win-build.bat b/bin/win-build.bat index 1df848508..6422cf35a 100644 --- a/bin/win-build.bat +++ b/bin/win-build.bat @@ -2,5 +2,5 @@ echo Setting environment variables for mingw+WinFsp compile set GOPATH=Z:\go rem set PATH=C:\Program Files\mingw-w64\i686-7.1.0-win32-dwarf-rt_v5-rev0\mingw32\bin;%PATH% -set PATH=C:\Program Files\mingw-w64\x86_64-8.1.0-win32-seh-rt_v6-rev0\mingw64\bin;%PATH% +set PATH=C:\Program Files\mingw-w64\x86_64-8.1.0-win32-seh-rt_v6-rev0\mingw64\bin;%GOPATH%/bin;%PATH% set CPATH=C:\Program Files\WinFsp\inc\fuse;C:\Program Files (x86)\WinFsp\inc\fuse