[8.1.0] Add set data type to Starlark #25111
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Cherry-pick of the following 2 commits:
Add set data type to Starlark
Experimental feature guarded by --experimental_enable_starlark_set.
This is the Bazel implementation of proposal: add a
set
data type starlark#264Replicates the Python 3 set API and (in almost all respects) the starlark-go
implementation, with the notable exception of explicitly not supporting
(partial) ordering of sets.
Note that there are no set-valued attributes (nor plans to add any), and
set-valued select() expressions are not supported.
RELNOTES: Add a set data type to Starlark, guarded by the --experimental_enable_starlark_set flag.
PiperOrigin-RevId: 695886977
Change-Id: Id1e178bd3dd354619f188c4375d8a1256bd55f75
Cherry-picked from
c5e08d4
Enable Starlark sets by default
Now that the Starlark language spec has been approved: https://github.com/bazelbuild/starlark/blob/master/spec.md#sets
Require elements of arguments to StarlarkSet methods to be hashable, matching
the final version of the language spec.
Take the opportunity to update our documentation to match the spec whenever
reasonable (modulo minor differences in terminology and formatting).
RELNOTES: Flip --experimental_enable_starlark_set and enable the Starlark set data type by default.
PiperOrigin-RevId: 707659085
Change-Id: Ibcad59838f9709e980d7b69f4957b8f0fede51c6
Cherry-picked from
8ae2570