-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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
go get
ing a repo with a go.mod
file does not honor the replace
directive
#30354
Comments
I think replace only works in the top-level main module:
|
This is working as designed.
|
Can you define local development in this perspective? If you are defining from a local machine, yes. Sure this works. If it is just me. As I have a team, that is distributed. For me to then have something that they have to work with, I have to change an entire import path of a rather large project. The The comment "This is working as designed". Does not necessarily mean that it cannot be changed. This made it feel that you were trying to understand my usage. I'm on a large team, which has been trying to embrace the new workflow, but has had difficulty learning the hard edges that The wiki page does its best to address these. But from UI perspective, if I am trying intuit features, without any feedback from the CLI that I am doing something wrong, I'm going to think it is a bug or missing feature. |
Or you can change the install instructions: you can ask them to Building binaries with ad-hoc patches of dependencies is fairly common today with For example: suppose that one of your users experiences a |
I don't agree with this workflow. I as a consumer of an upstream dependency A, shouldn't care up its dependencies. I just A and whatever it sees best for itself to run. The fact that I have to know and lock dependency A's upstream dependencies is a leaky abstraction. It means I have to worry more about using dependency A, rather than trusting upstream that they have a working Related to PRs and changing all the import statements. That's just needless maintenance. We are currently on this fork, for the sole purpose of we have a PR to the core Having to have my fork change all the import statements also affects my upstream PR. Meaning there would be a commit on the PR of all the import statements changing from So that would require me to have to branches. One that is the PR and one that is the PR + the import statement naming change. And for any reason the PR has to be changed (say maintainer request/comments), we'd have to update two branches. The fork that I have is not permanent, it is a temporary issue. The I understand that this a feature working as designed. But that doesn't mean it cannot be changed. |
See golang/go#30354 go get doesn't honor the go.mod replace options.
See golang/go#30354 go get doesn't honor the go.mod replace options.
…1028) See golang/go#30354 go get doesn't honor the go.mod replace options.
This addresses golang/go#30354 which states that `replace` is not to be used for importing a fork, leading to issues when trying to `go get` vshn/signalilo.
This is necessary because `replace` is not supported by `go get` to import a fork of a module, see golang/go#30354
This is necessary because `replace` is not supported by `go get` to import a fork of a module, see golang/go#30354
@tooolbox, don’t bother. This is the official method to propose a new feature is the mailing list. The +1 method does not work here. |
Signed-off-by: Jakub Sokołowski <jakub@status.im>
I'm in complete agreement with @jtarchie, this is a huge pain. We'll have a single breaking change in a dependency we don't control propogate across all our repos and have to add a |
I am doing this is an attempt to make go get work again with branch targets other than master. The problem is that if you issue go get github.com/gcla/termshark/v2/cmd/termshark@somebranch then Go doesn't apply the replace directives from termshark's go.mod; I think because it considers termshark.go's package main to not be part of the module. Here's a description of the issue: golang/go#30354 I certainly did not appreciate this until I read it. This is an experimental branch to see if I can go get from a branch by moving all the logic of main() under the umbrella of termshark's go.mod.
…) - switch to fork because golang/go#30354
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
We have a binary dependency that people install via
go get
orgo install
.When they do, they received an error of a missing type.
This is because the type is associated with a dependency is coming a forked version of that dependency, using the
replace
directive in thego.mod
file.What the user sees:
If you build it manually, it works:
What did you expect to see?
An error signifying that the
go get
did not honor thego.mod
file when pulling down dependencies.What did you see instead?
It works normally as expected.
The text was updated successfully, but these errors were encountered: