diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 859225ee5e..6ac1204c52 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -32,10 +32,10 @@ jobs: uses: actions/setup-dotnet@v2 with: dotnet-version: '6.0.x' - - name: Set up Go 1.16 + - name: Set up Go 1.18 uses: actions/setup-go@v3 with: - go-version: '1.16' + go-version: '1.18' - name: Set up Java 8 uses: actions/setup-java@v3 with: @@ -126,10 +126,10 @@ jobs: uses: actions/setup-dotnet@v2 with: dotnet-version: '6.0.x' - - name: Set up Go 1.16 + - name: Set up Go 1.18 uses: actions/setup-go@v3 with: - go-version: '1.16' + go-version: '1.18' - name: Set up Java 8 uses: actions/setup-java@v3 with: @@ -207,14 +207,14 @@ jobs: test: permissions: contents: none - name: Test (${{ matrix.os }} / dotnet ${{ matrix.dotnet }} / java ${{ matrix.java }} / node ${{ matrix.node }} / python ${{ matrix.python }}) + name: Test (${{ matrix.os }} / dotnet ${{ matrix.dotnet }} / go ${{ matrix.go }} / java ${{ matrix.java }} / node ${{ matrix.node }} / python ${{ matrix.python }}) needs: build strategy: fail-fast: false matrix: # All currently supported node versions (Maintenance LTS, Active LTS, Current) dotnet: ['3.1.x'] - go: ['1.16'] + go: ['1.18'] java: ['8'] node: - '14' # EOL 2023-04-30 @@ -227,47 +227,66 @@ jobs: # Test using Windows - os: windows-latest dotnet: '3.1.x' - go: '1.16' + go: '1.18' java: '8' node: '14' python: '3.7' # Test using macOS - os: macos-latest dotnet: '3.1.x' - go: '1.16' + go: '1.18' java: '8' node: '14' python: '3.7' # Test alternate .NETs - java: '8' dotnet: '6.0.x' - go: '1.16' + go: '1.18' + node: '14' + os: ubuntu-latest + python: '3.7' + # Test alternate Gos + - java: '8' + dotnet: '3.1.x' + go: '1.16' # EOL since March 15, 2022 (in grace period until end of september 2022) + node: '14' + os: ubuntu-latest + python: '3.7' + - java: '8' + dotnet: '3.1.x' + go: '1.17' # EOL since August 02, 2022 (in grace period until end of september 2022) + node: '14' + os: ubuntu-latest + python: '3.7' + - java: '8' + dotnet: '3.1.x' + go: '1.19' node: '14' os: ubuntu-latest python: '3.7' # Test alternate Javas - java: '11' dotnet: '3.1.x' - go: '1.16' + go: '1.18' node: '14' os: ubuntu-latest python: '3.7' # Test alternate Pythons - python: '3.8' dotnet: '3.1.x' - go: '1.16' + go: '1.18' java: '8' node: '14' os: ubuntu-latest - python: '3.9' dotnet: '3.1.x' - go: '1.16' + go: '1.18' java: '8' node: '14' os: ubuntu-latest - python: '3.10' dotnet: '3.1.x' - go: '1.16' + go: '1.18' java: '8' node: '14' os: ubuntu-latest diff --git a/gh-pages/content/user-guides/lib-author/index.md b/gh-pages/content/user-guides/lib-author/index.md index c7beba1298..850024e4b9 100644 --- a/gh-pages/content/user-guides/lib-author/index.md +++ b/gh-pages/content/user-guides/lib-author/index.md @@ -17,7 +17,7 @@ to produce releasable artifacts. | Language/Platform | SDK Requirement | | ----------------- | ---------------------------- | | .NET | .NET Core ≥ 3.1 / .NET ≥ 5.0 | -| Go | Go ≥ 1.16 | +| Go | Go ≥ 1.18 | | Java | JDK ≥ 8 *and* Maven ≥ 3.6 | | Python | Python ≥ 3.7 | diff --git a/packages/@jsii/go-runtime-test/project/go.mod b/packages/@jsii/go-runtime-test/project/go.mod index 1c82de7d5c..d1fe57ce7c 100644 --- a/packages/@jsii/go-runtime-test/project/go.mod +++ b/packages/@jsii/go-runtime-test/project/go.mod @@ -1,6 +1,6 @@ module github.com/aws/jsii/go-runtime-test -go 1.17 +go 1.16 require ( github.com/aws/jsii-runtime-go v0.0.0 @@ -12,16 +12,6 @@ require ( golang.org/x/tools v0.1.12 ) -require ( - github.com/Masterminds/semver/v3 v3.1.1 // indirect - github.com/aws/jsii/jsii-calc/go/scopejsiicalcbaseofbase/v2 v2.1.1 // indirect - github.com/davecgh/go-spew v1.1.1 // indirect - github.com/pmezard/go-difflib v1.0.0 // indirect - golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect - golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f // indirect - gopkg.in/yaml.v3 v3.0.1 // indirect -) - replace ( github.com/aws/jsii-runtime-go => ../../go-runtime/jsii-runtime-go github.com/aws/jsii/jsii-calc/go/jcb => ../jsii-calc/go/jcb diff --git a/packages/@jsii/go-runtime-test/project/go.sum b/packages/@jsii/go-runtime-test/project/go.sum index 4d877365a1..2b16f283b9 100644 --- a/packages/@jsii/go-runtime-test/project/go.sum +++ b/packages/@jsii/go-runtime-test/project/go.sum @@ -3,6 +3,8 @@ github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -30,8 +32,9 @@ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f h1:v4INt8xihDGvnrfjMDVXGxw9wrfxYyCjk0KbXjhR55s= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab h1:2QkjZIsXupsJbJIdSjjUOgWK3aEtzyuh2mPt3l/CkeU= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/deprecationwarning.go b/packages/@jsii/go-runtime/jsii-runtime-go/deprecationwarning.go new file mode 100644 index 0000000000..d8be02565d --- /dev/null +++ b/packages/@jsii/go-runtime/jsii-runtime-go/deprecationwarning.go @@ -0,0 +1,37 @@ +//go:build (go1.16 || go1.17) && !go1.18 +// +build go1.16 go1.17 +// +build !go1.18 + +package jsii + +import ( + "fmt" + "os" + + "github.com/aws/jsii-runtime-go/internal/compiler" + "github.com/mattn/go-isatty" +) + +// / Emits a deprecation warning message when +func init() { + tty := isatty.IsTerminal(os.Stderr.Fd()) || isatty.IsCygwinTerminal(os.Stderr.Fd()) + + if tty { + // Set terminal to bold red + fmt.Fprintf(os.Stderr, "\u001b[31m\u001b[1m") + } + + fmt.Fprintln(os.Stderr, "###########################################################") + fmt.Fprintf(os.Stderr, "# This binary was compiled with %v, which has reached #\n", compiler.Version) + fmt.Fprintf(os.Stderr, "# end-of-life on %v. #\n", compiler.EndOfLifeDate) + fmt.Fprintln(os.Stderr, "# #") + fmt.Fprintln(os.Stderr, "# Support for this version WILL be dropped in the future! #") + fmt.Fprintln(os.Stderr, "# #") + fmt.Fprintln(os.Stderr, "# See https://go.dev/security for more information. #") + fmt.Fprintln(os.Stderr, "###########################################################") + + if tty { + // Reset terminal back to normal + fmt.Fprintf(os.Stderr, "\u001b[0m") + } +} diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/go.mod b/packages/@jsii/go-runtime/jsii-runtime-go/go.mod index b4c56dce82..76c9441e85 100644 --- a/packages/@jsii/go-runtime/jsii-runtime-go/go.mod +++ b/packages/@jsii/go-runtime/jsii-runtime-go/go.mod @@ -4,6 +4,7 @@ go 1.16 require ( github.com/Masterminds/semver/v3 v3.1.1 + github.com/mattn/go-isatty v0.0.16 github.com/stretchr/testify v1.8.0 ) diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/go.sum b/packages/@jsii/go-runtime/jsii-runtime-go/go.sum index c082b0202a..85436dbd3a 100644 --- a/packages/@jsii/go-runtime/jsii-runtime-go/go.sum +++ b/packages/@jsii/go-runtime/jsii-runtime-go/go.sum @@ -3,6 +3,8 @@ github.com/Masterminds/semver/v3 v3.1.1/go.mod h1:VPu/7SZ7ePZ3QOrcuXROw5FAcLl4a0 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/mattn/go-isatty v0.0.16 h1:bq3VjFmv/sOjHtdEhmkEV4x1AJtvUvOJ2PFAZ5+peKQ= +github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -10,6 +12,8 @@ github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSS github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.8.0 h1:pSgiaMZlXftHpm5L7V1+rVB+AZJydKsMxsQBIJw4PKk= github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab h1:2QkjZIsXupsJbJIdSjjUOgWK3aEtzyuh2mPt3l/CkeU= +golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/internal/compiler/go1.16.go b/packages/@jsii/go-runtime/jsii-runtime-go/internal/compiler/go1.16.go new file mode 100644 index 0000000000..e531403eae --- /dev/null +++ b/packages/@jsii/go-runtime/jsii-runtime-go/internal/compiler/go1.16.go @@ -0,0 +1,12 @@ +//go:build go1.16 && !go1.17 +// +build go1.16,!go1.17 + +package compiler + +// Version denotes the version of the go compiler that was used for building +// this binary. It is intended for use only in the compiler deprecation warning +// message. +const Version = "go1.16" + +// EndOfLifeDate is the date at which this compiler version reached end-of-life. +const EndOfLifeDate = "2022-03-15" diff --git a/packages/@jsii/go-runtime/jsii-runtime-go/internal/compiler/go1.17.go b/packages/@jsii/go-runtime/jsii-runtime-go/internal/compiler/go1.17.go new file mode 100644 index 0000000000..87f6410103 --- /dev/null +++ b/packages/@jsii/go-runtime/jsii-runtime-go/internal/compiler/go1.17.go @@ -0,0 +1,12 @@ +//go:build go1.17 && !go1.18 +// +build go1.17,!go1.18 + +package compiler + +// Version denotes the version of the go compiler that was used for building +// this binary. It is intended for use only in the compiler deprecation warning +// message. +const Version = "go1.17" + +// EndOfLifeDate is the date at which this compiler version reached end-of-life. +const EndOfLifeDate = "2022-08-02" diff --git a/packages/jsii-pacmak/lib/targets/go.ts b/packages/jsii-pacmak/lib/targets/go.ts index 4b69472b52..9e43bdce44 100644 --- a/packages/jsii-pacmak/lib/targets/go.ts +++ b/packages/jsii-pacmak/lib/targets/go.ts @@ -41,7 +41,7 @@ export class Golang extends Target { const localGoMod = await this.writeLocalGoMod(pkgDir); try { - // run `go build` with local.go.mod, go 1.16 requires that we download + // run `go build` with local.go.mod, go 1.16+ requires that we download // modules explicit so go.sum is updated. We'd normally want to use // `go mod download`, but because of a bug in go 1.16, we have to use // `go mod tidy` instead. diff --git a/superchain/Dockerfile b/superchain/Dockerfile index a3f9660cb5..5d74675e55 100644 --- a/superchain/Dockerfile +++ b/superchain/Dockerfile @@ -75,7 +75,7 @@ RUN POWERSHELL_RELEASE=$(curl -X GET -fSsIL "https://aka.ms/powershell-release?t && chmod +x /opt/microsoft/powershell/pwsh # Prepare Go distribution -ARG GO_VERSION="1.17.5" +ARG GO_VERSION="1.18.5" RUN curl -fSsL "https://golang.org/dl/go${GO_VERSION}.linux-${TARGETPLATFORM#linux/}.tar.gz" -o /tmp/go.tar.gz \ && mkdir -p /opt/golang/go \ && tar -xzf /tmp/go.tar.gz -C /opt/golang/go --strip-components=1 diff --git a/superchain/README.md b/superchain/README.md index 881744bcbd..425471c7f9 100644 --- a/superchain/README.md +++ b/superchain/README.md @@ -16,7 +16,7 @@ SDK | Version `Javascript` | see [NodeJS and NPM](#nodejs-and-npm) `PowerShell` | `pwsh >= 7.1.3` `Python 3` | `python3 >= 3.7.4` with `pip3 >= 20.0.2` -`Go` | `go >= 1.17` +`Go` | `go >= 1.18` ## Image tags