Skip to content

Commit 38e3d55

Browse files
aykevldeadprogram
authored andcommitted
all: add Go 1.24 support
1 parent 66da29e commit 38e3d55

File tree

13 files changed

+67
-33
lines changed

13 files changed

+67
-33
lines changed

.circleci/config.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,9 @@ jobs:
109109
# "make lint" fails before go 1.21 because internal/tools/go.mod specifies packages that require go 1.21
110110
fmt-check: false
111111
resource_class: large
112-
test-llvm19-go123:
112+
test-llvm19-go124:
113113
docker:
114-
- image: golang:1.23-bullseye
114+
- image: golang:1.24-bullseye
115115
steps:
116116
- test-linux:
117117
llvm: "19"
@@ -124,4 +124,4 @@ workflows:
124124
# least the smoke tests still pass.
125125
- test-llvm15-go119
126126
# This tests LLVM 19 support when linking against system libraries.
127-
- test-llvm19-go123
127+
- test-llvm19-go124

.github/workflows/build-macos.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
- name: Install Go
4040
uses: actions/setup-go@v5
4141
with:
42-
go-version: '1.23'
42+
go-version: '1.24'
4343
cache: true
4444
- name: Restore LLVM source cache
4545
uses: actions/cache/restore@v4
@@ -143,7 +143,7 @@ jobs:
143143
- name: Install Go
144144
uses: actions/setup-go@v5
145145
with:
146-
go-version: '1.23'
146+
go-version: '1.24'
147147
cache: true
148148
- name: Build TinyGo (LLVM ${{ matrix.version }})
149149
run: go install -tags=llvm${{ matrix.version }}

.github/workflows/linux.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
# statically linked binary.
1919
runs-on: ubuntu-latest
2020
container:
21-
image: golang:1.23-alpine
21+
image: golang:1.24-alpine
2222
outputs:
2323
version: ${{ steps.version.outputs.version }}
2424
steps:
@@ -146,7 +146,7 @@ jobs:
146146
- name: Install Go
147147
uses: actions/setup-go@v5
148148
with:
149-
go-version: '1.23'
149+
go-version: '1.24'
150150
cache: true
151151
- name: Install wasmtime
152152
uses: bytecodealliance/actions/wasmtime/setup@v1
@@ -189,7 +189,7 @@ jobs:
189189
- name: Install Go
190190
uses: actions/setup-go@v5
191191
with:
192-
go-version: '1.23'
192+
go-version: '1.24'
193193
cache: true
194194
- name: Install Node.js
195195
uses: actions/setup-node@v4
@@ -315,7 +315,7 @@ jobs:
315315
- name: Install Go
316316
uses: actions/setup-go@v5
317317
with:
318-
go-version: '1.23'
318+
go-version: '1.24'
319319
cache: true
320320
- name: Restore LLVM source cache
321321
uses: actions/cache/restore@v4

.github/workflows/windows.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ jobs:
4141
- name: Install Go
4242
uses: actions/setup-go@v5
4343
with:
44-
go-version: '1.23'
44+
go-version: '1.24'
4545
cache: true
4646
- name: Restore cached LLVM source
4747
uses: actions/cache/restore@v4
@@ -156,7 +156,7 @@ jobs:
156156
- name: Install Go
157157
uses: actions/setup-go@v5
158158
with:
159-
go-version: '1.23'
159+
go-version: '1.24'
160160
cache: true
161161
- name: Download TinyGo build
162162
uses: actions/download-artifact@v4
@@ -186,7 +186,7 @@ jobs:
186186
- name: Install Go
187187
uses: actions/setup-go@v5
188188
with:
189-
go-version: '1.23'
189+
go-version: '1.24'
190190
cache: true
191191
- name: Download TinyGo build
192192
uses: actions/download-artifact@v4
@@ -222,7 +222,7 @@ jobs:
222222
- name: Install Go
223223
uses: actions/setup-go@v5
224224
with:
225-
go-version: '1.23'
225+
go-version: '1.24'
226226
cache: true
227227
- name: Download TinyGo build
228228
uses: actions/download-artifact@v4

Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# tinygo-llvm stage obtains the llvm source for TinyGo
2-
FROM golang:1.23 AS tinygo-llvm
2+
FROM golang:1.24 AS tinygo-llvm
33

44
RUN apt-get update && \
55
apt-get install -y apt-utils make cmake clang-15 ninja-build && \
@@ -33,7 +33,7 @@ RUN cd /tinygo/ && \
3333

3434
# tinygo-compiler copies the compiler build over to a base Go container (without
3535
# all the build tools etc).
36-
FROM golang:1.23 AS tinygo-compiler
36+
FROM golang:1.24 AS tinygo-compiler
3737

3838
# Copy tinygo build.
3939
COPY --from=tinygo-compiler-build /tinygo/build/release/tinygo /tinygo

GNUmakefile

+4-10
Original file line numberDiff line numberDiff line change
@@ -309,11 +309,9 @@ TEST_PACKAGES_FAST = \
309309
container/heap \
310310
container/list \
311311
container/ring \
312-
crypto/des \
313312
crypto/ecdsa \
314313
crypto/elliptic \
315314
crypto/md5 \
316-
crypto/rc4 \
317315
crypto/sha1 \
318316
crypto/sha256 \
319317
crypto/sha512 \
@@ -355,17 +353,11 @@ TEST_PACKAGES_FAST = \
355353
unique \
356354
$(nil)
357355

358-
# Assume this will go away before Go2, so only check minor version.
359-
ifeq ($(filter $(shell $(GO) env GOVERSION | cut -f 2 -d.), 16 17 18), )
360-
TEST_PACKAGES_FAST += crypto/internal/nistec/fiat
361-
else
362-
TEST_PACKAGES_FAST += crypto/elliptic/internal/fiat
363-
endif
364-
365356
# archive/zip requires os.ReadAt, which is not yet supported on windows
366357
# bytes requires mmap
367358
# compress/flate appears to hang on wasi
368359
# crypto/aes fails on wasi, needs panic()/recover()
360+
# crypto/des fails on wasi, needs panic()/recover()
369361
# crypto/hmac fails on wasi, it exits with a "slice out of range" panic
370362
# debug/plan9obj requires os.ReadAt, which is not yet supported on windows
371363
# image requires recover(), which is not yet supported on wasi
@@ -386,6 +378,7 @@ TEST_PACKAGES_LINUX := \
386378
archive/zip \
387379
compress/flate \
388380
crypto/aes \
381+
crypto/des \
389382
crypto/hmac \
390383
debug/dwarf \
391384
debug/plan9obj \
@@ -405,10 +398,11 @@ TEST_PACKAGES_LINUX := \
405398

406399
TEST_PACKAGES_DARWIN := $(TEST_PACKAGES_LINUX)
407400

401+
# os/user requires t.Skip() support
408402
TEST_PACKAGES_WINDOWS := \
409403
compress/flate \
404+
crypto/des \
410405
crypto/hmac \
411-
os/user \
412406
strconv \
413407
text/template/parse \
414408
$(nil)

builder/config.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ func NewConfig(options *compileopts.Options) (*compileopts.Config, error) {
2626

2727
// Version range supported by TinyGo.
2828
const minorMin = 19
29-
const minorMax = 23
29+
const minorMax = 24
3030

3131
// Check that we support this Go toolchain version.
3232
gorootMajor, gorootMinor, err := goenv.GetGorootVersion()
@@ -36,7 +36,7 @@ func NewConfig(options *compileopts.Options) (*compileopts.Config, error) {
3636
if gorootMajor != 1 || gorootMinor < minorMin || gorootMinor > minorMax {
3737
// Note: when this gets updated, also update the Go compatibility matrix:
3838
// https://github.com/tinygo-org/tinygo-site/blob/dev/content/docs/reference/go-compat-matrix.md
39-
return nil, fmt.Errorf("requires go version 1.19 through 1.23, got go%d.%d", gorootMajor, gorootMinor)
39+
return nil, fmt.Errorf("requires go version 1.%d through 1.%d, got go%d.%d", minorMin, minorMax, gorootMajor, gorootMinor)
4040
}
4141

4242
// Check that the Go toolchain version isn't too new, if we haven't been

builder/sizes_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ func TestBinarySize(t *testing.T) {
4444
// microcontrollers
4545
{"hifive1b", "examples/echo", 4560, 280, 0, 2268},
4646
{"microbit", "examples/serial", 2916, 388, 8, 2272},
47-
{"wioterminal", "examples/pininterrupt", 7315, 1489, 116, 6912},
47+
{"wioterminal", "examples/pininterrupt", 7359, 1489, 116, 6912},
4848

4949
// TODO: also check wasm. Right now this is difficult, because
5050
// wasm binaries are run through wasm-opt and therefore the

compiler/alias.go

+6-5
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,12 @@ var stdlibAliases = map[string]string{
1818
// crypto packages
1919
"crypto/ed25519/internal/edwards25519/field.feMul": "crypto/ed25519/internal/edwards25519/field.feMulGeneric",
2020
"crypto/internal/edwards25519/field.feSquare": "crypto/ed25519/internal/edwards25519/field.feSquareGeneric",
21-
"crypto/md5.block": "crypto/md5.blockGeneric",
22-
"crypto/sha1.block": "crypto/sha1.blockGeneric",
23-
"crypto/sha1.blockAMD64": "crypto/sha1.blockGeneric",
24-
"crypto/sha256.block": "crypto/sha256.blockGeneric",
25-
"crypto/sha512.blockAMD64": "crypto/sha512.blockGeneric",
21+
"crypto/md5.block": "crypto/md5.blockGeneric",
22+
"crypto/sha1.block": "crypto/sha1.blockGeneric",
23+
"crypto/sha1.blockAMD64": "crypto/sha1.blockGeneric",
24+
"crypto/sha256.block": "crypto/sha256.blockGeneric",
25+
"crypto/sha512.blockAMD64": "crypto/sha512.blockGeneric",
26+
"internal/chacha8rand.block": "internal/chacha8rand.block_generic",
2627

2728
// AES
2829
"crypto/aes.decryptBlockAsm": "crypto/aes.decryptBlock",

src/internal/abi/type.go

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package abi
2+
3+
type Type struct {
4+
// Intentionally left empty. TinyGo uses a different way to represent types,
5+
// so this is unimplementable. The type definition here is purely for
6+
// compatibility.
7+
}

src/reflect/value.go

+4
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,10 @@ func (v Value) Comparable() bool {
271271
}
272272
}
273273

274+
func (v Value) Equal(u Value) bool {
275+
panic("unimplemented: reflect.Value.Equal")
276+
}
277+
274278
func (v Value) Addr() Value {
275279
if !v.CanAddr() {
276280
panic("reflect.Value.Addr of unaddressable value")

src/runtime/synctest.go

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package runtime
2+
3+
// Dummy implementation of synctest functions (we don't support synctest at the
4+
// moment).
5+
6+
//go:linkname synctest_acquire internal/synctest.acquire
7+
func synctest_acquire() any {
8+
// Dummy: we don't support synctest.
9+
return nil
10+
}
11+
12+
//go:linkname synctest_release internal/synctest.release
13+
func synctest_release(sg any) {
14+
// Dummy: we don't support synctest.
15+
}

src/runtime/time.go

+13
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
package runtime
22

3+
//go:linkname time_runtimeNano time.runtimeNano
4+
func time_runtimeNano() int64 {
5+
// Note: we're ignoring sync groups here (package testing/synctest).
6+
// See: https://github.com/golang/go/issues/67434
7+
return nanotime()
8+
}
9+
10+
//go:linkname time_runtimeNow time.runtimeNow
11+
func time_runtimeNow() (sec int64, nsec int32, mono int64) {
12+
// Also ignoring the sync group here, like time_runtimeNano above.
13+
return now()
14+
}
15+
316
// timerNode is an element in a linked list of timers.
417
type timerNode struct {
518
next *timerNode

0 commit comments

Comments
 (0)