traefik / yaegi

Yaegi is Another Elegant Go Interpreter
https://pkg.go.dev/github.com/traefik/yaegi
Apache License 2.0
7.02k stars 349 forks source link

import "github.com/uber/jaeger-client-go" issue #1537

Closed caiuskong closed 1 year ago

caiuskong commented 1 year ago

The following program sample.go triggers an unexpected result

package main

import (
    "fmt"
    "github.com/uber/jaeger-client-go"
)

func main() {
  fmt.Println(jaeger.JaegerClientVersion)
}

Expected result

Go-2.30.0

Got

scope.go:220: nil type
panic: nil type

goroutine 1 [running]:
log.Panic({0x14002117678, 0x1, 0x1})
        /opt/hostedtoolcache/go/1.17.5/x64/src/log/log.go:354 +0x98
github.com/traefik/yaegi/interp.(*scope).add(0x1400026ca20, 0x0)
        /home/runner/work/yaegi/yaegi/interp/scope.go:220 +0x58
github.com/traefik/yaegi/interp.(*Interpreter).cfg.func1(0x1400165f9e0)
        /home/runner/work/yaegi/yaegi/interp/cfg.go:192 +0x38a8
github.com/traefik/yaegi/interp.(*node).Walk(0x1400165f9e0, 0x14002117cb0, 0x14002117c78)
        /home/runner/work/yaegi/yaegi/interp/interp.go:285 +0x38
github.com/traefik/yaegi/interp.(*node).Walk(0x1400165f560, 0x14002117cb0, 0x14002117c78)
        /home/runner/work/yaegi/yaegi/interp/interp.go:289 +0x88
github.com/traefik/yaegi/interp.(*node).Walk(0x1400165f440, 0x14002117cb0, 0x14002117c78)
        /home/runner/work/yaegi/yaegi/interp/interp.go:289 +0x88
github.com/traefik/yaegi/interp.(*node).Walk(0x1400165f320, 0x14002117cb0, 0x14002117c78)
        /home/runner/work/yaegi/yaegi/interp/interp.go:289 +0x88
github.com/traefik/yaegi/interp.(*node).Walk(0x1400163b9e0, 0x14002117cb0, 0x14002117c78)
        /home/runner/work/yaegi/yaegi/interp/interp.go:289 +0x88
github.com/traefik/yaegi/interp.(*node).Walk(0x140015758c0, 0x14002117cb0, 0x14002117c78)
        /home/runner/work/yaegi/yaegi/interp/interp.go:289 +0x88
github.com/traefik/yaegi/interp.(*Interpreter).cfg(0x14000368000, 0x140015758c0, 0x1400026ca20, {0x140005a1b01, 0x25}, {0x14000e83ef0, 0xb})
        /home/runner/work/yaegi/yaegi/interp/cfg.go:62 +0x1ac
github.com/traefik/yaegi/interp.(*Interpreter).importSrc(0x14000368000, {0x140013da820, 0x20}, {0x140005a1b01, 0x25}, 0x1)
        /home/runner/work/yaegi/yaegi/interp/src.go:125 +0x71c
github.com/traefik/yaegi/interp.(*Interpreter).gta.func1(0x14000553c20)
        /home/runner/work/yaegi/yaegi/interp/gta.go:237 +0x1c10
github.com/traefik/yaegi/interp.(*node).Walk(0x14000553c20, 0x14002118a58, 0x0)
        /home/runner/work/yaegi/yaegi/interp/interp.go:285 +0x38
github.com/traefik/yaegi/interp.(*node).Walk(0x140005538c0, 0x14002118a58, 0x0)
        /home/runner/work/yaegi/yaegi/interp/interp.go:289 +0x88
github.com/traefik/yaegi/interp.(*node).Walk(0x14000553680, 0x14002118a58, 0x0)
        /home/runner/work/yaegi/yaegi/interp/interp.go:289 +0x88
github.com/traefik/yaegi/interp.(*Interpreter).gta(0x14000368000, 0x14000553680, {0x140013da820, 0x20}, {0x140001151a1, 0x20}, {0x1400200dc00, 0x6})
        /home/runner/work/yaegi/yaegi/interp/gta.go:20 +0x17c
github.com/traefik/yaegi/interp.(*Interpreter).importSrc(0x14000368000, {0x1400011f9d0, 0x4}, {0x140001151a1, 0x20}, 0x1)
        /home/runner/work/yaegi/yaegi/interp/src.go:108 +0xfa4
github.com/traefik/yaegi/interp.(*Interpreter).gta.func1(0x14000373d40)
        /home/runner/work/yaegi/yaegi/interp/gta.go:237 +0x1c10
github.com/traefik/yaegi/interp.(*node).Walk(0x14000373d40, 0x14002119828, 0x0)
        /home/runner/work/yaegi/yaegi/interp/interp.go:285 +0x38
github.com/traefik/yaegi/interp.(*node).Walk(0x14000373320, 0x14002119828, 0x0)
        /home/runner/work/yaegi/yaegi/interp/interp.go:289 +0x88
github.com/traefik/yaegi/interp.(*node).Walk(0x140003730e0, 0x14002119828, 0x0)
        /home/runner/work/yaegi/yaegi/interp/interp.go:289 +0x88
github.com/traefik/yaegi/interp.(*Interpreter).gta(0x14000368000, 0x140003730e0, {0x1400011f9d0, 0x4}, {0x1400011f9d0, 0x4}, {0x1400011f9d0, 0x4})
        /home/runner/work/yaegi/yaegi/interp/gta.go:20 +0x17c
github.com/traefik/yaegi/interp.(*Interpreter).gtaRetry(0x14000368000, {0x1400024fa40, 0x1, 0x1}, {0x1400011f9d0, 0x4}, {0x1400011f9d0, 0x4})
        /home/runner/work/yaegi/yaegi/interp/gta.go:346 +0x150
github.com/traefik/yaegi/interp.(*Interpreter).CompileAST(0x14000368000, {0x101899a70, 0x140002d6280})
        /home/runner/work/yaegi/yaegi/interp/program.go:77 +0x184
github.com/traefik/yaegi/interp.(*Interpreter).compileSrc(0x14000368000, {0x14000476f00, 0x2182}, {0x16f102b4d, 0xb}, 0x0)
        /home/runner/work/yaegi/yaegi/interp/program.go:52 +0x110
github.com/traefik/yaegi/interp.(*Interpreter).eval(0x14000368000, {0x14000476f00, 0x2182}, {0x16f102b4d, 0xb}, 0x0)
        /home/runner/work/yaegi/yaegi/interp/interp.go:606 +0x50
github.com/traefik/yaegi/interp.(*Interpreter).EvalPath(0x14000368000, {0x16f102b4d, 0xb})
        /home/runner/work/yaegi/yaegi/interp/interp.go:508 +0xe8
main.runFile(0x14000368000, {0x16f102b4d, 0xb}, 0x0)
        /home/runner/work/yaegi/yaegi/cmd/yaegi/run.go:153 +0xb0
main.run({0x140001921a0, 0x1, 0x1})
        /home/runner/work/yaegi/yaegi/cmd/yaegi/run.go:116 +0xe14
main.main()
        /home/runner/work/yaegi/yaegi/cmd/yaegi/yaegi.go:133 +0xf4

Yaegi Version

0.11.2

Additional Notes

yaegi 0.15.0 and 0.15.1 still error

caiuskong commented 1 year ago

"go.opentelemetry.io/otel" // unsupported, include unsafe

caiuskong commented 7 months ago

hi @mvertes, I see that the code has been merged to master long ago, when is the new version of yaegi expected to be released, I would like to use it in the traefik local plugin...