Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd a command to generate registry index data #4497
Comments
This comment has been minimized.
This comment has been minimized.
|
In order to test out #4506, I've created a minimal registry! The part that this proposed command would create is this file's contents, given the current crate. I don't think we envision people running this command and doing something manually with the output, though that will be possible. The main goal is to enable any tool to be able to create the same registry entries that crates.io creates right now, without needing to run all of crates.io. |
This comment has been minimized.
This comment has been minimized.
stephanbuys
commented
Sep 22, 2017
|
@carols10cents from what I can tell #4506 deals with |
This comment has been minimized.
This comment has been minimized.
Yes, #4506 is only tangentially related-- someone on gitter was asking for an example of what a "minimal registry" would look like and what this command needs to generate, and #4506 had just happened to prompt me to do just that :)
Cargo can be used as a dependency, and someone on gitter also suggested adding a public API function that returns the text this command would output, so I think that would work. Does that sound ok? |
carols10cents
added
the
hacktoberfest
label
Sep 29, 2017
This comment has been minimized.
This comment has been minimized.
liranringel
commented
Sep 30, 2017
|
I started to look into it. |
This comment has been minimized.
This comment has been minimized.
liranringel
commented
Oct 3, 2017
•
|
What would be the best way to calculate the checksum? Edit: I noticed that the hash changes on every |
This comment has been minimized.
This comment has been minimized.
|
@carols10cents Do you have strong opinions on whether this should live as a cargo subcommand or a separate package we publish to crates.io? My only concern is that cargo could become one of those tools where you type |
This comment has been minimized.
This comment has been minimized.
|
I guess I don't feel super strongly about whether this is part of cargo or external, but it should be in the rust-lang org and it's seeming like having a library with a public api function as well as a binary would be useful... |
This comment has been minimized.
This comment has been minimized.
|
I definitely agree about both of those points. |
This comment has been minimized.
This comment has been minimized.
liranringel
commented
Oct 5, 2017
|
So where should it be? |
This comment has been minimized.
This comment has been minimized.
|
Is anyone actively working on this, if not then I may make a start on a new crate to add the interface, this way it makes it a lot easier for versioning the interface for external crates to use (not to mention the reduction in time as cargo takes ages to compile when you are only needing a tiny amount of the function). |
This comment has been minimized.
This comment has been minimized.
liranringel
commented
Nov 9, 2017
|
I'd like to but no one answered me here or in gitter, and I don't want to make such important decisions by myself. |
This comment has been minimized.
This comment has been minimized.
|
After taking a look it would seem to me more useful to have a command which adds the entry in a git registry directly, for example this code. It just seems to me like anyone who uses a command to generate the fragment of index would need to also perform the following:
That seems like a bunch of code which has already been written that anyone who uses the new command will also need to write (or copy). Is there some use case which I am missing? |
This comment has been minimized.
This comment has been minimized.
|
We don't want it to do things that are highly contextual to specific users. Possibly it could make a git commit for you, but definitely not pull or push, since those involve questions of which remote is the source of truth, and what authentication do you use. |
This comment has been minimized.
This comment has been minimized.
|
Leaving out the pull and push and just updating a git repo would still make for quite a clean split, rather than spreading the knowledge of the registry layout around different crates. |
aturon
referenced this issue
Jan 8, 2018
Open
Tracking issue for RFC 2141: Add support to Cargo for alternative registries #44931
carols10cents
removed
the
hacktoberfest
label
Jan 8, 2018
This comment has been minimized.
This comment has been minimized.
synek317
commented
Apr 22, 2018
|
I have implemented a working prototype here: https://github.com/synek317/cargo/tree/synek317_generate_index_metadata I decided to create |
This comment has been minimized.
This comment has been minimized.
hallfox
commented
Jun 21, 2018
|
Any updates on this? |
This comment has been minimized.
This comment has been minimized.
synek317
commented
Jun 21, 2018
|
@hallfox have you checked my branch? I think it is ready but unfortunately I had no time to push it. |
This comment has been minimized.
This comment has been minimized.
ninrod
commented
Jun 21, 2018
|
with this issue resolved, would we entreprise users, trying to use rust behind a firewall, with access to an artifactory server, be finally able to use rust? we have no access whatsoever to crates.io. |
This comment has been minimized.
This comment has been minimized.
hallfox
commented
Jun 21, 2018
|
Yeah, I have seen it, was waiting for when you'd open a PR! Do you feel
it's ready yet, or is there some blocker?
…On Thu, Jun 21, 2018, 2:02 AM synek317 ***@***.***> wrote:
@hallfox <https://github.com/hallfox> have you checked my branch? I think
it is ready but unfortunately I had no time to push it.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#4497 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AEfkSyl-BaOBPYfbbq-fpHbpiirAGHNTks5t-zbXgaJpZM4PZeP->
.
|
This comment has been minimized.
This comment has been minimized.
synek317
commented
Jun 21, 2018
|
Actually, I was blocked with two things (+ time):
|
This comment has been minimized.
This comment has been minimized.
rep-nop
commented
Oct 28, 2018
|
@synek317 have you had time to continue with this? |
This comment has been minimized.
This comment has been minimized.
|
Rather than implementing this in-tree, I have posted an experimental subcommand which relies on |
This comment has been minimized.
This comment has been minimized.
synek317
commented
Jan 15, 2019
|
@ehuss this is not a good solution. I mean, I was also concerned if generate-index-metadata should be included in cargo or in subcommand as you can see in my comment above. Anyway registry structs are currently defined in crates.io and in cargo, as carols10cents pointed it out in the first comment. Instead of unifying it, you are adding another copy. I've also some personal objections because now someone's effort (mine or yours, probably mine) will be wasted. If anyone had answered my previous question, I could just move it to the subcommand. Not even mentioning that your implementation is something different than @carols10cents was asking in the first comment. |
This comment has been minimized.
This comment has been minimized.
|
@synek317 I apologize for the lack of coordination. The code I posted is not intended to be a permanent solution. It was intended to explore what would be needed to support this functionality outside of Cargo, and to gauge the utility. The Cargo team is actively discussing the possibility of reorganizing some of the internals to make them more easily accessible in isolation and in a more stable form. However, it is not entirely clear, yet, exactly how that should appear, or how useful it would be. Different projects have different needs, so it's not always obvious how it should look and who it would serve. |
carols10cents commentedSep 15, 2017
•
edited by Eh2406
See RFC 2141 for more details/context.
Currently, the knowledge of what goes in the registry index in what format lives in crates.io:
In order to support minimal registries, we'd like cargo to be able to generate the JSON information that should go into a registry for the current crate.
Cargo does already understand how to read these entries! We need to teach it how to create them as well :)
So as I understand it, this would involve:
Serializefor theRegistryPackagestructgenerate-index-metadata, that should:RegistryPackagefor the current crate, reusing code that sends relevant information to crates.io when appropriate