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/sys/unix: cmsgAlignOf redeclared #35102

Closed
Sheshagiri opened this issue Oct 23, 2019 · 5 comments
Closed

x/sys/unix: cmsgAlignOf redeclared #35102

Sheshagiri opened this issue Oct 23, 2019 · 5 comments
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@Sheshagiri
Copy link

What version of Go are you using (go version)?

$ go version
go version go1.12.12 darwin/amd64

Does this issue reproduce with the latest release?

yes. I only tried with go1.12.12

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/sheshagiri/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/sheshagiri/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/Cellar/go@1.12/1.12.12/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go@1.12/1.12.12/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/sheshagiri/workspace/extreme/waas/api/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/fk/4gq46s3960z78bjbvrkbf2bh0000gp/T/go-build052242506=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

$go mod vendor

What did you expect to see?

I see that cmsgAlignOf is declared in two different go files in the same package.

What did you see instead?

github.com/extremenetworks/waas/api/vendor/gol
ang.org/x/sys/unix                                                                                                                 
srv/gopath/src/github.com/extremenetworks/waas/api/vendor/golang.org/x/sys/unix/sockcmsg_unix_other.go:14:6: cmsgAlignOf redeclared
 in this block                                                                                                                     
        previous declaration at srv/gopath/src/github.com/extremenetworks/waas/api/vendor/golang.org/x/sys/unix/sockcmsg_unix.go:17
:29.                                                                                                                               
@tklauser
Copy link
Member

Are you sure you correctly vendored x/sys/unix? I can't seem to access github.com/extremenetworks/waas to check for myself. There shouldn't be a declaration of cmsgAlignOf anymore in sockcmsg_unix.go:

https://github.com/golang/sys/blob/master/unix/sockcmsg_unix.go

It was there before but was moved by https://golang.org/cl/202179

@tklauser tklauser added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Oct 23, 2019
@Sheshagiri
Copy link
Author

unfortunately, that is a private repo. I deleted the vendor and cleaned my cache(go clean --modcache) and now I only see

~/w/e/w/api (shesh/add-rules-endpoint-api|✚1) $ grep -iR "func cmsgAlignOf(" vendor/
vendor//golang.org/x/sys/unix/sockcmsg_unix.go:func cmsgAlignOf(salen int) int {
~/w/e/w/api (shesh/add-rules-endpoint-api|✚1) $

@Sheshagiri
Copy link
Author

I tried go get -u golang.org/x/sys/unix and now it declared in two files.

~/w/e/w/api (shesh/add-rules-endpoint-api|✚1) $ go get -u golang.org/x/sys/unix
go: finding golang.org/x/sys/unix latest
go: finding golang.org/x/sys latest
~/w/e/w/api (shesh/add-rules-endpoint-api|✚2) $ go mod vendor
~/w/e/w/api (shesh/add-rules-endpoint-api|✚2) $ grep -iR "func cmsgAlignOf(" vendor/
vendor//golang.org/x/sys/unix/sockcmsg_unix_other.go:func cmsgAlignOf(salen int) int {
vendor//golang.org/x/sys/unix/sockcmsg_dragonfly.go:func cmsgAlignOf(salen int) int {
~/w/e/w/api (shesh/add-rules-endpoint-api|✚2) $

@tklauser
Copy link
Member

Yes, this is where they should be declared (once for dragonfly and once for all other geese). Does the issue still persist with this vendoring?

@bcmills bcmills added WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. and removed WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. labels Oct 23, 2019
@Sheshagiri
Copy link
Author

Apparently one of the dependency has an older version of sys/unix pinned to it because of which I was getting the error I described in this issue. I removed that dependency and don’t see the issue anymore, so closing the issue.

@golang golang locked and limited conversation to collaborators Oct 22, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

4 participants