-
Notifications
You must be signed in to change notification settings - Fork 243
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
update to go 1.20 #3843
update to go 1.20 #3843
Conversation
/hold |
Failure is
|
/unhold |
If I understand the commit log correctly, mingw is installed by github on the Windows images they offer? We are also using the official actions/setup-go action, so it's very unexpected there is such a breakage. |
Does not help, but I'd also drop the explicit |
The latest push passed gh actions checks. |
yeah, if explicit go version is not mentioned, then it works, it seems
|
My guess is that 1.20 and 1.21 would work if explicitly mentioned, and
In general, yes, we want to make sure crc compiles with the go version we'll be using to build our releases. Regarding the present issue :
This seems like a good time to switch to a newer go version :) |
rand.Seed has been deprecated from go 1.20 it is replaced with rand.NewSource to create a locally scoped random generator
Need to update the go version on openshift ci as well |
If you feel it's taking too much time, let's just go with the mingw downgrade to fix CI, then you can work at your own pace on the 1.20 update. |
created openshift/release#43837 |
No its fine, i believe once the openshift CI PR is merged, we'll have green CI here as well, and since the choco release job will anyway have to be triggered from the release commit, downgrading will not fix the choco release job for publishing the choco package purpose |
/retest |
99e2441
to
7547612
Compare
@anjannath: The following tests failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
9c0b8a6
to
473a41c
Compare
/test e2e-crc |
// when its a windows path with drive letter | ||
if volume := filepath.VolumeName(absPath); volume != "" { | ||
return fmt.Sprintf("file://%s/%s", volume[:1], absPath[3:]) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
file:///D:/a/crc/crc/pkg/crc/machine/bundle..
is apparently acceptable, see golang/go#6027 , so maybe calling https://pkg.go.dev/path/filepath#ToSlash would be enough to get a functional URI?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It didn't work, even after passing it to filepath.ToSlash
the resulting URI is D:\D:\a\crc\crc\pkg\crc\machine\bundle\testdata\sha256sum_correct_4.13.0.txt.sig
filepath.Abs
already returns D:\a\crc\crc\pkg\crc\machine\bundle\testdata\sha256sum_correct_4.13.0.txt.sig
and when we use the URI file:///
the additional /
is again converted to the root volume so we have double D:\D:\
job run: https://github.com/crc-org/crc/actions/runs/6414338773/job/17414568644?pr=3843
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This passes on my test Windows VM with:
diff --git a/pkg/crc/machine/bundle/metadata_test.go b/pkg/crc/machine/bundle/metadata_test.go
index cff984a98..61134f9b0 100644
--- a/pkg/crc/machine/bundle/metadata_test.go
+++ b/pkg/crc/machine/bundle/metadata_test.go
@@ -209,5 +209,5 @@ func TestVerifiedHash(t *testing.T) {
func testDataURI(t *testing.T, sha256sum string) string {
absPath, err := filepath.Abs(filepath.Join("testdata", sha256sum))
require.NoError(t, err)
- return fmt.Sprintf("file:///%s", absPath)
+ return fmt.Sprintf("file://%s", filepath.ToSlash(absPath))
}
(file:///
-> file://
+ use of filepath.ToSlash()
).
On linux, the test also passes with these changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ahh, i think i might have used file:///
instead of file://
Looks good to me! |
0f82789
to
56cc93d
Compare
this uses filepath.ToSlash function to convert root of the filepath to either slash or windows drive letter it fixes the following unit test failure on windows: ``` === RUN TestVerifiedHash metadata_test.go:214: Error Trace: D:/a/crc/crc/pkg/crc/machine/bundle/metadata_test.go:214 D:/a/crc/crc/pkg/crc/machine/bundle/metadata_test.go:193 Error: Received unexpected error: parse "file://D:\\a\\crc\\crc\\pkg\\crc\\machine\\bundle\\testdata\\sha256sum_correct_4.13.0.txt.sig": invalid port ":\\a\\crc\\crc\\pkg\\crc\\machine\\bundle\\testdata\\sha256sum_correct_4.13.0.txt.sig" after host Test: TestVerifiedHash ```
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK if CI "passes" for the tests impacted by these changes.
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cfergeau The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@anjannath: The following tests failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
This brings go 1.20/1.21 support, but drops go 1.19 support. After crc-org#3843 this should be fine. This fixes this build error with go 1.21: ``` package github.com/crc-org/crc/v2/cmd/crc imports github.com/crc-org/crc/v2/cmd/crc/cmd imports github.com/containers/gvisor-tap-vsock/pkg/virtualnetwork imports github.com/containers/gvisor-tap-vsock/pkg/services/dhcp imports github.com/containers/gvisor-tap-vsock/pkg/tap imports gvisor.dev/gvisor/pkg/tcpip/stack imports gvisor.dev/gvisor/pkg/sync/locking imports gvisor.dev/gvisor/pkg/gohacks: build constraints exclude all Go files in /Users/yevhen/work/redhat/crc/vendor/gvisor.dev/gvisor/pkg/gohacks make: *** [install] Error 1 ```
This brings go 1.20/1.21 support, but drops go 1.19 support. After crc-org#3843 this should be fine. This fixes this build error with go 1.21: ``` package github.com/crc-org/crc/v2/cmd/crc imports github.com/crc-org/crc/v2/cmd/crc/cmd imports github.com/containers/gvisor-tap-vsock/pkg/virtualnetwork imports github.com/containers/gvisor-tap-vsock/pkg/services/dhcp imports github.com/containers/gvisor-tap-vsock/pkg/tap imports gvisor.dev/gvisor/pkg/tcpip/stack imports gvisor.dev/gvisor/pkg/sync/locking imports gvisor.dev/gvisor/pkg/gohacks: build constraints exclude all Go files in /Users/yevhen/work/redhat/crc/vendor/gvisor.dev/gvisor/pkg/gohacks make: *** [install] Error 1 ```
This brings go 1.20/1.21 support, but drops go 1.19 support. After crc-org#3843 this should be fine. This fixes this build error with go 1.21: ``` package github.com/crc-org/crc/v2/cmd/crc imports github.com/crc-org/crc/v2/cmd/crc/cmd imports github.com/containers/gvisor-tap-vsock/pkg/virtualnetwork imports github.com/containers/gvisor-tap-vsock/pkg/services/dhcp imports github.com/containers/gvisor-tap-vsock/pkg/tap imports gvisor.dev/gvisor/pkg/tcpip/stack imports gvisor.dev/gvisor/pkg/sync/locking imports gvisor.dev/gvisor/pkg/gohacks: build constraints exclude all Go files in /Users/yevhen/work/redhat/crc/vendor/gvisor.dev/gvisor/pkg/gohacks make: *** [install] Error 1 ```
This brings go 1.20/1.21 support, but drops go 1.19 support. After crc-org#3843 this should be fine. This fixes this build error with go 1.21: ``` package github.com/crc-org/crc/v2/cmd/crc imports github.com/crc-org/crc/v2/cmd/crc/cmd imports github.com/containers/gvisor-tap-vsock/pkg/virtualnetwork imports github.com/containers/gvisor-tap-vsock/pkg/services/dhcp imports github.com/containers/gvisor-tap-vsock/pkg/tap imports gvisor.dev/gvisor/pkg/tcpip/stack imports gvisor.dev/gvisor/pkg/sync/locking imports gvisor.dev/gvisor/pkg/gohacks: build constraints exclude all Go files in /Users/yevhen/work/redhat/crc/vendor/gvisor.dev/gvisor/pkg/gohacks make: *** [install] Error 1 ```
This brings go 1.20/1.21 support, but drops go 1.19 support. After crc-org#3843 this should be fine. This fixes this build error with go 1.21: ``` package github.com/crc-org/crc/v2/cmd/crc imports github.com/crc-org/crc/v2/cmd/crc/cmd imports github.com/containers/gvisor-tap-vsock/pkg/virtualnetwork imports github.com/containers/gvisor-tap-vsock/pkg/services/dhcp imports github.com/containers/gvisor-tap-vsock/pkg/tap imports gvisor.dev/gvisor/pkg/tcpip/stack imports gvisor.dev/gvisor/pkg/sync/locking imports gvisor.dev/gvisor/pkg/gohacks: build constraints exclude all Go files in /Users/yevhen/work/redhat/crc/vendor/gvisor.dev/gvisor/pkg/gohacks make: *** [install] Error 1 ```
This brings go 1.20/1.21 support, but drops go 1.19 support. After crc-org#3843 this should be fine. This fixes this build error with go 1.21: ``` package github.com/crc-org/crc/v2/cmd/crc imports github.com/crc-org/crc/v2/cmd/crc/cmd imports github.com/containers/gvisor-tap-vsock/pkg/virtualnetwork imports github.com/containers/gvisor-tap-vsock/pkg/services/dhcp imports github.com/containers/gvisor-tap-vsock/pkg/tap imports gvisor.dev/gvisor/pkg/tcpip/stack imports gvisor.dev/gvisor/pkg/sync/locking imports gvisor.dev/gvisor/pkg/gohacks: build constraints exclude all Go files in /Users/yevhen/work/redhat/crc/vendor/gvisor.dev/gvisor/pkg/gohacks make: *** [install] Error 1 ```
This brings go 1.20/1.21 support, but drops go 1.19 support. After #3843 this should be fine. This fixes this build error with go 1.21: ``` package github.com/crc-org/crc/v2/cmd/crc imports github.com/crc-org/crc/v2/cmd/crc/cmd imports github.com/containers/gvisor-tap-vsock/pkg/virtualnetwork imports github.com/containers/gvisor-tap-vsock/pkg/services/dhcp imports github.com/containers/gvisor-tap-vsock/pkg/tap imports gvisor.dev/gvisor/pkg/tcpip/stack imports gvisor.dev/gvisor/pkg/sync/locking imports gvisor.dev/gvisor/pkg/gohacks: build constraints exclude all Go files in /Users/yevhen/work/redhat/crc/vendor/gvisor.dev/gvisor/pkg/gohacks make: *** [install] Error 1 ```
No description provided.