Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes building scope outside of a container. #901

Merged
merged 2 commits into from
Feb 15, 2016

Conversation

foot
Copy link
Contributor

@foot foot commented Feb 2, 2016

Fixes #900

@peterbourgon
Copy link
Contributor

I don't think an export in a Makefile is a good idea. Typically you'll do something like

GO ?= env GO15VENDOREXPERIMENT=1 go

target:
    $(GO) build

but I defer to either @paulbellamy or @tomwilkie on this.

@peterbourgon peterbourgon removed their assignment Feb 2, 2016
@foot
Copy link
Contributor Author

foot commented Feb 9, 2016

Yes! I will update this PR w/ Peter's suggestion!

@davkal
Copy link
Contributor

davkal commented Feb 9, 2016

Running this, still wants to build the docker container:

$ make SUDO= BUILD_IN_CONTAINER=0
time go build -i -ldflags "-extldflags \"-static\" -X main.version=abba6cf" -tags netgo -o prog/scope ./prog

real    0m44.775s
user    1m19.340s
sys 0m8.134s
cp prog/scope vendor/runsvinit/runsvinit docker/
cp .pkg/docker-1.6.2.tgz docker/docker.tgz
docker build -t weaveworks/scope docker/
Post http://%2Fvar%2Frun%2Fdocker.sock/v1.20/build?cgroupparent=&cpuperiod=0&cpuquota=0&cpusetcpus=&cpusetmems=&cpushares=0&dockerfile=Dockerfile&memory=0&memswap=0&rm=1&t=weaveworks%2Fscope&ulimits=null: dial unix /var/run/docker.sock: connect: no such file or directory.
* Are you trying to connect to a TLS-enabled daemon without TLS?
* Is your docker daemon up and running?
make: *** [scope.tar] Error 1

On the other hand, if I just run the following in master (without GO15VENDOREXPERIMENT) everything is fine:

$ make BUILD_IN_CONTAINER=false prog/scope
time go build -i -ldflags "-extldflags \"-static\" -X main.version=1b554ba" -tags netgo -o prog/scope ./prog

real    0m14.122s
user    0m14.997s
sys 0m2.795s

Is this PR still needed?

@foot
Copy link
Contributor Author

foot commented Feb 11, 2016

That is weird! Doesn't work for me on master =/

I will update this PR though.

ewq:~/weave/src/github.com/weaveworks/scope(master $%=)$ make BUILD_IN_CONTAINER=false prog/scope
time go build -i -ldflags "-extldflags \"-static\" -X main.version=05d4ce0" -tags netgo -o prog/scope ./prog
# k8s.io/kubernetes/pkg/util/parsers
../../../k8s.io/kubernetes/pkg/util/parsers/parsers.go:30: undefined: parsers.ParseRepositoryTag
# github.com/weaveworks/scope/probe/docker
probe/docker/registry.go:69: undefined: docker.CloseWaiter
probe/docker/registry.go:71: undefined: docker.CloseWaiter
probe/docker/registry.go:75: cannot use *docker.Client as type Client in return argument:
        *docker.Client does not implement Client (missing AttachToContainerNonBlocking method)

real    0m1.927s
user    0m0.825s
sys     0m0.585s
make: *** [prog/scope] Error 2

@foot
Copy link
Contributor Author

foot commented Feb 15, 2016

@peterbourgon can you have another quick look when you get a sec. Ta!

@peterbourgon
Copy link
Contributor

So all this does is enforce GO15VENDOREXPERIMENT? — If yes, LGTM once Circle is green.

foot added a commit that referenced this pull request Feb 15, 2016
…ainer

Fixes building scope outside of a container.
@foot foot merged commit 0ebefe0 into master Feb 15, 2016
@foot foot deleted the 900-fix-building-outside-container branch February 22, 2016 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants