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í 34cbd1b841 only list missing packages when obfuscating the runtime
We were listing all of std, which certainly worked,
but was quite slow at over 200 packages.
In practice, we can only be missing up to 20-30 packages.
It was a good change as it fixed a severe bug,
but it also introduced a fairly noticeable slow-down.

The numbers are clear; this change shaves off multiple seconds when
obfuscating the runtime with a cold cache:

	name              old time/op       new time/op       delta
	Build/NoCache-16        5.06s ± 1%        1.94s ± 1%  -61.64%  (p=0.008 n=5+5)

	name              old bin-B         new bin-B         delta
	Build/NoCache-16        6.70M ± 0%        6.71M ± 0%   +0.05%  (p=0.008 n=5+5)

	name              old sys-time/op   new sys-time/op   delta
	Build/NoCache-16        13.4s ± 2%         5.0s ± 2%  -62.45%  (p=0.008 n=5+5)

	name              old user-time/op  new user-time/op  delta
	Build/NoCache-16        60.6s ± 1%        19.8s ± 1%  -67.34%  (p=0.008 n=5+5)

Since we only want to call "go list" one extra time,
instead of once for every package we find out we're missing,
we want to know what packages we could be missing in advance.
Resurrect a smarter version of the runtime-related script.

Finally, remove the runtime-related.txt test script,
as it has now been superseeded by the sanity checks in listPackage.
That is, obfuscating the runtime package will now panic if we are
missing any necessary package information.

To double check that we get the runtime's linkname edge case right,
make gogarble.txt use runtime/debug.WriteHeapDump,
which is implemented via a direct runtime linkname.
This ensures we don't lose test coverage from runtime-related.txt.
3 years ago
..
asm.txt CI: test on GOARCH=386 3 years ago
basic.txt fix binsubstr calls to not prepare for a regexp 3 years ago
cgo.txt CI: test on GOARCH=386 3 years ago
crossbuild.txt only list missing packages when obfuscating the runtime 3 years ago
debugdir.txt deprecate using GOPRIVATE in favor of GOGARBLE (#427) 3 years ago
embed.txt deprecate using GOPRIVATE in favor of GOGARBLE (#427) 3 years ago
gogarble.txt only list missing packages when obfuscating the runtime 3 years ago
goversion.txt drop support for Go 1.16.x 3 years ago
help.txt give a useful error for "garble build -tiny" 3 years ago
implement.txt deprecate using GOPRIVATE in favor of GOGARBLE (#427) 3 years ago
imports.txt deprecate using GOPRIVATE in favor of GOGARBLE (#427) 3 years ago
init.txt drop support for Go 1.16.x 3 years ago
ldflags.txt deprecate using GOPRIVATE in favor of GOGARBLE (#427) 3 years ago
linkname.txt deprecate using GOPRIVATE in favor of GOGARBLE (#427) 3 years ago
literals.txt ensure the runtime is built in a reproducible way 3 years ago
modinfo.txt testdata: adjust for newer Go 1.18 tip version 3 years ago
plugin.txt deprecate using GOPRIVATE in favor of GOGARBLE (#427) 3 years ago
position.txt deprecate using GOPRIVATE in favor of GOGARBLE (#427) 3 years ago
reflect.txt deprecate using GOPRIVATE in favor of GOGARBLE (#427) 3 years ago
reverse.txt testdata: ensure go:noinline works via runtime.Callers 3 years ago
seed.txt deprecate using GOPRIVATE in favor of GOGARBLE (#427) 3 years ago
syntax.txt testdata: ensure go:noinline works via runtime.Callers 3 years ago
test.txt drop support for Go 1.16.x 3 years ago
tiny.txt deprecate using GOPRIVATE in favor of GOGARBLE (#427) 3 years ago