@cryptotaxi247 / kubo / commits / afc8ad3c6

feat: go 1.26.2 (#11275)

* feat: go 1.26.2, once more with feeling go 1.26 was reverted in v0.40.1 due to a windows crash in go's overlapped i/o layer. upstream fix landed in go 1.26.2, so kubo can switch back across all platforms. - go.mod, kubo-as-a-library, test/dependencies: go 1.26.2 - Dockerfile: golang:1.26.2 (pinned to same patch as go.mod) - v0.41 changelog: restore go 1.26 highlight, link upstream fix ref: https://github.com/ipfs/kubo/issues/11214 ref: https://github.com/golang/go/issues/78041 * ci: parse go version from go.mod for docker builds Dockerfile FROM lines must be literals, so go.mod can't drive them directly. The docker workflows now parse the `go` directive from go.mod and pass it as a GO_VERSION build arg, making go.mod the single source of truth across setup-go and docker. Local `docker build .` still works via the ARG default, and a lint check fails if that default drifts. - Dockerfile: ARG GO_VERSION=1.26.2 before FROM golang:${GO_VERSION} - docker-image.yml: read go.mod, pass GO_VERSION to all 4 build steps - docker-check.yml: same for the build job; lint job verifies the Dockerfile ARG default matches the go directive in go.mod

Marcin Rataj committed Apr 9, 2026 at 18:26 UTC afc8ad3c6662244af296d3053a9fbe3c3e19689a
7 files changed +57 -6
.github/workflows/docker-check.yml
+24 -2
@@ -30,6 +30,20 @@ jobs:
30 verbose: true
31 format: tty
32
33 + # Guard rail: the Dockerfile ARG default is what `docker build .` uses
34 + # locally without --build-arg. CI overrides it from go.mod, but the
35 + # default must stay in sync so local builds and the published image use
36 + # the same Go toolchain.
37 + - name: Verify Dockerfile GO_VERSION default matches go.mod
38 + run: |
39 + GO_MOD_VERSION=$(awk '/^go [0-9]/ {print $2; exit}' go.mod)
40 + DOCKERFILE_VERSION=$(awk -F= '/^ARG GO_VERSION=/ {print $2; exit}' Dockerfile)
41 + if [ "$GO_MOD_VERSION" != "$DOCKERFILE_VERSION" ]; then
42 + echo "::error file=Dockerfile::go.mod has 'go ${GO_MOD_VERSION}' but Dockerfile default ARG GO_VERSION=${DOCKERFILE_VERSION}. Update the Dockerfile default to match go.mod."
43 + exit 1
44 + fi
45 + echo "OK: both pinned to ${GO_MOD_VERSION}"
46 +
47 build:
48 if: github.repository == 'ipfs/kubo' || github.event_name == 'workflow_dispatch'
49 runs-on: ubuntu-latest
@@ -42,10 +56,16 @@ jobs:
56 shell: bash
57 steps:
58 - uses: actions/checkout@v6
45 -
59 +
60 - name: Set up Docker Buildx
61 uses: docker/setup-buildx-action@v4
48 -
62 +
63 + # Mirror the publish workflow: pull the Go version from go.mod so the
64 + # PR check builds with the same toolchain that the published image uses.
65 + - name: Read Go version from go.mod
66 + id: go
67 + run: echo "version=$(awk '/^go [0-9]/ {print $2; exit}' go.mod)" >> "$GITHUB_OUTPUT"
68 +
69 - name: Build Docker image with BuildKit
70 uses: docker/build-push-action@v7
71 with:
@@ -53,6 +73,8 @@ jobs:
73 push: false
74 load: true
75 tags: ${{ env.IMAGE_NAME }}:${{ env.WIP_IMAGE_TAG }}
76 + build-args: |
77 + GO_VERSION=${{ steps.go.outputs.version }}
78 cache-from: |
79 type=gha
80 type=registry,ref=${{ env.IMAGE_NAME }}:buildcache
.github/workflows/docker-image.yml
+14
@@ -66,6 +66,12 @@ jobs:
66 echo "EOF" >> $GITHUB_OUTPUT
67 shell: bash
68
69 + # Read the Go version from go.mod so the Docker image is built with the
70 + # exact same toolchain that setup-go installs in the rest of CI.
71 + - name: Read Go version from go.mod
72 + id: go
73 + run: echo "version=$(awk '/^go [0-9]/ {print $2; exit}' go.mod)" >> "$GITHUB_OUTPUT"
74 +
75 # We have to build each platform separately because when using multi-arch
76 # builds, only one platform is being loaded into the cache. This would
77 # prevent us from testing the other platforms.
@@ -78,6 +84,8 @@ jobs:
84 load: true
85 file: ./Dockerfile
86 tags: ${{ env.IMAGE_NAME }}:linux-amd64
87 + build-args: |
88 + GO_VERSION=${{ steps.go.outputs.version }}
89 cache-from: |
90 type=gha
91 type=registry,ref=${{ env.IMAGE_NAME }}:buildcache
@@ -92,6 +100,8 @@ jobs:
100 load: true
101 file: ./Dockerfile
102 tags: ${{ env.IMAGE_NAME }}:linux-arm-v7
103 + build-args: |
104 + GO_VERSION=${{ steps.go.outputs.version }}
105 cache-from: |
106 type=gha
107 type=registry,ref=${{ env.IMAGE_NAME }}:buildcache
@@ -106,6 +116,8 @@ jobs:
116 load: true
117 file: ./Dockerfile
118 tags: ${{ env.IMAGE_NAME }}:linux-arm64-v8
119 + build-args: |
120 + GO_VERSION=${{ steps.go.outputs.version }}
121 cache-from: |
122 type=gha
123 type=registry,ref=${{ env.IMAGE_NAME }}:buildcache
@@ -135,6 +147,8 @@ jobs:
147 push: true
148 file: ./Dockerfile
149 tags: "${{ github.event.inputs.tags || steps.tags.outputs.value }}"
150 + build-args: |
151 + GO_VERSION=${{ steps.go.outputs.version }}
152 cache-from: |
153 type=gha
154 type=registry,ref=${{ env.IMAGE_NAME }}:buildcache
Dockerfile
+9 -1
@@ -1,6 +1,14 @@
1 # syntax=docker/dockerfile:1
2 # Enables BuildKit with cache mounts for faster builds
3 -FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:1.25 AS builder
3 +
4 +# GO_VERSION is the source of truth for the Go toolchain version. CI parses
5 +# the `go` directive from go.mod and overrides this build arg, so the
6 +# published image always matches the version `setup-go` installs from go.mod.
7 +# The default below is what `docker build .` (without --build-arg) uses, and
8 +# `.github/workflows/docker-check.yml` lints that this default stays in sync
9 +# with go.mod. When bumping Go, update both go.mod and this default together.
10 +ARG GO_VERSION=1.26.2
11 +FROM --platform=${BUILDPLATFORM:-linux/amd64} golang:${GO_VERSION} AS builder
12
13 ARG TARGETOS TARGETARCH
14
docs/changelogs/v0.41.md
+7
@@ -17,6 +17,7 @@ This release was brought to you by the [Shipyard](https://ipshipyard.com/) team.
17 - [🛡️ `ipfs object patch` validates UnixFS node types](#-ipfs-object-patch-validates-unixfs-node-types)
18 - [🔗 MFS: fixed CidBuilder preservation](#-mfs-fixed-cidbuilder-preservation)
19 - [📂 FUSE Mount Fixes](#-fuse-mount-fixes)
20 + - [🐹 Go 1.26, Once More with Feeling](#-go-126-once-more-with-feeling)
21 - [📦️ Dependency updates](#-dependency-updates)
22 - [📝 Changelog](#-changelog)
23 - [👨‍👩‍👧‍👦 Contributors](#-contributors)
@@ -121,6 +122,12 @@ FUSE mounts (`/ipfs`, `/ipns`, `/mfs`) now work with editors like VIM that rely
122 - **Rename works on `/mfs`.** Renaming a file within the same directory no longer leaves the source behind.
123 - **IPNS FUSE publish works.** Writing files to `/ipns/local/` now correctly publishes the updated DAG to IPNS. Before this fix, IPNS publishing from the FUSE mount was silently blocked, so the DAG would disappear after a daemon restart.
124
125 +#### 🐹 Go 1.26, Once More with Feeling
126 +
127 +Kubo first shipped with [Go 1.26](https://go.dev/doc/go1.26) in v0.40.0, but [v0.40.1](https://github.com/ipfs/kubo/blob/master/docs/changelogs/v0.40.md#v0401) had to downgrade to Go 1.25 because of a Windows crash in Go's overlapped I/O layer ([#11214](https://github.com/ipfs/kubo/issues/11214)). Go 1.26.2 fixes that regression upstream ([golang/go#78041](https://github.com/golang/go/issues/78041)), so Kubo is back on Go 1.26 across all platforms.
128 +
129 +You should see lower memory usage and reduced GC pauses thanks to the new Green Tea garbage collector (10-40% less GC overhead). Reading block data and API responses is faster due to `io.ReadAll` improvements (~2x faster, ~50% less memory). On 64-bit platforms, heap base address randomization adds a layer of security hardening.
130 +
131 #### 📦️ Dependency updates
132
133 - update `go-libp2p` to [v0.48.0](https://github.com/libp2p/go-libp2p/releases/tag/v0.48.0)
docs/examples/kubo-as-a-library/go.mod
+1 -1
@@ -1,6 +1,6 @@
1 module github.com/ipfs/kubo/examples/kubo-as-a-library
2
3 -go 1.25.7
3 +go 1.26.2
4
5 // Used to keep this in sync with the current version of kubo. You should remove
6 // this if you copy this example.
go.mod
+1 -1
@@ -1,6 +1,6 @@
1 module github.com/ipfs/kubo
2
3 -go 1.25.7
3 +go 1.26.2
4
5 require (
6 bazil.org/fuse v0.0.0-20200117225306-7b5117fecadc
test/dependencies/go.mod
+1 -1
@@ -1,6 +1,6 @@
1 module github.com/ipfs/kubo/test/dependencies
2
3 -go 1.25.7
3 +go 1.26.2
4
5 replace github.com/ipfs/kubo => ../../
6