-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Add support for path dependencies in crates.io uploads #1565
Comments
So like Dabo proposed, I think it would be nice to add path dependencies support for crates.io uploads. In the case of all rust-gnome repositories, it would be very helpful. What do you think of it ? |
Right now you'll have to publish each component of a crate independently (e.g. publish |
But #1169 is a totally different issue. This is (as far as I understand) not about uploading a sub-crate but to include sub-crates into a package. I do not see how path dependencies should be harmful as long as they get uploaded to crates.io like any other file in the package. |
I agree, #1169 is different. @alexcrichton Can you reconsider re-opening this issue? It may not be a good idea in the end but it's worth discussing. |
@real-or-random what do you see the outcome of this issue being? How would this get resolved? |
The idea is to allow packages with path dependencies to be uploaded to crates.io. This could be achieved by simply packaging the path dependencies along with the main crate. A possible motivation for this could be splitting up a project into separate crates for better compilation performance/etc., or using a private fork of some other library temporarily. |
Such a feature is basically entirely incompatible with all of Cargo right now, and would require a significant rewrite from the ground up to support unfortunately. |
Looking at projects such as imag, which is spread over > 30 crates, I had the feeling that packaging path dependencies will be a very useful feature and that #1169 is the wrong reason to close it. I don't have any specific outcome in mind. I'm new to rust and I'm probably the wrong person to judge the effort to build this but even some notion of a group (just on crates.io, independently of cargo) will help in certain scenarios (this will be closer to #1169 then). On the other hand, there was a deliberate decision to use a flat namespace, and it's possible to create "meta-crates" which do nothing but depending on other crates if you want groups. |
It sounds like the requested feature, in terms of cargo internals, would be to support packages that have multiple library crates. That feature is quite large and is explicitly not supported by Cargo today, but it sounds like it would solve the use case here I believe. If you'd like to open a dedicated issue for that, please feel free to do so! |
@alexcrichton we can't release stdsimd on crates.io anymore without publishing stdsimd-test :/ |
@alexcrichton Hi, my idea is that sub crates with |
This is hitting us with |
This just bit me. I think it should definitely be fixed, though in the mean time it could at least be made less annoying. First, the error message I got is not great:
Confusing - why is it complaining about versions? I only got a clue that this was the problem from the very last line. I suggest something like this:
Second none of the documentation on I would add a comment in this section saying something vaguely like
On this page it does at least tell you:
But it's right at the bottom! I'd suggest moving it higher or making it into a yellow warning box (assuming you can do that). |
I also think this issue should be reconsidered and fixed. We want to be able to separate the project in different crates to improve the project organization, but we don't want them to get published. |
One way this could at least be improved is to have an "internal" flag in |
+1 for this feature |
It is really painful to publish all local dependencies after 7 years. |
This really needs to be addressed. This makes it so hard to maintain proc macro crates |
+1 here. I wish I could use a forked crate without publishing it to crates.io and cluttering its namespace. I just want to include it in my crate until the pull request gets approved. :| |
+1 for this issue making proc macro crates even more of a nightmare to deal with than they already are |
I created a crate for this:
|
Hi,
I have the following error when I run
cargo package
:The problem is that I have this sublib path in the cargo.toml file:
No problem with the
cargo build
however. So I changed the line to:(which is also the link to the library).
But when I run
cargo publish
:When reading the tutorial to publish library, it says that path is supported. However it seems not. Is it a bug ?
PS: Here is the link to the glib repository.
The text was updated successfully, but these errors were encountered: