You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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))
As per mikefarah/yq#2001, building yq requires
a golang version newer than the one available in el8 and el9. Let's use
prebuilt binaries from the go project.
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: