Unexpected error on windows10 when running pkl-go-examples
- Dominant language
- Go
- Stars
- 334
- Forks
- 43
- Avg merge
- 5h 41m
- Merged PRs (30d)
- 1
Description
go version go1.22.5 windows/amd64
Pkl 0.26.3 (Windows 10.0, native)
pkl-gen-go 0.8.0
foo.pkl
`foo: String = "hello"
bar: Int = 5`
main.go
`package main
import (
"context"
"fmt"
"github.com/apple/pkl-go/pkl"
)
type MyConfig struct {
Foo string `pkl:"foo"`
Bar int `pkl:"bar"`
}
func main() {
evaluator, err := pkl.NewEvaluator(context.Background(), pkl.PreconfiguredOptions)
if err != nil {
panic(err)
}
defer evaluator.Close()
var cfg MyConfig
if err = evaluator.EvaluateModule(context.Background(), pkl.FileSource("foo.pkl"), &cfg); err != nil {
panic(err)
}
fmt.Printf("Got module: %+v", cfg)
}
`
Just run it, then I got
`[Running] go run "d:\backup\pkl-go-examples\pkl-go-examples\main.go"
panic: org.pkl.core.PklBugException: An unexpected error has occurred. Would you mind filing a bug report?
goroutine 1 [running]:
main.main()
d:/backup/pkl-go-examples/pkl-go-examples/main.go:23 +0x1db
exit status 2
[Done] exited with code=1 in 3.145 seconds
`
How can fix it? Or how can I report this error?
Contributor guide
Research direction
Start by reproducing the report on Windows 10 with the versions listed, using foo.pkl and main.go and the EvaluateModule call. Inspect the panic and the evaluator setup to determine which operation fails. Done means the example no longer produces the unexpected PklBugException, or the compatibility limitation is clearly identified and covered by an appropriate regression test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100