eh-steve / goloader

Compile, load and run Go code at runtime.
Apache License 2.0
46 stars 4 forks source link

go-git v5.11.0 inittask panic #28

Closed TheMightyGit closed 8 months ago

TheMightyGit commented 8 months ago

Go version: go 1.21.5 MacOS: 12.7 (x86) goloader: 684a15fbb234

In my outer program I import and use github.com/go-git/go-git/v5 and github.com/go-git/go-git/v5/plumbing (it's a pure go package, no cgo, v5.11.0). These packages are NOT used in my JIT'd code. However, when I use either fmt.Println() or time.Sleep() in the JIT code and I get this panic...

still have 4 unresolved external symbols despite building and linking dependencies...:
github.com/go-git/gcfg/scanner..inittask     required by:
    github.com/go-git/gcfg..inittask

github.com/go-git/gcfg/token..inittask     required by:
    github.com/go-git/gcfg..inittask

github.com/go-git/gcfg/types.EnumParser.Parse     required by:
    github.com/go-git/gcfg.boolSetter

gopkg.in/warnings%2ev0..inittask     required by:
    github.com/go-git/gcfg..inittask

If I remove go-git from my outer code everything is fine.

Happy to provide more details if needed.

eh-steve commented 8 months ago

Would you mind trying on this branch https://github.com/eh-steve/goloader/pull/27 ?

I'm also planning to do some major rework soon which should hopefully fix some of these issues.

TheMightyGit commented 8 months ago

@eh-steve Yes! That fixes it :)

eh-steve commented 8 months ago

Great, I just need to massage the CI on that PR before I merge it so there might be some rebases before it ends up in master.

eh-steve commented 8 months ago

Merged into master, let me know if it works for you and I'll close this issue

TheMightyGit commented 8 months ago

Merged into master, let me know if it works for you and I'll close this issue

@eh-steve It works for me on master now. Thank you! :)