Wow, platforms. Pretty amazing stuff.
So. I have defined some platforms, and I'm trying to wire them all up. I have done the following:
- constraint_setting of java_runtime, with associated constraint_values of 'legacy_java_runtime' and 'modern_java_runtime'
- constraint_setting of export with associated constraint_values of 'building_for_export' and 'not_building_for_export'
- platform of 'host_and_execution' with constraint_values of 'modern_java_runtime' and 'not_building_for_export'
- platform of 'targetting_normal_service_deployment' with constraint_values of 'modern_java_runtime' and 'not-building_for_export'
- platform of 'targetting_legacy_export' with constraint_values of 'legacy_java_runtime' and 'building_for_export'
- java_toolchain 'modern_java_toolchain' at version 20, with an associated zulu jvm @ 20, registered with a toolchain of type @bazel_tools//tools/jdk:toolchain_type
- toolchain of type @bazel_tools//tools/jdk:runtime_toolchain_type, pointing at a zulu jvm @ 20
- java_toolchain 'legacy_java_toolchain' at version 11, with an associated zulu jvm @ 11, registered with a toolchain of type @bazel_tools//tools/jdk:toolchain_type
- registration of all the platforms in WORKSPACE
- addition to .bazelrc of 'common --host_platform=host_and_execution --platforms=host_and_execution
- transition which sets --platforms=targetting_legacy_export
So my questions now are:
- does this setup seem approximately sane?
- is it right to do the transition in platform space?
- what should I be setting in the platforms' exec_compatible_with and target_compatible_with configuation so that I end up with that desired outcome I layed out above, please? Or should I set something else somewhere else?
Thank you so much for your time.