Skip to content

agents(starlark): document depset element immutability and provider conventions - #4060

Merged
rickeylev merged 1 commit into
bazel-contrib:mainfrom
rickeylev:agents_starlark_depset_rules
Aug 16, 2026
Merged

agents(starlark): document depset element immutability and provider conventions#4060
rickeylev merged 1 commit into
bazel-contrib:mainfrom
rickeylev:agents_starlark_depset_rules

Conversation

@rickeylev

Copy link
Copy Markdown
Collaborator

agents(starlark): document depset element immutability and provider conventions

Depset elements and nested provider fields must be immutable upon depset
construction in Bazel, and using providers rather than structs enables
key sharing to minimize memory overhead. Documenting these invariants
helps agents adhere to Bazel best practices and avoid runtime errors
or buildifier lint warnings when working with custom providers in
depsets.

Update Starlark agent rules to require providers for depset elements,
enforce tuple or depset types for nested fields instead of mutable
lists, and document the buildifier suppression convention for non-Info
providers.

…onventions

Depset elements and nested provider fields must be immutable upon depset
construction in Bazel, and using providers rather than structs enables
key sharing to minimize memory overhead. Documenting these invariants
helps agents adhere to Bazel best practices and avoid runtime errors
or buildifier lint warnings when working with custom providers in
depsets.

Update Starlark agent rules to require providers for depset elements,
enforce tuple or depset types for nested fields instead of mutable
lists, and document the buildifier suppression convention for non-Info
providers.
@rickeylev
rickeylev requested a review from aignas as a code owner August 16, 2026 20:49
@rickeylev
rickeylev merged commit 865b4e4 into bazel-contrib:main Aug 16, 2026
3 of 5 checks passed
@rickeylev
rickeylev deleted the agents_starlark_depset_rules branch August 16, 2026 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant