bazelbuild / bazelbuild/rules_rust

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

Open
#3,495 1 comment 0 reactions 0 assignees View on GitHub
needs-triage
Dominant language
Starlark
Stars
843
Forks
651
Avg merge
2d 18h
Merged PRs (30d)
15

Description

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 = "...",
)
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.