Skip to content

rust: cargo subprojects: Add some kind of support for non-default crate registries, local source code #12211

Closed
@sdroege

Description

Fedora (and AFAIU Debian, @werdahias can confirm / correct) are currently building Rust code by having all dependencies locally available on the system, and telling cargo about that. It will be necessary to add a similar mechanism for meson so that cargo subprojects can be built without network access and without having to patch the code more than necessary.

For cargo, Fedora currently sets the following .cargo/config.toml in each project:

[source.local-registry]
directory = "/usr/share/cargo/registry"

[source.crates-io]
registry = "https://crates.io/"
replace-with = "local-registry"

This makes it take the crates from the local file system instead of doing network access to crates.io.

I'm not sure how to expose something similar in a meaningful way with meson, but the most suitable way would probably be via some kind of -D configuration?

Also, generally for when adding cargo subprojects to the project it would probably be good to be able to point at non-default crates registries. While almost everything is on crates.io, it seems good to stay generic here.

CC @decathorpe @werdahias @xclaesse

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions