Skip to content
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

[8.1.0] Add set data type to Starlark #25111

Merged
merged 2 commits into from
Jan 28, 2025

Conversation

tetromino
Copy link
Contributor

Cherry-pick of the following 2 commits:

  1. 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#264

    Replicates 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

  2. 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

Experimental feature guarded by --experimental_enable_starlark_set.

This is the Bazel implementation of bazelbuild/starlark#264

Replicates 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
bazelbuild@c5e08d4
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
bazelbuild@8ae2570
@tetromino tetromino added the team-Starlark-Interpreter Issues involving the Starlark interpreter used by Bazel label Jan 28, 2025
@tetromino tetromino added this to the 8.1.0 release blockers milestone Jan 28, 2025
@tetromino tetromino requested a review from a team as a code owner January 28, 2025 18:44
@github-actions github-actions bot added the awaiting-review PR is awaiting review from an assigned reviewer label Jan 28, 2025
@tetromino
Copy link
Contributor Author

Cherry-pick into 8.1.0 was suggested by @fmeum in 8ae2570#commitcomment-150509483

tetromino referenced this pull request Jan 28, 2025
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
@Wyverald Wyverald enabled auto-merge January 28, 2025 18:55
@Wyverald Wyverald added this pull request to the merge queue Jan 28, 2025
Merged via the queue into bazelbuild:release-8.1.0 with commit 8ad5f32 Jan 28, 2025
46 checks passed
@github-actions github-actions bot removed the awaiting-review PR is awaiting review from an assigned reviewer label Jan 28, 2025
@tetromino tetromino deleted the release-8.1.0-sets branch January 29, 2025 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
team-Starlark-Interpreter Issues involving the Starlark interpreter used by Bazel
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants