-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Misreported error with max_compatibility_level violation #22972
Copy link
Copy link
Closed
Labels
P3We're not considering working on this, but happy to review a PR. (No assignee)We're not considering working on this, but happy to review a PR. (No assignee)area-BzlmodBzlmod-specific PRs, issues, and feature requestsBzlmod-specific PRs, issues, and feature requestsbad error messagingIssues where users get stuck because they don't understand what they did wrongIssues where users get stuck because they don't understand what they did wrongteam-ExternalDepsExternal dependency handling, remote repositiories, WORKSPACE file.External dependency handling, remote repositiories, WORKSPACE file.type: bug
Metadata
Metadata
Assignees
Labels
P3We're not considering working on this, but happy to review a PR. (No assignee)We're not considering working on this, but happy to review a PR. (No assignee)area-BzlmodBzlmod-specific PRs, issues, and feature requestsBzlmod-specific PRs, issues, and feature requestsbad error messagingIssues where users get stuck because they don't understand what they did wrongIssues where users get stuck because they don't understand what they did wrongteam-ExternalDepsExternal dependency handling, remote repositiories, WORKSPACE file.External dependency handling, remote repositiories, WORKSPACE file.type: bug
bazel/src/main/java/com/google/devtools/build/lib/bazel/bzlmod/Selection.java
Lines 343 to 345 in d5e62f1
As the comment above describes, we report the error we see when we tried the first resolution strategy. But this error could be confusing since it could point blame at a
bazel_depthat has the rightmax_compatibility_levelset.See https://github.com/Wyverald/max_compat_level_repro for a repro (Bazel 7.2.1): root depends on foo@1 and bar@2. foo@1 depends on bar@1, with
max_compatibility_level=2. This is all fine (we end up using bar@2). But if root adds a new dependency on quux@1 which has a dependency on bar@1, we run into an error (correctly). However, the error we report points blame at thefoo@1 -> bar@1 (max_compat=2)edge.It's unclear to me yet how to report a "sensible" error here -- will need to think a bit.