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

Go generate does not work on newer systems #675

Open
cam72cam opened this issue Apr 16, 2024 · 0 comments
Open

Go generate does not work on newer systems #675

cam72cam opened this issue Apr 16, 2024 · 0 comments

Comments

@cam72cam
Copy link

cam72cam commented Apr 16, 2024

First issue I encountered was:

unicode2ragel.rb:85:in `initialize': No such file or directory @ rb_sysopen - http://www.unicode.org/Public/9.0.0/ucd/DerivedCoreProperties.txt (Errno::ENOENT)
        from unicode2ragel.rb:85:in `open'
        from unicode2ragel.rb:85:in `each_alpha'
        from unicode2ragel.rb:292:in `generate_machine'
        from unicode2ragel.rb:334:in `block in <main>'
        from unicode2ragel.rb:334:in `each'
        from unicode2ragel.rb:334:in `<main>'
hclsyntax/generate.go:7: running "ruby": exit status 1

Which was fixed by:

diff --git a/hclsyntax/unicode2ragel.rb b/hclsyntax/unicode2ragel.rb
index 235265d..f7b652e 100644
--- a/hclsyntax/unicode2ragel.rb
+++ b/hclsyntax/unicode2ragel.rb
@@ -82,7 +82,7 @@ end
 # range and description.
 
 def each_alpha( url, property ) 
-  open( url ) do |file|
+  URI.open( url ) do |file|
     file.each_line do |line|
       next if line =~ /^#/;
       next if line !~ /; #{property} #/;

Second issue is a panic when running with go1.22.2:

panic: runtime error: invalid memory address or nil pointer dereference [recovered]
        panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x5a6c4f]

goroutine 49 [running]:
go/types.(*Checker).handleBailout(0xc0003a1600, 0xc0005f3bd0)
        /usr/lib/go-1.22/src/go/types/check.go:367 +0x88
panic({0x65dc60?, 0x85d570?})
        /usr/lib/go-1.22/src/runtime/panic.go:770 +0x132
go/types.(*StdSizes).Sizeof(0x0, {0x6fccd0, 0x8605a0})
        /usr/lib/go-1.22/src/go/types/sizes.go:228 +0x30f
go/types.(*Config).sizeof(...)
        /usr/lib/go-1.22/src/go/types/sizes.go:333
go/types.representableConst.func1({0x6fccd0?, 0x8605a0?})
        /usr/lib/go-1.22/src/go/types/const.go:76 +0x9e
go/types.representableConst({0x6fe850, 0x855ec0}, 0xc0003a1600, 0x8605a0, 0x0)
        /usr/lib/go-1.22/src/go/types/const.go:92 +0x192
go/types.(*Checker).arrayLength(0xc0003a1600, {0x6fe388, 0xc0004ea5c0?})
        /usr/lib/go-1.22/src/go/types/typexpr.go:510 +0x2d3
go/types.(*Checker).typInternal(0xc0003a1600, {0x6fdc98, 0xc0002a1dd0}, 0xc000d43860)
        /usr/lib/go-1.22/src/go/types/typexpr.go:299 +0x49d
go/types.(*Checker).definedType(0xc0003a1600, {0x6fdc98, 0xc0002a1dd0}, 0x40b087?)
        /usr/lib/go-1.22/src/go/types/typexpr.go:180 +0x37
go/types.(*Checker).typeDecl(0xc0003a1600, 0xc000d43860, 0xc0004ec580, 0x0)
        /usr/lib/go-1.22/src/go/types/decl.go:615 +0x44d
go/types.(*Checker).objDecl(0xc0003a1600, {0x700cb8, 0xc000d43860}, 0x0)
        /usr/lib/go-1.22/src/go/types/decl.go:197 +0xa7f
go/types.(*Checker).ident(0xc0003a1600, 0xc0004fca00, 0xc000459c60, 0x0, 0x1)
        /usr/lib/go-1.22/src/go/types/typexpr.go:62 +0x250
go/types.(*Checker).typInternal(0xc0003a1600, {0x6fdb48, 0xc000459c60}, 0x0)
        /usr/lib/go-1.22/src/go/types/typexpr.go:241 +0x605
go/types.(*Checker).definedType(0xc0003a1600, {0x6fdb48, 0xc000459c60}, 0xc0005f31b8?)
        /usr/lib/go-1.22/src/go/types/typexpr.go:180 +0x37
go/types.(*Checker).varType(0xc0003a1600, {0x6fdb48, 0xc000459c60})
        /usr/lib/go-1.22/src/go/types/typexpr.go:145 +0x25
go/types.(*Checker).structType(0xc0003a1600, 0xc00087d740, 0xc00087d740?)
        /usr/lib/go-1.22/src/go/types/struct.go:113 +0x19f
go/types.(*Checker).typInternal(0xc0003a1600, {0x6fdcc8, 0xc000b0b398}, 0xc000d43630)
        /usr/lib/go-1.22/src/go/types/typexpr.go:316 +0x1345
go/types.(*Checker).definedType(0xc0003a1600, {0x6fdcc8, 0xc000b0b398}, 0x10?)
        /usr/lib/go-1.22/src/go/types/typexpr.go:180 +0x37
go/types.(*Checker).typeDecl(0xc0003a1600, 0xc000d43630, 0xc00037da00, 0x0)
        /usr/lib/go-1.22/src/go/types/decl.go:615 +0x44d
go/types.(*Checker).objDecl(0xc0003a1600, {0x700cb8, 0xc000d43630}, 0x0)
        /usr/lib/go-1.22/src/go/types/decl.go:197 +0xa7f
go/types.(*Checker).packageObjects(0xc0003a1600)
        /usr/lib/go-1.22/src/go/types/resolver.go:681 +0x425
go/types.(*Checker).checkFiles(0xc0003a1600, {0xc000797110, 0x1a, 0x1a})
        /usr/lib/go-1.22/src/go/types/check.go:408 +0x1a5
go/types.(*Checker).Files(...)
        /usr/lib/go-1.22/src/go/types/check.go:372
golang.org/x/tools/go/packages.(*loader).loadPackage(0xc000180000, 0xc00022b920)
        /home/cmesh/go/pkg/mod/golang.org/x/tools@v0.6.0/go/packages/packages.go:1052 +0xa72
golang.org/x/tools/go/packages.(*loader).loadRecursive.func1()
        /home/cmesh/go/pkg/mod/golang.org/x/tools@v0.6.0/go/packages/packages.go:851 +0x1a9
sync.(*Once).doSlow(0xc0002d2798?, 0x405f17?)
        /usr/lib/go-1.22/src/sync/once.go:74 +0xc2
sync.(*Once).Do(...)
        /usr/lib/go-1.22/src/sync/once.go:65
golang.org/x/tools/go/packages.(*loader).loadRecursive(0x606c5e?, 0xc0002d27d0?)
        /home/cmesh/go/pkg/mod/golang.org/x/tools@v0.6.0/go/packages/packages.go:839 +0x4a
golang.org/x/tools/go/packages.(*loader).refine.func2(0x0?)
        /home/cmesh/go/pkg/mod/golang.org/x/tools@v0.6.0/go/packages/packages.go:774 +0x26
created by golang.org/x/tools/go/packages.(*loader).refine in goroutine 1
        /home/cmesh/go/pkg/mod/golang.org/x/tools@v0.6.0/go/packages/packages.go:773 +0xccf
exit status 2
hclsyntax/generate.go:12: running "go": exit status 1

Which was fixed by downgrading to go 1.18

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

No branches or pull requests

1 participant