Skip to content

Add support for package alias in bzlmod #3742

@nmattia

Description

@nmattia

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",
)

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