platform(name = "foobar",constraint_values = ["@platforms//cpu:arm","@platforms//os:android",],)cc_library(name = "lib",)
c:\git\bazel-issues\platforms_output_dir2>c:\bazel\bazel-master build --platforms //:foobar --incompatible_enable_cc_toolchain_resolution --toolchain_resolution_debug --compilation_mode opt ...INFO: Writing tracer profile to 'C:/users/yurchuk/_bazel_yurchuk/dyw5dx65/command.profile.gz'INFO: ToolchainResolution: Looking for toolchain of type @bazel_tools//tools/cpp:toolchain_type...INFO: ToolchainResolution: Considering toolchain @local_config_cc//:cc-compiler-armeabi-v7a...INFO: ToolchainResolution: Considering toolchain @local_config_cc//:cc-compiler-x64_windows...INFO: ToolchainResolution: Toolchain constraint @platforms//cpu:cpu has value @platforms//cpu:x86_64, which does not match value @platforms//cpu:arm from the target platform //:foobarINFO: ToolchainResolution: Toolchain constraint @platforms//os:os has value @platforms//os:windows, which does not match value @platforms//os:android from the target platform //:foobarINFO: ToolchainResolution: Rejected toolchain @local_config_cc//:cc-compiler-x64_windows, because of target platform mismatchINFO: ToolchainResolution: For toolchain type @bazel_tools//tools/cpp:toolchain_type, possible execution platforms and toolchains: {@local_config_platform//:host -> @local_config_cc//:cc-compiler-armeabi-v7a}INFO: ToolchainResolution: Selected execution platform @local_config_platform//:host, type @bazel_tools//tools/cpp:toolchain_type -> toolchain @local_config_cc//:cc-compiler-armeabi-v7aINFO: ToolchainResolution: Selected execution platform @local_config_platform//:host,INFO: Analyzed target //:lib (1 packages loaded, 2 targets configured).INFO: Found 1 target...Target //:lib up-to-date (nothing to build)INFO: Elapsed time: 0.433s, Critical Path: 0.01sINFO: 0 processes.INFO: Build completed successfully, 1 total action
c:\git\bazel-issues\platforms_output_dir2>dir bazel-outVolume in drive C has no label.Volume Serial Number is B0A8-33A4Directory of c:\git\bazel-issues\platforms_output_dir2\bazel-out14.10.2019 14:02 <DIR> .14.10.2019 14:02 <DIR> ..14.10.2019 14:02 57 stable-status.txt14.10.2019 14:02 27 volatile-status.txt14.10.2019 14:02 <DIR> x64_windows-opt14.10.2019 14:02 <DIR> _tmp2 File(s) 84 bytes4 Dir(s) 103 032 303 616 bytes free
--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/2f16f5da-297e-499b-9d6e-b004735edd2a%40googlegroups.com.
platforms://:foobar--cpu=k8
c:\git\bazel-issues\platforms_output_dir>c:\bazel\bazel-master build --platforms //:foobar --incompatible_enable_cc_toolchain_resolution --toolchain_resolution_debug --compilation_mode opt ...INFO: Writing tracer profile to 'C:/users/yurchuk/_bazel_yurchuk/ubpijymk/command.profile.gz'INFO: Build option --cpu has changed, discarding analysis cache.
INFO: ToolchainResolution: Looking for toolchain of type @bazel_tools//tools/cpp:toolchain_type...INFO: ToolchainResolution: Considering toolchain @local_config_cc//:cc-compiler-armeabi-v7a...INFO: ToolchainResolution: Considering toolchain @local_config_cc//:cc-compiler-x64_windows...INFO: ToolchainResolution: Toolchain constraint @platforms//cpu:cpu has value @platforms//cpu:x86_64, which does not match value @platforms//cpu:arm from the target platform //:foobarINFO: ToolchainResolution: Toolchain constraint @platforms//os:os has value @platforms//os:windows, which does not match value @platforms//os:android from the target platform //:foobarINFO: ToolchainResolution: Rejected toolchain @local_config_cc//:cc-compiler-x64_windows, because of target platform mismatchINFO: ToolchainResolution: For toolchain type @bazel_tools//tools/cpp:toolchain_type, possible execution platforms and toolchains: {@local_config_platform//:host -> @local_config_cc//:cc-compiler-armeabi-v7a}INFO: ToolchainResolution: Selected execution platform @local_config_platform//:host, type @bazel_tools//tools/cpp:toolchain_type -> toolchain @local_config_cc//:cc-compiler-armeabi-v7aINFO: ToolchainResolution: Selected execution platform @local_config_platform//:host,INFO: ToolchainResolution: Selected execution platform @local_config_platform//:host,
ERROR: C:/users/yurchuk/_bazel_yurchuk/ubpijymk/external/local_config_cc/BUILD:47:1: in cc_toolchain_suite rule @local_config_cc//:toolchain: cc_toolchain_suite '@local_config_cc//:toolchain' does not contain a toolchain for cpu 'k8'ERROR: Analysis of target '//:lib' failed; build aborted: Analysis of target '@local_config_cc//:toolchain' failed; build abortedINFO: Elapsed time: 0.447sINFO: 0 processes.FAILED: Build did NOT complete successfully (0 packages loaded, 54 targets configured)
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-...@googlegroups.com.
Hello, Greg!Thank you for detailed answer. As I'm understood I can specify platform mappings, and output directory will use cpu from mappings. But seems, this is not working as I'm expected. As an example I put following platform_mappings in my workspace rootplatforms://:foobar--cpu=k8And I've expected, that (with same bazel invocation from first message)- since I specified --platform option bazel will not rely on --cpu=k8 in toolchain resolutions- since bazel has cpu value it will create output directory with name "k8-opt" (or something like that)
But bazel start trying to use cpu value in toolchain resolution:
ERROR: C:/users/yurchuk/_bazel_yurchuk/ubpijymk/external/local_config_cc/BUILD:47:1: in cc_toolchain_suite rule @local_config_cc//:toolchain: cc_toolchain_suite '@local_config_cc//:toolchain' does not contain a toolchain for cpu 'k8'
So, no idea how to make predictable names in bazel-out with platform mappings. Or, maybe, I missed something?
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/22bf223d-406d-4412-afaa-65a9870013c6%40googlegroups.com.
Few thoughts about platform output naming: why not just add field "platform_canonical_name" as platform argument and create directory with that name in bazel-out? There are no problems mentioned by you:- bazel built-in directories can be declared in compatible way with existing --cpu stuff- there is no problem mentioned as "Too few and .... Too many and ...", because it is user's business. User can by self specify not intersecting names for own platforms. Moreover, I think it's totally unsolvable problem to generate platform directory output name on bazel side, because user can put own constraint values (for example glibc version, compiler version, sanitaizer settings and many others) which are not built-in in bazel, so bazel can't use its in directory naming.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/22bf223d-406d-4412-afaa-65a9870013c6%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/22bf223d-406d-4412-afaa-65a9870013c6%40googlegroups.com.