Commit e6420f3
authored
feat: expand the usefulness of resource_sets (#1235)
This adds a new public function, `resource_set_for`, which takes a cpu
and memory value and returns an appropriate `resource_set` function for
those values, adding some support for the cross-product [mentioned in
the previous
pass](#792 (comment)).
The bazel resource_set API isn't very easy to work with, and this hides
the ugliness here, rather than expecting every module to implement
something like [rules_rust
did](https://github.com/bazelbuild/rules_rust/blob/f29a63cb3c473bd0158c8c9d3e0793a33187d505/rust/private/rustc_resource_set.bzl).
The ugliness of the implementation is mitigated slightly by using a
helper script to generate it, and I reason that people attempting to use
the `resource_set` API would be better off with additional abstraction,
so if/when this gets fixed in bazel, most people don't need to notice.1 parent 8a8fcd6 commit e6420f3
File tree
7 files changed
+2424
-46
lines changed- lib
- private
- tests
7 files changed
+2424
-46
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
276 | 276 | | |
277 | 277 | | |
278 | 278 | | |
| 279 | + | |
279 | 280 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
289 | 289 | | |
290 | 290 | | |
291 | 291 | | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
292 | 298 | | |
293 | 299 | | |
294 | 300 | | |
| |||
0 commit comments