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í 6b1a062c6f make -literals succeed on all of std
Two bugs were remaining which made the build with -literals of std fail.

First, we were ignoring too many objects in constant expressions,
including type names. This resulted in type names declared in
dependencies which were incorrectly not obfuscated in the current
package:

	# go/constant
	O1ku7TCe.go:1: undefined: alzLJ5Fd.Word
	b0ieEGVQ.go:1: undefined: alzLJ5Fd.Word
	LEpgYKdb.go:4: undefined: alzLJ5Fd.Word
	FkhHJCfm.go:1: undefined: alzLJ5Fd.Word

This edge case is easy to reproduce, so a test case is added to
literals.txt.

The second issue is trickier; in some packages like os/user, we would
get syntax errors because of comments printed out of place:

	../tip/os/user/getgrouplist_unix.go:35:130: syntax error: unexpected newline, expecting comma or )

This is a similar kind of error that we tried to fix with e2f06cce94. In
particular, it's fixed by also setting CallExpr.Rparen in withPos. We
also add many other missing Pos fields for good measure, even though
we're not sure they help just yet.

Unfortunately, all my attempts to minimize this into a reproducible
failure have failed. We can't just copy the failing file from os/user,
as it only builds on some OSs. It seems like it was the perfect mix of
cgo (which adds line directive comments) plus unlucky positioning of
literals.

For that last reason, as well as for ensuring that -literals works well
with a wide variety of software, we add a build of all of std with
-literals when not testing with -short. This is akin to what we do in
goprivate.txt, but with the -literals flag. This does make "go test"
more expensive, but also more thorough.

Fixes #285, hopefully for good this time.
3 years ago
..
asm.txt obfuscate asm function names as well (#273) 3 years ago
basic.txt testdata: reduce the cost of short tests 3 years ago
cgo.txt all: drop support for Go 1.15.x (#265) 3 years ago
debugdir.txt refactor "current package" with TOOLEXEC_IMPORTPATH (#266) 3 years ago
embed.txt don't obfuscate the "embed" import path 3 years ago
goprivate.txt obfuscate asm function names as well (#273) 3 years ago
goversion.txt all: drop support for Go 1.15.x (#265) 3 years ago
help.txt make "help" refuse arguments for now 3 years ago
implement.txt all: drop support for Go 1.15.x (#265) 3 years ago
imports.txt all: drop support for Go 1.15.x (#265) 3 years ago
init.txt all: drop support for Go 1.15.x (#265) 3 years ago
ldflags.txt testdata: remove some unnecessary execs (#267) 3 years ago
linkname.txt all: drop support for Go 1.15.x (#265) 3 years ago
literals.txt make -literals succeed on all of std 3 years ago
modinfo.txt testdata: remove some unnecessary execs (#267) 3 years ago
plugin.txt all: drop support for Go 1.15.x (#265) 3 years ago
position.txt improve "reverse" even further (#289) 3 years ago
reverse.txt testdata: reduce the cost of short tests 3 years ago
seed.txt make flags like -literals and GOPRIVATE affect hashing (#288) 3 years ago
syntax.txt all: drop support for Go 1.15.x (#265) 3 years ago
test.txt testdata: reduce the cost of short tests 3 years ago
tiny.txt use hashWith for obfuscation position information 3 years ago