Skip to content

Upgrade to Go v1.26 and build separate Windows resource files on 386 and amd64 platforms - #6220

Merged
chrisd8088 merged 2 commits into
git-lfs:mainfrom
chrisd8088:upgrade-go-1-26
Mar 17, 2026
Merged

chrisd8088 merged 2 commits into
git-lfs:mainfrom
chrisd8088:upgrade-go-1-26

Conversation

@chrisd8088

@chrisd8088 chrisd8088 commented Mar 16, 2026 •

Copy link
Copy Markdown
Member

Go version 1.26 has been released, and because we aim to build and test Git LFS against only supported versions of Go, we upgrade our GitHub Actions CI workflows to test against Go versions 1.26 and 1.25.

This resolves a problem now seen in our Build with specific Go CI job, where we install the latest version of the goimports package and it fails because the x/tools module requires Go v1.25 as of commit golang/tools@f644bf7, and we are still using Go v1.24 for that CI job.

After this PR is merged, we will revise the required set of jobs in our CI test suite, and also upgrade the version of Go used in the scripts and Dockerfiles in our github/build-dockers project.


We also revise our Windows builds so that we create separate resource.syso files on the 386 and amd64 platforms, in order to avoid an unknown relocation type 7 error which would otherwise now occur in our Windows CI jobs.

In commit golang/go@594deca a long-standing Go linker issue was resolved so that relocations on the 386 and amd64 platforms are now handled appropriately and no longer accidentally conflated. This change was then included in the Go v1.26 release.

One consequence of this bug fix is that users of the goversioninfo command provided by the github.com/josephspurrier/goversioninfo package must now disambiguate their Windows builds on the two platforms, because that command defaults to generating resource files for the 386 platform. These resource.syso files would previously suffice for the amd64 platform as well because the Go linker would incorrectly allow them to be embedded in the binaries it produced. For reference, see golang/go#77783 (comment) and CL 672155.

We therefore replace our common git-lfs_windows.go source file with distinct git-lfs_windows_386.go and git-lfs_windows_amd64.go files. Each of these specifies a single Go architecture build tag, either 386 or amd64, and in the latter case we pass the -64=true option to the "goversioninfo command, while in the former case we defer to the command's default 32-bit setting.

@chrisd8088
chrisd8088 requested a review from a team as a code owner March 16, 2026 04:00
@chrisd8088 chrisd8088 added the github_actions Pull requests that update GitHub Actions code label Mar 16, 2026
Go version 1.26 has been released, and because we aim to build and test
Git LFS against only supported versions of Go, we upgrade our GitHub
Actions CI workflows to test against Go versions 1.26 and 1.25.

This resolves a problem now seen in our "Build with specific Go" CI job,
where we install the latest version of the "goimports" package and it
fails because the "x/tools" module requires Go v1.25 as of commit
golang/tools@f644bf7, and we are still
using Go v1.24 for that CI job.
In commit golang/go@594deca a
long-standing Go linker issue was resolved so that relocations on the
386 and amd64 platforms are now handled appropriately and no longer
accidentally conflated.  This change was then included in the
Go v1.26 release.

However, one consequence of this bug fix is that users of the
"goversioninfo" command provided by the
"github.com/josephspurrier/goversioninfo" package must now disambiguate
their Windows builds on the two platforms, because that command defaults
to generating resource files for the 386 platform.  These "resource.syso"
files would previously suffice for the amd64 platform as well because
the Go linker would incorrectly allow them to be embedded in the
binaries it produced.  See, for reference:

  golang/go#77783 (comment)
  https://go-review.googlesource.com/c/go/+/672155

In a prior commit in this PR we upgraded our CI and release GitHub
Actions workflows to use Go v1.26, and as a result, our Windows jobs
will not succeed unless we also ensure that we build separate resource
files for the 386 and amd64 platforms.

We therefore replace our common "git-lfs_windows.go" source file
with distinct "git-lfs_windows_386.go" and "git-lfs_windows_amd64.go"
files.  Each of these specifies a single Go architecture build tag,
either "386" or "amd64", and in the latter case we pass the "-64=true"
option to the "goversioninfo" command, while in the former case we
defer to the command's default 32-bit setting.
@chrisd8088 chrisd8088 changed the title Upgrade to Go 1.26 Upgrade to Go v1.26 and build separate Windows resource files on 386 and amd64 platforms Mar 16, 2026
@chrisd8088
chrisd8088 merged commit 0a45b99 into git-lfs:main Mar 17, 2026
10 checks passed
@chrisd8088
chrisd8088 deleted the upgrade-go-1-26 branch March 17, 2026 04:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

github_actions Pull requests that update GitHub Actions code windows

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Sponsor
SponsoredKunjungi sekarang
Promo