golang / go

The Go programming language
https://go.dev
BSD 3-Clause "New" or "Revised" License
124.02k stars 17.68k forks source link

cmd/go: can't build go subrepos and goprotobuf with gccgo #3228

Closed alberts closed 9 years ago

alberts commented 12 years ago
What steps will reproduce the problem?

I have a deps directory with all the Go subrepos and goprotobuf:

$ find ~/deps -type d | grep -v /.hg/
deps
deps/src
deps/src/code.google.com
deps/src/code.google.com/p
deps/src/code.google.com/p/go.crypto
deps/src/code.google.com/p/go.crypto/xtea
deps/src/code.google.com/p/go.crypto/.hg
deps/src/code.google.com/p/go.crypto/md4
deps/src/code.google.com/p/go.crypto/pbkdf2
deps/src/code.google.com/p/go.crypto/ripemd160
deps/src/code.google.com/p/go.crypto/ocsp
deps/src/code.google.com/p/go.crypto/bcrypt
deps/src/code.google.com/p/go.crypto/ssh
deps/src/code.google.com/p/go.crypto/cast5
deps/src/code.google.com/p/go.crypto/twofish
deps/src/code.google.com/p/go.crypto/blowfish
deps/src/code.google.com/p/go.crypto/openpgp
deps/src/code.google.com/p/go.crypto/openpgp/elgamal
deps/src/code.google.com/p/go.crypto/openpgp/errors
deps/src/code.google.com/p/go.crypto/openpgp/packet
deps/src/code.google.com/p/go.crypto/openpgp/armor
deps/src/code.google.com/p/go.crypto/openpgp/s2k
deps/src/code.google.com/p/go.crypto/openpgp/clearsign
deps/src/code.google.com/p/go.net
deps/src/code.google.com/p/go.net/.hg
deps/src/code.google.com/p/go.net/dict
deps/src/code.google.com/p/go.net/spdy
deps/src/code.google.com/p/go.net/websocket
deps/src/code.google.com/p/goprotobuf
deps/src/code.google.com/p/goprotobuf/lib
deps/src/code.google.com/p/goprotobuf/lib/codereview
deps/src/code.google.com/p/goprotobuf/.hg
deps/src/code.google.com/p/goprotobuf/protoc-gen-go
deps/src/code.google.com/p/goprotobuf/protoc-gen-go/testdata
deps/src/code.google.com/p/goprotobuf/protoc-gen-go/testdata/my_test
deps/src/code.google.com/p/goprotobuf/protoc-gen-go/plugin
deps/src/code.google.com/p/goprotobuf/protoc-gen-go/descriptor
deps/src/code.google.com/p/goprotobuf/protoc-gen-go/generator
deps/src/code.google.com/p/goprotobuf/proto
deps/src/code.google.com/p/goprotobuf/proto/testdata

What is the expected output?

GOPATH=~/deps go install -v code.google.com/...
code.google.com/p/go.crypto/blowfish
code.google.com/p/go.crypto/cast5
code.google.com/p/go.crypto/md4
code.google.com/p/go.crypto/ocsp
code.google.com/p/go.crypto/openpgp/errors
code.google.com/p/go.crypto/openpgp/elgamal
code.google.com/p/go.crypto/pbkdf2
code.google.com/p/go.crypto/ripemd160
code.google.com/p/go.crypto/ssh
code.google.com/p/go.crypto/twofish
code.google.com/p/go.crypto/xtea
code.google.com/p/go.net/dict
code.google.com/p/go.net/spdy
code.google.com/p/go.net/websocket
code.google.com/p/goprotobuf/proto
code.google.com/p/go.crypto/openpgp/armor
code.google.com/p/go.crypto/openpgp/s2k
code.google.com/p/go.crypto/bcrypt
code.google.com/p/go.crypto/openpgp/packet
code.google.com/p/goprotobuf/protoc-gen-go/descriptor
code.google.com/p/go.crypto/openpgp
code.google.com/p/go.crypto/openpgp/clearsign
code.google.com/p/goprotobuf/protoc-gen-go/plugin
code.google.com/p/goprotobuf/protoc-gen-go/generator
code.google.com/p/goprotobuf/protoc-gen-go

What do you see instead?

GOPATH=~/deps go install -compiler=gccgo -v code.google.com/...
code.google.com/p/go.crypto/bcrypt
code.google.com/p/go.crypto/openpgp/armor
code.google.com/p/go.crypto/openpgp/s2k
code.google.com/p/goprotobuf/protoc-gen-go/descriptor
# code.google.com/p/go.crypto/openpgp/s2k
deps/src/code.google.com/p/go.crypto/openpgp/s2k/s2k.go:10:44: error: import file
‘code.google.com/p/go.crypto/openpgp/errors’ not found
deps/src/code.google.com/p/go.crypto/openpgp/s2k/s2k.go:92:15: error: reference to
undefined name ‘errors’
deps/src/code.google.com/p/go.crypto/openpgp/s2k/s2k.go:96:15: error: reference to
undefined name ‘errors’
deps/src/code.google.com/p/go.crypto/openpgp/s2k/s2k.go:126:14: error: reference to
undefined name ‘errors’
# code.google.com/p/go.crypto/bcrypt
deps/src/code.google.com/p/go.crypto/bcrypt/bcrypt.go:11:38: error: import file
‘code.google.com/p/go.crypto/blowfish’ not found
deps/src/code.google.com/p/go.crypto/bcrypt/bcrypt.go:196:77: error: expected package
deps/src/code.google.com/p/go.crypto/bcrypt/bcrypt.go:179:12: error: number of results
does not match number of values
deps/src/code.google.com/p/go.crypto/bcrypt/bcrypt.go:200:3: error: too many values in
return statement
deps/src/code.google.com/p/go.crypto/bcrypt/bcrypt.go:207:12: error: reference to
undefined name ‘blowfish’
deps/src/code.google.com/p/go.crypto/bcrypt/bcrypt.go:209:3: error: too many values in
return statement
deps/src/code.google.com/p/go.crypto/bcrypt/bcrypt.go:214:3: error: reference to
undefined name ‘blowfish’
deps/src/code.google.com/p/go.crypto/bcrypt/bcrypt.go:215:3: error: reference to
undefined name ‘blowfish’
deps/src/code.google.com/p/go.crypto/bcrypt/bcrypt.go:218:2: error: too many values in
return statement
# code.google.com/p/go.crypto/openpgp/armor
deps/src/code.google.com/p/go.crypto/openpgp/armor/armor.go:12:44: error: import file
‘code.google.com/p/go.crypto/openpgp/errors’ not found
deps/src/code.google.com/p/go.crypto/openpgp/armor/armor.go:38:26: error: reference to
undefined name ‘errors’
# code.google.com/p/goprotobuf/protoc-gen-go/descriptor
deps/src/code.google.com/p/goprotobuf/protoc-gen-go/descriptor/descriptor.pb.go:6:8:
error: import file ‘code.google.com/p/goprotobuf/proto’ not found
deps/src/code.google.com/p/goprotobuf/protoc-gen-go/descriptor/descriptor.pb.go:286:35:
error: expected package
deps/src/code.google.com/p/goprotobuf/protoc-gen-go/descriptor/descriptor.pb.go:287:22:
error: expected ‘,’ or ‘}’
deps/src/code.google.com/p/goprotobuf/protoc-gen-go/descriptor/descriptor.pb.go:290:50:
error: expected package
deps/src/code.google.com/p/goprotobuf/protoc-gen-go/descriptor/descriptor.pb.go:317:38:
error: expected package
deps/src/code.google.com/p/goprotobuf/protoc-gen-go/descriptor/descriptor.pb.go:318:22:
error: expected ‘,’ or ‘}’
deps/src/code.google.com/p/goprotobuf/protoc-gen-go/descriptor/descriptor.pb.go:321:53:
error: expected package
deps/src/code.google.com/p/goprotobuf/protoc-gen-go/descriptor/descriptor.pb.go:348:36:
error: expected package
deps/src/code.google.com/p/goprotobuf/protoc-gen-go/descriptor/descriptor.pb.go:349:22:
error: expected ‘,’ or ‘}’
deps/src/code.google.com/p/goprotobuf/protoc-gen-go/descriptor/descriptor.pb.go:352:51:
error: expected package
deps/src/code.google.com/p/goprotobuf/protoc-gen-go/descriptor/descriptor.pb.go:376:35:
error: expected package
deps/src/code.google.com/p/goprotobuf/protoc-gen-go/descriptor/descriptor.pb.go:377:22:
error: expected ‘,’ or ‘}’
deps/src/code.google.com/p/goprotobuf/protoc-gen-go/descriptor/descriptor.pb.go:380:50:
error: expected package
deps/src/code.google.com/p/goprotobuf/protoc-gen-go/descriptor/descriptor.pb.go:401:40:
error: expected package
deps/src/code.google.com/p/goprotobuf/protoc-gen-go/descriptor/descriptor.pb.go:402:22:
error: expected ‘,’ or ‘}’
deps/src/code.google.com/p/goprotobuf/protoc-gen-go/descriptor/descriptor.pb.go:405:55:
error: expected package
deps/src/code.google.com/p/goprotobuf/protoc-gen-go/descriptor/descriptor.pb.go:424:38:
error: expected package
deps/src/code.google.com/p/goprotobuf/protoc-gen-go/descriptor/descriptor.pb.go:425:22:
error: expected ‘,’ or ‘}’
deps/src/code.google.com/p/goprotobuf/protoc-gen-go/descriptor/descriptor.pb.go:428:53:
error: expected package
deps/src/code.google.com/p/goprotobuf/protoc-gen-go/descriptor/descriptor.pb.go:447:37:
error: expected package
deps/src/code.google.com/p/goprotobuf/protoc-gen-go/descriptor/descriptor.pb.go:448:22:
error: expected ‘,’ or ‘}’
deps/src/code.google.com/p/goprotobuf/protoc-gen-go/descriptor/descriptor.pb.go:451:52:
error: expected package
deps/src/code.google.com/p/goprotobuf/protoc-gen-go/descriptor/descriptor.pb.go:10:9:
error: reference to undefined name ‘proto’
deps/src/code.google.com/p/goprotobuf/protoc-gen-go/descriptor/descriptor.pb.go:82:9:
error: reference to undefined name ‘proto’
deps/src/code.google.com/p/goprotobuf/protoc-gen-go/descriptor/descriptor.pb.go:109:9:
error: reference to undefined name ‘proto’
deps/src/code.google.com/p/goprotobuf/protoc-gen-go/descriptor/descriptor.pb.go:136:9:
error: reference to undefined name ‘proto’
deps/src/code.google.com/p/goprotobuf/protoc-gen-go/descriptor/descriptor.pb.go:163:9:
error: reference to undefined name ‘proto’
deps/src/code.google.com/p/goprotobuf/protoc-gen-go/descriptor/descriptor.pb.go:172:57:
error: reference to undefined name ‘proto’
deps/src/code.google.com/p/goprotobuf/protoc-gen-go/descriptor/descriptor.pb.go:189:59:
error: reference to undefined name ‘proto’
deps/src/code.google.com/p/goprotobuf/protoc-gen-go/descriptor/descriptor.pb.go:203:55:
error: reference to undefined name ‘proto’
deps/src/code.google.com/p/goprotobuf/protoc-gen-go/descriptor/descriptor.pb.go:212:70:
error: reference to undefined name ‘proto’
deps/src/code.google.com/p/goprotobuf/protoc-gen-go/descriptor/descriptor.pb.go:227:60:
error: reference to undefined name ‘proto’
deps/src/code.google.com/p/goprotobuf/protoc-gen-go/descriptor/descriptor.pb.go:237:59:
error: reference to undefined name ‘proto’
deps/src/code.google.com/p/goprotobuf/protoc-gen-go/descriptor/descriptor.pb.go:247:64:
error: reference to undefined name ‘proto’
deps/src/code.google.com/p/goprotobuf/protoc-gen-go/descriptor/descriptor.pb.go:257:62:
error: reference to undefined name ‘proto’
deps/src/code.google.com/p/goprotobuf/protoc-gen-go/descriptor/descriptor.pb.go:268:61:
error: reference to undefined name ‘proto’
deps/src/code.google.com/p/goprotobuf/protoc-gen-go/descriptor/descriptor.pb.go:284:51:
error: reference to undefined name ‘proto’
deps/src/code.google.com/p/goprotobuf/protoc-gen-go/descriptor/descriptor.pb.go:315:54:
error: reference to undefined name ‘proto’
deps/src/code.google.com/p/goprotobuf/protoc-gen-go/descriptor/descriptor.pb.go:346:52:
error: reference to undefined name ‘proto’
deps/src/code.google.com/p/goprotobuf/protoc-gen-go/descriptor/descriptor.pb.go:374:51:
error: reference to undefined name ‘proto’
deps/src/code.google.com/p/goprotobuf/protoc-gen-go/descriptor/descriptor.pb.go:399:56:
error: reference to undefined name ‘proto’
deps/src/code.google.com/p/goprotobuf/protoc-gen-go/descriptor/descriptor.pb.go:422:54:
error: reference to undefined name ‘proto’
deps/src/code.google.com/p/goprotobuf/protoc-gen-go/descriptor/descriptor.pb.go:445:53:
error: reference to undefined name ‘proto’
deps/src/code.google.com/p/goprotobuf/protoc-gen-go/descriptor/descriptor.pb.go:472:59:
error: reference to undefined name ‘proto’
deps/src/code.google.com/p/goprotobuf/protoc-gen-go/descriptor/descriptor.pb.go:481:68:
error: reference to undefined name ‘proto’
deps/src/code.google.com/p/goprotobuf/protoc-gen-go/descriptor/descriptor.pb.go:484:2:
error: reference to undefined name ‘proto’
deps/src/code.google.com/p/goprotobuf/protoc-gen-go/descriptor/descriptor.pb.go:485:2:
error: reference to undefined name ‘proto’
deps/src/code.google.com/p/goprotobuf/protoc-gen-go/descriptor/descriptor.pb.go:486:2:
error: reference to undefined name ‘proto’
deps/src/code.google.com/p/goprotobuf/protoc-gen-go/descriptor/descriptor.pb.go:487:2:
error: reference to undefined name ‘proto’

Which compiler are you using (5g, 6g, 8g, gccgo)?

gccgo

Which operating system are you using?

linux

Which revision are you using?  (hg identify)

4346881f5c9d tip

also tip of gccgo
alberts commented 12 years ago

Comment 1:

It seems some of these missing packages are ending up in $GOROOT/pkg/gccgo.
This works:
GOROOT= GOPATH=~/deps go install -compiler=gccgo -v code.google.com/...
code.google.com/p/go.crypto/blowfish
code.google.com/p/go.crypto/cast5
code.google.com/p/go.crypto/md4
code.google.com/p/go.crypto/ocsp
code.google.com/p/go.crypto/openpgp/errors
code.google.com/p/go.crypto/openpgp/elgamal
code.google.com/p/go.crypto/pbkdf2
code.google.com/p/go.crypto/ripemd160
code.google.com/p/go.crypto/ssh
code.google.com/p/go.crypto/twofish
code.google.com/p/go.crypto/xtea
code.google.com/p/go.net/dict
code.google.com/p/go.net/spdy
code.google.com/p/go.net/websocket
code.google.com/p/goprotobuf/proto
code.google.com/p/go.crypto/openpgp/armor
code.google.com/p/go.crypto/openpgp/s2k
code.google.com/p/go.crypto/bcrypt
code.google.com/p/go.crypto/openpgp/packet
code.google.com/p/go.crypto/openpgp
code.google.com/p/go.crypto/openpgp/clearsign
code.google.com/p/goprotobuf/protoc-gen-go/descriptor
code.google.com/p/goprotobuf/protoc-gen-go/plugin
code.google.com/p/goprotobuf/protoc-gen-go/generator
code.google.com/p/goprotobuf/protoc-gen-go
alberts commented 12 years ago

Comment 2:

There's another bug:
GOROOT= GOPATH=~/deps go install -v -compiler=gccgo code.google.com/...
GOROOT= GOPATH=~/deps go install -v -compiler=gccgo code.google.com/...
GOROOT= GOPATH=~/deps go install -v -compiler=gccgo code.google.com/...
go rebuilds all the packages each time.
ianlancetaylor commented 12 years ago

Comment 3:

Labels changed: added priority-go1, gccgo, removed priority-triage.

rsc commented 12 years ago

Comment 4:

Now that we've resolved 3231, how much of this report goes away if you
set GOROOT correctly?

Status changed to Accepted.

remyoudompheng commented 12 years ago

Comment 5:

This issue was closed by revision 5c4d6ebb118bc541647b9b15af5a19502570d0d.

Status changed to Fixed.