traefik / yaegi

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

Automatically keeping `yaegi extract` generated files up-to-date with `go generate` #1493

Open karelorigin opened 1 year ago

karelorigin commented 1 year ago

Proposal

Currently, there's no way to automatically synchronize extracted symbols with their respective dependencies. A go:generate directive, added to the output of Yaegi generated Go files, could help with automating the process. Implementing this feature could make synchronization as simple as calling go generate to regenerate the symbols. Removal will still need to be done manually, however.

Background

I found myself in need of this feature after having written multiple precompiled libraries that need a manual yaegi extract after each API change. This is especially cumbersome for third party dependencies.

Workarounds

The alternative is to write a script that loops over a list of dependencies and calls yaegi extract.