-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
crates.io: Package Groups #975
Comments
Have you considered making "group" to be a full blown domain name? |
@ioquatix Like in Java? Please god no! |
@mangecoeur Perhaps you can provide some actual logical reasons? If you use domain names you have a pre-existing system for name dispute resolution - i.e. domain registries. It isn't completely stupid IMHO. |
I think domains would be a bad idea, since it significantly raises the Forcing users to pay someone to create a project group makes this idea a
|
@ioquatix so the java habit is particularly bad (making endless sub-folders for each part of the domain) - but let's say you at least avoid that problem, you then have the case where you are forced to associate a group with a domain - so the group name is defined by the original group ownership/availability of domain (which may be taken up by something totally unrelated)/willingness of someone to pay for it. If the project changes hands/gets a new website you then either break everyone's stuff by updating the domain to match or let the group name and group website be out of sync (this has happened to several java libs I've used). |
Can't we just make group = username? |
Groups make sense in many ways, except they are still a limited commodity - who owns the "HTML" group? Who owns the "OpenGL" group? The name contention problem still exists, it's still an essentially flat namespace. By prefixing packages with a group name, e.g. "html-client", "html-server", you'd achieve almost exactly the same thing. If you need to have additional metadata, have a top level package "html" with that if really necessary. |
@arthurprs +1 |
@arthurprs +1 - Something like so: username -> package -> files; use ecogiko::math::Float; |
@ecogiko I agree with the part of the proposal that would leave off the username/groupname in |
@ecogiko please no. The crate group (or username if we go that way) shouldn't affect the crate code namespaces. |
I agree that if we have namespacing, then the groups mentioned here should just be the usernames. If an "organization" wants to create a namespace they could just register the username, like "iron" could be one, this way packages don't clash by default. After using Clojure, I'm pretty accustomed to using |
+1 to username for namespace. I don't find counterarguments compelling and it drastically reduces the name contention problem (which I do find to be a problem with Rubygems). |
Wait, a username? I think simply an additional namespace would be enough. With a similar uniqueness resolution as package name. How someone else solved the problem (HUGE repository): https://packagist.org/about |
Sure, but "additional namespace" is overly general. The OP proposal (group) On Tuesday, November 25, 2014, Nerijus Arlauskas [email protected]
|
The username is a safe and meaningfull namespace, we don't even need an additional attribute in the toml. |
I think Clojure and its tooling take the right approach for this sort of thing. Leiningen, the project orchestration tool equivalent to Cargo, uses Maven for dependency resolution and specification, so it has the same concepts of "groups" and "packages". But conventionally, for Clojure projects hosted on Clojars anyway, the canonical group name is just the name of the overall project. Users also get a personal namespace for forks, throwaway experiments, alpha versions, and the like under To specify a dependency in More information here: https://github.com/ato/clojars-web/wiki/Groups |
It's also important when we consider and dread the conventional use of reverse domain names in Java that the deep |
If I wanted another group, would I have to create another username? For example, a community project. |
You don't get groups, you get your username (or organization name) as a namespace. |
I commented in rust-lang/crates.io#58 as well, but I just want to reiterate that the policy here is under development. We're going to be discussing this at the work week next week and I'll be sure to keep everyone here posted with what we're thinking as well. |
I like the idea of having some sort of namespace or group and also like the idea of usernames for that. Not so sure about having "blessed" groups/packages though. Do we really need that if we have a good way to gauge package popularity and similar statistics? Who decides which things are blessed? Would that mean those packages have some sort of official status or is it just something more like "recommended"? |
By "blessed" I meant packages that are the "official" packages for a group, such as iron's router. |
Ah, okay. That sounds like a good idea then. I was thinking about something closer to the way the haskell platform (e.g., "blessed packages") works for hackage which I'm not a big fan of. |
Uses username for namespace is not a good idea. An username of github.com? or an username of crates.io? or any else? Not all of the crates host in github. I prefer uses URL as namespace: |
crates.io currently logs you in using your github identity, so yes, from github. |
The team has discussed these issues at some length and we've written up a more formal explanation of our package group policy at http://discuss.rust-lang.org/t/crates-io-package-policies/1041. Further discussion should happen there. |
@steveklabnik the link http://discuss.rust-lang.org/t/crates-io-package-policies/1041 is broken. |
Motivation
We want to support "special" or "blessed" packages and would also like to limit the contention for important names in a flat namespace.
Overview
Cargo will support groups as package namespaces with special permissions. Any user can create a new group whose name is not taken and begin adding packages and owners to it. Packages in a group can be referenced in the
[dependencies]
section and on crates.io as<group>/<package>
. Only owners of a group can add new packages to the group or update existing packages.Details
New cargo commands:
Creates a new blank group with the passed-in name, make yourself an owner, and push it.
Download and open the group's configuration as a
toml
file and edit it with$EDITOR
. This includes description, members, etc. Only owners of a group may run this command.Adding a package to a group is as easy as adding
group = "<name>"
to the[package]
section of that package'sCargo.toml
and runningcargo publish
. Permission to do this action is checked duringcargo publish
.Expressing a dependency on a package within a group is the same as with a normal package, except the package is referred to as
<group>/<package>
inCargo.toml
. Notably, the name of the package does not change, and you still access the crate by doingextern crate <package>
. This has the potential to cause some naming conflicts, but cargo could provide a solution to this by adding optionalalias
metadata to a dependency that tells cargo what name it should use when linking that dependency.Each group gets its own page on crates.io that shows all the packages within it, and all packages in a group share owners.
Group configuration
cargo group edit <name>
brings up the configuration file for a group, which contains the following structure in toml:Necessary:
Optional:
More fields could be added if/when they are needed.
The text was updated successfully, but these errors were encountered: