From b33b6ce29303a3b1edfef9f48d0b1ff336aa6997 Mon Sep 17 00:00:00 2001 From: Ayke van Laethem Date: Fri, 11 Jul 2025 09:34:44 +0200 Subject: [PATCH] all: add Go 1.25 support --- .circleci/config.yml | 2 +- .github/workflows/build-macos.yml | 4 ++-- .github/workflows/linux.yml | 8 ++++---- .github/workflows/windows.yml | 8 ++++---- Dockerfile | 4 ++-- GNUmakefile | 22 +++++++++++++--------- builder/config.go | 2 +- src/crypto/x509/internal/macos/macos.go | 4 ++++ src/runtime/time.go | 6 ++++++ 9 files changed, 37 insertions(+), 23 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index afa7a7300..68a013a25 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -105,7 +105,7 @@ jobs: # 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" diff --git a/.github/workflows/build-macos.yml b/.github/workflows/build-macos.yml index bda947432..564978c82 100644 --- a/.github/workflows/build-macos.yml +++ b/.github/workflows/build-macos.yml @@ -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 @@ -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 }} diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 803759892..52e49eaff 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -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: @@ -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 @@ -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 @@ -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 diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 6c428c98c..ee7fbf1ad 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/Dockerfile b/Dockerfile index 520ad7c9b..c45dd5d77 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 && \ @@ -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 diff --git a/GNUmakefile b/GNUmakefile index 2b14dd6ac..61174600e 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -460,11 +460,15 @@ TEST_PACKAGES_HOST := $(TEST_PACKAGES_FAST) $(TEST_PACKAGES_WINDOWS) TEST_IOFS := false endif +TEST_SKIP_FLAG := -skip='TestExtraMethods|TestParseAndBytesRoundTrip/P256/Generic' + # Test known-working standard library packages. # TODO: parallelize, and only show failing tests (no implied -v flag). .PHONY: tinygo-test tinygo-test: - $(TINYGO) test $(TEST_PACKAGES_HOST) $(TEST_PACKAGES_SLOW) + @# TestExtraMethods: used by many crypto packages and uses reflect.Type.Method which is not implemented. + @# TestParseAndBytesRoundTrip/P256/Generic: relies on t.Skip() which is not implemented + $(TINYGO) test $(TEST_SKIP_FLAG) $(TEST_PACKAGES_HOST) $(TEST_PACKAGES_SLOW) @# io/fs requires os.ReadDir, not yet supported on windows or wasi. It also @# requires a large stack-size. Hence, io/fs is only run conditionally. @# For more details, see the comments on issue #3143. @@ -472,7 +476,7 @@ ifeq ($(TEST_IOFS),true) $(TINYGO) test -stack-size=6MB io/fs endif tinygo-test-fast: - $(TINYGO) test $(TEST_PACKAGES_HOST) + $(TINYGO) test $(TEST_SKIP_FLAG) $(TEST_PACKAGES_HOST) tinygo-bench: $(TINYGO) test -bench . $(TEST_PACKAGES_HOST) $(TEST_PACKAGES_SLOW) tinygo-bench-fast: @@ -480,18 +484,18 @@ tinygo-bench-fast: # Same thing, except for wasi rather than the current platform. tinygo-test-wasm: - $(TINYGO) test -target wasm $(TEST_PACKAGES_WASM) + $(TINYGO) test -target wasm $(TEST_SKIP_FLAG) $(TEST_PACKAGES_WASM) tinygo-test-wasi: - $(TINYGO) test -target wasip1 $(TEST_PACKAGES_FAST) $(TEST_PACKAGES_SLOW) ./tests/runtime_wasi + $(TINYGO) test -target wasip1 $(TEST_SKIP_FLAG) $(TEST_PACKAGES_FAST) $(TEST_PACKAGES_SLOW) ./tests/runtime_wasi tinygo-test-wasip1: - GOOS=wasip1 GOARCH=wasm $(TINYGO) test $(TEST_PACKAGES_FAST) $(TEST_PACKAGES_SLOW) ./tests/runtime_wasi + GOOS=wasip1 GOARCH=wasm $(TINYGO) test $(TEST_SKIP_FLAG) $(TEST_PACKAGES_FAST) $(TEST_PACKAGES_SLOW) ./tests/runtime_wasi tinygo-test-wasip1-fast: - $(TINYGO) test -target=wasip1 $(TEST_PACKAGES_FAST) ./tests/runtime_wasi + $(TINYGO) test -target=wasip1 $(TEST_SKIP_FLAG) $(TEST_PACKAGES_FAST) ./tests/runtime_wasi tinygo-test-wasip2-slow: - $(TINYGO) test -target=wasip2 $(TEST_PACKAGES_SLOW) + $(TINYGO) test -target=wasip2 $(TEST_SKIP_FLAG) $(TEST_PACKAGES_SLOW) tinygo-test-wasip2-fast: - $(TINYGO) test -target=wasip2 $(TEST_PACKAGES_FAST) ./tests/runtime_wasi + $(TINYGO) test -target=wasip2 $(TEST_SKIP_FLAG) $(TEST_PACKAGES_FAST) ./tests/runtime_wasi tinygo-test-wasip2-sum-slow: TINYGO=$(TINYGO) \ @@ -517,7 +521,7 @@ tinygo-bench-wasip2-fast: # Run tests on riscv-qemu since that one provides a large amount of memory. tinygo-test-baremetal: - $(TINYGO) test -target riscv-qemu $(TEST_PACKAGES_BAREMETAL) + $(TINYGO) test -target riscv-qemu $(TEST_SKIP_FLAG) $(TEST_PACKAGES_BAREMETAL) # Test external packages in a large corpus. test-corpus: diff --git a/builder/config.go b/builder/config.go index b36b9333f..5fb74ee19 100644 --- a/builder/config.go +++ b/builder/config.go @@ -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() diff --git a/src/crypto/x509/internal/macos/macos.go b/src/crypto/x509/internal/macos/macos.go index e9ec2ef84..c662acb57 100644 --- a/src/crypto/x509/internal/macos/macos.go +++ b/src/crypto/x509/internal/macos/macos.go @@ -63,6 +63,10 @@ func SecCertificateCopyData(cert CFRef) ([]byte, error) { return nil, errors.New("not implemented") } +func SecTrustCopyCertificateChain(trustObj CFRef) (CFRef, error) { + return 0, errors.New("not implemented") +} + func SecTrustEvaluateWithError(trustObj CFRef) (int, error) { return 0, errors.New("not implemented") } diff --git a/src/runtime/time.go b/src/runtime/time.go index 3935b4486..23a9bf5e2 100644 --- a/src/runtime/time.go +++ b/src/runtime/time.go @@ -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 +}