Skip to content

Remove resource_set limitations#28013

Open
agomezl wants to merge 4 commits intobazelbuild:masterfrom
agomezl:generic_resource_set
Open

Remove resource_set limitations#28013
agomezl wants to merge 4 commits intobazelbuild:masterfrom
agomezl:generic_resource_set

Conversation

@agomezl
Copy link

@agomezl agomezl commented Dec 16, 2025

Currently, the resource_set attribute of ctx.actions.run (an similar) can only be set to a function returning a dictionary with a limited set of keys/resources (mem, cpu, and local_test). This change removes this restriction, allowing any resource known to the resource manager.

RELNOTES: resource_set function can now reference custom resources

Closes #27950

@google-cla
Copy link

google-cla bot commented Dec 16, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

Currently, the resource_set attribute of `ctx.actions.run` (an similar)
can only be set to a function returning a dictionary with a limited set
of keys/resources (mem, cpu, and local_test). This change removes this
restriction, allowing any resource know to the resource manager.

RELNOTES: `resource_set` function can now reference custom resources

Closes bazelbuild#27950
@agomezl agomezl force-pushed the generic_resource_set branch from 0dff987 to a47a795 Compare December 16, 2025 10:47
@agomezl
Copy link
Author

agomezl commented Dec 16, 2025

Ok, here is the code for #27950. Still missing:

  • Update the documentation
  • Find some good place for tests (Help appreciated 😜)

@fmeum
Copy link
Collaborator

fmeum commented Dec 16, 2025

@agomezl agomezl marked this pull request as ready for review December 16, 2025 21:53
@agomezl agomezl requested a review from a team as a code owner December 16, 2025 21:53
@agomezl agomezl requested review from gregestren and removed request for a team December 16, 2025 21:53
@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 Dec 16, 2025
@agomezl
Copy link
Author

agomezl commented Dec 16, 2025

I don't know what is the deal with the macos-arm64 tests, but they also fail in my personal mac with:

ERROR: Error computing the main repository mapping: Error accessing registry https://bcr.bazel.build/: 
Failed to fetch registry file https://bcr.bazel.build/modules/rules_cc/0.2.14/MODULE.bazel: No route to host

@fmeum
Copy link
Collaborator

fmeum commented Feb 11, 2026

@gregestren Friendly ping, although I assume this has some overlap with local exec (@meisterT for your opinion on this)

@meisterT
Copy link
Member

I think this is the right approach, but would appreciate a look from someone owning the Build API

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

awaiting-review PR is awaiting review from an assigned reviewer team-Configurability platforms, toolchains, cquery, select(), config transitions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow resource_set's callback to return custom resources

3 participants