Skip to content

script/setup: use git clone instead of go get -d#5009

Merged
estesp merged 1 commit intocontainerd:masterfrom
thaJeztah:fix_install_scripts
Mar 3, 2021
Merged

script/setup: use git clone instead of go get -d#5009
estesp merged 1 commit intocontainerd:masterfrom
thaJeztah:fix_install_scripts

Conversation

@thaJeztah
Copy link
Copy Markdown
Member

relates to #5005

go get -d uses go modules by default in Go 1.16 and up, which results
in modules being fetched for the "latest" module version, after which we
tried to "git checkout" to <VERSION>.

For runc, this means that (possibly incorrectly), go get will download
runc v0.1.1 (most recent non-"pre-release", which caused failures (e.g
the old Sirupsen/logrus being downloaded).

In addition, some of the dependencies we're installing use vendoring, and
thus would not require the modules to be downloaded (and vendored files
will be ignored when using go get with modules).

This patch switches several uses go get -d to use a regular
git clone, after which the desired version is checked out,
and the binaries are built.

@thaJeztah
Copy link
Copy Markdown
Member Author

Hmmm... odd; is state not cleaned up between runs?

==> default: Running provisioner: install-runc (shell)...
    default: Running: inline script
    default: + /root/go/src/github.com/containerd/containerd/script/setup/install-runc
    default: fatal: destination path '/root/go/src/github.com/opencontainers/runc' already exists and is not an empty directory.

@dims
Copy link
Copy Markdown
Member

dims commented Feb 5, 2021

@thaJeztah the vagrant up is laying down that directory from what i can tell looking at the logs

@thaJeztah
Copy link
Copy Markdown
Member Author

ah, hm... will have to look a bit more in depth then how to best fix.

`go get -d` uses go modules by default in Go 1.16 and up, which results
in modules being fetched for the "latest" module version, after which we
tried to "git checkout" to `<VERSION>`.

For runc, this means that (possibly incorrectly), `go get` will download
runc `v0.1.1` (most recent non-"pre-release", which caused failures (e.g
the old `Sirupsen/logrus` being downloaded).

In addition, some of the dependencies we're installing use vendoring, and
thus would not require the modules to be downloaded (and vendored files
will be ignored when using `go get` with modules).

This patch switches several uses `go get -d` to use a regular
git clone, after which the desired version is checked out,
and the binaries are built.

Signed-off-by: Sebastiaan van Stijn <[email protected]>
Signed-off-by: Phil Estes <[email protected]>
@estesp estesp force-pushed the fix_install_scripts branch from b680121 to 1645738 Compare March 3, 2021 20:35
@containerd containerd deleted a comment from theopenlab-ci Bot Mar 3, 2021
@containerd containerd deleted a comment from theopenlab-ci Bot Mar 3, 2021
@containerd containerd deleted a comment from theopenlab-ci Bot Mar 3, 2021
@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Mar 3, 2021

Build succeeded.

Copy link
Copy Markdown
Member

@mikebrow mikebrow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Copy Markdown
Member

@estesp estesp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@estesp estesp merged commit 91ff314 into containerd:master Mar 3, 2021
@thaJeztah thaJeztah deleted the fix_install_scripts branch March 4, 2021 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants