check that the go stdlib was built with the required options
AFAICT, go build tags are a compile-time only construct, so there is no way to query whether a certain package was built with a specific tag. However, the 'netgo' tag triggers conditional compilation of the cgo_stubs.go file, and that file name ends up in the executable. (we could have looked for specific symbols in the 'net.a' library instead, but that requires locating it first, which is more hassle than it is worth) issue #93
This commit is contained in:
1 parent
7b02365de8
commit
cf9c479727
1 file changed
+7
@@ -8,6 +8,13 @@ all: docker-image
|
||||
weaver: ../*.go main.go
|
||||
go get -tags netgo
|
||||
go build -ldflags '-extldflags "-static"' -tags netgo
|
||||
@strings $@ | grep cgo_stub\\\.go >/dev/null || { \
|
||||
rm $@; \
|
||||
echo "\nYour go standard library was built without the 'netgo' build tag."; \
|
||||
echo "To fix that, run"; \
|
||||
echo " sudo go install -a -tags netgo std"; \
|
||||
false; \
|
||||
}
|
||||
|
||||
.PHONY: docker-image
|
||||
docker-image: /var/tmp/weave.tar
|
||||
|
||||
Reference in new issue
Block a user