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
module github.com/apache/thrift/lib/go/thrift
go 1.14
Then I tried to test this upgrade in another repo importing thrift, by:
go mod edit --replace=github.com/apache/thrift=github.com/fishy/thrift@a25cee372
But then go mod tidy fails with:
github.com/apache/thrift/lib/go/thrift: module github.com/apache/thrift@latest found (v0.13.0, replaced by github.com/fishy/thrift@v0.13.1-0.20210119191924-a25cee37208b), but does not contain package github.com/apache/thrift/lib/go/thrift
What did you expect to see?
This go mod edit --replace should work and not causing any errors.
What did you see instead?
See the error above.
I tried to create a completely new repo with go.mod file in a subdir, and importing that repo from another repo seem to work. I also tried to:
Create a repo (A), with no go.mod file, and go library code in a subdir
Import repo A from a different repo (B)
Add go.mod to repo A's subdir
upgrade repo B's A dependency to the new one with go.mod under subdir
And that seems to work as well, so the problem seems to only exist when go mod edit --replace is involved.
I mainly want to test that this thrift PR works before merging it, but since go mod edit --replace causes problems I cannot actually test it without merging it.
The text was updated successfully, but these errors were encountered:
Require and replace operate on modules, not repositories.
Your existing require is for a (synthesized) module named github.com/apache/thrift, your replace targets the (synthesized) module at github.com/fishy/thrift which is separate from the module you created at github.com/fishy/thrift/lib/go/thrift.
If you want to test this, remove the existing require for github.com/apache/thrift (it will conflict), add a require for the new module github.com/apache/thrift/lib/go/thrift (can be any version, eg v0.0.0) and add a replace matching the new module go mod edit -replace=github.com/apache/thrift/lib/go/thrift=github.com/fishy/thrift/lib/go/thrift@a25cee372
For a seamless upgrade experience for downstream users, you should really consider placing the module at the repo root, it'll also make the tagging less complex.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
This is the latest release
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
The current
master
branch of github.com/apache/thrift doesn't have go.mod files (as of0e68e8c51b2924d211a47978c80c6753f45e8af3
)I'm trying to add
go.mod
file in a new Pull Request, into a subdirectory (lib/go/thrift/go.mod
), as in https://github.com/apache/thrift/pull/2309/files#diff-56d7575d9a6d7b2ca71217a3d9f49f9ba4354af736d0b96df07401c2782c1ed6:Then I tried to test this upgrade in another repo importing thrift, by:
But then
go mod tidy
fails with:What did you expect to see?
This
go mod edit --replace
should work and not causing any errors.What did you see instead?
See the error above.
I tried to create a completely new repo with
go.mod
file in a subdir, and importing that repo from another repo seem to work. I also tried to:go.mod
file, and go library code in a subdirgo.mod
to repo A's subdirgo.mod
under subdirAnd that seems to work as well, so the problem seems to only exist when
go mod edit --replace
is involved.I mainly want to test that this thrift PR works before merging it, but since
go mod edit --replace
causes problems I cannot actually test it without merging it.The text was updated successfully, but these errors were encountered: