[bazel] Fix golang cross-compilation on RBE
Without this change, one could not have a Mac Bazel host
and use our Linux executor to build for a Mac target.
What I observed was the host uploading the Mac go toolchain
to the Linux RBE instance and that not working.
To fix this, we explicitly download a Linux golang toolchain
as well as one for the host machine. This is straightforward
after the fact (See WORKSPACE.bazel) but took a bit of
experimentation and doc reading to get right.
To *use* the right toolchain, one must tell the Linux
RBE instance the target platform should be the same as
the host platform. This is a smidge tricky to do correctly
in a script (e.g. a Makefile), so I also added a short
Bazel (read: Python) script to call `go version` and parse
the output into a Bazel-ready os_arch string.
Change-Id: If009316209c46efa912f39f0f55bd7d6734d27c5
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/604061
Reviewed-by: Leandro Lovisolo <lovisolo@google.com>
3 files changed