From b0366743cd1080e107e0560eed790ccaa0537158 Mon Sep 17 00:00:00 2001 From: Ayke van Laethem Date: Thu, 4 Mar 2021 21:32:36 +0100 Subject: [PATCH] all: remove support for Go 1.11 and 1.12 Go 1.13 has some important improvements that we would like to use, such as the new integer literals and `errors.Is` which both arrived in Go 1.13. --- .circleci/config.yml | 14 -------------- BUILDING.md | 7 +------ builder/config.go | 4 ++-- go.mod | 2 +- src/runtime/strings_go111.go | 20 -------------------- 5 files changed, 4 insertions(+), 43 deletions(-) delete mode 100644 src/runtime/strings_go111.go diff --git a/.circleci/config.yml b/.circleci/config.yml index 9d99582a..316507c9 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -342,18 +342,6 @@ commands: - /go/pkg/mod jobs: - test-llvm10-go111: - docker: - - image: circleci/golang:1.11-buster - steps: - - test-linux: - llvm: "10" - test-llvm10-go112: - docker: - - image: circleci/golang:1.12-buster - steps: - - test-linux: - llvm: "10" test-llvm10-go113: docker: - image: circleci/golang:1.13-buster @@ -399,8 +387,6 @@ jobs: workflows: test-all: jobs: - - test-llvm10-go111 - - test-llvm10-go112 - test-llvm10-go113 - test-llvm10-go114 - test-llvm11-go115 diff --git a/BUILDING.md b/BUILDING.md index 1a7b6558..8439c32c 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -23,7 +23,7 @@ different guide: LLVM, Clang and LLD are quite light on dependencies, requiring only standard build tools to be built. Go is of course necessary to build TinyGo itself. - * Go (1.11+) + * Go (1.13+) * Standard build tools (gcc/clang) * git * CMake @@ -43,11 +43,6 @@ You can also store LLVM outside of the TinyGo root directory by setting the `LLVM_BUILDDIR`, `CLANG_SRC` and `LLD_SRC` make variables, but that is not covered by this guide. -TinyGo uses Go modules, so if you clone TinyGo inside your GOPATH (and are using -Go below 1.13), make sure that Go modules are enabled: - - export GO111MODULE=on - ## Build LLVM, Clang, LLD Before starting the build, you may want to set the following environment diff --git a/builder/config.go b/builder/config.go index b145ec5e..bfa56361 100644 --- a/builder/config.go +++ b/builder/config.go @@ -25,8 +25,8 @@ func NewConfig(options *compileopts.Options) (*compileopts.Config, error) { if err != nil { return nil, fmt.Errorf("could not read version from GOROOT (%v): %v", goroot, err) } - if major != 1 || minor < 11 || minor > 16 { - return nil, fmt.Errorf("requires go version 1.11 through 1.16, got go%d.%d", major, minor) + if major != 1 || minor < 13 || minor > 16 { + return nil, fmt.Errorf("requires go version 1.13 through 1.16, got go%d.%d", major, minor) } clangHeaderPath := getClangHeaderPath(goenv.Get("TINYGOROOT")) return &compileopts.Config{ diff --git a/go.mod b/go.mod index a7b556da..bc9c6fe3 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/tinygo-org/tinygo -go 1.11 +go 1.13 require ( github.com/blakesmith/ar v0.0.0-20150311145944-8bd4349a67f2 diff --git a/src/runtime/strings_go111.go b/src/runtime/strings_go111.go deleted file mode 100644 index 2f14df33..00000000 --- a/src/runtime/strings_go111.go +++ /dev/null @@ -1,20 +0,0 @@ -// +build !go1.12 - -package runtime - -import "internal/bytealg" - -// The following functions provide compatibility with Go 1.11. -// See the following: -// https://github.com/tinygo-org/tinygo/issues/351 -// https://github.com/golang/go/commit/ad4a58e31501bce5de2aad90a620eaecdc1eecb8 - -//go:linkname indexByte strings.IndexByte -func indexByte(s string, c byte) int { - return bytealg.IndexByteString(s, c) -} - -//go:linkname bytesEqual bytes.Equal -func bytesEqual(a, b []byte) bool { - return bytealg.Equal(a, b) -}