-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
incompatible_always_check_depset_elements: depset: depset(direct=...) constructor does not check element validity #10313
Comments
Can you check if I suspect this migration should be a blocker for #9017. |
Without the flag, depset([(x,)]) reports an error if and only if x is (or contains) a mutable value. With the flag, the expression succeeds even if x is (or contains) a mutable value. I could not see any difference between Blaze at tip and the previous release of Blaze, which is encouraging. |
…rlark-hashable. All other subclasses of analysis.ConfiguredTarget were already marked as @immutable in 13abce5. There are several starlark files using InputFileConfiguredTarget in a depset which breaks when --incompatible_always_check_depset_elements is flipped unless the class is marked @immutable. See also: #10313 PiperOrigin-RevId: 297103804
Fixes bazelbuild/bazel#10313 RELNOTES: The flag `--incompatible_always_check_depset_elements` is enabled by default. PiperOrigin-RevId: 297852167
…arlark-hashable. All other subclasses of analysis.ConfiguredTarget were already marked as @immutable in bazelbuild/bazel@13abce5. There are several starlark files using InputFileConfiguredTarget in a depset which breaks when --incompatible_always_check_depset_elements is flipped unless the class is marked @immutable. See also: bazelbuild/bazel#10313 PiperOrigin-RevId: 297103804
The depset(direct=...) constructor that we have been recently migrating users towards does not apply the same element validity checks as the legacy depset([...]) constructor. Consequently one can insert mutable items such as structs and tuples containing lists:
The fix is to apply the same checks as done by the legacy constructor, but this is a breaking change. The new check will thus be behind a flag called
--incompatible_always_check_depset_elements
.The text was updated successfully, but these errors were encountered: