Skip to content

How to override the source of external dependencies? similar to patch.crates.io #3495

@janosimas

Description

@janosimas

I have a Bazel/rules_rust project without a Cargo.toml and I was unable to find how to override the source of a dependency.

When I crate a spec pointing to my fork, it works for direct dependents. When other crates depend on the crate I forked, they get a different version from crates.io.

crate.spec(package = "tokio", git =...)           # <- works for direct dependencies

How can I define a specific version and override it with a git repo?
Something like

crate.spec(package = "tokio", version = "=1.36.0",...)

git_override(
    module_name = "tokio",
    remote = "...",
    commit = "...",
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions