Skip to content

Fix builtin action resource set regression introdued by #29284 - #30747

Closed
Silic0nS0ldier wants to merge 3 commits into
bazelbuild:masterfrom
Silic0nS0ldier:restore-builtin-action-resource-sets
Closed

Silic0nS0ldier wants to merge 3 commits into
bazelbuild:masterfrom
Silic0nS0ldier:restore-builtin-action-resource-sets

Conversation

@Silic0nS0ldier

Copy link
Copy Markdown
Contributor

Description

Fixes a regression introduced by #29284 where local resource specifications (resources:*:*, cpu:* and memory:*) affected builtin actions such as;

  • test.xml generator action
  • C spawn include scanner

Also moves resource overriding into ResourceSetOrBuilder to reduce the risk of drift between BaseSpawn and SimpleSpawn.

Motivation

Deriving local resource sets in these builtin spawns causes otherwise lightweight tasks to backup (and temporarily block) other larger spawns due to them taking an unreasonably high number of resource permits. In the case of test.xml generation, when resources are exhausted it can cause tests to visibly appear as if they are running for much longer than they really are (exacerbation of an existing issue where test.xml generation scheduling is not differentiated from spawn running in UI and potentially elsewhere).

Build API Changes

No

Checklist

  • I have added tests for the new use cases (if any).
  • I have updated the documentation (if applicable).

Release Notes

RELNOTES: Fix for regression in #29284 that caused select builtin actions to incorrectly inherit resource set overrides.

@Silic0nS0ldier

Silic0nS0ldier commented Aug 17, 2026 •

Copy link
Copy Markdown
Contributor Author

A followup to this PR is planned that will remove LocalResourcesSupplier (introduced in 91d93f6) which I believe can now be covered by ResourceSetOrBuilder while retaining the lazy evaluation of local resource requirements (intended to optimise remote execution).

EDIT: Removal composed better than expected. Addressing here.

@fmeum

fmeum commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

@bazel-io fork 9.3.0

@fmeum

fmeum commented Aug 17, 2026

Copy link
Copy Markdown
Collaborator

Let me know when you want me to take a look. I'm also looking into this now, we might need to fix more

@fmeum fmeum left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I looked into this a bit more and I don't think that more is needed here. Feel free to mark as ready for review at any time.

@github-actions github-actions Bot added the community-reviewed Reviewed by a trusted community contributor label Aug 20, 2026
@meisterT

Copy link
Copy Markdown
Member

What are the steps to make this non-draft?

@Silic0nS0ldier
Silic0nS0ldier force-pushed the restore-builtin-action-resource-sets branch from 3c740c7 to f076d29 Compare September 2, 2026 05:00
@lberki

lberki commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Is this ready for review? (I assumed it was not since it has the "draft" tag")

@iancha1992

Copy link
Copy Markdown
Contributor

@Silic0nS0ldier Is this ready for review? It's currentlly in draft mode.

@Silic0nS0ldier
Silic0nS0ldier marked this pull request as ready for review September 3, 2026 13:27
@github-actions github-actions Bot added team-Performance Issues for Performance teams team-Rules-CPP Issues for C++ rules awaiting-review PR is awaiting review from an assigned reviewer labels Sep 3, 2026
@Silic0nS0ldier

Copy link
Copy Markdown
Contributor Author

Sorry for the delay. PR was raised in a rush (I had other responsibilities to attend to) so I'd not scrutinized some parts as much as others (hence draft).

I've now had the chance to fully look it over (and action feedback), so this is now ready for review.

@lberki lberki left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks! Looks very reasonable.

@keith

keith commented Sep 4, 2026

Copy link
Copy Markdown
Member

thanks for fixing!

@meisterT meisterT added awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally and removed awaiting-review PR is awaiting review from an assigned reviewer labels Sep 7, 2026
@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 Sep 14, 2026
bazel-io pushed a commit to bazel-io/bazel that referenced this pull request Sep 15, 2026
…build#29284 (https… (bazelbuild#31136)

…://github.com/bazelbuild/pull/30747)

Fixes a regression introduced by bazelbuild#29284 where local resource
specifications (`resources:*:*`, `cpu:*` and `memory:*`) affected
builtin actions such as;
- `test.xml` generator action
- C spawn include scanner

Also moves resource overriding into `ResourceSetOrBuilder` to reduce the
risk of drift between `BaseSpawn` and `SimpleSpawn`.

Deriving local resource sets in these builtin spawns causes otherwise
lightweight tasks to backup (and temporarily block) other larger spawns
due to them taking an unreasonably high number of resource permits. In
the case of `test.xml` generation, when resources are exhausted it can
cause tests to visibly appear as if they are running for much longer
than they really are (exacerbation of an existing issue where `test.xml`
generation scheduling is not differentiated from spawn running in UI and
potentially elsewhere).

No

- [x] I have added tests for the new use cases (if any).
- [x] I have updated the documentation (if applicable).

RELNOTES: Fix for regression in bazelbuild#29284 that caused select builtin
actions to incorrectly inherit resource set overrides.

Closes bazelbuild#30747.

PiperOrigin-RevId: 981231820
Change-Id: If2dd7b33fefca8ebe2ba4866cc87bc7316230fd1

<!--
Thank you for contributing to Bazel!
Please read the contribution guidelines: https://bazel.build/contribute
-->

### Description
<!--
Please provide a brief summary of the changes in this PR.
-->

### Motivation
<!--
Why is this change important? Does it fix a specific bug or add a new
feature?
If this PR fixes an existing issue, please link it here (e.g. "Fixes
bazelbuild#1234").
-->

### Build API Changes
<!--
Does this PR affect the Build API? (e.g. Starlark API, providers,
command-line flags, native rules)
If yes, please answer the following:
1. Has this been discussed in a design doc or issue? (Please link it)
2. Is the change backward compatible?
3. If it's a breaking change, what is the migration plan?
-->

No

### Checklist

- [ ] I have added tests for the new use cases (if any).
- [ ] I have updated the documentation (if applicable).

### Release Notes

<!--
If this is a new feature, please add 'RELNOTES[NEW]: <description>'
here.
If this is a breaking change, please add 'RELNOTES[INC]: <reason>' here.
If this change should be mentioned in release notes, please add
'RELNOTES: <reason>' here.
-->

RELNOTES: None

Commit
bazelbuild@af88dde

Co-authored-by: Jordan Mele <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-reviewed Reviewed by a trusted community contributor team-Performance Issues for Performance teams team-Rules-CPP Issues for C++ rules

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants