Skip to content

Commit e7cc2ff

Browse files
marcsanmiclaude
andauthored
chore: bump Go to 1.25.7 (#4877)
* fix: move WaitGroup.Add inside watch() to fix Go 1.25 vet check Go 1.25 added a vet check that flags WaitGroup.Add called from inside a new goroutine. Move wg.Add(1) from the goroutine callback into the watch() method itself, keeping it paired with its defer wg.Done(). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * chore: revise update-go-version skill per review feedback - Skill now calls tools/upgrade-go-version.sh for CI/Dockerfile/release updates instead of duplicating its logic - go directive only updated when a dependency or language feature requires it (not automatically on every minor bump) - toolchain directive updated on every bump (patch and minor) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * fix: make upgrade-go-version.sh portable across macOS and Linux Use sed -i.bak instead of sed -i for cross-platform compatibility. BSD sed (macOS) requires a backup extension with -i, while GNU sed (Linux) treats it as optional. The .bak files are cleaned up after. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * Update golang version to 1.25.7 * Update Go toolchain to go1.25.7 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 19c41ef commit e7cc2ff

File tree

33 files changed

+123
-153
lines changed

33 files changed

+123
-153
lines changed

.claude/skills/update-go-version/SKILL.md

Lines changed: 64 additions & 99 deletions
Original file line numberDiff line numberDiff line change
@@ -39,43 +39,41 @@ Report these to the user before making changes.
3939

4040
### 2. Determine bump type
4141

42-
Compare the target version against the current `go` directive in `go.mod`:
42+
Compare the target version against the current `toolchain` directive in `go.mod`:
4343

44-
- **Same minor** (e.g. current `go 1.25.0`, target `1.25.7`): this is a **patch bump**. Only the `toolchain` directive and build/CI files need updating. The `go` directive stays as-is.
45-
- **Different minor** (e.g. current `go 1.24.6`, target `1.25.7`): this is a **minor bump**. Both the `go` directive and `toolchain` directive need updating, plus build/CI files.
44+
- **Same minor** (e.g. current `toolchain go1.25.3`, target `1.25.7`): **patch bump**. Only the `toolchain` directive and build/CI files need updating.
45+
- **Different minor** (e.g. current `toolchain go1.24.9`, target `1.25.7`): **minor bump**. The `toolchain` directive and build/CI files need updating. Ask the user whether to also update the `go` directive (see step 4).
4646

4747
Tell the user which type was detected before proceeding.
4848

49-
### 3. Update go.mod and go.work files
49+
### 3. Run the upgrade script
5050

51-
**Important:** Do NOT run `go mod tidy` or `go work sync` manually. Step 7 handles module synchronization correctly using `make go/mod`.
51+
The `tools/upgrade-go-version.sh` script handles CI, Dockerfile, and release config updates. It also creates a git commit with those changes:
5252

53-
#### For a minor bump
54-
55-
The `go` directive sets the minimum compatible version, the `toolchain` directive sets the exact build version. They MUST be different to prevent Go from dropping the `toolchain` line.
56-
57-
- Set `go` directive to `X.Y.0` (the base of the new minor)
58-
- Set `toolchain` directive to `goX.Y.Z` (the exact target patch version, which must be > X.Y.0)
59-
60-
Use two separate `go mod edit` calls to ensure the toolchain line is preserved:
6153
```bash
62-
go mod edit -go=X.Y.0 <file>
63-
go mod edit -toolchain=goX.Y.Z <file>
54+
bash tools/upgrade-go-version.sh X.Y.Z
6455
```
6556

66-
If using a single `go mod edit -go=X.Y.0 -toolchain=goX.Y.Z` and both values are the same, Go will DROP the toolchain line. Always ensure they differ.
57+
This updates and commits:
58+
- `.github/workflows/*.yml``go-version:` values
59+
- `.goreleaser.yaml` — version check hook
60+
- `.pyroscope.yaml``ref:` for Go stdlib source linking and `GO_VERSION`
61+
- `tools/update_examples.Dockerfile``GO_VERSION` ARG
62+
- All Go Dockerfiles — `FROM golang:` base image tag (excluding ebpf testdata)
6763

68-
#### For a patch bump
64+
### 4. Update `toolchain` directive in go.mod and go.work files
6965

70-
Update only the `toolchain` directive to `goX.Y.Z` in all go.mod files and the root `go.work`. Do NOT change the `go` directive.
66+
Update the `toolchain` directive to `goX.Y.Z` in all go.mod files using `go mod edit`, and the root `go.work` using `go work edit`:
7167

7268
```bash
69+
# For go.mod files:
7370
go mod edit -toolchain=goX.Y.Z <file>
74-
```
7571

76-
#### Files to update
72+
# For go.work files (go mod edit does NOT work on .work files):
73+
go work edit -toolchain=goX.Y.Z <file>
74+
```
7775

78-
**go.mod files (all need both `go` and `toolchain` for minor bumps, only `toolchain` for patch bumps):**
76+
**go.mod files:**
7977
- `go.mod`
8078
- `api/go.mod`
8179
- `lidia/go.mod`
@@ -86,114 +84,81 @@ go mod edit -toolchain=goX.Y.Z <file>
8684
- `examples/language-sdk-instrumentation/golang-push/rideshare-k6/go.mod`
8785
- `examples/language-sdk-instrumentation/golang-push/simple/go.mod`
8886

89-
**go.work files (edit directly with sed or text editing):**
90-
- `go.work` (has both `go` and `toolchain` lines)
91-
- `examples/golang-pgo/go.work` (only `go` line, no `toolchain`)
92-
- `examples/tracing/golang-push/go.work` (only `go` line)
93-
- `examples/language-sdk-instrumentation/golang-push/rideshare/go.work` (only `go` line)
94-
- `examples/language-sdk-instrumentation/golang-push/rideshare-alloy/go.work` (only `go` line)
95-
- `examples/language-sdk-instrumentation/golang-push/rideshare-k6/go.work` (only `go` line)
96-
- `examples/language-sdk-instrumentation/golang-push/simple/go.work` (only `go` line)
97-
98-
For go.work files:
99-
- **Minor bump**: update the `go` directive to `X.Y.0` in all go.work files, and update the `toolchain` directive to `goX.Y.Z` in the root `go.work`.
100-
- **Patch bump**: update only the `toolchain` directive to `goX.Y.Z` in the root `go.work`. Do not touch example go.work files (they have no `toolchain` line).
101-
102-
### 4. Update CI workflows
87+
**go.work (root only — use `go work edit`):**
88+
- `go.work`
10389

104-
Update `go-version:` in all GitHub Actions workflow files to the exact target version `X.Y.Z`. The version may be quoted or unquoted:
90+
#### Optional: update `go` directive (minor bump only)
10591

106-
Files to update (check each one):
107-
- `.github/workflows/ci.yml` (6 occurrences)
108-
- `.github/workflows/fuzzer.yml`
109-
- `.github/workflows/release.yml`
110-
- `.github/workflows/test-examples.yml`
111-
- `.github/workflows/update-contributors.yml`
112-
- `.github/workflows/weekly-release.yml`
92+
The `go` directive sets the **minimum compatible Go version**. Only update it when:
93+
- A dependency requires a newer Go version
94+
- The codebase uses a Go language feature from the newer minor version
95+
- The user explicitly requests it
11396

114-
### 5. Update Dockerfiles
97+
If updating the `go` directive, the `go` and `toolchain` values MUST differ to prevent Go from dropping the `toolchain` line. Use two separate calls:
11598

116-
Update `FROM golang:` base images to the exact target version `X.Y.Z` in all Go example Dockerfiles.
117-
118-
Find them with:
11999
```bash
120-
git ls-files '**/Dockerfile*' | xargs grep -l 'golang:[0-9]' | grep -v ebpf/symtab/elf/testdata
121-
```
100+
# For go.mod files:
101+
go mod edit -go=X.Y.0 <file>
102+
go mod edit -toolchain=goX.Y.Z <file>
122103

123-
**Do NOT touch:**
124-
- Non-Go Dockerfiles (dotnet, java, python, nodejs — they don't use `golang:` images)
125-
- `examples/grafana-alloy-auto-instrumentation/ebpf-otel/Dockerfile.demo` (uses `golang:1.22-alpine`, intentionally pinned to an older version)
126-
- Any Dockerfile under `ebpf/symtab/elf/testdata/`
104+
# For go.work files (go mod edit does NOT work on .work files):
105+
go work edit -go=X.Y.0 <file>
106+
go work edit -toolchain=goX.Y.Z <file>
107+
```
127108

128-
### 6. Update build and release configuration
109+
Also update the `go` directive in all go.work files (use `go work edit`):
110+
- `go.work`
111+
- `examples/golang-pgo/go.work`
112+
- `examples/tracing/golang-push/go.work`
113+
- `examples/language-sdk-instrumentation/golang-push/rideshare/go.work`
114+
- `examples/language-sdk-instrumentation/golang-push/rideshare-alloy/go.work`
115+
- `examples/language-sdk-instrumentation/golang-push/rideshare-k6/go.work`
116+
- `examples/language-sdk-instrumentation/golang-push/simple/go.work`
129117

130-
- **`.goreleaser.yaml`**: Update the version check hook string:
131-
```
132-
go version | grep "go version goX.Y.Z "
133-
```
118+
### 5. Synchronize Go modules
134119

135-
- **`.pyroscope.yaml`**: Update the Go source code ref for symbol resolution:
136-
```yaml
137-
ref: goX.Y.Z
138-
```
120+
```bash
121+
make go/mod
122+
```
139123

140-
- **`tools/update_examples.Dockerfile`**: Update the `GO_VERSION` ARG:
141-
```
142-
ARG GO_VERSION=X.Y.Z
143-
```
124+
This runs `go work sync` and `go mod tidy` across all modules. Required because CI runs `check/go/mod`.
144125

145-
### 7. Synchronize Go modules
126+
Review the diff. Expected: `go.sum` changes, small indirect dependency bumps. Investigate anything unexpected.
146127

147-
Run the project's standard module sync target:
128+
### 6. Verify the build
148129

149130
```bash
150-
make go/mod
131+
make go/bin
151132
```
152133

153-
This runs `go work sync` and `go mod tidy` across all modules in the correct order. It is **required** because:
154-
- CI runs `check/go/mod` which verifies modules are tidy — skipping this will fail CI
155-
- Bumping the `go` directive changes the `go.sum` checksum retention window
156-
- Minor version bumps may cause small, legitimate dependency adjustments (e.g. transitive minimum versions)
134+
If the build fails, investigate and fix before proceeding.
157135

158-
Review the resulting diff. Expected changes:
159-
- `go.sum` additions/removals (checksum window shift) — **normal**
160-
- Small indirect dependency version bumps in `go.mod` files — **normal for minor bumps**
161-
- Large unexpected dependency changes — **investigate before committing**
136+
### 7. Commit remaining changes
162137

163-
### 8. Verify the build
138+
The script already committed CI/Dockerfile/release changes. Now commit the go.mod/go.work/go.sum changes:
164139

165140
```bash
166-
make go/bin
141+
git add -u *.mod *.sum *.work api/ lidia/ examples/
167142
```
168143

169-
If the build fails, investigate and fix before proceeding.
144+
Use a commit message that reflects what changed:
145+
- Toolchain only: `"Update Go toolchain to goX.Y.Z"`
146+
- Toolchain + go directive: `"Update Go to X.Y.Z (go directive + toolchain)"`
170147

171-
### 9. Summary
148+
### 8. Summary
172149

173-
After all changes, show the user:
150+
Show the user:
174151
- Number of files modified
175-
- Old version -> New version for each category (go directive, toolchain, CI, Dockerfiles)
152+
- Old -> New version for each category (go directive, toolchain, CI, Dockerfiles)
176153
- Whether it was a minor or patch bump
177154
- Build verification result
178-
- Summary of `make go/mod` changes (any dependency adjustments)
155+
- Remind user to review commits and push when ready
179156

180157
## Version semantics reference
181158

182159
| Directive | Meaning | When to update |
183160
|-----------|---------|---------------|
184-
| `go X.Y.0` | Minimum Go version for compatibility | Minor bumps only |
161+
| `go X.Y.Z` | Minimum Go version for compatibility | Only when a dependency or language feature requires it |
185162
| `toolchain goX.Y.Z` | Exact build version (bug fixes, security) | Every bump (patch and minor) |
186-
| CI `go-version` | Exact version CI uses to build/test | Every bump |
187-
| Dockerfile `golang:X.Y.Z` | Exact version for container builds | Every bump |
188-
189-
## Files Reference
190-
191-
| Category | Files | What changes |
192-
|----------|-------|-------------|
193-
| Go modules | `go.mod`, `api/go.mod`, `lidia/go.mod`, `examples/**/go.mod` | `go` directive (minor bump) + `toolchain` directive (always) |
194-
| Go workspaces | `go.work`, `examples/**/go.work` | `go` directive (minor bump) + `toolchain` directive (root only) |
195-
| CI workflows | `.github/workflows/*.yml` | `go-version:` value |
196-
| Dockerfiles | `examples/**/Dockerfile*` (Go ones only) | `FROM golang:` base image tag |
197-
| Release | `.goreleaser.yaml` | Version check hook |
198-
| Profiling | `.pyroscope.yaml` | `ref:` for Go stdlib source linking |
199-
| Build tools | `tools/update_examples.Dockerfile` | `GO_VERSION` ARG |
163+
| CI `go-version` | Exact version CI uses to build/test | Every bump (via script) |
164+
| Dockerfile `golang:X.Y.Z` | Exact version for container builds | Every bump (via script) |

.github/workflows/ci.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- name: Install Go
2828
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
2929
with:
30-
go-version: 1.24.13
30+
go-version: 1.25.7
3131
- name: Format
3232
run: make fmt check/unstaged-changes
3333
check-generated:
@@ -40,7 +40,7 @@ jobs:
4040
- name: Install Go
4141
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
4242
with:
43-
go-version: 1.24.13
43+
go-version: 1.25.7
4444
- name: Check generated files
4545
run: make generate check/unstaged-changes
4646
test:
@@ -63,7 +63,7 @@ jobs:
6363
- name: Install Go
6464
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
6565
with:
66-
go-version: 1.24.13
66+
go-version: 1.25.7
6767
- name: Go Mod
6868
run: make check/go/mod
6969
- name: Test
@@ -78,7 +78,7 @@ jobs:
7878
- name: Install Go
7979
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
8080
with:
81-
go-version: 1.24.13
81+
go-version: 1.25.7
8282
- name: Run linter
8383
run: make lint
8484
- name: Check helm manifests
@@ -109,7 +109,7 @@ jobs:
109109
- name: Set up go
110110
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
111111
with:
112-
go-version: 1.24.13
112+
go-version: 1.25.7
113113
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
114114
with:
115115
node-version: 20
@@ -139,7 +139,7 @@ jobs:
139139
- name: Set up go
140140
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
141141
with:
142-
go-version: 1.24.13
142+
go-version: 1.25.7
143143
# login to docker hub
144144
- id: get-secrets
145145
uses: grafana/shared-workflows/actions/get-vault-secrets@c2f1df59dba624b3fd509e5181aa8da5217120c0

.github/workflows/fuzzer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@ jobs:
1616
- name: Install Go
1717
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
1818
with:
19-
go-version: 1.24.13
19+
go-version: 1.25.7
2020
- name: Run Fuzz_Merge_Single
2121
run: go test -fuzz=Fuzz_Merge_Single --fuzztime 1h -run '^$' -v ./pkg/pprof/

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
- run: git fetch --force --tags
3333
- uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
3434
with:
35-
go-version: "1.24.13"
35+
go-version: "1.25.7"
3636
cache: false
3737
- uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
3838
with:

.github/workflows/test-examples.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ jobs:
2222
- name: Install Go
2323
uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6.2.0
2424
with:
25-
go-version: 1.24.13
25+
go-version: 1.25.7
2626
- name: Run tests
2727
run: make examples/test

.github/workflows/update-contributors.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
echo "user-id=$(gh api "/users/${APP_BOT}" --jq .id)" >> "$GITHUB_OUTPUT"
4848
- uses: actions/setup-go@7a3fe6cf4cb3a834922a1244abfce67bcef6a0c5 # v6
4949
with:
50-
go-version: 1.24.13
50+
go-version: 1.25.7
5151
- name: Update contributors
5252
run: make update-contributors
5353

.github/workflows/weekly-release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
git tag "$IMAGE_TAG"
4040
- uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5
4141
with:
42-
go-version: "1.24.13"
42+
go-version: "1.25.7"
4343
cache: false
4444
# setup docker buildx
4545
- name: Set up QEMU

.goreleaser.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ version: 2
33
before:
44
hooks:
55
# This hook ensures that goreleaser uses the correct go version for a Pyroscope release
6-
- sh -euc 'go version | grep "go version go1.24.13 " || { echo "Unexpected go version"; exit 1; }'
6+
- sh -euc 'go version | grep "go version go1.25.7 " || { echo "Unexpected go version"; exit 1; }'
77
env:
88
# Strip debug information from the binary by default, weekly builds will have debug information
99
- GORELEASER_DEBUG_INFO_FLAGS={{ if and (index .Env "GORELEASER_STRIP_DEBUG_INFO") (eq .Env.GORELEASER_STRIP_DEBUG_INFO "false") }}{{ else }}-s -w{{ end }}

.pyroscope.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ source_code:
88
github:
99
owner: golang
1010
repo: go
11-
ref: go1.24.13
11+
ref: go1.25.7
1212
path: src

api/go.mod

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ module github.com/grafana/pyroscope/api
22

33
go 1.24.6
44

5-
toolchain go1.24.9
5+
toolchain go1.25.7
66

77
require (
88
connectrpc.com/connect v1.19.1
@@ -22,10 +22,11 @@ require (
2222
github.com/google/gnostic-models v0.7.0 // indirect
2323
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
2424
github.com/rogpeppe/go-internal v1.14.1 // indirect
25-
go.opentelemetry.io/otel v1.39.0 // indirect
25+
go.opentelemetry.io/otel v1.40.0 // indirect
26+
go.opentelemetry.io/otel/sdk/metric v1.40.0 // indirect
2627
go.yaml.in/yaml/v3 v3.0.4 // indirect
2728
golang.org/x/net v0.48.0 // indirect
28-
golang.org/x/sys v0.39.0 // indirect
29+
golang.org/x/sys v0.40.0 // indirect
2930
golang.org/x/text v0.33.0 // indirect
3031
google.golang.org/genproto/googleapis/rpc v0.0.0-20260120221211-b8f7ae30c516 // indirect
3132
gopkg.in/yaml.v3 v3.0.1 // indirect

0 commit comments

Comments
 (0)