Skip to content
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

ci: upgrade to Go 1.23 #2301

Merged
merged 9 commits into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from 6 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
14 changes: 6 additions & 8 deletions .github/workflows/commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
~/.cache/golangci-lint
~/go/pkg/mod
~/go/bin
key: check-${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum', 'Makefile') }}
key: check-${{ runner.os }}-go-${{ env.GO_VERSION }}-${{ hashFiles('**/go.sum', 'Makefile') }}

- run: make build.spectest

Expand All @@ -71,9 +71,8 @@ jobs:
- os: macos-14
arch: arm64
go-version:
- "1.23.0-rc.2" # Test the pending next version
- "1.22" # Current Go version
- "1.20" # Floor Go version of wazero (current - 2)
- "1.23" # Current Go version
- "1.21" # Floor Go version of wazero (current - 2)

steps:

Expand Down Expand Up @@ -113,9 +112,8 @@ jobs:
fail-fast: false # don't fail fast as sometimes failures are arch/OS specific
matrix: # Use versions consistent with wazero's Go support policy.
go-version:
- "1.23.0-rc.2" # Test the pending next version
- "1.22" # Current Go version
- "1.20" # Floor Go version of wazero (current - 2)
- "1.23" # Current Go version
- "1.21" # Floor Go version of wazero (current - 2)
arch:
- "amd64"
- "arm64"
Expand Down Expand Up @@ -160,7 +158,7 @@ jobs:
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
with:
with: # Use version consistent with TinyGo.
go-version: "1.22"
- uses: acifani/setup-tinygo@v2
with:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/examples.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
matrix: # Use versions consistent with TinyGo.
go-version:
- "1.22"
- "1.20"
- "1.21"

steps:
- name: Checkout
Expand Down Expand Up @@ -84,7 +84,6 @@ jobs:

- name: Build TinyGo examples
run: make build.examples.tinygo
if: matrix.go-version != '1.20' # fails with TinyGo v0.32.0

- name: Build AssemblyScript examples
run: make build.examples.as
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ defaults:
shell: bash

env: # Update this prior to requiring a higher minor version in go.mod
GO_VERSION: "1.22"
GO_VERSION: "1.23"
TINYGO_VERSION: "0.32.0"
ZIG_VERSION: "0.11.0"
BINARYEN_VERSION: "116"
Expand Down Expand Up @@ -146,8 +146,8 @@ jobs:

- uses: actions/setup-go@v4
if: steps.binary-cache.outputs.cache-hit != 'true'
with:
go-version: ${{ env.GO_VERSION }}
with: # Use version consistent with TinyGo.
go-version: "1.22"

- name: Build Test Binaries
if: steps.binary-cache.outputs.cache-hit != 'true'
Expand Down Expand Up @@ -276,9 +276,8 @@ jobs:
name: Windows
arch: amd64
go-version:
- "1.23"
- "1.21"
- "1.22"
- "1.23.0-rc.2" # Test the pending next version

steps:
- id: setup-go
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
tags: 'v[0-9]+.[0-9]+.[0-9]+**' # Ex. v0.2.0 v0.2.1-rc2

env: # Update this prior to requiring a higher minor version in go.mod
GO_VERSION: "1.22"
GO_VERSION: "1.23"

defaults:
run: # use bash for all operating systems unless overridden
Expand Down
4 changes: 1 addition & 3 deletions experimental/wazerotest/wazerotest.go
Original file line number Diff line number Diff line change
Expand Up @@ -379,9 +379,7 @@ func (f *Function) Call(ctx context.Context, params ...uint64) ([]uint64, error)
copy(stack, params)
err := f.CallWithStack(ctx, stack)
if err != nil {
for i := range stack {
stack[i] = 0
}
clear(stack)
}
return stack[:len(f.ResultTypes)], err
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module github.com/tetratelabs/wazero

// Floor Go version of wazero (current - 2)
go 1.20
go 1.21

// All the beta tags are retracted and replaced with "pre" to prevent users
// from accidentally upgrading into the broken beta 1.
Expand Down
4 changes: 1 addition & 3 deletions imports/wasi_snapshot_preview1/poll.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,7 @@ func pollOneoffFn(_ context.Context, mod api.Module, params []uint64) sys.Errno
}
outBuf, ok := mem.Read(out, nsubscriptions*32)
// zero-out all buffer before writing
for i := range outBuf {
outBuf[i] = 0
}
clear(outBuf)

if !ok {
return sys.EFAULT
Expand Down
9 changes: 2 additions & 7 deletions internal/descriptor/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,6 @@ func (t *Table[Key, Item]) Range(f func(Key, Item) bool) {

// Reset clears the content of the table.
func (t *Table[Key, Item]) Reset() {
for i := range t.masks {
t.masks[i] = 0
}
var zero Item
for i := range t.items {
t.items[i] = zero
}
clear(t.masks)
clear(t.items)
}
4 changes: 1 addition & 3 deletions internal/engine/wazevo/backend/regalloc/regset.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,7 @@ func newRegInUseSet[I Instr, B Block[I], F Function[I, B]]() regInUseSet[I, B, F
}

func (rs *regInUseSet[I, B, F]) reset() {
for i := range rs {
rs[i] = nil
}
clear(rs[:])
}

func (rs *regInUseSet[I, B, F]) format(info *RegisterInfo) string { //nolint:unused
Expand Down
2 changes: 0 additions & 2 deletions internal/engine/wazevo/frontend/sort_id.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
//go:build go1.21

package frontend

import (
Expand Down
17 changes: 0 additions & 17 deletions internal/engine/wazevo/frontend/sort_id_old.go

This file was deleted.

2 changes: 0 additions & 2 deletions internal/engine/wazevo/ssa/basic_block_sort.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
//go:build go1.21

package ssa

import (
Expand Down
24 changes: 0 additions & 24 deletions internal/engine/wazevo/ssa/basic_block_sort_old.go

This file was deleted.

4 changes: 1 addition & 3 deletions internal/engine/wazevo/wazevoapi/resetmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ func ResetMap[K comparable, V any](m map[K]V) map[K]V {
if m == nil {
m = make(map[K]V)
} else {
for v := range m {
delete(m, v)
}
clear(m)
}
return m
}
2 changes: 1 addition & 1 deletion internal/integration_test/fuzz/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/tetratelabs/wazero/internal/integration_test/fuzz

go 1.20
go 1.21

require github.com/tetratelabs/wazero v0.0.0

Expand Down
2 changes: 1 addition & 1 deletion internal/version/testdata/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/tetratelabs/wazero/internal/version/testdata

go 1.20
go 1.21

require github.com/tetratelabs/wazero v0.0.0-20220818123113-1948909ec0b1 // indirect

Expand Down
11 changes: 6 additions & 5 deletions internal/wasm/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package wasm
import (
"context"
"encoding/binary"
"errors"
"fmt"
"sync"
"sync/atomic"
Expand Down Expand Up @@ -659,20 +660,20 @@ func (s *Store) GetFunctionTypeID(t *FunctionType) (FunctionTypeID, error) {
}

// CloseWithExitCode implements the same method as documented on wazero.Runtime.
func (s *Store) CloseWithExitCode(ctx context.Context, exitCode uint32) (err error) {
func (s *Store) CloseWithExitCode(ctx context.Context, exitCode uint32) error {
s.mux.Lock()
defer s.mux.Unlock()
// Close modules in reverse initialization order.
var errs []error
for m := s.moduleList; m != nil; m = m.next {
// If closing this module errs, proceed anyway to close the others.
if e := m.closeWithExitCode(ctx, exitCode); e != nil && err == nil {
// TODO: use multiple errors handling in Go 1.20.
err = e // first error
if err := m.closeWithExitCode(ctx, exitCode); err != nil {
errs = append(errs, err)
}
}
s.moduleList = nil
s.nameToModule = nil
s.nameToModuleCap = 0
s.typeIDs = nil
return
return errors.Join(errs...)
}
3 changes: 0 additions & 3 deletions sys/stat_unsupported.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ import "io/fs"
// sysParseable is only used here as we define "supported" as being able to
// parse `info.Sys()`. The above `go:build` constraints exclude 32-bit until
// that's requested.
//
// TODO: When Go 1.21 is out, use the "unix" build constraint (as 1.21 makes
// our floor Go version 1.19.
const sysParseable = false

func statFromFileInfo(info fs.FileInfo) Stat_t {
Expand Down
Loading