Makefile: add assertion to ensure the go toolchain is correct

This should provide an earlier error for cases such as
tailscale/tailscale#8987 if the error comes from a failure to fetch the
toolchain, or a change that forces an alternative GOROOT by some other
means.

Updates tailscale/tailscale#8987
raggi/assert-goroot
James Tucker 1 year ago
parent c73f8533f0
commit 867a0f062b
No known key found for this signature in database

@ -123,7 +123,11 @@ androidpath:
@echo "export ANDROID_SDK_ROOT=$(ANDROID_SDK_ROOT)" @echo "export ANDROID_SDK_ROOT=$(ANDROID_SDK_ROOT)"
@echo 'export PATH=$(ANDROID_HOME)/cmdline-tools/latest/bin:$(ANDROID_HOME)/platform-tools:$$PATH' @echo 'export PATH=$(ANDROID_HOME)/cmdline-tools/latest/bin:$(ANDROID_HOME)/platform-tools:$$PATH'
# Assert that the go toolchain referred to by TOOLCHAINDIR is in fact the
# one that `go` in the current PATH is using.
toolchain: $(TOOLCHAINDIR)/bin/go toolchain: $(TOOLCHAINDIR)/bin/go
test `go env GOROOT` = $(TOOLCHAINDIR)
android/libs: android/libs:
mkdir -p android/libs mkdir -p android/libs

Loading…
Cancel
Save