google / benchmark

A microbenchmark support library
Apache License 2.0
8.59k stars 1.57k forks source link

Modernize wheel building job config #1783

Closed nicholasjng closed 2 months ago

nicholasjng commented 2 months ago

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.


That last paragraph wrecked my day, but that's apparently a design choice by rules_python. I verified that the wheels build, see https://github.com/nicholasjng/benchmark/actions/runs/8691995492 (the failure is only because I screwed up the musllinux exclude flag, which I reverted back to how it was.)

nicholasjng commented 2 months ago

Thanks!