mirror of
https://github.com/google/benchmark.git
synced 2025-02-27 03:40:08 +08:00
It is now possible to build Mac wheels on native machines in Github Actions, so ARM64 Mac wheels are now built and tested on M1 machines. Also, the artifact up-/download was migrated to v4, which made it necessary to upload wheels to unique artifact names, and then later stitch them together again in a subsequent job. The cross-platform Mac build injection in setup.py was removed, since it is no longer necessary. I relanded a monkey-patching of Bazel build files, this time for MODULE.bazel. This is because `rules_python` does not allow running as the root user, which is the case in cibuildwheel+Linux (happens in a Docker container). Since I did not see a quick way of switching to rootless containers, and did not want to hardcode the config change (it can apparently cause cache misses and build failures), I inject the "ignore_root_user_error" flag into the MODULE.bazel file when running in cibuildwheel on Linux.
13 lines
389 B
Bash
13 lines
389 B
Bash
if ! bazel version; then
|
|
arch=$(uname -m)
|
|
if [ "$arch" == "aarch64" ]; then
|
|
arch="arm64"
|
|
fi
|
|
echo "Downloading $arch Bazel binary from GitHub releases."
|
|
curl -L -o $HOME/bin/bazel --create-dirs "https://github.com/bazelbuild/bazel/releases/download/7.1.1/bazel-7.1.1-linux-$arch"
|
|
chmod +x $HOME/bin/bazel
|
|
else
|
|
# Bazel is installed for the correct architecture
|
|
exit 0
|
|
fi
|