mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-16 18:53:29 +00:00
all: add Go 1.24 support
This commit is contained in:
committed by
Ron Evans
parent
66da29e89f
commit
38e3d55e64
@@ -109,9 +109,9 @@ jobs:
|
|||||||
# "make lint" fails before go 1.21 because internal/tools/go.mod specifies packages that require go 1.21
|
# "make lint" fails before go 1.21 because internal/tools/go.mod specifies packages that require go 1.21
|
||||||
fmt-check: false
|
fmt-check: false
|
||||||
resource_class: large
|
resource_class: large
|
||||||
test-llvm19-go123:
|
test-llvm19-go124:
|
||||||
docker:
|
docker:
|
||||||
- image: golang:1.23-bullseye
|
- image: golang:1.24-bullseye
|
||||||
steps:
|
steps:
|
||||||
- test-linux:
|
- test-linux:
|
||||||
llvm: "19"
|
llvm: "19"
|
||||||
@@ -124,4 +124,4 @@ workflows:
|
|||||||
# least the smoke tests still pass.
|
# least the smoke tests still pass.
|
||||||
- test-llvm15-go119
|
- test-llvm15-go119
|
||||||
# This tests LLVM 19 support when linking against system libraries.
|
# This tests LLVM 19 support when linking against system libraries.
|
||||||
- test-llvm19-go123
|
- test-llvm19-go124
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ jobs:
|
|||||||
- name: Install Go
|
- name: Install Go
|
||||||
uses: actions/setup-go@v5
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: '1.23'
|
go-version: '1.24'
|
||||||
cache: true
|
cache: true
|
||||||
- name: Restore LLVM source cache
|
- name: Restore LLVM source cache
|
||||||
uses: actions/cache/restore@v4
|
uses: actions/cache/restore@v4
|
||||||
@@ -143,7 +143,7 @@ jobs:
|
|||||||
- name: Install Go
|
- name: Install Go
|
||||||
uses: actions/setup-go@v5
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: '1.23'
|
go-version: '1.24'
|
||||||
cache: true
|
cache: true
|
||||||
- name: Build TinyGo (LLVM ${{ matrix.version }})
|
- name: Build TinyGo (LLVM ${{ matrix.version }})
|
||||||
run: go install -tags=llvm${{ matrix.version }}
|
run: go install -tags=llvm${{ matrix.version }}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ jobs:
|
|||||||
# statically linked binary.
|
# statically linked binary.
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container:
|
container:
|
||||||
image: golang:1.23-alpine
|
image: golang:1.24-alpine
|
||||||
outputs:
|
outputs:
|
||||||
version: ${{ steps.version.outputs.version }}
|
version: ${{ steps.version.outputs.version }}
|
||||||
steps:
|
steps:
|
||||||
@@ -146,7 +146,7 @@ jobs:
|
|||||||
- name: Install Go
|
- name: Install Go
|
||||||
uses: actions/setup-go@v5
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: '1.23'
|
go-version: '1.24'
|
||||||
cache: true
|
cache: true
|
||||||
- name: Install wasmtime
|
- name: Install wasmtime
|
||||||
uses: bytecodealliance/actions/wasmtime/setup@v1
|
uses: bytecodealliance/actions/wasmtime/setup@v1
|
||||||
@@ -189,7 +189,7 @@ jobs:
|
|||||||
- name: Install Go
|
- name: Install Go
|
||||||
uses: actions/setup-go@v5
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: '1.23'
|
go-version: '1.24'
|
||||||
cache: true
|
cache: true
|
||||||
- name: Install Node.js
|
- name: Install Node.js
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
@@ -315,7 +315,7 @@ jobs:
|
|||||||
- name: Install Go
|
- name: Install Go
|
||||||
uses: actions/setup-go@v5
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: '1.23'
|
go-version: '1.24'
|
||||||
cache: true
|
cache: true
|
||||||
- name: Restore LLVM source cache
|
- name: Restore LLVM source cache
|
||||||
uses: actions/cache/restore@v4
|
uses: actions/cache/restore@v4
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ jobs:
|
|||||||
- name: Install Go
|
- name: Install Go
|
||||||
uses: actions/setup-go@v5
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: '1.23'
|
go-version: '1.24'
|
||||||
cache: true
|
cache: true
|
||||||
- name: Restore cached LLVM source
|
- name: Restore cached LLVM source
|
||||||
uses: actions/cache/restore@v4
|
uses: actions/cache/restore@v4
|
||||||
@@ -156,7 +156,7 @@ jobs:
|
|||||||
- name: Install Go
|
- name: Install Go
|
||||||
uses: actions/setup-go@v5
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: '1.23'
|
go-version: '1.24'
|
||||||
cache: true
|
cache: true
|
||||||
- name: Download TinyGo build
|
- name: Download TinyGo build
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
@@ -186,7 +186,7 @@ jobs:
|
|||||||
- name: Install Go
|
- name: Install Go
|
||||||
uses: actions/setup-go@v5
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: '1.23'
|
go-version: '1.24'
|
||||||
cache: true
|
cache: true
|
||||||
- name: Download TinyGo build
|
- name: Download TinyGo build
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
@@ -222,7 +222,7 @@ jobs:
|
|||||||
- name: Install Go
|
- name: Install Go
|
||||||
uses: actions/setup-go@v5
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: '1.23'
|
go-version: '1.24'
|
||||||
cache: true
|
cache: true
|
||||||
- name: Download TinyGo build
|
- name: Download TinyGo build
|
||||||
uses: actions/download-artifact@v4
|
uses: actions/download-artifact@v4
|
||||||
|
|||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
# tinygo-llvm stage obtains the llvm source for TinyGo
|
# tinygo-llvm stage obtains the llvm source for TinyGo
|
||||||
FROM golang:1.23 AS tinygo-llvm
|
FROM golang:1.24 AS tinygo-llvm
|
||||||
|
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
apt-get install -y apt-utils make cmake clang-15 ninja-build && \
|
apt-get install -y apt-utils make cmake clang-15 ninja-build && \
|
||||||
@@ -33,7 +33,7 @@ RUN cd /tinygo/ && \
|
|||||||
|
|
||||||
# tinygo-compiler copies the compiler build over to a base Go container (without
|
# tinygo-compiler copies the compiler build over to a base Go container (without
|
||||||
# all the build tools etc).
|
# all the build tools etc).
|
||||||
FROM golang:1.23 AS tinygo-compiler
|
FROM golang:1.24 AS tinygo-compiler
|
||||||
|
|
||||||
# Copy tinygo build.
|
# Copy tinygo build.
|
||||||
COPY --from=tinygo-compiler-build /tinygo/build/release/tinygo /tinygo
|
COPY --from=tinygo-compiler-build /tinygo/build/release/tinygo /tinygo
|
||||||
|
|||||||
+4
-10
@@ -309,11 +309,9 @@ TEST_PACKAGES_FAST = \
|
|||||||
container/heap \
|
container/heap \
|
||||||
container/list \
|
container/list \
|
||||||
container/ring \
|
container/ring \
|
||||||
crypto/des \
|
|
||||||
crypto/ecdsa \
|
crypto/ecdsa \
|
||||||
crypto/elliptic \
|
crypto/elliptic \
|
||||||
crypto/md5 \
|
crypto/md5 \
|
||||||
crypto/rc4 \
|
|
||||||
crypto/sha1 \
|
crypto/sha1 \
|
||||||
crypto/sha256 \
|
crypto/sha256 \
|
||||||
crypto/sha512 \
|
crypto/sha512 \
|
||||||
@@ -355,17 +353,11 @@ TEST_PACKAGES_FAST = \
|
|||||||
unique \
|
unique \
|
||||||
$(nil)
|
$(nil)
|
||||||
|
|
||||||
# Assume this will go away before Go2, so only check minor version.
|
|
||||||
ifeq ($(filter $(shell $(GO) env GOVERSION | cut -f 2 -d.), 16 17 18), )
|
|
||||||
TEST_PACKAGES_FAST += crypto/internal/nistec/fiat
|
|
||||||
else
|
|
||||||
TEST_PACKAGES_FAST += crypto/elliptic/internal/fiat
|
|
||||||
endif
|
|
||||||
|
|
||||||
# archive/zip requires os.ReadAt, which is not yet supported on windows
|
# archive/zip requires os.ReadAt, which is not yet supported on windows
|
||||||
# bytes requires mmap
|
# bytes requires mmap
|
||||||
# compress/flate appears to hang on wasi
|
# compress/flate appears to hang on wasi
|
||||||
# crypto/aes fails on wasi, needs panic()/recover()
|
# crypto/aes fails on wasi, needs panic()/recover()
|
||||||
|
# crypto/des fails on wasi, needs panic()/recover()
|
||||||
# crypto/hmac fails on wasi, it exits with a "slice out of range" panic
|
# crypto/hmac fails on wasi, it exits with a "slice out of range" panic
|
||||||
# debug/plan9obj requires os.ReadAt, which is not yet supported on windows
|
# debug/plan9obj requires os.ReadAt, which is not yet supported on windows
|
||||||
# image requires recover(), which is not yet supported on wasi
|
# image requires recover(), which is not yet supported on wasi
|
||||||
@@ -386,6 +378,7 @@ TEST_PACKAGES_LINUX := \
|
|||||||
archive/zip \
|
archive/zip \
|
||||||
compress/flate \
|
compress/flate \
|
||||||
crypto/aes \
|
crypto/aes \
|
||||||
|
crypto/des \
|
||||||
crypto/hmac \
|
crypto/hmac \
|
||||||
debug/dwarf \
|
debug/dwarf \
|
||||||
debug/plan9obj \
|
debug/plan9obj \
|
||||||
@@ -405,10 +398,11 @@ TEST_PACKAGES_LINUX := \
|
|||||||
|
|
||||||
TEST_PACKAGES_DARWIN := $(TEST_PACKAGES_LINUX)
|
TEST_PACKAGES_DARWIN := $(TEST_PACKAGES_LINUX)
|
||||||
|
|
||||||
|
# os/user requires t.Skip() support
|
||||||
TEST_PACKAGES_WINDOWS := \
|
TEST_PACKAGES_WINDOWS := \
|
||||||
compress/flate \
|
compress/flate \
|
||||||
|
crypto/des \
|
||||||
crypto/hmac \
|
crypto/hmac \
|
||||||
os/user \
|
|
||||||
strconv \
|
strconv \
|
||||||
text/template/parse \
|
text/template/parse \
|
||||||
$(nil)
|
$(nil)
|
||||||
|
|||||||
+2
-2
@@ -26,7 +26,7 @@ func NewConfig(options *compileopts.Options) (*compileopts.Config, error) {
|
|||||||
|
|
||||||
// Version range supported by TinyGo.
|
// Version range supported by TinyGo.
|
||||||
const minorMin = 19
|
const minorMin = 19
|
||||||
const minorMax = 23
|
const minorMax = 24
|
||||||
|
|
||||||
// Check that we support this Go toolchain version.
|
// Check that we support this Go toolchain version.
|
||||||
gorootMajor, gorootMinor, err := goenv.GetGorootVersion()
|
gorootMajor, gorootMinor, err := goenv.GetGorootVersion()
|
||||||
@@ -36,7 +36,7 @@ func NewConfig(options *compileopts.Options) (*compileopts.Config, error) {
|
|||||||
if gorootMajor != 1 || gorootMinor < minorMin || gorootMinor > minorMax {
|
if gorootMajor != 1 || gorootMinor < minorMin || gorootMinor > minorMax {
|
||||||
// Note: when this gets updated, also update the Go compatibility matrix:
|
// Note: when this gets updated, also update the Go compatibility matrix:
|
||||||
// https://github.com/tinygo-org/tinygo-site/blob/dev/content/docs/reference/go-compat-matrix.md
|
// https://github.com/tinygo-org/tinygo-site/blob/dev/content/docs/reference/go-compat-matrix.md
|
||||||
return nil, fmt.Errorf("requires go version 1.19 through 1.23, got go%d.%d", gorootMajor, gorootMinor)
|
return nil, fmt.Errorf("requires go version 1.%d through 1.%d, got go%d.%d", minorMin, minorMax, gorootMajor, gorootMinor)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check that the Go toolchain version isn't too new, if we haven't been
|
// Check that the Go toolchain version isn't too new, if we haven't been
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ func TestBinarySize(t *testing.T) {
|
|||||||
// microcontrollers
|
// microcontrollers
|
||||||
{"hifive1b", "examples/echo", 4560, 280, 0, 2268},
|
{"hifive1b", "examples/echo", 4560, 280, 0, 2268},
|
||||||
{"microbit", "examples/serial", 2916, 388, 8, 2272},
|
{"microbit", "examples/serial", 2916, 388, 8, 2272},
|
||||||
{"wioterminal", "examples/pininterrupt", 7315, 1489, 116, 6912},
|
{"wioterminal", "examples/pininterrupt", 7359, 1489, 116, 6912},
|
||||||
|
|
||||||
// TODO: also check wasm. Right now this is difficult, because
|
// TODO: also check wasm. Right now this is difficult, because
|
||||||
// wasm binaries are run through wasm-opt and therefore the
|
// wasm binaries are run through wasm-opt and therefore the
|
||||||
|
|||||||
+6
-5
@@ -18,11 +18,12 @@ var stdlibAliases = map[string]string{
|
|||||||
// crypto packages
|
// crypto packages
|
||||||
"crypto/ed25519/internal/edwards25519/field.feMul": "crypto/ed25519/internal/edwards25519/field.feMulGeneric",
|
"crypto/ed25519/internal/edwards25519/field.feMul": "crypto/ed25519/internal/edwards25519/field.feMulGeneric",
|
||||||
"crypto/internal/edwards25519/field.feSquare": "crypto/ed25519/internal/edwards25519/field.feSquareGeneric",
|
"crypto/internal/edwards25519/field.feSquare": "crypto/ed25519/internal/edwards25519/field.feSquareGeneric",
|
||||||
"crypto/md5.block": "crypto/md5.blockGeneric",
|
"crypto/md5.block": "crypto/md5.blockGeneric",
|
||||||
"crypto/sha1.block": "crypto/sha1.blockGeneric",
|
"crypto/sha1.block": "crypto/sha1.blockGeneric",
|
||||||
"crypto/sha1.blockAMD64": "crypto/sha1.blockGeneric",
|
"crypto/sha1.blockAMD64": "crypto/sha1.blockGeneric",
|
||||||
"crypto/sha256.block": "crypto/sha256.blockGeneric",
|
"crypto/sha256.block": "crypto/sha256.blockGeneric",
|
||||||
"crypto/sha512.blockAMD64": "crypto/sha512.blockGeneric",
|
"crypto/sha512.blockAMD64": "crypto/sha512.blockGeneric",
|
||||||
|
"internal/chacha8rand.block": "internal/chacha8rand.block_generic",
|
||||||
|
|
||||||
// AES
|
// AES
|
||||||
"crypto/aes.decryptBlockAsm": "crypto/aes.decryptBlock",
|
"crypto/aes.decryptBlockAsm": "crypto/aes.decryptBlock",
|
||||||
|
|||||||
@@ -0,0 +1,7 @@
|
|||||||
|
package abi
|
||||||
|
|
||||||
|
type Type struct {
|
||||||
|
// Intentionally left empty. TinyGo uses a different way to represent types,
|
||||||
|
// so this is unimplementable. The type definition here is purely for
|
||||||
|
// compatibility.
|
||||||
|
}
|
||||||
@@ -271,6 +271,10 @@ func (v Value) Comparable() bool {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (v Value) Equal(u Value) bool {
|
||||||
|
panic("unimplemented: reflect.Value.Equal")
|
||||||
|
}
|
||||||
|
|
||||||
func (v Value) Addr() Value {
|
func (v Value) Addr() Value {
|
||||||
if !v.CanAddr() {
|
if !v.CanAddr() {
|
||||||
panic("reflect.Value.Addr of unaddressable value")
|
panic("reflect.Value.Addr of unaddressable value")
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package runtime
|
||||||
|
|
||||||
|
// Dummy implementation of synctest functions (we don't support synctest at the
|
||||||
|
// moment).
|
||||||
|
|
||||||
|
//go:linkname synctest_acquire internal/synctest.acquire
|
||||||
|
func synctest_acquire() any {
|
||||||
|
// Dummy: we don't support synctest.
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
|
||||||
|
//go:linkname synctest_release internal/synctest.release
|
||||||
|
func synctest_release(sg any) {
|
||||||
|
// Dummy: we don't support synctest.
|
||||||
|
}
|
||||||
@@ -1,5 +1,18 @@
|
|||||||
package runtime
|
package runtime
|
||||||
|
|
||||||
|
//go:linkname time_runtimeNano time.runtimeNano
|
||||||
|
func time_runtimeNano() int64 {
|
||||||
|
// Note: we're ignoring sync groups here (package testing/synctest).
|
||||||
|
// See: https://github.com/golang/go/issues/67434
|
||||||
|
return nanotime()
|
||||||
|
}
|
||||||
|
|
||||||
|
//go:linkname time_runtimeNow time.runtimeNow
|
||||||
|
func time_runtimeNow() (sec int64, nsec int32, mono int64) {
|
||||||
|
// Also ignoring the sync group here, like time_runtimeNano above.
|
||||||
|
return now()
|
||||||
|
}
|
||||||
|
|
||||||
// timerNode is an element in a linked list of timers.
|
// timerNode is an element in a linked list of timers.
|
||||||
type timerNode struct {
|
type timerNode struct {
|
||||||
next *timerNode
|
next *timerNode
|
||||||
|
|||||||
Reference in New Issue
Block a user