Hey there,
Continuing our discussion, about platformizing C++ rules, now that I think we have a solution for Go, the next is Android and iOS.
My understanding is that there are the following problems (please check if I'm right!):
- Android and iOS configuration transitions tweak the legacy flags (--cpu, --crosstool_top, --compiler and the like)
- We currently don't have official platform specifications for Android (and probably for iOS)
- We currently don't define the NDK toolchains (iOS, I have no clue)
- We currently don't have the relevant flags, specifically, a platform-based alternative for --ios_multi_pcu and --fat_apk_cpu and the incompatible flag disabling the legacy behavior
The current official workaround is to have a platform mappings file that maps back and forth between the legacy flags and platforms, thereby making it possible for the toolchain resolution to have some platform that could be used for matching toolchains. However, one still needs to define the Android platforms and toolchains for this to work.
So in an ideal world, we'd (solution A):
- Define the Android and iOS toolchains and platforms
- Change the Android and iOS config transitions to transition by platforms and put that behind an incompatible flag
- Flip the flag in Bazel 1.0
However, (1) and probably (2) would need to be done before 1.0 is cut, which is within a week. So if we want to do the ideal solution, it's pretty much a fire drlll and/or postponing 0.29 .
Alternatively, we could increase success by lowering expectations and instead of "C++ code is platformized" we could decree "non-mobile C++ code is platformized". To that end, we either (solution B):
- Define the Android and iOS toolchains and platforms
- Implement an official platform mapping file that could transform the --cpu/--crosstool_top/--compiler options into platform constraints
- Probably put the functional change in (2) behind some sort of flag because it looks scary
Or (solution C) we change the Android and iOS configuration transitions to disable the "look up C++ toolchain by platforms" flag.
Given that solution B isn't much less work than solution A (in particular, we wouldn't spare ourselves the work defining mobile toolchains and platforms) we should either go with (A) or (C).
My heart is at (A) because, well, that's what "C++ rules are nicely platformized" means. Unfortunately, I don't see how we could do that without a fire drill and pushing 1.0 back.
WDYT?
--
Lukács T. Berki | Software Engineer | lbe...@google.com | Google Germany GmbH | Erika-Mann-Str. 33 | 80636 München | Germany | Geschäftsführer: Paul Manicle, Halimah DeLaine Prado | Registergericht und -nummer: Hamburg, HRB 86891