Skip to content

Add Go 1.25 support #4954

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: dev
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 9 additions & 8 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,20 @@ commands:
- /go/pkg/mod

jobs:
test-llvm15-go122:
test-oldest:
# This tests our lowest supported versions of Go and LLVM, to make sure at
# least the smoke tests still pass.
docker:
- image: golang:1.22-bullseye
steps:
- test-linux:
llvm: "15"
resource_class: large
test-llvm20-go124:
test-newest:
# This tests the latest supported LLVM version when linking against system
# libraries.
docker:
- image: golang:1.24-bullseye
- image: golang:1.25rc2-bullseye
steps:
- test-linux:
llvm: "20"
Expand All @@ -110,8 +114,5 @@ jobs:
workflows:
test-all:
jobs:
# This tests our lowest supported versions of Go and LLVM, to make sure at
# least the smoke tests still pass.
- test-llvm15-go122
# This tests LLVM 20 support when linking against system libraries.
- test-llvm20-go124
- test-oldest
- test-newest
4 changes: 2 additions & 2 deletions .github/workflows/build-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: '1.24'
go-version: '1.25.0-rc.2'
cache: true
- name: Restore LLVM source cache
uses: actions/cache/restore@v4
Expand Down Expand Up @@ -134,7 +134,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: '1.24'
go-version: '1.25.0-rc.2'
cache: true
- name: Build TinyGo (LLVM ${{ matrix.version }})
run: go install -tags=llvm${{ matrix.version }}
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
# statically linked binary.
runs-on: ubuntu-latest
container:
image: golang:1.24-alpine
image: golang:1.25rc2-alpine
outputs:
version: ${{ steps.version.outputs.version }}
steps:
Expand Down Expand Up @@ -137,7 +137,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: '1.24'
go-version: '1.25.0-rc.2'
cache: true
- name: Install wasmtime
uses: bytecodealliance/actions/wasmtime/setup@v1
Expand Down Expand Up @@ -181,7 +181,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: '1.24'
go-version: '1.25.0-rc.2'
cache: true
- name: Install Node.js
uses: actions/setup-node@v4
Expand Down Expand Up @@ -298,7 +298,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: '1.24'
go-version: '1.25.0-rc.2'
cache: true
- name: Restore LLVM source cache
uses: actions/cache/restore@v4
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: '1.24'
go-version: '1.25.0-rc.2'
cache: true
- name: Restore cached LLVM source
uses: actions/cache/restore@v4
Expand Down Expand Up @@ -147,7 +147,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: '1.24'
go-version: '1.25.0-rc.2'
cache: true
- name: Download TinyGo build
uses: actions/download-artifact@v4
Expand Down Expand Up @@ -177,7 +177,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: '1.24'
go-version: '1.25.0-rc.2'
cache: true
- name: Download TinyGo build
uses: actions/download-artifact@v4
Expand Down Expand Up @@ -213,7 +213,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: '1.24'
go-version: '1.25.0-rc.2'
cache: true
- name: Download TinyGo build
uses: actions/download-artifact@v4
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# tinygo-llvm stage obtains the llvm source for TinyGo
FROM golang:1.24 AS tinygo-llvm
FROM golang:1.25rc2 AS tinygo-llvm

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

# tinygo-compiler copies the compiler build over to a base Go container (without
# all the build tools etc).
FROM golang:1.24 AS tinygo-compiler
FROM golang:1.25rc2 AS tinygo-compiler

# Copy tinygo build.
COPY --from=tinygo-compiler-build /tinygo/build/release/tinygo /tinygo
Expand Down
2 changes: 1 addition & 1 deletion builder/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func NewConfig(options *compileopts.Options) (*compileopts.Config, error) {

// Version range supported by TinyGo.
const minorMin = 19
const minorMax = 24
const minorMax = 25

// Check that we support this Go toolchain version.
gorootMajor, gorootMinor, err := goenv.GetGorootVersion()
Expand Down
7 changes: 7 additions & 0 deletions src/internal/abi/escape.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,10 @@ import "unsafe"
func NoEscape(p unsafe.Pointer) unsafe.Pointer {
return p
}

func Escape[T any](x T) T {
// This function is used from internal/synctest which doesn't seem to be
// used much by other packages.
// This probably needs support from the compiler to implement correctly.
panic("internal/abi.Escape: unimplemented")
}
5 changes: 5 additions & 0 deletions src/reflect/type.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,11 @@ type Method struct {
Index int // index for Type.Method
}

// IsExported reports whether the method is exported.
func (m Method) IsExported() bool {
return m.PkgPath == ""
}

// The following Type type has been copied almost entirely from
// https://github.com/golang/go/blob/go1.15/src/reflect/type.go#L27-L212.
// Some methods have been commented out as they haven't yet been implemented.
Expand Down
6 changes: 6 additions & 0 deletions src/runtime/time.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,9 @@ func timerCallback(tn *timerNode, delta int64) {
addTimer(tn)
}
}

//go:linkname time_runtimeIsBubbled time.runtimeIsBubbled
func time_runtimeIsBubbled() bool {
// We don't currently support bubbles.
return false
}
Loading