mac: Pull arm64 gn binary on M1 hosts.
...at least once there's an arm cipd binary. gclient's DEPS variables have a host_cpu variable (backed by detect_host_arch.py in depot_tools, which even correctly returns "arm64" on M1s), but it can't be queried via Var() in DEPS (and even if that was possible, the x64 value is "x64" and not "amd64" like we'd need for the cipd package name) and we can't use it in a gclient `condition` here either since we'd have to do something like 'src/buildtools/mac': { ...'gn/gn/mac-amd64' condition: 'host_os == "mac" and host_cpu == "x64"' } 'src/buildtools/mac': { ...'gn/gn/mac-arm64' condition: 'host_os == "mac" and host_cpu == "arm64"' } and then gclient would complain that we have two entries for the key 'src/buildtools/mac'. So gclient variables and cipd deps don't synergize very well here. However, cipd has a bunch of built-in variables too, and ${arch} is populated based on runtime.GOARCH and that is "amd64" in x64 and "arm64" on arm64, so we can use that: https://chromium.googlesource.com/infra/luci/luci-go/+/master/cipd/client/cipd/ensure/doc.go (In fact, we could use `gn/gn/${{platform}}` and remove the conditional on host_os. That might confuse linux/arm and windows/arm machines since we might not have gn prebuilts for those, but trying to build on those platforms probably doesn't work great for other reasons already?) Bug: 1103319 Change-Id: I2d445a02e5e05f9553929404a3d569f7fe7a2213 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2602663 Commit-Queue: Nico Weber <thakis@chromium.org> Auto-Submit: Nico Weber <thakis@chromium.org> Reviewed-by:Dirk Pranke <dpranke@google.com> Cr-Commit-Position: refs/heads/master@{#839584}
Showing
Please register or sign in to comment