Closed parkr closed 6 years ago
I can't build the gddo-server
binary starting with https://github.com/golang/gddo/commit/abcff8962b91e0c6ebbfdeeb6dc963ea6f636e79. cc @dsymonds
Taking a look at https://go-review.googlesource.com/c/gddo/+/114775, the TryBot was not re-run after the first failure. Perhaps the tests are still failing?
FROM golang:1.10.2
RUN go get -d github.com/golang/gddo/gddo-server
RUN cd /go/src/github.com/golang/gddo && \
git fetch -q origin && \
git checkout -q --force abcff8962b91e0c6ebbfdeeb6dc963ea6f636e79
RUN go install github.com/golang/gddo/gddo-server
ADD exe/run.sh /usr/bin/docker-entrypoint.sh
CMD /usr/bin/docker-entrypoint.sh
exe/run.sh
is:
#!/bin/sh
if [ -z "$REDIS_URL" ]; then
echo "You must set a REDIS_URL env var" >&2
exit 1
fi
if [ -z "$HTTP_ADDR" ]; then
echo "You must set a HTTP_ADDR env var" >&2
exit 1
fi
/bin/gddo-server \
--assets /assets \
--db-server "$REDIS_URL" \
--db-log \
--http "$HTTP_ADDR" \
--robot "9e99" \
--trust_proxy_headers "$@"
Are you able to verify that it worked before abcff89?
I can't see how it could have caused a duplicate HTTP registration (note that godoc.org is currently running this code quite happily). abcff89 adds an explicit dependency on cloud.google.com/go/pubsub
, and that (via google.golang.org/grpc
) depends on x/net/trace, but gddo-server was already importing cloud.google.com/go/logging
and that also imports the grpc package.
I can reproduce this, though I still don't understand why it is happening.
github.com/golang/gddo
is vendoring golang.org/x/net
. It also vendors google.golang.org/grpc
, which is the only place that imports golang.org/x/net/trace
directly in the gddo repository.
The duplicate registration is coming from a non-vendored golang.org/x/net/trace
. The question is: why is the vendored version of that package not being used in the gddo-server build?
The vendored package broke the build, investigating.
@dsymonds When a vendored package imports another vendored package which is not in its vendor directory, but the importing package's vendor directory (as we have here), is Go smart enough to look in the importing package's vendor directory?
github.com/golang/gddo/gddo-server imports google.golang.org/grpc which imports golang.org/x/net/trace which it does NOT vendor, so it loads from GOPATH
github.com/golang/gddo/gddo-server imports golang.org/x/net/trace which it does vendor, so loads from there
github.com/golang/gddo
vendor/
google.golang.org/
grpc/
golang.org/
x/
net/
trace/
I'm not sure. I don't really use vendoring myself. I expected it would have, though.
Would someone mind taking a look at this? I tested the patch in #557, and it seems to work well.
Right now, following the instructions in Development Environment Setup won't work, as the go install
command errors out. This makes it hard for people to contribute/fix bugs (it took me a while to actually get master running when I was fixing a bug yesterday).
Thanks!
When running a154dc8b46f4e499724277f2ff2e9b41b959198d
gddo-server
on golang 1.10.2 in a docker container, I get:Some googling shows me that this is because
golang.org/x/net/trace
is imported. This package importscloud.google.com/go/trace
which importsx/net/trace
and is deprecated. Is there a way to run this server on golang 1.10.2?