bazel-contrib / bazel-contrib/rules_oci
FR: Let the user customise the _PLATFORM_TO_BAZEL_CPU mapping and make the oci_pull platform logic stricter
- Dominant language
- Starlark
- Stars
- 423
- Forks
- 213
- Avg merge
- 53m
- Merged PRs (30d)
- 1
Description
The current behaviour of `oci_pull` for multi-arch images is that `platforms` entries absent from the `_PLATFORM_TO_BAZEL_CPU` mapping are silently omitted from the `select( ... )` in the `oci_pull` alias.
A better behavior would be to fail if *any* of the elements in the `platforms` attribute is not supported.
In order to ensure that users with exotic platforms don't get stuck with an impossible-to-fix error, we should also let the user specify their own platform-to-bazel-cpu mapping in case they need to handle platforms that are not currently present in the hardcoded `_PLATFORM_TO_BAZEL_CPU` mapping provided by `rules_oci`.
Contributor guide
Research direction
Start by tracing the oci_pull handling of the platforms attribute, the _PLATFORM_TO_BAZEL_CPU mapping, and the select(...) used in the alias. Verify how unsupported entries are currently omitted; done means users can provide an additional mapping and any unsupported platform causes a clear failure rather than being silently dropped.
Written by the indexing model from the issue text.
Assessment
- Domain
- build-system
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100