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

Upgrade Golang version to 1.20.6 #3842

Merged
merged 1 commit into from
Aug 9, 2023
Merged

Conversation

chienhanlin
Copy link
Contributor

@chienhanlin chienhanlin commented Aug 8, 2023

Summary

This PR bumps Golang version from 1.19.10 to 1.20.6.

Implementation details

1. Update Golang version in

  • GO_VERSION
  • GO_VERSION_WINDOWS
  • BuildRequires: golang >= 1.20.0 in packaging/amazon-linux-ami-integrated/ecs-agent.spec to build ecs-init artifacts with the Golang version >= 1.20.0.

2. Update static check tool in Makefile
Update staticcheck to v0.4.0 to be compatible to Golang 1.20.6. See reference [here].

3. Set CGO_ENABLED=1 in scripts/run-integ-tests.ps1 to run integration test on Windows
As Golang 1.20 now disables cgo by default on systems without a C toolchain, we need explicitly enable it. See Go 1.20 release notes [here] for more details. For reference, we got following errors before setting CGO_ENABLED=1,

At C:\Users\Administrator\AppData\Local\Temp\amazon-ecs-agent\go\src\github.com\aws\amazon-ecs-agent\scripts\run-integ-
tests.ps1:62 char:32
+ ...  = 'debug'; go test -race -tags integration -timeout=40m -v ../agent/ ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (go: -race requi...g CGO_ENABLED=1:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
 
go : go: -race requires cgo; enable cgo by setting CGO_ENABLED=1
At C:\Users\Administrator\AppData\Local\Temp\amazon-ecs-agent\go\src\github.com\aws\amazon-ecs-agent\scripts\run-integ-
tests.ps1:64 char:34
+ ...  = 'debug'; go test -race -tags integration -timeout=40m -v ../agent/ ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (go: -race requi...g CGO_ENABLED=1:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError

Testing

  • Building ecs-init artifacts with Golang 1.20.6 for AL2 and AL2023, both succeeded.
  • Static checks for both Linux and Windows pass on this PR
  • Functional tests for all supported OS pass on this PR

New tests cover the changes: no

Description for the changelog

Enhancement - Update Agent build golang version to 1.20.6

Licensing

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

mythri-garaga
mythri-garaga previously approved these changes Aug 8, 2023
@chienhanlin chienhanlin merged commit 1df48d3 into aws:dev Aug 9, 2023
6 checks passed
@chienhanlin chienhanlin deleted the golang_update_20 branch August 9, 2023 17:54
@chienhanlin chienhanlin mentioned this pull request Aug 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants