Skip to content

vendor: move vendor dir under cmd - #28080

Closed
LK4D4 wants to merge 1 commit into
moby:masterfrom
LK4D4:move_vendor
Closed

LK4D4 wants to merge 1 commit into
moby:masterfrom
LK4D4:move_vendor

Conversation

@LK4D4

@LK4D4 LK4D4 commented Nov 4, 2016

Copy link
Copy Markdown
Contributor

- What I did
Moved vendor directory under cmd/ directory to avoid problems for users who uses libraries from docker repo.

We need this because vendor directory under docker/docker breaks people
who use our libraries.

This sadly does not run unit tests for cmd/docker and cmd/dockerd, I
think we can fix that later.
Also, this moves integration-cli under cmd dir, because it needs vendored
stuff as well.
- How I did it
Modified hack/vendor.sh to put vendor dir under cmd/ directory and used some bash code.
- How to verify it
make test
- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)
cat

ping @vdemeester WDYT

@LK4D4

LK4D4 commented Nov 4, 2016

Copy link
Copy Markdown
Contributor Author

Have no idea why it fails on windows, will take a look.

@aaronlehmann

Copy link
Copy Markdown

Kind of sad about this. It means unit tests won't use the correct dependencies when run with go test, and my editor won't resolve symbols to vendored source files. But I understand the problem it's trying to solve and don't have better ideas.

@thaJeztah

Copy link
Copy Markdown
Member

Some way a symlink can solve this? (Probably not)

@cpuguy83

cpuguy83 commented Nov 6, 2016

Copy link
Copy Markdown
Member

Should we revert until after the release?

@LK4D4

LK4D4 commented Nov 6, 2016

Copy link
Copy Markdown
Contributor Author

@cpuguy83 what so special about release? I think revert would be kinda hard now :/

@justincormack

Copy link
Copy Markdown
Contributor

Could we split out our libraries into a libdocker repo? (Seems painful...)

On 4 Nov 2016 10:08 p.m., "Aaron Lehmann" [email protected] wrote:

Kind of sad about this. It means unit tests won't use the correct
dependencies when run with go test, and my editor won't resolve symbols
to vendored source files. But I understand the problem it's trying to solve
and don't have better ideas.

—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#28080 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAdcPO_4mnhNIBjciD1HQzJwpot-pZQ8ks5q66zhgaJpZM4Kp_cC
.

@LK4D4

LK4D4 commented Nov 7, 2016

Copy link
Copy Markdown
Contributor Author

I think that way in this PR is simplest. It's also used by etcd. Code completion is fixable too.

@AkihiroSuda AkihiroSuda added the status/failing-ci Indicates that the PR in its current state fails the test suite label Nov 7, 2016
@AkihiroSuda

Copy link
Copy Markdown
Member

CI failing
https://jenkins.dockerproject.org/job/Docker-PRs-experimental/26150/console

00:03:45.710 ---> Making bundle: binary-client (in bundles/1.13.0-dev/binary-client)
00:03:46.181 Building: bundles/1.13.0-dev/binary-client/docker-1.13.0-dev
00:04:12.103 Created binary: bundles/1.13.0-dev/binary-client/docker-1.13.0-dev
00:04:12.217 
00:04:12.221 ---> Making bundle: binary-daemon (in bundles/1.13.0-dev/binary-daemon)
00:04:12.738 Building: bundles/1.13.0-dev/binary-daemon/dockerd-1.13.0-dev
00:04:13.321 vendor/github.com/docker/swarmkit/manager/logbroker/broker.go:11:2: cannot find package "github.com/Sirupsen/logrus" in any of:
00:04:13.322    /go/src/github.com/docker/docker/vendor/github.com/Sirupsen/logrus (vendor tree)
00:04:13.322    /usr/local/go/src/github.com/Sirupsen/logrus (from $GOROOT)
00:04:13.322    /go/src/github.com/Sirupsen/logrus (from $GOPATH)
00:04:13.322 vendor/github.com/docker/swarmkit/manager/logbroker/broker.go:12:2: cannot find package "github.com/docker/go-events" in any of:
...

@LK4D4

LK4D4 commented Nov 7, 2016

Copy link
Copy Markdown
Contributor Author

Okay, I don't know what's with windows :/ ping @jhowardmsft

@lowenna

lowenna commented Nov 7, 2016

Copy link
Copy Markdown
Member

Windows CI hard codes the GOPATH. I'd need to update it. What's the priority on this PR? Working through a bunch of stuff for 1.13....

(Currently path would be set $drive:$base\src\github.com\docker\docker\vendor;$drive$base).

What would the new path be? (CL too large to show in github :( )

@LK4D4

LK4D4 commented Nov 7, 2016

Copy link
Copy Markdown
Contributor Author

@jhowardmsft it should be just $drive\$base. Also I've found weird that GOPATH is in same place as GOROOT :)

@lowenna

lowenna commented Nov 7, 2016

Copy link
Copy Markdown
Member

$drive$base is already in the gopath..... So there must be somewhere else needed in the path. Is there no src\github.com\docker\docker\vendor directory any more?

@LK4D4

LK4D4 commented Nov 7, 2016

Copy link
Copy Markdown
Contributor Author

@jhowardmsft It is there, but it shouldn't be in GOPATH. I dunno, but somehow windows CI has C:\go\src\vendor directory.

@lowenna

lowenna commented Nov 7, 2016

Copy link
Copy Markdown
Member

I'm confused. Ignore the \go\src\vendor thing - I can probably explain that, but it's not the cause of the problem. Just another place it can't find the dependencies.

Surely drive:\base\src\github.com\docker\docker\vendor should be in the GOPATH? Otherwise how is it going to pick up the vendored dependencies? IOW my question is where does this PR move this to?

@LK4D4

LK4D4 commented Nov 7, 2016

Copy link
Copy Markdown
Contributor Author

@jhowardmsft it moves it to cmd. Vendored dependencies should be picked by go tool automatically.

@lowenna

lowenna commented Nov 7, 2016

Copy link
Copy Markdown
Member

Uh? Is there some documentation on that ('vendored dependencies should be picked by go tool automatically')? AFAIK, it searches the GOPATH for dependencies, and there's no hard-coded opt-in of cmd\vendor to my knowledge. Obviously it's not being picked up. It sounds like the GOPATH does need to be set but to include drive:\base\src\github.com\docker\docker\cmd\vendor.

@tamird

tamird commented Nov 7, 2016 •

Copy link
Copy Markdown

Any package being built will look for a vendor directory in its directory hierarchy. There's nothing special about vendor at the repo root.

https://docs.google.com/document/d/1Bz5-UB7g2uPBdOx-rw5t9MxJwkfpx90cqG9AFL0JAYo/edit

EDIT: more info https://golang.org/cmd/go/#hdr-Vendor_Directories

@lowenna

lowenna commented Nov 7, 2016

Copy link
Copy Markdown
Member

That doc doesn't really help at all. I know there's nothing special about a root vendor directory. The reason it currently works is that that root vendor directory is set explicitly to be at the front of the GOPATH. If that has moved, then so does GOPATH. Correct?

@tamird

tamird commented Nov 7, 2016

Copy link
Copy Markdown

No. GOPATH does not need to be aware of vendor directories ever; that's the whole point that @LK4D4 is trying to communicate - the Go toolchain is responsible for discovering vendor directories, not the user (via GOPATH).

@lowenna

lowenna commented Nov 7, 2016 •

Copy link
Copy Markdown
Member

Then it appears if that were the case that the go toolchain isn't doing that for some reason on Windows. If your statement above were correct, I would not have to explicitly have set GOPATH to include the vendor directory in the root of the GOPATH... But it absolutely does need to be done (prior to this PR which is where the vendored dependencies live), at least as I say on Windows.

@LK4D4

LK4D4 commented Nov 7, 2016

Copy link
Copy Markdown
Contributor Author

@jhowardmsft even if you'd set it wouldn't work because there is no src directory in vendor now and it wouldn't be recognized as GOPATH. That must be something else :/

@lowenna

lowenna commented Nov 7, 2016 •

Copy link
Copy Markdown
Member

Yes, understood. However, this go tool capability just doesn't seem to work on Windows.

E:\go\src\github.com\docker\docker\cmd\docker [move_vendor]> $env:GO15VENDOREXPERIMENT
E:\go\src\github.com\docker\docker\cmd\docker [move_vendor]> $env:GOPATH
e:\go
E:\go\src\github.com\docker\docker\cmd\docker [move_vendor]> dir ..\vendor


    Directory: E:\go\src\github.com\docker\docker\cmd\vendor


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----        11/7/2016  12:22 PM                github.com
d-----        11/7/2016  12:22 PM                golang.org
d-----        11/7/2016  12:22 PM                google.golang.org


E:\go\src\github.com\docker\docker\cmd\docker [move_vendor]> go build
..\..\pkg\term\windows\ansi_reader.go:14:2: cannot find package "github.com/Azure/go-ansiterm" in any of:
        C:\Go\src\github.com\Azure\go-ansiterm (from $GOROOT)
        e:\go\src\github.com\Azure\go-ansiterm (from $GOPATH)
..\..\pkg\term\term_windows.go:11:2: cannot find package "github.com/Azure/go-ansiterm/winterm" in any of:
        C:\Go\src\github.com\Azure\go-ansiterm\winterm (from $GOROOT)
        e:\go\src\github.com\Azure\go-ansiterm\winterm (from $GOPATH)
..\..\cliconfig\credentials\native_store.go:4:2: cannot find package "github.com/docker/docker-credential-helpers/client" in any of:
        C:\Go\src\github.com\docker\docker-credential-helpers\client (from $GOROOT)
        e:\go\src\github.com\docker\docker-credential-helpers\client (from $GOPATH)
..\..\cliconfig\credentials\native_store.go:5:2: cannot find package "github.com/docker/docker-credential-helpers/credentials" in any of:
        C:\Go\src\github.com\docker\docker-credential-helpers\credentials (from $GOROOT)
        e:\go\src\github.com\docker\docker-credential-helpers\credentials (from $GOPATH)
..\..\cli\command\container\run.go:22:2: cannot find package "github.com/docker/libnetwork/resolvconf/dns" in any of:
        C:\Go\src\github.com\docker\libnetwork\resolvconf\dns (from $GOROOT)
        e:\go\src\github.com\docker\libnetwork\resolvconf\dns (from $GOPATH)
..\..\api\common.go:18:2: cannot find package "github.com/docker/libtrust" in any of:
        C:\Go\src\github.com\docker\libtrust (from $GOROOT)
        e:\go\src\github.com\docker\libtrust (from $GOPATH)
..\..\cli\command\image\trust.go:33:2: cannot find package "github.com/docker/notary" in any of:
        C:\Go\src\github.com\docker\notary (from $GOROOT)
        e:\go\src\github.com\docker\notary (from $GOPATH)
..\..\cli\command\image\trust.go:34:2: cannot find package "github.com/docker/notary/client" in any of:
        C:\Go\src\github.com\docker\notary\client (from $GOROOT)
        e:\go\src\github.com\docker\notary\client (from $GOPATH)
..\..\cli\command\image\trust.go:35:2: cannot find package "github.com/docker/notary/passphrase" in any of:
        C:\Go\src\github.com\docker\notary\passphrase (from $GOROOT)
        e:\go\src\github.com\docker\notary\passphrase (from $GOPATH)
..\..\cli\command\image\trust.go:36:2: cannot find package "github.com/docker/notary/storage" in any of:
        C:\Go\src\github.com\docker\notary\storage (from $GOROOT)
        e:\go\src\github.com\docker\notary\storage (from $GOPATH)
..\..\cli\command\image\trust.go:37:2: cannot find package "github.com/docker/notary/trustmanager" in any of:
        C:\Go\src\github.com\docker\notary\trustmanager (from $GOROOT)
        e:\go\src\github.com\docker\notary\trustmanager (from $GOPATH)
..\..\cli\command\image\trust.go:38:2: cannot find package "github.com/docker/notary/trustpinning" in any of:
        C:\Go\src\github.com\docker\notary\trustpinning (from $GOROOT)
        e:\go\src\github.com\docker\notary\trustpinning (from $GOPATH)
..\..\cli\command\image\trust.go:39:2: cannot find package "github.com/docker/notary/tuf/data" in any of:
        C:\Go\src\github.com\docker\notary\tuf\data (from $GOROOT)
        e:\go\src\github.com\docker\notary\tuf\data (from $GOPATH)
..\..\cli\command\image\trust.go:40:2: cannot find package "github.com/docker/notary/tuf/signed" in any of:
        C:\Go\src\github.com\docker\notary\tuf\signed (from $GOROOT)
        e:\go\src\github.com\docker\notary\tuf\signed (from $GOPATH)
..\..\cli\command\service\update.go:20:2: cannot find package "github.com/flynn-archive/go-shlex" in any of:
        C:\Go\src\github.com\flynn-archive\go-shlex (from $GOROOT)
        e:\go\src\github.com\flynn-archive\go-shlex (from $GOPATH)
..\..\api\server\httputils\errors.go:10:2: cannot find package "github.com/gorilla/mux" in any of:
        C:\Go\src\github.com\gorilla\mux (from $GOROOT)
        e:\go\src\github.com\gorilla\mux (from $GOPATH)
..\..\client\request.go:17:2: cannot find package "github.com/pkg/errors" in any of:
        C:\Go\src\github.com\pkg\errors (from $GOROOT)
        e:\go\src\github.com\pkg\errors (from $GOPATH)
..\..\cli\cobra.go:6:2: cannot find package "github.com/spf13/cobra" in any of:
        C:\Go\src\github.com\spf13\cobra (from $GOROOT)
        e:\go\src\github.com\spf13\cobra (from $GOPATH)
..\..\cli\flags\common.go:12:2: cannot find package "github.com/spf13/pflag" in any of:
        C:\Go\src\github.com\spf13\pflag (from $GOROOT)
        e:\go\src\github.com\spf13\pflag (from $GOPATH)
..\..\layer\layer_store.go:17:2: cannot find package "github.com/vbatts/tar-split/tar/asm" in any of:
        C:\Go\src\github.com\vbatts\tar-split\tar\asm (from $GOROOT)
        e:\go\src\github.com\vbatts\tar-split\tar\asm (from $GOPATH)
..\..\daemon\graphdriver\driver.go:12:2: cannot find package "github.com/vbatts/tar-split/tar/storage" in any of:
        C:\Go\src\github.com\vbatts\tar-split\tar\storage (from $GOROOT)
        e:\go\src\github.com\vbatts\tar-split\tar\storage (from $GOPATH)
..\..\..\..\Microsoft\go-winio\privilege.go:12:2: cannot find package "golang.org/x/sys/windows" in any of:
        C:\Go\src\golang.org\x\sys\windows (from $GOROOT)
        e:\go\src\golang.org\x\sys\windows (from $GOPATH)
..\..\pkg\progress\progressreader.go:7:2: cannot find package "golang.org/x/time/rate" in any of:
        C:\Go\src\golang.org\x\time\rate (from $GOROOT)
        e:\go\src\golang.org\x\time\rate (from $GOPATH)
..\..\api\server\httputils\errors.go:11:2: cannot find package "google.golang.org/grpc" in any of:
        C:\Go\src\google.golang.org\grpc (from $GOROOT)
        e:\go\src\google.golang.org\grpc (from $GOPATH)
E:\go\src\github.com\docker\docker\cmd\docker [move_vendor]> $env:GOROOT
C:\Go\
E:\go\src\github.com\docker\docker\cmd\docker [move_vendor]> $env:GO15VENDOREXPERIMENT=1
E:\go\src\github.com\docker\docker\cmd\docker [move_vendor]> go build
..\..\pkg\term\windows\ansi_reader.go:14:2: cannot find package "github.com/Azure/go-ansiterm" in any of:
        C:\Go\src\github.com\Azure\go-ansiterm (from $GOROOT)
        e:\go\src\github.com\Azure\go-ansiterm (from $GOPATH)
..\..\pkg\term\term_windows.go:11:2: cannot find package "github.com/Azure/go-ansiterm/winterm" in any of:
        C:\Go\src\github.com\Azure\go-ansiterm\winterm (from $GOROOT)
        e:\go\src\github.com\Azure\go-ansiterm\winterm (from $GOPATH)
..\..\cliconfig\credentials\native_store.go:4:2: cannot find package "github.com/docker/docker-credential-helpers/client" in any of:
        C:\Go\src\github.com\docker\docker-credential-helpers\client (from $GOROOT)
        e:\go\src\github.com\docker\docker-credential-helpers\client (from $GOPATH)
..\..\cliconfig\credentials\native_store.go:5:2: cannot find package "github.com/docker/docker-credential-helpers/credentials" in any of:
        C:\Go\src\github.com\docker\docker-credential-helpers\credentials (from $GOROOT)
        e:\go\src\github.com\docker\docker-credential-helpers\credentials (from $GOPATH)
..\..\cli\command\container\run.go:22:2: cannot find package "github.com/docker/libnetwork/resolvconf/dns" in any of:
        C:\Go\src\github.com\docker\libnetwork\resolvconf\dns (from $GOROOT)
        e:\go\src\github.com\docker\libnetwork\resolvconf\dns (from $GOPATH)
..\..\api\common.go:18:2: cannot find package "github.com/docker/libtrust" in any of:
        C:\Go\src\github.com\docker\libtrust (from $GOROOT)
        e:\go\src\github.com\docker\libtrust (from $GOPATH)
..\..\cli\command\image\trust.go:33:2: cannot find package "github.com/docker/notary" in any of:
        C:\Go\src\github.com\docker\notary (from $GOROOT)
        e:\go\src\github.com\docker\notary (from $GOPATH)
..\..\cli\command\image\trust.go:34:2: cannot find package "github.com/docker/notary/client" in any of:
        C:\Go\src\github.com\docker\notary\client (from $GOROOT)
        e:\go\src\github.com\docker\notary\client (from $GOPATH)
..\..\cli\command\image\trust.go:35:2: cannot find package "github.com/docker/notary/passphrase" in any of:
        C:\Go\src\github.com\docker\notary\passphrase (from $GOROOT)
        e:\go\src\github.com\docker\notary\passphrase (from $GOPATH)
..\..\cli\command\image\trust.go:36:2: cannot find package "github.com/docker/notary/storage" in any of:
        C:\Go\src\github.com\docker\notary\storage (from $GOROOT)
        e:\go\src\github.com\docker\notary\storage (from $GOPATH)
..\..\cli\command\image\trust.go:37:2: cannot find package "github.com/docker/notary/trustmanager" in any of:
        C:\Go\src\github.com\docker\notary\trustmanager (from $GOROOT)
        e:\go\src\github.com\docker\notary\trustmanager (from $GOPATH)
..\..\cli\command\image\trust.go:38:2: cannot find package "github.com/docker/notary/trustpinning" in any of:
        C:\Go\src\github.com\docker\notary\trustpinning (from $GOROOT)
        e:\go\src\github.com\docker\notary\trustpinning (from $GOPATH)
..\..\cli\command\image\trust.go:39:2: cannot find package "github.com/docker/notary/tuf/data" in any of:
        C:\Go\src\github.com\docker\notary\tuf\data (from $GOROOT)
        e:\go\src\github.com\docker\notary\tuf\data (from $GOPATH)
..\..\cli\command\image\trust.go:40:2: cannot find package "github.com/docker/notary/tuf/signed" in any of:
        C:\Go\src\github.com\docker\notary\tuf\signed (from $GOROOT)
        e:\go\src\github.com\docker\notary\tuf\signed (from $GOPATH)
..\..\cli\command\service\update.go:20:2: cannot find package "github.com/flynn-archive/go-shlex" in any of:
        C:\Go\src\github.com\flynn-archive\go-shlex (from $GOROOT)
        e:\go\src\github.com\flynn-archive\go-shlex (from $GOPATH)
..\..\api\server\httputils\errors.go:10:2: cannot find package "github.com/gorilla/mux" in any of:
        C:\Go\src\github.com\gorilla\mux (from $GOROOT)
        e:\go\src\github.com\gorilla\mux (from $GOPATH)
..\..\client\request.go:17:2: cannot find package "github.com/pkg/errors" in any of:
        C:\Go\src\github.com\pkg\errors (from $GOROOT)
        e:\go\src\github.com\pkg\errors (from $GOPATH)
..\..\cli\cobra.go:6:2: cannot find package "github.com/spf13/cobra" in any of:
        C:\Go\src\github.com\spf13\cobra (from $GOROOT)
        e:\go\src\github.com\spf13\cobra (from $GOPATH)
..\..\cli\flags\common.go:12:2: cannot find package "github.com/spf13/pflag" in any of:
        C:\Go\src\github.com\spf13\pflag (from $GOROOT)
        e:\go\src\github.com\spf13\pflag (from $GOPATH)
..\..\layer\layer_store.go:17:2: cannot find package "github.com/vbatts/tar-split/tar/asm" in any of:
        C:\Go\src\github.com\vbatts\tar-split\tar\asm (from $GOROOT)
        e:\go\src\github.com\vbatts\tar-split\tar\asm (from $GOPATH)
..\..\daemon\graphdriver\driver.go:12:2: cannot find package "github.com/vbatts/tar-split/tar/storage" in any of:
        C:\Go\src\github.com\vbatts\tar-split\tar\storage (from $GOROOT)
        e:\go\src\github.com\vbatts\tar-split\tar\storage (from $GOPATH)
..\..\..\..\Microsoft\go-winio\privilege.go:12:2: cannot find package "golang.org/x/sys/windows" in any of:
        C:\Go\src\golang.org\x\sys\windows (from $GOROOT)
        e:\go\src\golang.org\x\sys\windows (from $GOPATH)
..\..\pkg\progress\progressreader.go:7:2: cannot find package "golang.org/x/time/rate" in any of:
        C:\Go\src\golang.org\x\time\rate (from $GOROOT)
        e:\go\src\golang.org\x\time\rate (from $GOPATH)
..\..\api\server\httputils\errors.go:11:2: cannot find package "google.golang.org/grpc" in any of:
        C:\Go\src\google.golang.org\grpc (from $GOROOT)
        e:\go\src\google.golang.org\grpc (from $GOPATH)
E:\go\src\github.com\docker\docker\cmd\docker [move_vendor]> dir ..\..


    Directory: E:\go\src\github.com\docker\docker


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----        11/7/2016  10:27 AM                .github
d-----        11/7/2016  10:27 AM                api
d-----        11/7/2016  12:32 PM                autogen
d-----        11/7/2016  10:27 AM                builder
d-----        11/7/2016  12:32 PM                bundles
d-----        11/7/2016  10:27 AM                cli
d-----        11/7/2016  10:27 AM                cliconfig
d-----        11/7/2016  10:27 AM                client
d-----        11/7/2016  12:22 PM                cmd
d-----        11/7/2016  10:27 AM                container
d-----        11/7/2016  10:27 AM                contrib
d-----        11/7/2016  10:27 AM                daemon
d-----        11/7/2016  10:27 AM                distribution
d-----        11/7/2016  12:32 PM                dockerversion
d-----        11/7/2016  10:27 AM                docs
d-----        11/7/2016  10:27 AM                experimental
d-----        11/7/2016  12:22 PM                hack
d-----        11/7/2016  10:27 AM                image
d-----        11/7/2016  10:27 AM                layer
d-----        11/7/2016  10:27 AM                libcontainerd
d-----        11/7/2016  10:27 AM                man
d-----        11/7/2016  10:27 AM                migrate
d-----        11/7/2016  10:27 AM                oci
d-----        11/7/2016  10:27 AM                opts
d-----        11/7/2016  10:27 AM                pkg
d-----        11/7/2016  10:27 AM                plugin
d-----        11/7/2016  10:27 AM                profiles
d-----        11/7/2016  10:27 AM                project
d-----        11/7/2016  10:27 AM                reference
d-----        11/7/2016  10:27 AM                registry
d-----        11/7/2016  10:27 AM                restartmanager
d-----        11/7/2016  10:27 AM                runconfig
d-----        11/7/2016  10:27 AM                utils
d-----        11/7/2016  10:27 AM                volume
-a----        11/7/2016  10:27 AM             45 .dockerignore
-a----        11/7/2016  10:27 AM            657 .gitignore
-a----        11/7/2016  10:27 AM          14123 .mailmap
-a----        11/7/2016  10:27 AM          63328 AUTHORS
-a----        11/7/2016  10:27 AM         150130 CHANGELOG.md
-a----        11/7/2016  10:27 AM          18461 CONTRIBUTING.md
-a----        11/7/2016  10:27 AM           9044 Dockerfile
-a----        11/7/2016  10:27 AM           6671 Dockerfile.aarch64
-a----        11/7/2016  10:27 AM           6855 Dockerfile.armhf
-a----        11/7/2016  10:27 AM           7901 Dockerfile.ppc64le
-a----        11/7/2016  10:27 AM           7653 Dockerfile.s390x
-a----        11/7/2016  10:27 AM           2182 Dockerfile.simple
-a----        11/7/2016  10:27 AM           8127 Dockerfile.windows
-a----        11/7/2016  10:27 AM          10956 LICENSE
-a----        11/7/2016  10:27 AM          10864 MAINTAINERS
-a----        11/7/2016  10:27 AM           6630 Makefile
-a----        11/7/2016  10:27 AM            657 NOTICE
-a----        11/7/2016  10:27 AM          14063 README.md
-a----        11/7/2016  10:27 AM           6358 ROADMAP.md
-a----        11/7/2016  10:27 AM           1998 VENDORING.md
-a----        11/7/2016  10:27 AM             12 VERSION

And compare to master:

E:\go\src\github.com\docker\docker\cmd\docker [master]> $env:GOPATH="e:\go\src\github.com\docker\docker\vendor;e:\go"
E:\go\src\github.com\docker\docker\cmd\docker [master]> go build
E:\go\src\github.com\docker\docker\cmd\docker [master]>

@tamird

tamird commented Nov 7, 2016

Copy link
Copy Markdown

What happens on master when you don't include the vendor directory in GOPATH? Also, what does go version output? Also, what else do you have in the environment that might be interesting?

@LK4D4

LK4D4 commented Nov 7, 2016

Copy link
Copy Markdown
Contributor Author

@tamird looks like symlinks just doesn't work for windows, that's why.

@lowenna

lowenna commented Nov 7, 2016

Copy link
Copy Markdown
Member

@tamird Just to clarify - was chatting to @LK4D4 offline. Symlinks which are in a github repo which is cloned on a Windows machine don't work. Not all symlinks. Symlinks in a repo will appear as a file of the right name, the contents of which will be the target of the symlink. But it is still a file, not a symlink. We crossed this bridge some 18+ months ago when the hack/ directory was symlinked to something else in the main docker repo which meant it wasn't usable. The solution was to remove symlinks entirely from the repo contents as stored on github.

@LK4D4

LK4D4 commented Nov 15, 2016

Copy link
Copy Markdown
Contributor Author

@tamird not all consumers are broken. Only those who doesn't remove nested vendor directories.
We're working on fixing windows CI. It's not easy :(

@tamird

tamird commented Nov 15, 2016

Copy link
Copy Markdown

What is the breakage on windows? Why does it work when vendor repo is at the top level? Where are the symlinks?

@LK4D4

LK4D4 commented Nov 15, 2016

Copy link
Copy Markdown
Contributor Author

@tamird When vendor at the top level, we don't need any symlinks because everything uses that vendor directory(build, unit-tests, integration-cli). When it's in cmd, we need to make symlink github.com/docker/docker -> github.com/docker/docker/vendor/github.com/docker/docker and that's where it became hard on windows because we can't commit symlinks and new symlinks don't work very well on windows, too. Also windows CI uses separate script for integration-cli, which needs to be updated too :/

@tamird

tamird commented Nov 15, 2016

Copy link
Copy Markdown

I'm confused, why do you need that symlink?

@LK4D4

LK4D4 commented Nov 15, 2016

Copy link
Copy Markdown
Contributor Author

@tamird Yeah, it was surprising to me as well. So, cmd has binaries; binaries use some libraries from github.com/docker/docker/cmd/vendor and some from github.com/docker/docker, but libraries from github.com/docker/docker needs vendored dependencies as well and can't use them because they're under cmd dir. So we create the symlink to emulate "everything is vendored" in cmd.

@dnephin

dnephin commented Nov 15, 2016 •

Copy link
Copy Markdown
Member

I'm still not really a fan of this PR.

If you're using docker/docker as a dependency to your project you should manage your dependencies using a tool like vndr or glide. You shouldn't rely on the vendor/ directory in this project.

We shouldn't be creating a strange directory structure for our integration tests to facilitate dependencies.

@tamird

tamird commented Nov 15, 2016

Copy link
Copy Markdown

That makes no sense. We're not relying on your vendor directory - we are
relying on its absence. Its presence breaks us.

On Tue, Nov 15, 2016 at 4:18 PM, Daniel Nephin [email protected]
wrote:

I'm still not really a fan of this PR.

If you're using docker/docker as a dependency to your project you should
manage your dependencies using a tool like vndr or glide. You shouldn't
rely on the vendor/ directory in this project.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
#28080 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/ABdsPHPKyfmDrpH6p5yEhTA73MCvHRshks5q-iGUgaJpZM4Kp_cC
.

@dnephin

dnephin commented Nov 15, 2016

Copy link
Copy Markdown
Member

That's strange. How does it break?

I guess that's why glide install --strip-vendor exists, to address this problem. Which seems like a better solution.

@tamird

tamird commented Nov 15, 2016

Copy link
Copy Markdown

My thanks to the peanut gallery, but perhaps it would be prudent of you to read the issue before commenting and suggesting nonsense solutions.

@dnephin

dnephin commented Nov 15, 2016

Copy link
Copy Markdown
Member

This PR? I've read through it and I don't see anything about the original issue (maybe I missed it?). All the discussion seems to be about windows not working with symlinks.

Is there a related issue that isn't linked?

Your hostility isn't necessary.

@tamird

tamird commented Nov 15, 2016

Copy link
Copy Markdown

On Tue, Nov 15, 2016 at 5:04 PM, Daniel Nephin [email protected]
wrote:

Is there a related issue that isn't linked?

#27912 (comment)

@dnephin

dnephin commented Nov 16, 2016

Copy link
Copy Markdown
Member

It seems like if glock handled removing vendor/ of dependencies this wouldn't be an issue. Many of the other dependency management tools appear to solve the problem in this way.

@lowenna

lowenna commented Nov 17, 2016

Copy link
Copy Markdown
Member

@LK4D4 Windows CI has been updated to support the moved location. (@johnstep FYI). That said, I'm not that keen on this overall approach :sad:

@LK4D4

LK4D4 commented Nov 17, 2016

Copy link
Copy Markdown
Contributor Author

@jhowardmsft If there will be more unhappy people, than happy we can abandon PR.
ping @docker/core-maintainers

@tamird

tamird commented Nov 17, 2016 •

Copy link
Copy Markdown

I'll just mention once more than forcing all consumers of the client package to use a vendor-flattening tool is a not-nice thing, and pretty much unprecedented.

EDIT: therefore, I would like to see this merged.

@vdemeester

Copy link
Copy Markdown
Member

Hum this will break the simple go test ./cli/... though 😓

@LK4D4 LK4D4 removed the status/failing-ci Indicates that the PR in its current state fails the test suite label Nov 18, 2016
@tamird

tamird commented Nov 22, 2016

Copy link
Copy Markdown

Looks like this passed CI, but has merge conflicts now. Any updates here?

@LK4D4

LK4D4 commented Nov 22, 2016

Copy link
Copy Markdown
Contributor Author

@tamird I'm rebasing every day, but now every day there is changes in vendor. I definitely saw it green.

@tamird

tamird commented Nov 22, 2016

Copy link
Copy Markdown

Another merge conflict.

We need this because vendor directory under docker/docker breaks people
who use our libraries.

This sadly does not run unit tests for cmd/docker and cmd/dockerd, I
think we can fix that later.
Also this moves integration-cli under cmd dir, because it needs vendored
stuff as well.

Signed-off-by: Alexander Morozov <[email protected]>
@tamird

tamird commented Nov 22, 2016

Copy link
Copy Markdown

Sigh, more merge conflicts. Is it possible for someone to shepherd this?

@lowenna

lowenna commented Nov 22, 2016

Copy link
Copy Markdown
Member

@tamird - Just to be clear, there isn't yet consensus from the maintainers that this is something we all agree should be implemented yet. There are concerns, including from myself, and this is still in design review, not code review. With the thanksgiving break and many people not working this week, I don't think it's realistic to ask @LK4D4 to keep rebasing until a discussion is had with more of the maintainers.

@tiborvass

Copy link
Copy Markdown
Contributor

@LK4D4 So we cannot merge this unfortunately, and this is more of a Go issue.

As a stopgap solution, let's go back to GOPATH dancing, and have your vndr tool somehow be able to move things under vendor/src instead of vendor/. Does that make sense?

@LK4D4

LK4D4 commented Dec 1, 2016

Copy link
Copy Markdown
Contributor Author

@tiborvass you should close it then :)

@tiborvass

Copy link
Copy Markdown
Contributor

@LK4D4 alright sorry :( Hopefully we'll find a solution as part of the ongoing works in the Go world.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.