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í 63c42c3cc7
support typechecking all of std (#236)
There was one bug keeping the command below from working:

	GOPRIVATE='*' garble build std

The bug is rather obscure; I'm still working on a minimal reproducer
that I can submit upstream, and I'm not yet convinced about where the
bug lives and how it can be fixed.

In short, the command would fail with:

	typecheck error: /go/src/crypto/ecdsa/ecdsa.go:122:12: cannot use asn1.SEQUENCE (constant 48 of type asn1.Tag) as asn1.Tag value in argument to b.AddASN1

Note that the error is ambiguous; there are two asn1 packages, but they
are actually mismatching. We can see that by manually adding debug
prints to go/types:

	constant: asn1.SEQUENCE (constant 48 of type golang.org/x/crypto/cryptobyte/asn1.Tag)
	argument type: vendor/golang.org/x/crypto/cryptobyte/asn1.Tag

It's clear that, for some reason, go/types ends up confused and loading
a vendored and non-vendored version of asn1. There also seems to be no
way to work around this with our lookup function, as it just receives an
import path as a parameter, and returns an object file reader.

For now, work around the issue by *not* using a custom lookup function
in this rare edge case involving vendored dependencies in std packages.
The added code has a lengthy comment explaining the reasoning.

I still intend to investigate this further, but there's no reason to
keep garble failing if we can work around the bug.

Fixes #223.
5 years ago
..
asm.txt testdata: don't let tests rely on rewriting mod files 5 years ago
basic.txt obfuscate unexported names like exported ones (#227) 5 years ago
cgo.txt testdata: don't let tests rely on rewriting mod files 5 years ago
debugdir.txt testdata: don't let tests rely on rewriting mod files 5 years ago
goprivate.txt support typechecking all of std (#236) 5 years ago
goversion.txt testdata: simplify goversion test (#232) 5 years ago
help.txt include a "garble version" test (#221) 5 years ago
implement.txt testdata: don't let tests rely on rewriting mod files 5 years ago
imports.txt make the handling of import paths more robust 5 years ago
init.txt testdata: add test case for init funcs in many files (#208) 5 years ago
ldflags.txt testdata: don't let tests rely on rewriting mod files 5 years ago
linkname.txt fixed some bugs related to additional linkname corner cases (#210) 5 years ago
literals.txt do not try to obfuscate huge literals (#204) 5 years ago
modinfo.txt testdata: don't let tests rely on rewriting mod files 5 years ago
plugin.txt testdata: don't let tests rely on rewriting mod files 5 years ago
reverse.txt reverse: support unexported names and package paths (#233) 5 years ago
seed.txt testdata: don't let tests rely on rewriting mod files 5 years ago
syntax.txt avoid panic on funcs that almost look like tests (#235) 5 years ago
test.txt testdata: don't let tests rely on rewriting mod files 5 years ago
tiny.txt testdata: don't let tests rely on rewriting mod files 5 years ago