tool/gocross: support running from outside the repo dir
A bunch of us invoke tool/go from outside the repo that hosts gocross, as a way of accessing our version-controlled toolchain. This removes assumptions from gocross that it's being invoked within the repository that contains its source code and toolchain configuration. Fixes tailscale/corp#9627 Signed-off-by: David Anderson <danderson@tailscale.com>
This commit is contained in:
committed by
Dave Anderson
parent
df02bb013a
commit
e7a78bc28f
@@ -19,6 +19,13 @@ fi
|
||||
(
|
||||
repo_root="$(dirname $0)/../.."
|
||||
|
||||
# Figuring out if gocross needs a rebuild, as well as the rebuild itself, need
|
||||
# to happen with CWD inside this repo. Since we're in a subshell entirely
|
||||
# dedicated to wrangling gocross and toolchains, cd over now before doing
|
||||
# anything further so that the rest of this logic works the same if gocross is
|
||||
# being invoked from somewhere else.
|
||||
cd "$repo_root"
|
||||
|
||||
toolchain="$HOME/.cache/tailscale-go"
|
||||
|
||||
if [ -d "$toolchain" ]; then
|
||||
|
||||
Reference in New Issue
Block a user