You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
garble/testdata/scripts
Daniel Martí b234cef335 initial support for build caching
As per the discussion in https://github.com/golang/go/issues/41145, it
turns out that we don't need special support for build caching in
-toolexec. We can simply modify the behavior of "[...]/compile -V=full"
and "[...]/link -V=full" so that they include garble's own version and
options in the printed build ID.

The part of the build ID that matters is the last, since it's the
"content ID" which is used to work out whether there is a need to redo
the action (build) or not. Since cmd/go parses the last word in the
output as "buildID=...", we simply add "+garble buildID=_/_/_/${hash}".
The slashes let us imitate a full binary build ID, but we assume that
the other components such as the action ID are not necessary, since the
only reader here is cmd/go and it only consumes the content ID.

The reported content ID includes the tool's original content ID,
garble's own content ID from the built binary, and the garble options
which modify how we obfuscate code. If any of the three changes, we
should use a different build cache key. GOPRIVATE also affects caching,
since a different GOPRIVATE value means that we might have to garble a
different set of packages.

Include tests, which mainly check that 'garble build -v' prints package
lines when we expect to always need to rebuild packages, and that it
prints nothing when we should be reusing the build cache even when the
built binary is missing.

After this change, 'go test' on Go 1.15.2 stabilizes at about 8s on my
machine, whereas it used to be at around 25s before.
5 years ago
..
asm.txt Strip all filename and position info when -tiny is passed (#128) 5 years ago
basic.txt initial support for build caching 5 years ago
cgo.txt Strip all filename and position info when -tiny is passed (#128) 5 years ago
debugdir.txt fixed comments cleaning 5 years ago
goprivate.txt add blacklist for runtime std packages 5 years ago
goversion.txt add test for Go version checking (#140) 5 years ago
help.txt all: update the docs a bit 5 years ago
implement.txt testdata: set GOPRIVATE in all but two tests (#104) 5 years ago
imports.txt initial support for build caching 5 years ago
ldflags.txt Rewrite renaming logic for private names and reduce length of public names (#135) 5 years ago
literals.txt testdata: use the debugdir flag less often 5 years ago
modinfo.txt testdata: set GOPRIVATE in all but two tests (#104) 5 years ago
plugin.txt Disable plugin test (#120) 5 years ago
seed.txt initial support for build caching 5 years ago
syntax.txt More correct comments transformation (#152) 5 years ago
test.txt testdata: set GOPRIVATE in all but two tests (#104) 5 years ago
tiny.txt testdata: use the debugdir flag less often 5 years ago