-
-
Notifications
You must be signed in to change notification settings - Fork 262
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
add support for "garble list"? #298
Comments
I should note that I'm not sure how to cache the obfuscation process involved in I guess that's not a big deal since our obfuscation process isn't expensive when compared to compilation. But still worth noting. |
Reading the above, it appears that garble directly reads the Go build cache? Is that true? TinyGo does not use the Go build cache, instead it implements its own cache. And this cache should be considered an implementation detail. How TinyGo implements the cache is (in short) by hashing all input files and using that as a cache key, something similar might work for garble. |
When obfuscating+compiling a package, garble does read from the build cache to load type information from dependencies. However, garble doesn't store anything in the build cache itself. So, naively,
By the way, starting in Go 1.16 you could even reuse Go's own cache key:
The hash is split into two parts, where the first part is the hash of the package's inputs (source files, deps, compiler version, etc), and the second hash is the hash of its build result - the compiled object file. This requires |
Also, the reason rebuilds are needed is for reproducibility with bootstrapping; see https://golang.org/src/cmd/go/internal/work/buildid.go. |
For the sake of search engines and indexers, another useful keyword here is gomobile, which also replaces |
It could be useful for
tinygo build
, for example, as it usesgo list -json -deps
to obtain the source code of the input packages. We could perhaps shoehorn garble in there by makinggarble list
provide the equivalent but with obfuscated files and package paths.I imagine that
garble list
could also be useful for debugging or inspecting how the obfuscator works without doing full obfuscated builds.Would it be useful for anything else? This command not be a huge amount of work to write and maintain, but I also want to make sure that people want it before we invest time into it.
The text was updated successfully, but these errors were encountered: