Skip to content

bazel_dep should allow specifying a maximum supported compatibility_level #17378

@brentleyjones

Description

@brentleyjones

Description of the feature request:

bazel_dep should gain something like a max_compatibility_level which would allow specifying an upper bound for a dependency. The version would imply the lower compatibility_level.

What underlying problem are you trying to solve with this feature?

Image that rules_apple depends on another module, rules_swift, at version=1.0.0/compatibility_level=1. Then rules_swift makes an API breaking change and bumps to version=2.0.0/compatibility_level=2. In subsequent change to rules_apple it accommodates the new API in a way that it can use either version/compatibility_level of rules_swift. Currently there is no way to declare that in bazel_dep, because bazel_dep(name = "rules_swift", version = "1.0.0") will cause a resolution issue if another dep or the root module declares a dependency on rules_swift 2.0.0, and bazel_dep(name = "rules_swift", version = "2.0.0") will do the same the other way. Ideally it could do this instead: bazel_dep(name = "rules_swift", version = "1.0.0", max_compatibility_level = 2) to say that it supports both.

This is a real problem that I see happening very soon, just with different example rulesets (rules_xcodeproj and rules_apple).

Which operating system are you running Bazel on?

No response

What is the output of bazel info release?

No response

If bazel info release returns development version or (@non-git), tell us how you built Bazel.

No response

What's the output of git remote get-url origin; git rev-parse master; git rev-parse HEAD ?

No response

Have you found anything relevant by searching the web?

No response

Any other information, logs, or outputs that you want to share?

https://bazelbuild.slack.com/archives/C014RARENH0/p1675176300407969

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2We'll consider working on this in future. (Assignee optional)area-BzlmodBzlmod-specific PRs, issues, and feature requeststeam-ExternalDepsExternal dependency handling, remote repositiories, WORKSPACE file.type: feature request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions