-
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
Include files of private sub crates (package.publish = false) in the package #4726
Comments
I almost come up with a patch but this line of code gets me down for lack of context: cargo/src/cargo/util/toml/mod.rs Line 494 in abd137a
I need to check package.publish and strip the path only if the package is not allowed to be published. Any help? UPDATE: Alright, I am trying to handle it now. |
I think the very reason for |
@est31 I know. But now people are mixing published sub crates with private sub crates. If cargo insists on publishing all sub crates, then |
@est31 Ah, "publish" has two meanings here: a) publish the sub crate to the registry; b) publish the source along with the root crate. I want to support (b) and forbid (a). Better ideas? |
@iology I don't know but many people type |
@est31 Say, root crate A is to be published, and it depends on sub crate B (publish=false, path="./B"), it is reasonable to upload B too, otherwise B should not be placed there. Why would this be a surprise? |
@iology if you do To give you an use case where this might bite people: maybe crate B is a super secret company crate while crate A is an open source crate that uses B to have some proprietary extensions. Now you want to publish A but you forget to remove the extensions, e.g. because you forgot to switch branches or something. Then you publish it and suddenly B is visible to the world! |
@est31 If you really want to keep those private, you can change the default registry with Given your extreme use case, I would rather need more than one manifest keys to solve the problem. The real world examples are like this: package A has reusable module1, module2, module3... in their own crates, and crates for tests. It makes people sad that some packages have to make their test crates published to the registry for better modularity. |
It does not make me sad that I won't have to download your test code (which may be quite large) if I just want to build your crate :) |
Maybe you think "publish (to registry)" = "public". I do not. "module=true" could be ok too. I'll come up with a patch. |
I assume this should be closed given that rust-lang/rfcs#2224 was postponed? |
Before #1565 is solved, is it possible to include verbatim copy of all sub crates with config
package.publish = false
? (excluding the ignored files)The text was updated successfully, but these errors were encountered: