Skip to content

Commit 4c64784

Browse files
aykevldeadprogram
authored andcommitted
all: Go 1.19 support
This adds early Go 1.19 support. There are a number of things that don't work yet, but the smoke tests pass so it's at least working for a significant subset of programs. This change also switches from CircleCI convenience images to upstream Go images. This makes it a bit easier to use the latest Go versions. Also, the convenience images are not updated anymore.
1 parent 8d6b210 commit 4c64784

File tree

2 files changed

+35
-17
lines changed

2 files changed

+35
-17
lines changed

.circleci/config.yml

Lines changed: 33 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ commands:
2222
steps:
2323
- restore_cache:
2424
keys:
25-
- llvm-source-14-v2
25+
- llvm-source-14-v3
2626
- run:
2727
name: "Fetch LLVM source"
2828
command: make llvm-source
2929
- save_cache:
30-
key: llvm-source-14-v2
30+
key: llvm-source-14-v3
3131
paths:
3232
- llvm-project/clang/lib/Headers
3333
- llvm-project/clang/include
@@ -45,29 +45,32 @@ commands:
4545
steps:
4646
- restore_cache:
4747
keys:
48-
- binaryen-linux-v1
48+
- binaryen-linux-v2
4949
- run:
5050
name: "Build Binaryen"
5151
command: |
5252
make binaryen
5353
- save_cache:
54-
key: binaryen-linux-v1
54+
key: binaryen-linux-v2
5555
paths:
5656
- build/wasm-opt
5757
test-linux:
5858
parameters:
5959
llvm:
6060
type: string
61+
fmt-check:
62+
type: boolean
63+
default: true
6164
steps:
6265
- checkout
6366
- submodules
6467
- run:
6568
name: "Install apt dependencies"
6669
command: |
67-
echo 'deb https://apt.llvm.org/buster/ llvm-toolchain-buster-<<parameters.llvm>> main' | sudo tee /etc/apt/sources.list.d/llvm.list
68-
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
69-
sudo apt-get update
70-
sudo apt-get install --no-install-recommends \
70+
echo 'deb https://apt.llvm.org/buster/ llvm-toolchain-buster-<<parameters.llvm>> main' > /etc/apt/sources.list.d/llvm.list
71+
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add -
72+
apt-get update
73+
apt-get install --no-install-recommends -y \
7174
llvm-<<parameters.llvm>>-dev \
7275
clang-<<parameters.llvm>> \
7376
libclang-<<parameters.llvm>>-dev \
@@ -80,38 +83,53 @@ commands:
8083
- build-binaryen-linux
8184
- restore_cache:
8285
keys:
83-
- go-cache-v2-{{ checksum "go.mod" }}-{{ .Environment.CIRCLE_PREVIOUS_BUILD_NUM }}
84-
- go-cache-v2-{{ checksum "go.mod" }}
86+
- go-cache-v3-{{ checksum "go.mod" }}-{{ .Environment.CIRCLE_PREVIOUS_BUILD_NUM }}
87+
- go-cache-v3-{{ checksum "go.mod" }}
8588
- llvm-source-linux
8689
- run: go install -tags=llvm<<parameters.llvm>> .
8790
- restore_cache:
8891
keys:
89-
- wasi-libc-sysroot-systemclang-v5
92+
- wasi-libc-sysroot-systemclang-v6
9093
- run: make wasi-libc
9194
- save_cache:
92-
key: wasi-libc-sysroot-systemclang-v5
95+
key: wasi-libc-sysroot-systemclang-v6
9396
paths:
9497
- lib/wasi-libc/sysroot
9598
- run: make gen-device -j4
9699
- run: make smoketest XTENSA=0
97100
- save_cache:
98-
key: go-cache-v2-{{ checksum "go.mod" }}-{{ .Environment.CIRCLE_BUILD_NUM }}
101+
key: go-cache-v3-{{ checksum "go.mod" }}-{{ .Environment.CIRCLE_BUILD_NUM }}
99102
paths:
100103
- ~/.cache/go-build
101104
- /go/pkg/mod
102-
- run: make fmt-check
105+
- when:
106+
condition: <<parameters.fmt-check>>
107+
steps:
108+
- run:
109+
name: Check Go code formatting
110+
command: make fmt-check
103111

104112
jobs:
105113
test-llvm13-go116:
106114
docker:
107-
- image: circleci/golang:1.16-buster
115+
- image: golang:1.16-buster
108116
steps:
109117
- test-linux:
110118
llvm: "13"
119+
test-llvm14-go119:
120+
docker:
121+
- image: golang:1.19beta1-buster
122+
steps:
123+
- test-linux:
124+
llvm: "14"
125+
fmt-check: false
111126

112127
workflows:
113128
test-all:
114129
jobs:
115130
# This tests our lowest supported versions of Go and LLVM, to make sure at
116131
# least the smoke tests still pass.
117132
- test-llvm13-go116
133+
# This tests a beta version of Go. It should be removed once regular
134+
# release builds are built using this version.
135+
- test-llvm14-go119

builder/config.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ func NewConfig(options *compileopts.Options) (*compileopts.Config, error) {
3333
if err != nil {
3434
return nil, fmt.Errorf("could not read version from GOROOT (%v): %v", goroot, err)
3535
}
36-
if major != 1 || minor < 16 || minor > 18 {
37-
return nil, fmt.Errorf("requires go version 1.16 through 1.18, got go%d.%d", major, minor)
36+
if major != 1 || minor < 16 || minor > 19 {
37+
return nil, fmt.Errorf("requires go version 1.16 through 1.19, got go%d.%d", major, minor)
3838
}
3939

4040
clangHeaderPath := getClangHeaderPath(goenv.Get("TINYGOROOT"))

0 commit comments

Comments
 (0)