Skip to content

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

@luciusmagn

Description

@luciusmagn

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. 🙏

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-crate-dependenciesArea: [dependencies] of any kindA-gitArea: anything dealing with gitA-registriesArea: registriesC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`S-triageStatus: This issue is waiting on initial triage.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions