Skip to content

Conversation

@fmeum
Copy link
Collaborator

@fmeum fmeum commented Jan 19, 2026

Since Bazel's only FileWriteStrategy doesn't execute a spawn, this can currently only affect the path mapping behavior of the action when supplying Args as content. This will make it possible to opt C++ rules into path mapping without any command line flags beyond --experimental_output_paths=strip in future PRs.

Work towards #27732
Work towards #27591

Since Bazel's only `FileWriteStrategy` doesn't execute a spawn, this can currently only affect the path mapping behavior of the action when supplying `Args` as content. This will make it possible to opt C++ rules into path mapping without any command line flags beyond `--experimental_output_paths=strip` in future PRs.

Work towards bazelbuild#27732
Work towards bazelbuild#27591
@fmeum fmeum marked this pull request as ready for review January 19, 2026 12:10
@fmeum fmeum requested a review from a team as a code owner January 19, 2026 12:10
@fmeum fmeum requested review from dabanki and removed request for a team January 19, 2026 12:10
@github-actions github-actions bot added team-Configurability platforms, toolchains, cquery, select(), config transitions awaiting-review PR is awaiting review from an assigned reviewer labels Jan 19, 2026
@fmeum fmeum removed the request for review from dabanki January 19, 2026 12:10
@fmeum
Copy link
Collaborator Author

fmeum commented Jan 19, 2026

@hvadehra I would have assigned Ivo for review in the past - who would be the right person for rules API changes nowadays?

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds an execution_requirements parameter to ctx.actions.write. This allows passing execution information, which for now is mainly used to enable path mapping for actions that write parameter files (Args content). The changes to the Starlark API and the action factory implementation look correct and are accompanied by a new test. I've pointed out a potential issue where ParameterFileWriteAction doesn't persist all execution requirements, which could be surprising for users inspecting the action.

@hvadehra
Copy link
Member

@hvadehra I would have assigned Ivo for review in the past - who would be the right person for rules API changes nowadays?

* [`team-Rules-API`](https://github.com/bazelbuild/bazel/labels/team-Rules-API){: .external}: API for writing rules/aspects: providers, runfiles, actions, artifacts
* Contact: [pzembrod](https://github.com/pzembrod){: .external}

@fmeum fmeum requested a review from pzembrod January 20, 2026 09:18
@hvadehra hvadehra self-requested a review January 20, 2026 13:31
Copy link
Collaborator

@katre katre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@hvadehra hvadehra added awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally team-Rules-API API for writing rules/aspects: providers, runfiles, actions, artifacts and removed awaiting-review PR is awaiting review from an assigned reviewer labels Jan 20, 2026
@fmeum
Copy link
Collaborator Author

fmeum commented Jan 20, 2026

@bazel-io fork 9.0.0

doc =
"Information for scheduling the action. See "
+ "<a href=\"${link common-definitions#common.tags}\">tags</a> "
+ "for useful keys."),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realize that this is our existing standard doc for execution_requirements; however, it is a bit confusing to me, given that tags in https://bazel.build/reference/be/common-definitions#common.tags is described as list of string, whereas here we have a dict. Do we have any better documentation for execution_requirements that we could point to? Or that we could write?

@github-actions github-actions bot removed the awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally label Jan 21, 2026
bazel-io pushed a commit to bazel-io/bazel that referenced this pull request Jan 21, 2026
Since Bazel's only `FileWriteStrategy` doesn't execute a spawn, this can currently only affect the path mapping behavior of the action when supplying `Args` as content. This will make it possible to opt C++ rules into path mapping without any command line flags beyond `--experimental_output_paths=strip` in future PRs.

Work towards bazelbuild#27732
Work towards bazelbuild#27591

Closes bazelbuild#28335.

PiperOrigin-RevId: 859069420
Change-Id: I73db26fb1f37303f49931ab19cd12575536607fb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

team-Configurability platforms, toolchains, cquery, select(), config transitions team-Rules-API API for writing rules/aspects: providers, runfiles, actions, artifacts

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants