You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I set a rust edition default in my WORKSPACE (e.g. rust_repositories(..., edition="2021", ...))
Another developer sets a different rust edition (e.g. "2018") in their WORKSPACE and uses that default for their rust rules
I import and use their code in my project
(Naively) expected behavior:
Targets from the imported repository build with edition="2018" where not overridden at the target level
Targets from my repository build with edition="2021" where not overriden at the target level
Actual behavior:
All targets default to edition="2021" regardless.
Some targets which relied on edition="2018" break as a result.
My understanding is that this is a bazel limitation more than anything -- bazel doesn't consult the WORKSPACE of an imported project at all, and from what I can tell doesn't offer much of a middle ground between setting global defaults in the workspace on the one hand and requiring the argument for all targets that use it on the other.
I don't know if there's a satisfying way to fix this, but it'd be good to at least have the docs mention the limitation and mitigation.
The text was updated successfully, but these errors were encountered:
I believe #1256 addressed this issue so I'll close this out. @silas-enf definitely reopen this (or someone ping this issue and I can do so) if I'm mistaken!
For a concrete example of the problem, see dtolnay/cxx#1031.
Scenario:
rust_repositories(..., edition="2021", ...)
)(Naively) expected behavior:
edition="2018"
where not overridden at the target leveledition="2021"
where not overriden at the target levelActual behavior:
edition="2021"
regardless.edition="2018"
break as a result.My understanding is that this is a bazel limitation more than anything -- bazel doesn't consult the WORKSPACE of an imported project at all, and from what I can tell doesn't offer much of a middle ground between setting global defaults in the workspace on the one hand and requiring the argument for all targets that use it on the other.
I don't know if there's a satisfying way to fix this, but it'd be good to at least have the docs mention the limitation and mitigation.
The text was updated successfully, but these errors were encountered: