-
-
Notifications
You must be signed in to change notification settings - Fork 245
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
Reflection with module #403
Comments
For better or worse, Go builds one package at a time, and so we obfuscate one package at a time as well. When we obfuscate The alternative would be to analyze the entire package graph before starting the build. This would be very inefficient for large builds though, and would affect our ability to rely on the build cache for speed. So it doesn't feel like the right decision. |
So for this particular case (heavy use of cross package reflection), can I create a sort of objects-to-ignore list, like knownReflectAPIs but for objects to tell garble to ignore them? |
The easiest way is to do something like:
It's also nice because you annotate that information right next to the type definition. |
We recently improved the automatic detection of reflection. However, note that a hint may still be needed in some cases, in particular when the reflection usage happens in a downstream package. Keep making that suggestion. Also mention that we obfuscate one package at a time. I've also written down burrowers#406 with more ideas on how we could polish this rough edge for end users in the future. Fixes burrowers#403.
What version of Garble and Go are you using?
What environment are you running Garble on?
go env
OutputWhat did you do?
run binary built from
main.go
struct.go
project structure
What did you expect to see?
What did you see instead?
I noticed in the source code to ignore objects for obfuscation they must be declared and their reflection usage must be in the same package, and indeed when I move MyStruct's declaration into main.go it gives the inteded output. Since my project relies on a lot of plugins and reflection, can there be a way to make it happen cross packages?
The text was updated successfully, but these errors were encountered: