From 7e284a37fccc970e05db124863c66c26c8e0ff40 Mon Sep 17 00:00:00 2001 From: Ayke van Laethem Date: Sat, 22 Jun 2024 17:04:44 +0200 Subject: [PATCH] ci: use Go 1.23 --- .circleci/config.yml | 6 +++--- .github/workflows/build-macos.yml | 4 ++-- .github/workflows/linux.yml | 8 ++++---- .github/workflows/windows.yml | 8 ++++---- Dockerfile | 4 ++-- GNUmakefile | 2 -- builder/config.go | 4 ++-- main_test.go | 7 ++++++- src/syscall/syscall_libc_darwin.go | 1 + src/syscall/syscall_libc_wasi.go | 4 ++++ testdata/errors/types.go | 2 +- 11 files changed, 29 insertions(+), 21 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f694a4ee1..826240d9a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -107,9 +107,9 @@ jobs: # "make lint" fails before go 1.21 because internal/tools/go.mod specifies packages that require go 1.21 fmt-check: false resource_class: large - test-llvm18-go122: + test-llvm18-go123: docker: - - image: golang:1.22-bullseye + - image: golang:1.23-bullseye steps: - test-linux: llvm: "18" @@ -122,4 +122,4 @@ workflows: # least the smoke tests still pass. - test-llvm15-go119 # This tests LLVM 18 support when linking against system libraries. - - test-llvm18-go122 + - test-llvm18-go123 diff --git a/.github/workflows/build-macos.yml b/.github/workflows/build-macos.yml index 17fe3852a..5fef339dd 100644 --- a/.github/workflows/build-macos.yml +++ b/.github/workflows/build-macos.yml @@ -37,7 +37,7 @@ jobs: - name: Install Go uses: actions/setup-go@v5 with: - go-version: '1.22' + go-version: '1.23' cache: true - name: Restore LLVM source cache uses: actions/cache/restore@v4 @@ -145,7 +145,7 @@ jobs: - name: Install Go uses: actions/setup-go@v5 with: - go-version: '1.22' + go-version: '1.23' 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 589eb71fe..ab150317d 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.22-alpine + image: golang:1.23-alpine steps: - name: Install apk dependencies # tar: needed for actions/cache@v4 @@ -141,7 +141,7 @@ jobs: - name: Install Go uses: actions/setup-go@v5 with: - go-version: '1.22' + go-version: '1.23' cache: true - name: Install wasmtime uses: bytecodealliance/actions/wasmtime/setup@v1 @@ -184,7 +184,7 @@ jobs: - name: Install Go uses: actions/setup-go@v5 with: - go-version: '1.22' + go-version: '1.23' cache: true - name: Install Node.js uses: actions/setup-node@v4 @@ -307,7 +307,7 @@ jobs: - name: Install Go uses: actions/setup-go@v5 with: - go-version: '1.22' + go-version: '1.23' 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 0d144304d..5287e108e 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -35,7 +35,7 @@ jobs: - name: Install Go uses: actions/setup-go@v5 with: - go-version: '1.22' + go-version: '1.23' cache: true - name: Restore cached LLVM source uses: actions/cache/restore@v4 @@ -143,7 +143,7 @@ jobs: - name: Install Go uses: actions/setup-go@v5 with: - go-version: '1.22' + go-version: '1.23' cache: true - name: Download TinyGo build uses: actions/download-artifact@v4 @@ -173,7 +173,7 @@ jobs: - name: Install Go uses: actions/setup-go@v5 with: - go-version: '1.22' + go-version: '1.23' cache: true - name: Download TinyGo build uses: actions/download-artifact@v4 @@ -209,7 +209,7 @@ jobs: - name: Install Go uses: actions/setup-go@v5 with: - go-version: '1.22' + go-version: '1.23' cache: true - name: Download TinyGo build uses: actions/download-artifact@v4 diff --git a/Dockerfile b/Dockerfile index eb99e0e95..9a9effac2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # tinygo-llvm stage obtains the llvm source for TinyGo -FROM golang:1.22 AS tinygo-llvm +FROM golang:1.23 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.22 AS tinygo-compiler +FROM golang:1.23 AS tinygo-compiler # Copy tinygo build. COPY --from=tinygo-compiler-build /tinygo/build/release/tinygo /tinygo diff --git a/GNUmakefile b/GNUmakefile index 1fe2a5a6c..94d9c357d 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -370,7 +370,6 @@ endif # Additional standard library packages that pass tests on individual platforms TEST_PACKAGES_LINUX := \ archive/zip \ - bytes \ compress/flate \ crypto/hmac \ debug/dwarf \ @@ -381,7 +380,6 @@ TEST_PACKAGES_LINUX := \ net \ os/user \ strconv \ - testing/fstest \ text/tabwriter \ text/template/parse diff --git a/builder/config.go b/builder/config.go index a82450a63..40c6f0c9a 100644 --- a/builder/config.go +++ b/builder/config.go @@ -27,10 +27,10 @@ func NewConfig(options *compileopts.Options) (*compileopts.Config, error) { if err != nil { return nil, err } - if major != 1 || minor < 19 || minor > 22 { + if major != 1 || minor < 19 || minor > 23 { // 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 - return nil, fmt.Errorf("requires go version 1.19 through 1.22, got go%d.%d", major, minor) + return nil, fmt.Errorf("requires go version 1.19 through 1.23, got go%d.%d", major, minor) } return &compileopts.Config{ diff --git a/main_test.go b/main_test.go index e70e9f7fd..836a4b173 100644 --- a/main_test.go +++ b/main_test.go @@ -215,7 +215,7 @@ func runPlatTests(options compileopts.Options, tests []string, t *testing.T) { } } if options.GOOS == "linux" && (options.GOARCH == "mips" || options.GOARCH == "mipsle") { - if name == "atomic.go" { + if name == "atomic.go" || name == "timers.go" { // 64-bit atomic operations aren't currently supported on MIPS. continue } @@ -246,6 +246,11 @@ func runPlatTests(options compileopts.Options, tests []string, t *testing.T) { // some compiler changes). continue + case "timers.go": + // Crashes starting with Go 1.23. + // Bug: https://github.com/llvm/llvm-project/issues/104032 + continue + default: } } diff --git a/src/syscall/syscall_libc_darwin.go b/src/syscall/syscall_libc_darwin.go index f0d297a77..3b0341880 100644 --- a/src/syscall/syscall_libc_darwin.go +++ b/src/syscall/syscall_libc_darwin.go @@ -55,6 +55,7 @@ const ( F_GETFL = 0x3 F_SETFL = 0x4 O_NONBLOCK = 0x4 + TIOCSPGRP = 0x80047476 ) // Source: https://opensource.apple.com/source/xnu/xnu-7195.141.2/bsd/sys/errno.h.auto.html diff --git a/src/syscall/syscall_libc_wasi.go b/src/syscall/syscall_libc_wasi.go index 2d83a8714..06169bb2b 100644 --- a/src/syscall/syscall_libc_wasi.go +++ b/src/syscall/syscall_libc_wasi.go @@ -104,6 +104,9 @@ const ( // ../../lib/wasi-libc/expected/wasm32-wasi/predefined-macros.txt F_GETFL = 3 F_SETFL = 4 + + // ../../lib/wasi-libc/libc-top-half/musl/arch/generic/bits/ioctl.h + TIOCSPGRP = 0x5410 ) // These values are needed as a stub until Go supports WASI as a full target. @@ -114,6 +117,7 @@ const ( SYS_FCNTL SYS_FCNTL64 SYS_FSTATAT64 + SYS_IOCTL SYS_OPENAT SYS_UNLINKAT PATH_MAX = 4096 diff --git a/testdata/errors/types.go b/testdata/errors/types.go index 6bd949f0c..a74fb4a33 100644 --- a/testdata/errors/types.go +++ b/testdata/errors/types.go @@ -7,6 +7,6 @@ func main() { } // ERROR: # command-line-arguments -// ERROR: types.go:4:6: a declared and not used +// ERROR: types.go:4:6: declared and not used: a // ERROR: types.go:5:6: cannot use "foobar" (untyped string constant) as int value in assignment // ERROR: types.go:6:2: undefined: nonexisting