-
Notifications
You must be signed in to change notification settings - Fork 341
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
import "go.uber.org/zap" fails #1172
Comments
@darkweak fyi, I was able to get past your issue by changing all func() signatures to func(i int) , so that they would match the os.Exit signature. Not a real fix of course, but that allowed us to see that there's other problems waiting behind. So it's going to be several fixes before you can use that package in yaegi. |
So, what's next ? Is there another way to make plugins for træfik instead of using yaegi while you're trying to fix this bug ? @mpl |
The plugin's system inside Traefik is based on Yaegi, then there is no other way. |
@ldez I don't think fork the zap project and patch by myself is a good and viable solution. When does the fix would be available ? As rc or concrete release idc, that's just for testing purpose and be able to prepare the release of this plugin. |
Thank you, and many thanks to @mvertes for his incredible work 🚀 |
I want to add something to this issue (I'm using 4653d87):
code: ce.ErrorOutput = log.errorOutput Should I create a new issue? |
I'm seeing a couple of similar issues following the rework on types, under investigation right now. No need for a new issue, thanks. |
I have copied the zap source code into my project (messed around with namespaces too) but I eventually got a minimal logging example to work. I had to use go 1.9 so that I could use the native sync/atomic package so that I could drop the uber atomic packaged which uses unsafe. Quite a lot of the fixes relate to helping yeagi understand the type Example 1Broken:
To:
Example 2
to
https://github.com/taliesins/traefik-plugin-oidc/tree/initial/log |
#1485 is required for zap to work |
Any updates on this fix being merged. I think it is holding up the CorazaWAF traefik plugin from working which I would like to test and use with traefik. |
Zap was removed from coraza v3. We have other problems with sync.Pool |
Ah ok. Thanks for a speedy response. Any estimate on when a fix for sync.Pool will be available? |
No idea, there is no ongoing project for Traefik until we find a maintainer. We try yaegi once in a while to check whether it works but no success yet. |
Ok thanks. May have to look at testing by running a Caddy container in front of my traefik container as from the Coraza site it seems Caddy integration looks fully stable. |
Other very popular integrations are apisix or envoy using coraza-proxy-wasm |
For methods defined on interfaces (vs concrete methods), the resolution of the method is necessarily delayed at the run time and can not be completed at compile time. The selectorExpr processing has been changed to correctly identify calls on interface methods which were confused as fields rather than methods (due to the fact that in a interface definition, methods are fields of the interface). Then at runtime, method lookup has been fixed to correctly recurse in nested valueInterface wrappers and to find embedded interface fields in case of struct or pointer to struct. Finally, remove receiver processing in `call()`.The receiver is already processed at method resolution and in genFunctionWrapper. Removing redundant processing in call fixes handling of variadic method, simplifies the code and makes it faster. With those fixes, it is now possible to load and run `go.uber.org/zap` in yaegi. In turn, it makes possible for yaegi to run plugins dependent on zap, such as coraza-waf. Fixes #1515, Fixes #1172, Fixes #1275, Fixes #1485.
The following program
sample.go
triggers an unexpected resultExpected result
Got
Yaegi Version
devel
Additional Notes
Hints at: https://github.com/uber-go/zap/blob/master/internal/exit/exit.go#L27
The text was updated successfully, but these errors were encountered: