-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Migrate to go modules: incompatible (>=v2) packages #5956
Comments
/cc @ipfs/go-team, @libp2p/go-team |
Can you define incompatible? It makes it sound like they can't work at all, when I think instead there may be a Go-mod specific meaning. |
is the definition of incompatible. |
I think the consensus was to remove those tags and revert to v0 or v1. |
@Kubuxu that is how we are going to progress forward at this point. I had wanted to maintain the existing git tags but it is more work than it is worth especially considering the inconsistency of gx releases with matching git tags. |
@Kubuxu the latest idea was to prefix all existing tags with |
I agree. I'm all for not removing history (one of the reasons I created: https://github.com/ipfs/go-ipfs-archived/) |
Not using the current major versions in libp2p was driven by incomplete third-party tooling support in libp2p/go-libp2p-kad-dht#236. As mentioned there, the core Go tooling works seamlessly with >= 2 major versions in import paths. Resetting versions will only aid support until version 2+, when again the issue with out-of-date tooling will pop up. On the downside, reverting to version 0 and 1 for projects may cause a lot of confusion, there is likely package managers other than gx in use that depend on the existing versioning, not to mention the human element of associating commits to version numbers. Many conversations around versioning in any project that has reset the version will begin with "version X? do you mean before/after the gx/version reset...". Many of these projects have been around for many years, I think pretending that they're still in v0 is vane and optimistic. Major versions are not a finite resource, and I think people are too easily encumbered by trying to make major versions a very serious thing. |
@anacrolix gx doesn't use version numbers, it uses hashes; version numbers are purely vanity, that's why archiving them under a People using govendor and other third party tools should just upgrade to the official solution: gomod. We can't support every single ecosystem tool out there. My point is that, prior to gomod, bumping up numbers in gx was somewhat done recklessly because it had no implications other than the text of the tag in Git. However, with gomod, the implications of those version numbers are now visible. Not in metadata, but they actually surface in source files, yikes. I strongly refuse making users have to go through this pain:
We are unlike most Go projects. We are an extremely modular project with independent version numbers that follow no predictable heuristic. For the Kubernetes monorepo, using v4 (or whatever) all throughout is fine, because all imports will carry that number. We are not like that. The above example is proof and it's horrendous DX. We'd be insane to accept inflicting that pain on our users, for no compelling gain. To recap:
|
@anacrolix's point about the confusion of resetting to <v1 versions is a good one. That sucks. But I think that what @raulk points out about the version numbers in the import paths sucks worse. This is being stuck between a rock and a hard place... |
It will for any other systems that rely on the tags.
Yes, although anybody that already has could have issues when the tags change under them.
Note that this pain is only when you adopt go mod in "compatible" mode. Other packaging schemes are entirely unaffected with the right Go versions in use (for instance GOPATH users, and gx should be unaffected by major version use in paths, other systems may not). There are still replace directives and other tricks to make transitioning more gradual for go mod users. There's also the always ignored fact that you can still use go mod in the poorly-named "incompatible" mode, should you wish to avoid littering your import paths with major versions for a spell. I think resetting the version is great if it eases the transition for consumers, but I'm not sure that it's necessary, or even correct to do it just because some linting tools break. Note that everything else in the downstream worked correctly without modification, even with major versioning throughout the import paths due to the core Go tool support. I'm not hardline against the reset, but it smells of the aforementioned excitement that major version numbers always engender. If for example, we set go-libp2p-kad-dht to version 1 so the import paths don't change, as soon as some breaking changes are put in (for traversal stats and metrics for example), we go to version 2 and downstream linters break again. (And we definitely don't want our tools dictating changes.) If we went with version 0, we'd have downstream breakages fairly regularly due to the widespread dependence on the module and inability to communicate breaking changes. |
Let's not make a mess with the versions in the import paths. |
I am not sure anyone would have got libp2p or ipfs to work by relying on the git tags. Things simply did not work without Gx. By default, Gx does not create git tags either when doing Renaming tags in top-level projects is a polite thing, but other than that I'm not sure it's really helpful. If I wanted to look at actual gx releases, rather than tags I would look at the history of |
Another suggestion from my side is starting from the bottom and going up the dependency chain. Meaning start with go-multihash for example (multiformats/go-multihash#94), do multiaddr, multiaddr-net and so on. Going on it from the top will just create a mess of indirect dependencies. Ideally, there shouldn't be any/many in the top level modules. |
Can we proceed then? I want to start using |
After renaming tags all of us will need to run |
Ok, so the approach would be:
How does it sound? Can I get some confirmations about the strategy (@Stebalien @whyrusleeping @raulk @ipfs/go-team) |
@Kubuxu LGTM. I’d add making gx create the tag as part of Also, integrating the “tag police” script with GitHub via a webhook, and having it open an issue in the affected repo rather than directly fixing it is probably better. Lesser magic and security exposure. |
Should we push to get this over and done with this week across IPFS and libp2p? It’s high prio for us this quarter, and it’s bogging us down. I’d say let’s form a ninja team and just do it. @mvid, would you be having spare capacity to do the legwork on the libp2p side? |
@raulk there is whyrusleeping/gx#207 but it's been stuck for a while. I also agree with webhook but what would be the action of the hook? |
@Kubuxu Let's find a way forward with that gx issue; one way or another we need to automate tag creation IMO. Proof lies in the status quo: gx release tagging is erratic across repos. Re: webhook. I'm thinking we react on tag pushes and bark on tags >= WDYT? |
SGWM One issue I've encontered is that |
@ipfs/go-team @libp2p/go-team Renames in orgs:
|
To all tagging devs: Run It will refresh tags based on GitHub. |
@Kubuxu thanks for the info, here and elsewhere. Should we have a document somewhere that contains things like how to fix the tags, what the travis configs should look like, and other common tasks that arise from adopting go mod? I keep needing to refer to this kind of stuff and get lost trying to remember where on GitHub or in an email I saw it mentioned. |
Sure. I will write this here and we can move it in future. Travis files is https://github.com/ipfs/ci-helpers/blob/master/travis-ci/travis.example.yml
Anything else? |
I put it in a gist: https://gist.github.com/anacrolix/bc342e13e8052bf9ff737b49b735af8b. |
Can we get the magic incantations for the gomod workflow as well? |
I will include them in: https://github.com/ipfs/gomod |
I'm finishing up a script to add/remove local replace directives in a module uber tree like https://github.com/raulk/uber-libp2p, to facilitate local development. |
Ok, so the script is finished and reviewed by @Kubuxu. I'll be adding instructions to that repo tomorrow. Since it's useful for the IPFS team to hack into libp2p regularly, we might need a version of this uber-repo that is cross-project. |
This is... |
Tracking issue for the migration of ipfs deps that are incompatible with go modules, i.e. they have a git tag that is semver and >=v2. This spans packages in both ipfs and libp2p.
Packages:
Along the way, I will attempt to migrate any incompatible packages that are dependencies of the above listed packages as well.
The text was updated successfully, but these errors were encountered: