Create configurable platforms
As part of !107 (merged) there was some exploration into being able to provide a 'configurable' platform.
A configurable platform is one that works with the configurable toolchain that allows providing the NetworkService Resource arguments via CLI string_flags.
There was a discussion on the MR about being able to specify the os/cpu by providing a label_flag on the bazel CLI which would essentially add those constraints to a generic configurable platform that looked like:
platform(
name = "configurable",
constraint_values = [
"//labgrid/constraint/device:configurable",
"//labgrid/platform:configurable_cpu",
"//labgrid/platform:configurable_os",
],
You could then run the CLI like so:
bazelisk run --configurable_cpu=@platforms//cpu:arm64 (...)
This doesn't seem to work since Bazel 7 due to a bazel issue which suggest using label_flags for constraints is not the correct way to go.
That issue does mention Platform based flags so that is something to explore but I'm not certain whether that is fully implemented yet, at least it isn't documented at the moment.
One other approach that was taken was to attempt to change the platform.parents
attribute in the transition in store.bzl
.
Although the label_flag was usable with the parents field, it proved difficult to get hold of the PlatformInfo Provider to modify the parents field.
At that point in the transition it seemed as though the label_flag was already resolved and just used the default.
So this ticket is to explore various options and see if we can find a way to make defining platforms in a configurable way, rather than having to come up with the current approach which is a list comprehension of many cpu/os combinations.