Skip to content

Commit

Permalink
feat(go): emit deprecation warning when using go1.16 and go1.17
Browse files Browse the repository at this point in the history
Both go1.16 and go1.17 have reached end-of-life. Customers should upgrade
to go1.18 or 1.19. Support for go1.16 and go1.17 will be dropped around
late September 2022.
  • Loading branch information
RomainMuller committed Aug 22, 2022
1 parent bf9c142 commit de58d37
Show file tree
Hide file tree
Showing 9 changed files with 82 additions and 17 deletions.
43 changes: 31 additions & 12 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -214,7 +214,7 @@ jobs:
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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion gh-pages/content/user-guides/lib-author/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |

Expand Down
2 changes: 1 addition & 1 deletion packages/@jsii/go-runtime-test/project/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/aws/jsii/go-runtime-test

go 1.17
go 1.18

require (
github.com/aws/jsii-runtime-go v0.0.0
Expand Down
22 changes: 22 additions & 0 deletions packages/@jsii/go-runtime/jsii-runtime-go/deprecationwarning.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
//go:build (go1.16 || go1.17) && !go1.18
// +build go1.16 go1.17
// +build !go1.18

package jsii

import (
"fmt"

"github.com/aws/jsii-runtime-go/internal/compiler"
)

// / Emits a deprecation warning message when
func init() {
fmt.Println("###########################################################")
fmt.Printf("# This binary was compiled with %v, which has reached #\n", compiler.Version)
fmt.Printf("# end-of-life on %v. #", compiler.EndOfLifeDate)
fmt.Println("# Support for this version will be dropped in the future. #")
fmt.Println("# #")
fmt.Println("# See https://go.dev/security for more information. #")
fmt.Println("###########################################################")
}
Original file line number Diff line number Diff line change
@@ -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"
Original file line number Diff line number Diff line change
@@ -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"
2 changes: 1 addition & 1 deletion packages/jsii-pacmak/lib/targets/go.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion superchain/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion superchain/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit de58d37

Please sign in to comment.