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 upTracking issue for RFC 1977: public & private dependencies #44663
Comments
withoutboats
added
B-RFC-approved
C-tracking-issue
T-cargo
labels
Sep 17, 2017
This was referenced Sep 25, 2017
carols10cents
referenced this issue
Oct 18, 2017
Closed
enhancement - allow to express the version of a crate as a version of a dependent crate #4641
This comment has been minimized.
This comment has been minimized.
Boscop
commented
Oct 27, 2017
•
|
Maybe it's useful to look at how this problem is approached in Haskell. Here is an example of a subtle issue that occurs with private dependencies: Btw, I found it through this post: http://harry.garrood.me/blog/purescript-why-bower/ |
Eh2406
referenced this issue
Mar 24, 2018
Open
Linking to native library multiple times through build dependencies #5237
This comment has been minimized.
This comment has been minimized.
|
Would Rust2018 be a good opportunity to make the braking changes to |
This comment has been minimized.
This comment has been minimized.
|
Maybe. Though such changes should be designed and proposed soon, have an easy migration path, and preferably only affect a minority of existing crates. |
Eh2406
referenced this issue
Sep 22, 2018
Closed
Allow multiple pre-release versions of a crate to co-exist #6019
Eh2406
referenced this issue
Oct 3, 2018
Open
Tracking issue for RFC 1977: public & private dependencies, as it relates to the resolver #6129
This comment has been minimized.
This comment has been minimized.
|
Thought I just had related to ecosystems like [dependencies]
futures = { version = "10.17", public = false }
futures-core = { version = "1.2", public = true }But then, in code you would never import items from the "core" crate, instead you would simply have public APIs that return types which have been re-exported through the "facade" from the "core" crate and rely on the compiler to warn you if you accidentally use something that didn't originate in the "core" crate. |
This comment has been minimized.
This comment has been minimized.
|
I don't quite understand something about your example. Can you elaborate on what the |
This comment has been minimized.
This comment has been minimized.
|
@Eh2406 the setup's a little annoying to just explain, so here's a full compiling set of example crates: https://github.com/Nemo157/rust-44663-facade-example In this example Now So, to have the compiler enforce this restriction the developers of |
This comment has been minimized.
This comment has been minimized.
|
I'd like to work on this. |
This comment has been minimized.
This comment has been minimized.
|
Thanks for offering to work on this! @alexcrichton, do you have any mentoring advice? I can at any time get a branch ready for the resolver part of cargo, it will be good enough to start experimentation, although not good enough to be ready to stabilize. |
This comment has been minimized.
This comment has been minimized.
|
Sure! @Aaron1011 so this is split roughly into two features, one being rustc knowing what crates are in the "public interface" and a second being the support in Cargo's resolver to make various decisions differently. Are you interested in one of those in particular? |
This comment has been minimized.
This comment has been minimized.
|
@alexcrichton: I've started working on the rustc part in a branch: https://github.com/Aaron1011/rust/commits/feature/pub-priv-dep, and I plan to submit a (WIP) PR soon. I might also be interested in working on the cargo part as well. |
This comment has been minimized.
This comment has been minimized.
|
@Aaron1011 please cc me when you make that PR. I know nothing about the internals of Rust, so will be of no help, but I do want to follow the discussion. I will redouble my efforts to get the Cargo's resolver part mergeable. I have been enjoying ( and hating ) it because it is the hardest algorithmic problem I have ever worked on. I would be happy for some help, perhaps a new perspective will get me un-stuck. |
This comment has been minimized.
This comment has been minimized.
|
@Aaron1011 ok and it seems like you're off to a great start! I'd be up for reviewing that PR, and if you've got any questions along the way just let me know |
Aaron1011
referenced this issue
Jan 14, 2019
Merged
Implement public/private dependency feature #57586
This comment has been minimized.
This comment has been minimized.
|
There was another usecase for this mentioned on i.rl.o, if Similarly, if you're self-hosting documentation for a crate somewhere you may want to be able to generate a documentation bundle including the crate and all its public dependencies so that it is fully self-contained. |

withoutboats commentedSep 17, 2017
•
edited by carols10cents
This is the tracking issue for rust-lang/rfcs#1977 - public and private dependencies in cargo.
Blocking stabilization:
cargo publishuse the minimal versions allowed by Cargo.toml