Make BuildOptions immutable #6723
Labels
P3
We're not considering working on this, but happy to review a PR. (No assignee)
stale
Issues or PRs that are stale (no activity for 30 days)
team-Configurability
platforms, toolchains, cquery, select(), config transitions
type: process
Configuration transitions, which are a core building block of same-build multiplatform builds, work by transforming an input set of BuildOptions into an appropriate output set.
It's important that this transformation doesn't mutate the input set, since that would inadvertently apply the changes to the source configuration, which messes the whole transition up (in a best case) and destroys Bazel's internals (in a worst).
Unfortunately, the
BuildOptions
class isn't immutable. And it isn't easy to make it immutable with the way it's currently used.Starlark build configuration should eventually refactor this severely enough to make it naturally immutable. This issue tracks both that sub-effect (as a subset of #5574) and interim efforts to "harden up"
BuildOptions
today to at least make it "inconvenient" to mutate if not totally impossible.The text was updated successfully, but these errors were encountered: