Skip to content
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

Can't publish to our crates registry if git is also specified #10875

Open
luciusmagn opened this issue Jul 17, 2022 · 2 comments
Open

Can't publish to our crates registry if git is also specified #10875

luciusmagn opened this issue Jul 17, 2022 · 2 comments
Labels
A-crate-dependencies Area: [dependencies] of any kind A-git Area: anything dealing with git A-registries Area: registries C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`

Comments

@luciusmagn
Copy link

Hello,
I have an issue with introducing a custom registry at our company.

It's essentially described by this test:

fn registry_incompatible_with_git() {
registry::alt_init();
let p = project()
.file(
"Cargo.toml",
r#"
[project]
name = "foo"
version = "0.0.1"
authors = []
[dependencies.bar]
git = ""
registry = "alternative"
"#,
)
.file("src/main.rs", "fn main() {}")
.build();
p.cargo("build")
.with_status(101)
.with_stderr_contains(
" dependency (bar) specification is ambiguous. \
Only one of `git` or `registry` is allowed.",
)
.run();
}

We need to be able to specify both, I don't see why it should be any different from git + crates.io registry.

Why is this?

If possible, what can I do implement this ASAP?

Thanks a lot in advance for any information. 🙏

@weihanglo weihanglo added A-git Area: anything dealing with git C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` A-registries Area: registries labels Jul 26, 2022
@weihanglo
Copy link
Member

weihanglo commented Aug 15, 2022

Sorry for the late reply. If I get you correct, you want something similar to multiple dependency location but for publishing to an alternative registry. Is that true?

To tell the truth, Cargo's source and registry management is undergoing a series of scrutinies and developments in recent. For example,

Your feature request is quite an interesting use case, though from my point of view, it either directly or indirectly related to aforementioned issues. I feel like this area is somehow stuffed and may not have enough room to accept a new sizable feature at this moment.

That's my own opinion only. If someone is willing to have a discussion in depth, and able to find Cargo team members also willing to discuss, go ahead! We'd love to see thing get improved! I just doubt that chance is high. Sorry for the bad news 😞 (Or good? At least registry has been renewed these days)

@luciusmagn
Copy link
Author

Hi, yeah, I want multiple dependency location with git + alternative registry just like how git + crates.io works. I patched it and tested it by removing the test and mimicking the behavior, and it works well enough, but of course, I don't think I have thought through all the corner cases :D

I don't think it's that big of a feature, looks to me to be more about allowing it... :)

I will look into the issues you have mentioned, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-crate-dependencies Area: [dependencies] of any kind A-git Area: anything dealing with git A-registries Area: registries C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
Projects
None yet
Development

No branches or pull requests

3 participants