This makes gocross and its bootstrap script understand an absolute
path in go.toolchain.rev to mean "use the given toolchain directly".
Signed-off-by: David Anderson <danderson@tailscale.com>
We need to build gocross from multiple repos, but Go's innate
git hash embedding only works when you build gocross from this repo,
not when you build it from elsewhere via 'go build
tailscale.com/tool/gocross'. Instead, explicitly embed the version
found with 'git rev-parse HEAD', which will work from any git repo.
Signed-off-by: David Anderson <danderson@tailscale.com>
This avoids accidentally overwriting variables from the input
environment, which might non-deterministically change the behavior
of gocross.
Signed-off-by: David Anderson <danderson@tailscale.com>
Turns out directing the printed script into the bootstrap location leads
to irritating "text file busy" problems and then having to muck about with
tempfiles and chmod and all that. Instead, have gocross write everything
with the right values.
Signed-off-by: David Anderson <danderson@tailscale.com>
So that when importing and using gocross from other repos, there's
an easy way to get at the right wrapper script that's in sync with
the gocross binary.
Signed-off-by: David Anderson <danderson@tailscale.com>