You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
cmd/go: non-top-level packages ending in "/vendor" are omitted from module zip files #37397
build github.com/bep/temp: cannot load github.com/bep/testmodlib/somepackage/vendor: module github.com/bep/testmodlib@latest found (v1.0.1), but does not contain package github.com/bep/testmodlib/somepackage/vendor
I understand that the vendor top level folder in a module has a special meaning, but according to https://golang.org/ref/spec#Packages that package name should be fine -- and just deleting it sounds rather harsh.
I assume this is related to #31562 -- I have not read that one in detail, but I don't see how the conclusion can be correct.
github.com/bep/testmodlib/somepackage/vendor seem to be a valid package with a replace, and I assume that the compiler works as expected here.
Also, a module may contain non-Go folders (test resources etc. to make the test pass).
changed the title [-]modules: github.com/bep/testmodlib/somepackage/vendor fails[/-][+]cmd/go: packages named "vendor" are erroneously omitted from module zip files[/+]on Feb 24, 2020
changed the title [-]cmd/go: packages named "vendor" are erroneously omitted from module zip files[/-][+]cmd/go: non-top-level packages named "vendor" are erroneously omitted from module zip files[/+]on Feb 24, 2020
changed the title [-]cmd/go: non-top-level packages named "vendor" are erroneously omitted from module zip files[/-][+]cmd/go: non-top-level packages ending in "/vendor" are omitted from module zip files[/+]on Feb 24, 2020
@FiloSottile Unfortunately not. Old versions of cmd/go should still work with go.mod files that declare newer versions. So different versions of Go would produce different sums.
Does it work for anyone after 1.24 release? Because it seems it doesn't for me unfortunately. I've upgraded my module's require to 1.24 so it should work, shouldn't it?
Activity
gopherbot commentedon Feb 24, 2020
Change https://golang.org/cl/220640 mentions this issue:
cmd/go/internal/modfetch: delete unused isVendoredPackage functionbcmills commentedon Feb 24, 2020
You are correct: this is closely related. https://play.golang.org/p/zCP7U8cKAGc
bcmills commentedon Feb 24, 2020
CC @jayconrod @matloob, @FiloSottile FYI.
(I don't think we can plausibly fix this without invalidating checksums, though.)
gopherbot commentedon Feb 24, 2020
Change https://golang.org/cl/220657 mentions this issue:
zip: document isVendoredPackage false-positives[-]modules: github.com/bep/testmodlib/somepackage/vendor fails[/-][+]cmd/go: packages named "vendor" are erroneously omitted from module zip files[/+][-]cmd/go: packages named "vendor" are erroneously omitted from module zip files[/-][+]cmd/go: non-top-level packages named "vendor" are erroneously omitted from module zip files[/+][-]cmd/go: non-top-level packages named "vendor" are erroneously omitted from module zip files[/-][+]cmd/go: non-top-level packages ending in "/vendor" are omitted from module zip files[/+]cmd/go/internal/modfetch: delete unused isVendoredPackage function
zip: document isVendoredPackage false-positives
FiloSottile commentedon Feb 24, 2020
I suppose we could gate this sort of changes on the
go.modversion?jayconrod commentedon Feb 25, 2020
@FiloSottile Unfortunately not. Old versions of
cmd/goshould still work withgo.modfiles that declare newer versions. So different versions of Go would produce different sums.bcmills commentedon Feb 25, 2020
That proposal is #30369, but it seems unlikely to be accepted.
9 remaining items
x/mod: remove vendor/modules.txt from module download
gopherbot commentedon Oct 9, 2024
Change https://go.dev/cl/619175 mentions this issue:
x/mod: fix handling of vendored packages with '/vendor' in non-top-level pathsx/mod: fix handling of vendored packages with '/vendor' in non-top-le…
gucio321 commentedon Feb 14, 2025
Does it work for anyone after 1.24 release? Because it seems it doesn't for me unfortunately. I've upgraded my module's
requireto 1.24 so it should work, shouldn't it?zip: document isVendoredPackage false-positives
x/mod: remove vendor/modules.txt from module download
x/mod: fix handling of vendored packages with '/vendor' in non-top-le…