-
-
Notifications
You must be signed in to change notification settings - Fork 103
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
A truly decentralized approach #16
Comments
I agree with most points. I'm not sure about the Apart from that, most of the points are implemented, except for conflict resolution (that is hard, and thus avoided for now) and the locked file. The require change of also searching The decentralized approach is good. I'm suggesting a registry that would be a cross between bower (searchable list + directs name to repository URL) and NPM/Rubygems: have a nice website, listing shards with metadata, the available versions, the README, links, etc. It may become useful to Shards, like allowing to define dependencies as a slick Yet, I'm designing the locked dependencies to be self sufficient so it never has to hit the registry (ie. it would expand the |
Anyway, the registry would need a complete Web framework (I'm working on that) so it won't come soon. |
I'm all in favour of a decentralized approach, but I don't understand why there has to be a separate Why not just checkout a version number tag and use the I also don't like it because it forces users to use git, instead of some other vcs. (I personally only use git, and will probably continue to do so forever.) Although using (git) tags also forces users to use git though, unless other vc systems also have the same or similar concept. But then you'd have to write in different vcs logic, and then even just knowing what vcs to use for a package is another big issue altogether. I don't even think shards supports other vc systems although I might be wrong. But I mainly don't like it because it seems to unnecessarily meddle with my git branches (even if it's named It seems to force a particular git workflow (or does it)? How does it work with some popular git workflows like git flow (which already has a concept of releases)? Does it just branch off the current branch? Does the stuff in this Does any other language do anything like this? Because I haven't seen it/heard of it, but perhaps I just don't know about it. Maybe it's not as big an issue as I think, but I don't understand why it's done. |
@ysbaddaden @vyp The 0.1:
webmock.cr:
github: manastech/webmock.cr
version: ~0.0.2
0.2:
webmock.cr:
github: manastech/webmock.
version: >=0.3.0
timecop.cr:
github: waterlink/timecop.cr
version: >=0.1.0 In this way to know all the dependencies of a given library you only need to check out that small branch. If you don't have dependencies for each of the versions you can't solve conflicts in a fast way: you'd have to check out all tags to see which matches the current set of restrictions. About this:
But that means you have to clone the entire repository, instead of just checking out the version you are interested in. With the approach we propose you only have to check out one small branch and then the version you need. And @ysbaddaden, the problem with having @vyp I don't think any other language does this. Julia does something similar, but different: it has a repository where metadata for all existing libraries is listed. If you want to add a library, you send a pull request to that repository. Want to release? Send a pull request to that repository. It works, but somebody has to manage that repository, and of course there's moderation (for example they choose good names before adding something, and they get a chance to discuss it in pull requests). So it's not descentralized, but they don't need infrastructure for the central repository because they just rely on GitHub (smart :-)). And for Ruby there's rubygems, and bundler downloads a huge file with all version metadata for all existing gems. Here we also try to rely on github, but without any kind of centralization, so you can release whenever you want, and you can choose any name you want... but while writing this sentence I just realized that if I choose "foo" and somebody else chooses "foo", and our libraries have totally unrelated functionalities, then nobody can use both libraries at the same time. It's a maybe uncommon case, but it can happen. So maybe global names isn't such a bad idea after all. |
And the problem with using the
I think this is great because it can work easily whilst being entirely disconnected from everything else (all the other branches). You never have to do anything with the branch, no merging or anything, meaning all the things I talked about related to conflicting with git workflows should not be a problem.
Can we use a |
@vyp You can change the name in On second thought, maybe conflicting names won't be a problem because it would be strange to, say, use two different mysql packages in a project. And you can always search for existing names in case you want to avoid conflict at all cost. De-centralization might be worth this little inconvenience. |
The _release branch would merely be to speed things up, without the need for a central registry. @vyp we shall support other VCS than Git, yet other resolvers could behave in the same way. |
@asterite In that case, I can't really think of a way to solve it. But as you say, I also think decentralization is still worth this. Perhaps it would be useful to mention this somewhere in the docs, and to tell people to search the internet or popular hosting sites like github, bitbucket, gitlab etc. before deciding on a name. |
However I think it can be a problem. For example, one To resolve such conflicts we can rely on approved by years of github existence approach - user name. It can works this way:
|
@sergey-kucher Except because of decentralization, not everything will be on github, what then? But that's still a good idea in my opinion, perhaps it can make a case for github.com urls specifically, where it falls back to usernames, because github is so popular. (And perhaps the same for other popular source code hosting sites if they have the concept of usernames.) |
The conflict is not only on the filesystem level, but more importantly on the module namespace level, there are no namespaced requires and by conventions both should use |
@jhass Maybe resolving conflicts on namespace level in similar way is quite acceptable. I.e.
|
How do you handle dependencies then? Say I have |
Also see crystal-lang/crystal#265 |
Discussion moves to crystal-lang/crystal#1357 |
Highly against a decentralized system.
For example, what if the one dependency is hosted on HTTP and not HTTPs. Some policies for companies would like all downloads to come from HTTPs for security and auditing. Rubygems has gone through the problem and finally after many years and community feedback resolved on an important issue. First it was github that hosted all the rubygems, gemcutter, and now current rubygems. Open ended, what is stopping us from following another community's work and conventions? |
Hi @ysbaddaden !
We have an idea for a truly decentalized approach for dependencies. Please read this. What do you think?
The text was updated successfully, but these errors were encountered: