Repository navigation
Description
Desired Outcome
I would like to use the methodology described here in this blog post => https://blog.golang.org/v2-go-modules to support users who aren't using go modules.
Specifically, that would mean moving to a directory setup like so:
github.com/urfave/cli @ master branch
/go.mod → module github.com/urfave/cli
/v2/go.mod → module github.com/urfave/cli/v2
Risks
This proposed change will make the git repo most "noisy", in that there will be more total files in the repo. It will be a bit more confusing to direct new contributors to the right place to add code. I think both those issues are easily solved with strong documentation, though!
Motivation
The motivation here is the many many cases where we broke someone who wasn't using go modules, or were the reason why someone had to start using go modules. Examples:
- cli.StringFlag does not implement cli.Flag (Apply method has pointer receiver) #925 (comment)
- cli.StringFlag does not implement cli.Flag (Apply method has pointer receiver) #925 (comment)
- cli.StringFlag does not implement cli.Flag (Apply method has pointer receiver) #925 (comment)
- after cli.GlobalString was removed Google Cloud Print Connector cannot be built #926 (comment)
- v1 bug: Not everyone is using modules, mind what you push to master #947 (comment)
- Add go modules and update cli flag creation to work with latest urfave/cli changes anubhavmishra/envoy-consul-sds#4
- Go modules ethereum/go-ethereum#20164
Non-goals
Even with this proposal, I would still consider v1 go be "locked" at 1.22.X. Which is to say, I am by no means suggesting that we start merging feature PRs into v1! v1 would remain in its "critical bug fixes only" state, it would simply live in the master branch.
Our Paths Forward
This section describes how our paths forward from here would effect each of the following types of users:
- users using GOPATH mode, who have already updated
- users using GOPATH mode, who have not updated yet
- users using vendoring
- users using go modules
If we don't make this change
- users using GOPATH mode, who have already updated
These users will be broken again when we update the package to v3 #833. This will also be broken again if we update to v4, or v5, etc...
- users using GOPATH mode, who have not updated yet
All of these users are currently broken, and will remain broken unless they take some action. The most common actions people take are:
- swap to using go modules, or
- update to v2
- users using vendoring
These users are currently ok, and will remain ok
- users using go modules
These users are currently ok, and will remain ok
If we make this change
- users using GOPATH mode, who have already updated
These users will be broken once, because they will update to downgrade from v2 => v1
- users using GOPATH mode, who have not updated yet
These users will be fixed
- users using vendoring
These users are currently ok, and will remain ok
- users using go modules
These users are currently ok, and will remain ok
A comparison of the options
As you can read above, users in group (3) and (4) will be fine regardless of what we do.
So this decision is really about users in groups (1) and (2), we will be affected in the following way:
- if we dont make this change
#ff0000group 1 users will be broken at least once in the future#ff0000group 2 users will be broken forever
- if we do make this change
#ff0000group 1 users will be broken only once#00ff00group 2 users will be fixed
In Conclusion
This problem space is complex, but the cost of not making this change is much higher than the cost of making it.
Activity
coilysiren commentedon Nov 28, 2019
@urfave/cli please review this issue and let me know if you're 👍 or 👎 ! I think it could potentially be a great help for our users.coilysiren commentedon Nov 28, 2019
I just realized ... we can't do this, becausev2is already in masterSo we can't changemasterback tov1now, because that would be another breaking change. RIP me, software is hard.I'm gonna close thiscoilysiren commentedon Nov 29, 2019
Re-opening this because I think it's viable to implement still. More details incoming!
[-]Support users who aren't using go modules[/-][+]Support users who are using GOPATH mode[/+]coilysiren commentedon Nov 29, 2019
@urfave/cli I've reviewed this problem more thoroughly, and it's currently my recommendation that we make this change. Please review the 1st post in this issue and 👍 or 👎 it! Please also ask me any clarifying questions.
coilysiren commentedon Nov 29, 2019
Additionally, if (and only if) we accept this proposal, I will do the following:
coilysiren commentedon Nov 29, 2019
@gravis can you add a comment in support here? I would like for it to be known to the @urfave/cli maintainers that people are interested in this, and I'm proposing that we do exactly what you mention here db-journey/journey#16 (comment)
coilysiren commentedon Nov 29, 2019
@purpleidea FYI this proposal would break your project again since you aren't using modules or vendoring, specifically we would have to revert this PR => purpleidea/mgmt#571. Please let me know if there's any way we can make it so that this proposal doesn't break your repo, thank you!
As I explain in the OP, if we change nothing about your project - you will be broken once and only once, and it will simply mean that this PR purpleidea/mgmt#571 has to be reverted. I can very happily make that change for you, if we go through with this plan.
gravis commentedon Dec 1, 2019
@lynncyrin Sure.
Actually, I'm giving this advice while not following it myself, since journey and migrate have switched to v2 directly in their respective
masterbranch without any/v2.But this repo (
urfave/cli) is much more used in dependent projects, and they will all have issues if theyy haven't switched to go modules yet.coilysiren commentedon Dec 3, 2019
@AudriusButkevicius / @rliebz / @asahasrabuddhe anytime this week, can you read through this issue any let me know what you think? It's fairly time sensitive, so I'll probably close it if it's not looking like it's going to get 2 👍's by December 9th.
That said, please do ask me any clarifying questions 🙏
AudriusButkevicius commentedon Dec 3, 2019
V2 is in master and you suggest to undo that?
This will break everyone that fixed up their code, yet continued without module support. These people are probably the most pissed off ones now, so pissing them off once more is less than great.
I'd rather new users had to fiddle with something.
Perhaps we leave this as is, and do it differently in v3. Having master shapeshift twice in a short timeframe is somewhat against my appetite.
rliebz commentedon Dec 3, 2019
I agree with @AudriusButkevicius here—we'd probably be having a different conversation if we hadn't already cut the v2 release branch.
That said, from here, I don't think restructuring the repo is worth it to support users who use
GOPATHmode without any sort of dependency management. We have major version tags to indicate what to pin to if users aren't interesting in keeping up with breaking changes, so as long as users are using something likedep,glide,govendor, etc., they'd have effectively the same experience whether or not we do that restructuring.coilysiren commentedon Dec 4, 2019
🙏 thanks for your comments!
This is at...
...so I'm going to close it ♻️
I think this will be a helpful issue to read for future people who are trying to figure out this same problem 📖👩🎓 so I appreciate everyone's input here tons ✨