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

x/build/cmd/coordinator: clean build fails #20747

Closed
kevinburke opened this issue Jun 21, 2017 · 17 comments
Closed

x/build/cmd/coordinator: clean build fails #20747

kevinburke opened this issue Jun 21, 2017 · 17 comments
Labels
Builders x/build issues (builders, bots, dashboards) FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@kevinburke
Copy link
Contributor

from https://travis-ci.org/kevinburke/build/builds/245548241:

Status: Downloaded newer image for golang:1.8
 ---> 41e7847de71b
Step 2/17 : LABEL maintainer "golang-dev@googlegroups.com"
 ---> Running in 3269c00ccbe7
 ---> 757878332654
Removing intermediate container 3269c00ccbe7
Step 3/17 : RUN go get -d cloud.google.com/go/compute/metadata cloud.google.com/go/datastore cloud.google.com/go/storage &&     cd /go/src/cloud.google.com/go &&     git reset --hard cd0da878c66091060d2e7403abd62192b3e387e0
 ---> Running in b79f51cf935a
HEAD is now at cd0da87 datastore: add field name keys to protobuf struct literals
 ---> b8ee197660fd
Removing intermediate container b79f51cf935a
Step 4/17 : RUN go get -d golang.org/x/perf/storage &&     cd /go/src/golang.org/x/perf &&     git reset --hard b74b45749c47cd1edf5b64df78ecf13bd2dd944f
 ---> Running in 08238ef90ee1
HEAD is now at b74b457 storage: add Context arguments for queries
 ---> 4296bc6171f9
Removing intermediate container 08238ef90ee1
Step 5/17 : RUN go get -d golang.org/x/time/rate &&     cd /go/src/golang.org/x/time/rate &&     git reset --hard f51c12702a4d776e4c1fa9b0fabab841babae631
 ---> Running in d6ffecbc69b3
HEAD is now at f51c127 rate: change doc for ReserveN to reflect its signature
 ---> 5890e3a6f10a
Removing intermediate container d6ffecbc69b3
Step 6/17 : RUN go get -d golang.org/x/oauth2 golang.org/x/oauth2/google &&     cd /go/src/golang.org/x/oauth2 &&     git reset --hard 314dd2c0bf3ebd592ec0d20847d27e79d0dbe8dd
 ---> Running in 54c6938d944c
HEAD is now at 314dd2c golang.org/x/oauth2/jwt: Set kid to KeyID of private key
 ---> c7289af1f99c
Removing intermediate container 54c6938d944c
Step 7/17 : RUN go get -d golang.org/x/crypto/acme/autocert &&     cd /go/src/golang.org/x/crypto &&     git reset --hard 573951cbe80bb6352881271bb276f48749eab6f4
 ---> Running in ca10b370717c
HEAD is now at 573951c ssh: improve client public key authentication
 ---> 8277d426cff8
Removing intermediate container ca10b370717c
Step 8/17 : RUN go get -d go4.org/syncutil &&     cd /go/src/go4.org &&     git reset --hard 7ce08ca145dbe0e66a127c447b80ee7914f3e4f9
 ---> Running in 5ec55a569bfd
HEAD is now at 7ce08ca Added Solaris to the list of builds that are compatible with 'lock_unix'.
 ---> edee140c90ff
Removing intermediate container 5ec55a569bfd
Step 9/17 : RUN go get -d golang.org/x/net/context &&     cd /go/src/golang.org/x/net &&     git reset --hard f2499483f923065a842d38eb4c7f1927e6fc6e6d
 ---> Running in d60bf0fb1aff
HEAD is now at f249948 idna: Revert "use code generated by internal x/text package"
 ---> a2bff8b2e4ac
Removing intermediate container d60bf0fb1aff
Step 10/17 : RUN go get -d google.golang.org/api/container/v1 google.golang.org/api/compute/v1 google.golang.org/api/googleapi &&     cd /go/src/google.golang.org/api &&     git reset --hard dfa61ae24628a06502b9c2805d983b57e89399b5
 ---> Running in b92c5c89eb74
HEAD is now at dfa61ae all: regenerate all APIs
 ---> 7d77512a0f74
Removing intermediate container b92c5c89eb74
Step 11/17 : RUN go get -d google.golang.org/genproto/googleapis/type/latlng google.golang.org/genproto/googleapis/datastore/v1 &&     cd /go/src/google.golang.org/genproto  &&     git reset --hard b3e7c2fb04031add52c4817f53f43757ccbf9c18
 ---> Running in ae12d1e406fd
HEAD is now at b3e7c2f use proto's go_package option (#17)
 ---> e6407fee07f8
Removing intermediate container ae12d1e406fd
Step 12/17 : RUN go get -d gopkg.in/inf.v0 &&     cd /go/src/gopkg.in/inf.v0 &&     git reset --hard 3887ee99ecf07df5b447e9b00d9c0b2adaa9f3e4
 ---> Running in 28dc348d19cc
HEAD is now at 3887ee9 clarify license
 ---> d61c04f05ce6
Removing intermediate container 28dc348d19cc
Step 13/17 : RUN cd /go/src/google.golang.org/grpc &&     git reset --hard 50955793b0183f9de69bd78e2ec251cf20aab121
 ---> Running in 911db26fea63
HEAD is now at 5095579 Debugging tests for AuthInfo (#1046)
 ---> 83c8ff38a583
Removing intermediate container 911db26fea63
Step 14/17 : RUN go get grpc.go4.org &&     cd /go/src/grpc.go4.org && git reset --hard 11d0a25b491971beb5a4625ea7856a3c4afaafa5
 ---> Running in 54e1e9abd84a
HEAD is now at 11d0a25 all: change import path to grpc.go4.org
 ---> d1f5d584ac6c
Removing intermediate container 54e1e9abd84a
Step 15/17 : ARG version=unknown
 ---> Running in ca1a2bd98c94
 ---> f8f747302b1b
Removing intermediate container ca1a2bd98c94
Step 16/17 : COPY . /go/src/golang.org/x/build/
 ---> f51572020cc8
Removing intermediate container b91ad987ee72
Step 17/17 : RUN go install -ldflags "-linkmode=external -extldflags '-static -pthread' -X 'main.Version=$version'" golang.org/x/build/cmd/coordinator
 ---> Running in 523b7e884ce0
src/github.com/googleapis/gax-go/call_option.go:38:2: cannot find package "google.golang.org/grpc/status" in any of:
	/usr/local/go/src/google.golang.org/grpc/status (from $GOROOT)
	/go/src/google.golang.org/grpc/status (from $GOPATH)
Removing intermediate container 523b7e884ce0
The command '/bin/sh -c go install -ldflags "-linkmode=external -extldflags '-static -pthread' -X 'main.Version=$version'" golang.org/x/build/cmd/coordinator' returned a non-zero code: 1
make: *** [build0] Error 1
@kevinburke
Copy link
Contributor Author

Working on a fix now.

@gopherbot gopherbot added this to the Unreleased milestone Jun 21, 2017
@gopherbot gopherbot added the Builders x/build issues (builders, bots, dashboards) label Jun 21, 2017
@bradfitz
Copy link
Contributor

I don't understand what failure you're reporting.

How can I reproduce?

(Everything seems to build fine for me.)

@kevinburke
Copy link
Contributor Author

kevinburke commented Jun 23, 2017

In a $GOPATH with no dependencies downloaded, cd cmd/coordinator && make docker-dev errors with the above error.

@bradfitz
Copy link
Contributor

I tried both:

  1. an empty $GOPATH + go install golang.org/x/build/cmd/coordinator
    and
  2. an empty $GOPATH, then add to it only golang.org/x/build, then cd cmd/coordinator && make docker-dev.

Both (1) and (2) work.

And I see no reason why (2) would ever fail, since it's in Docker and doesn't use your $GOPATH.

@bradfitz
Copy link
Contributor

Oh, and both (1) and (2) were with Go 1.8.

Does it require tip?

@kevinburke
Copy link
Contributor Author

Let me see if I can reproduce. I can reproduce it currently in Travis CI using this file

$ cat .travis.yml
sudo: required
language: go
go_import_path: golang.org/x/build

services:
  - docker

before_install:
  # Hack to work around https://github.com/golang/go/issues/20423.
  - go get go4.org/syncutil

go:
  - 1.8
  - tip

script:
  - go vet ./... || true
  - go test -v -race ./...
  - pushd cmd/coordinator && make docker-dev && popd
  - pushd cmd/gitmirror && make docker-dev && popd
  - pushd cmd/gopherbot && make docker-dev && popd
  - pushd cmd/pubsubhelper && make docker-dev && popd
  - pushd devapp/devappserver && make docker-dev && popd
  - pushd maintner/maintnerd && make docker-dev && popd

@kevinburke
Copy link
Contributor Author

(It fails on both Go 1.8 and tip in Travis CI)

@bradfitz
Copy link
Contributor

I wonder if it's your before_install of go get go4.org/ANYTHING that's the problem there.

@bradfitz
Copy link
Contributor

I can't reproduce my earlier attempts using Go tip.

@bradfitz
Copy link
Contributor

(That is, it works for me with both Go 1.8 and Go tip, without Travis)

@kevinburke
Copy link
Contributor Author

kevinburke commented Jun 23, 2017

I was able to reproduce it with the following script on my Mac:

#!/usr/bin/env bash

set -eo pipefail

main() {
    rm -rf "$HOME/tmp/go"
    mkdir -p "$HOME/tmp/go/src/golang.org/x"
    export GOPATH="$HOME/tmp/go"
    pushd "$HOME/tmp/go/src/golang.org/x"
        git clone https://go.googlesource.com/build
        pushd build/cmd/coordinator
            env | grep GOPATH # just checking
            make docker-dev
        popd
    popd
}

main "$@"

That prints the following error:

Step 17/17 : RUN go install -ldflags "-linkmode=external -extldflags '-static -pthread' -X 'main.Version=$version'" golang.org/x/build/cmd/coordinator
 ---> Running in d2e0e8e00097
src/github.com/googleapis/gax-go/call_option.go:38:2: cannot find package "google.golang.org/grpc/status" in any of:
	/usr/local/go/src/google.golang.org/grpc/status (from $GOROOT)
	/go/src/google.golang.org/grpc/status (from $GOPATH)

If that doesn't reproduce it, maybe Docker is caching an older, correct, image, on your machine.

@bradfitz
Copy link
Contributor

bradfitz commented Jul 7, 2017

@cybrcodr just encountered this and came to the same conclusion: that my local Docker cache is just getting lucky.

He writes:

My git rev is at the same commit d59834090c8e8cf6f4eff02e9433f27274d2b84e as yours. Previous attempt was on my Goobuntu host. I decided to try it out on my Mac instead. I encountered the same issue. So, I dug in to find the culprit and here's what I've figured out.

"go get -d cloud.google.com/go/compute/metadata" pulls in latest "github.com/googleapis/gax-go". Latest commit to github.com/googleapis/gax-go pulls in google.golang.org/grpc/status ...

googleapis/gax-go@84ed267

By pinning github.com/googleapis/gax-go to the previous commit ...

$ git diff Dockerfile.0
diff --git a/cmd/coordinator/Dockerfile.0 b/cmd/coordinator/Dockerfile.0
index 986881e..a8e399b 100644
--- a/cmd/coordinator/Dockerfile.0
+++ b/cmd/coordinator/Dockerfile.0
@@ -13,6 +13,10 @@ RUN go get -d cloud.google.com/go/compute/metadata cloud.google.com/go/datastore
     cd /go/src/cloud.google.com/go && \
     git reset --hard cd0da878c66091060d2e7403abd62192b3e387e0

+RUN go get -d github.com/googleapis/gax-go && \
+    cd /go/src/github.com/googleapis/gax-go && \
+    git reset --hard e6c452d1a33fcea46ab9cfd3058ee858297ac13a
+

I am now able to make build0. As for why you're not seeing the same issue, my guess is that because your build is using cache. Add --no-cache on docker build invocations and see if you can reproduce the issue I raised ...

[...]

I think the challenge here is that while we do reset certain repos at a particular commit version, the transitive dependencies are not pinned and may clash with repos that are pinned.

@kevinburke
Copy link
Contributor Author

Ok - Hopefully the CL I submitted should fix this...

@bradfitz
Copy link
Contributor

bradfitz commented Jul 7, 2017

Which CL?

@gopherbot
Copy link

CL https://golang.org/cl/46395 mentions this issue.

@kevinburke
Copy link
Contributor Author

Ugh, I forgot the golang/go preamble. See linked.

kevinburke added a commit to kevinburke/build that referenced this issue Jul 8, 2017
…dencies

These builds don't come up cleanly in Travis CI. I'm not sure whether
the build is failing normally.

Fixes golang/go#20747

Change-Id: I74beeb7edbbe06c58f0cec75a652c724c02df4e3
kevinburke added a commit to kevinburke/build that referenced this issue Jul 8, 2017
…dencies

These builds don't come up cleanly in Travis CI. I'm not sure whether
the build is failing normally.

Fixes golang/go#20747

Change-Id: I74beeb7edbbe06c58f0cec75a652c724c02df4e3
@bradfitz bradfitz added the NeedsFix The path to resolution is known, but the work has not been done. label Jul 10, 2017
@bradfitz bradfitz self-assigned this Jul 10, 2017
@gopherbot
Copy link

CL https://golang.org/cl/47971 mentions this issue.

@golang golang locked and limited conversation to collaborators Jul 13, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Builders x/build issues (builders, bots, dashboards) FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

3 participants