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
[release/1.7] Fix compile from version control system (source) use case #10012
[release/1.7] Fix compile from version control system (source) use case #10012
Conversation
This change excludes the github.com/mitchellh/osext indirect dependency to resolve compile from source use case issue due to dependency no longer being available. Signed-off-by: Austin Vazquez <macedonv@amazon.com>
Hi @austinvazquez. Thanks for your PR. I'm waiting for a containerd member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like a good solution; @thaJeztah you know of any downsides or unintended consequences here?
I honestly had to look up the
This StackOverflow post had some explanation as well; https://stackoverflow.com/a/53824026/1811501
Which .. seems to indicate the I'm still confused why go modules is even looking for this dependency; for sure, it may be "somewhere" in the dependency tree, but with both I tried reproducing the issue, inside a container, but ... wasn't able to? git checkout v1.6.30
Note: switching to 'v1.6.30'.
# ...
docker build -t containerd-test -f contrib/Dockerfile.test .
docker run -it --rm containerd-test
root@9412af045bd2:/go/src/github.com/containerd/containerd# make binaries GOPROXY=direct
+ bin/ctr
+ bin/containerd
+ bin/containerd-stress
+ bin/containerd-shim
+ bin/containerd-shim-runc-v1
+ bin/containerd-shim-runc-v2
+ binaries In the above, source is stored in docker run -it --rm containerd-test
cd /
root@320cff3c429e:/# mv /go/src/github.com/containerd/containerd /containerd
root@320cff3c429e:/# cd containerd/
root@320cff3c429e:/containerd# make binaries GOPROXY=direct
+ bin/ctr
+ bin/containerd
+ bin/containerd-stress
+ bin/containerd-shim
+ bin/containerd-shim-runc-v1
+ bin/containerd-shim-runc-v2
+ binaries |
That said, it's definitely possible something would happen if it were to resolve modules, so I dug a bit deeper, and tried docker run -it --rm containerd-test
make GOPROXY=direct vendor
...
go: downloading github.com/blang/semver v3.5.1+incompatible
go: github.com/containerd/aufs@v1.0.0 requires
github.com/containerd/containerd@v1.5.0-beta.3 requires
github.com/Microsoft/hcsshim@v0.8.15 requires
github.com/containerd/containerd@v1.5.0-beta.1 requires
github.com/Microsoft/hcsshim/test@v0.0.0-20201218223536-d3e5debf77da requires
github.com/docker/distribution@v0.0.0-20190905152932-14b96e55d84c requires
github.com/mitchellh/osext@v0.0.0-20151018003038-5e2d6d41470f: invalid version: git ls-remote -q origin in /go/pkg/mod/cache/vcs/94ed57c5b21c953d93b47487113db43a5c9b69fd990329ec70dc77348c4dd443: exit status 128:
fatal: could not read Username for 'https://github.com': terminal prompts disabled
Confirm the import path was entered correctly.
If this is a private repository, see https://golang.org/doc/faq#git_https for additional information.
make: *** [Makefile:447: vendor] Error 1 So the issue there is that it (again; I recall we had that before) discovers an old version of containerd (1.5), and now starts traversing those dependencies. ISTR Go maintainers mentioned "that issue is solved, and we now (automatically) use the local (main) module", but ... maybe that's not the case? It's somewhat odd that it goes looking for dependencies for an older version of the main module we're in, to resolve dependencies for that, knowing that those dependencies won't be used for the current version 🤔 All of that doesn't make a lot of sense; if it's following SemVer, then containerd 1.6 (current version of the main module) is compatible with any of the make binaries GOPROXY=direct
+ bin/ctr
+ bin/containerd
...
go version -m bin/containerd
bin/containerd: go1.21.8
path github.com/containerd/containerd/cmd/containerd
mod github.com/containerd/containerd (devel)
dep dario.cat/mergo v1.0.0 h1:AGCNq9Evsj31mOgNPcLyXc+4PNABt905YmuqPYYpBWk= So... would that mean that .. the main module doesn't have a version and is ignored in version resolution, and therefore the minimum required version of So, curious about that, I tried adding back the "replace" hack; and ... yes, that works! docker run -it --rm containerd-test
go mod edit -replace github.com/containerd/containerd=./
make GOPROXY=direct vendor
...
go: found github.com/satori/go.uuid in github.com/satori/go.uuid v1.2.0
all modules verified So, as the "missing module" is (per above) a consequence of go modules using an old version of the containerd module; but not limited to just that module; it also goes looking for other indirect modules (any of which could go AWOL); perhaps we should exclude that module (i.e., don't use But unfortunately that doesn't work, because that ignored docker run -it --rm containerd-test
go mod edit -exclude github.com/containerd/containerd@v1.5.0-beta.3
make GOPROXY=direct vendor
...
go: github.com/Microsoft/hcsshim@v0.9.10 requires
github.com/containerd/containerd@v1.5.7 requires
github.com/containerd/imgcrypt@v1.1.1 requires
github.com/containerd/containerd@v1.5.0-rc.0 requires
github.com/Microsoft/hcsshim@v0.8.15 requires
github.com/containerd/containerd@v1.5.0-beta.1 requires
github.com/Microsoft/hcsshim/test@v0.0.0-20201218223536-d3e5debf77da requires
github.com/docker/distribution@v0.0.0-20190905152932-14b96e55d84c requires
github.com/mitchellh/osext@v0.0.0-20151018003038-5e2d6d41470f: invalid version: git ls-remote -q origin in /go/pkg/mod/cache/vcs/94ed57c5b21c953d93b47487113db43a5c9b69fd990329ec70dc77348c4dd443: exit status 128:
fatal: could not read Username for 'https://github.com': terminal prompts disabled
Confirm the import path was entered correctly.
If this is a private repository, see https://golang.org/doc/faq#git_https for additional information.
make: *** [Makefile:447: vendor] Error 1
ro And go mod edit -exclude github.com/containerd/container
go: -exclude=github.com/containerd/container: need path@version Excluding all versions found .. isn't a realistic option here either; go mod graph | grep ' github.com/containerd/containerd' | wc -l
33 |
So ...
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Sorry for the long comments; I was really curious "whyyy go? whyyyy? why again??"
Love it. Thanks for the deep dive. Certainly a few TILs for me there. 🤭 From golang/go#51285 (comment), the dependencies need to be go >= 1.17 for module graph pruning. In the case of both containerd/aufs@v1.0.0 and Microsoft/hcsshim@v0.9.10 have go version 1.13. So perhaps that is why the older versions of containerd are not pruned from the dependency graph. |
containerd 1.7.15 Welcome to the v1.7.15 release of containerd! The fifteenth patch release for containerd 1.7 contains various fixes; one for a regression introduced in v1.7.14 in the way process exits were handled. * Adds mediatype to OCI index record on export ([#9990](containerd/containerd#9990)) * Fix runc shim to only defer init process exits ([#10037](containerd/containerd#10037)) Please try out the release binaries and report any issues at https://github.com/containerd/containerd/issues. * Derek McGowan * Phil Estes * Austin Vazquez * Laura Brehm * Sebastiaan van Stijn * Talon <details><summary>12 commits</summary> <p> * Prepare for v1.7.15 release ([#10039](containerd/containerd#10039)) * [`4d4759b54`](containerd/containerd@4d4759b) Prep v1.7.15 release * Fix runc shim to only defer init process exits ([#10037](containerd/containerd#10037)) * [`21df46766`](containerd/containerd@21df467) runc-shim: only defer init process exits * Fix compile from version control system (source) use case ([#10012](containerd/containerd#10012)) * [`2a054213e`](containerd/containerd@2a05421) Fix compile from version control system (source) use case * Adds mediatype to OCI index record on export ([#9990](containerd/containerd#9990)) * [`6605c47a4`](containerd/containerd@6605c47) adds mediatype to oci index record * vendor: google.golang.org/protobuf 1.33.0, github.com/golang/protobuf v1.5.4 ([#9975](containerd/containerd#9975)) * [`e6d91d843`](containerd/containerd@e6d91d8) vendor: github.com/golang/protobuf v1.5.4 * [`2d136c5f5`](containerd/containerd@2d136c5) build(deps): bump google.golang.org/protobuf from 1.32.0 to 1.33.0 * [`a1a7af7a3`](containerd/containerd@a1a7af7) build(deps): bump google.golang.org/protobuf from 1.31.0 to 1.32.0 </p> </details> * **github.com/golang/protobuf** v1.5.3 -> v1.5.4 * **google.golang.org/protobuf** v1.31.0 -> v1.33.0 Previous release can be found at [v1.7.14](https://github.com/containerd/containerd/releases/tag/v1.7.14)
Issue
Resolves #9969
The module github.com/mitchellh/osext is no longer available via source. The issue is it is currently a indirect dependency via containerd/aufs@v1.0.0 (see containerd/aufs#49 (comment)) and Microsoft/hcsshim@v0.9.10.
Description
This change excludes the github.com/mitchellh/osext indirect dependency to resolve compile from source use case issue due to dependency no longer being available.
Testing
Additional context