rules_rust icon indicating copy to clipboard operation
rules_rust copied to clipboard

Add support for package alias in bzlmod

Open nmattia opened this issue 1 month ago • 0 comments

When a WORKSPACE.bazel is used, crates can be aliased in crates_repository (useful if multiple versions of the same crate are being used):

crates_repository(
    name = "crate_index",
    ...
    packages = {
        "actix-rt": crate.spec(
            version = "^2.10.0",
        ),
        "actix-rt-old": crate.spec(
            package = "actix-rt",
            version = "1.0.0",
        ),
    )
)

this is not possible anymore when using MODULE.bazel. It would be great to be able to specify an alias:

crate.spec(
    package = "actix-rt",
    version = "^2.10.0",
)

crate.spec(
    package = "actix-rt",
    package_alias = "actix-rt-old",
    version = "^1.0.0",
)

nmattia avatar Nov 25 '25 15:11 nmattia