Skip to content

Disable go modules when compiling binaries used in tests#42391

Merged
thaJeztah merged 2 commits intomoby:masterfrom
thaJeztah:nomod
May 20, 2021
Merged

Disable go modules when compiling binaries used in tests#42391
thaJeztah merged 2 commits intomoby:masterfrom
thaJeztah:nomod

Conversation

@thaJeztah
Copy link
Member

relates to #40353

These caused CI to fail when using Go 1.16, so disabling Go modules to prevent that

thaJeztah added 2 commits May 18, 2021 09:51
    INFO: Running integration tests at 05/17/2021 12:54:50...
    INFO: DOCKER_HOST at tcp://127.0.0.1:2357
    INFO: Integration API tests being run from the host:
    INFO: make.ps1 starting at 05/17/2021 12:54:50
    powershell.exe : go: cannot find main module, but found vendor.conf in D:\gopath\src\github.com\docker\docker
    At D:\gopath\src\github.com\docker\docker@tmp\durable-1ed00396\powershellWrapper.ps1:3 char:1
    + & powershell -NoProfile -NonInteractive -ExecutionPolicy Bypass -Comm ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (go: cannot find...m\docker\docker:String) [], RemoteException
        + FullyQualifiedErrorId : NativeCommandError

    	to create a module there, run:
    	go mod init
    INFO: make.ps1 ended at 05/17/2021 12:54:51

Signed-off-by: Sebastiaan van Stijn <[email protected]>
    === RUN   TestServicePlugin
        plugin_test.go:42: assertion failed: error is not nil: error building basic plugin bin: no required module provides package github.com/docker/docker/testutil/fixtures/plugin/basic: go.mod file not found in current directory or any parent directory; see 'go help modules'
            : exit status 1

Signed-off-by: Sebastiaan van Stijn <[email protected]>
@thaJeztah
Copy link
Member Author

@cpuguy83 @AkihiroSuda ptal

@thaJeztah thaJeztah mentioned this pull request May 18, 2021
20 tasks
@thaJeztah
Copy link
Member Author

failure on amd64 is a known flaky test; #42357

--- FAIL: TestDaemonHostGatewayIP (1.91s)
    daemon_linux_test.go:144: [de50f3b669e81] failed to start daemon with arguments [--data-root /go/src/github.com/docker/docker/bundles/test-integration/TestDaemonHostGatewayIP/de50f3b669e81/root --exec-root /tmp/dxr/de50f3b669e81 --pidfile /go/src/github.com/docker/docker/bundles/test-integration/TestDaemonHostGatewayIP/de50f3b669e81/docker.pid --userland-proxy=true --containerd-namespace de50f3b669e81 --containerd-plugins-namespace de50f3b669e81p --containerd /var/run/docker/containerd/containerd.sock --host unix:///tmp/docker-integration/de50f3b669e81.sock --debug --storage-driver overlay2] : [de50f3b669e81] daemon exited during startup: exit status 1

kicking ci again

@tianon
Copy link
Member

tianon commented May 18, 2021

This will only work until Go 1.17, right? 😞

@thaJeztah
Copy link
Member Author

This will only work until Go 1.17, right? 😞

Good question; haven't fully caught up on that; will Go 1.17 still support a -mod flag (e.g.) to disable? We can probably work around it in some other way (this was a quick way to get it working and to somewhat unblock #40353)

@tianon
Copy link
Member

tianon commented May 19, 2021

https://blog.golang.org/go116-module-changes

We plan to drop support for GOPATH mode in Go 1.17. In other words, Go 1.17 will ignore GO111MODULE. If you have projects that do not build in module-aware mode, now is the time to migrate.

(So in short, no, I do not think so -- for Go 1.17 we either have to "convert or die" so to speak.)

@thaJeztah
Copy link
Member Author

So much for "no breaking changes'. Will they still support vendoring? (that's a bit odd as they're not modules either)

@tianon
Copy link
Member

tianon commented May 19, 2021

Yes! From my testing, even an empty go.mod with -mod vendor does something ~sane, but it's a bit of a hack (and I wouldn't be surprised if they later break it when they notice it's possible, especially if a "big" project like Docker starts using it 🙈).

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.

4 participants