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í 4e79bfc01a
warn when a public package imports a private package (#182)
That is, a package that is built without obfuscation imports an
obfuscated package. This will result in confusing compilation error
messages, because the importer can't find the exported names from the
imported package by their non-obfuscated names:

	> ! garble build ./importer
	[stderr]
	# test/main/importer
	importer/importer.go:5:9: undefined: imported.Name
	exit status 2

Instead, detect this bad input case and provide a nice error:

	public package "test/main/importer" can't depend on obfuscated package "test/main/imported" (matched via GOPRIVATE="test/main/imported")

For now, this is by design. It also makes little sense for a public
package to import an obfuscated package in general, because the public
package would have to leak details about the private package's API and
behavior.

While at it, fix a quirk where we thought the unsafe package could be
private. It can't be, because the runtime package is always public and
it imports the runtime package:

	public package "internal/bytealg" can't depend on obfuscated package "unsafe" (matched via GOPRIVATE="*")

Instead of trying to obfuscate "unsafe" and doing nothing, simply add it
to the neverPrivate list, which is also a better name than
"privateBlacklist" (for #169).

Fixes #164.

Co-authored-by: lu4p <lu4p@pm.me>
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 (#142) 5 years ago
cgo.txt Strip all filename and position info when -tiny is passed (#128) 5 years ago
debugdir.txt Store obfuscated sources in object files (#158) 5 years ago
goprivate.txt warn when a public package imports a private package (#182) 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 Fix bug where structs would get garbled in some packages but not in others (#161) 5 years ago
init.txt testdata: avoid unnecessary deps in init.txt (#166) 5 years ago
ldflags.txt Rewrite renaming logic for private names and reduce length of public names (#135) 5 years ago
literals.txt testdata: avoid 'go build' with -short in literals.txt 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 (#142) 5 years ago
syntax.txt Allow struct fields to be garbled, fixes #48 (#159) 5 years ago
test.txt testdata: set GOPRIVATE in all but two tests (#104) 5 years ago
tiny.txt Print interfaces/pointers when -tiny is used (#170) 5 years ago