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
v4.43.1 doesn't build with go <1.21 #2001
Comments
Hello, The requirement on go 1.21 was set in commit bbe196b "feat: upgrade go.mod to 1.21 (#1830)". This is related to the patch on pkg/yqlib/operator_omit.go because it uses a max() function that is apparenty not available in go 1.20. Preserving go 1.20 compatibility would be great because that version is available in el8 and el9. So far I was able to build our RPM package without too much hassle that patch: --- a/go.mod
+++ b/go.mod
@@ -30,4 +30,4 @@ require (
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
)
-go 1.21
+go 1.20
--- a/pkg/yqlib/operator_omit.go
+++ b/pkg/yqlib/operator_omit.go
@@ -5,6 +5,13 @@ import (
"strconv"
)
+func max(a, b int) int {
+ if a > b {
+ return a
+ }
+ return b
+}
+
func omitMap(original *CandidateNode, indices *CandidateNode) *CandidateNode {
filteredContent := make([]*CandidateNode, 0, max(0, len(original.Content)-len(indices.Content)*2))
Regards, |
Sorry yq does not have backwards compatibility for older versions of go. Often the go version is bumped for security issues. |
Describe the bug
I'm not sure what your policy for supporting older go runtimes is, mostly raising this in case anyone else bumps into it.
RHEL8 ships with go 1.20, yq v4.43.1 doesn't build with this runtime:
Which appears to point at #1989 - possibly other changes too, however the build stops at the first fault it encounters.
v4.42.1 still builds absolutely fine on 1.20
Version of yq: 4.43.1
Operating system: linux
Installed via: rpm
Input Yaml
Concise yaml document(s) (as simple as possible to show the bug, please keep it to 10 lines or less)
data1.yml:
n/a
Command
The command you ran:
Actual behavior
n/a
Expected behavior
n/a
Additional context
n/a
The text was updated successfully, but these errors were encountered: