soniaai / rules_poetry

Bazel rules that use Poetry for Python package management
MIT License
72 stars 22 forks source link

Work around issue building wheels on M1 macs by passing --use-pep517 to pip #12

Closed gmishkin closed 2 years ago

gmishkin commented 2 years ago

On an M1 Mac, getting almost the same error as this when installing pycares using a custom universal2 python 3.8 build

This message led me to look into PEP 517 and I noticed that pip has an option to use it (why it's not the default appears to be a long story).

I'm sure there are downsides, and perhaps this could be opt-in instead, but the idea behind PEP 517 seemed sort of bazel-y so it felt sensible to have it on by default here.

NathanHowell commented 2 years ago

have you had any build failures with this? I'm assuming the impact is slightly slower wheel builds, when those are necessary?

gmishkin commented 2 years ago

Nope and we have about 140 packages in our list of pins.

Yes they make it sound like it would be slower. I can't actually tell when it's necessary. I know the rule calls pip wheel which based on the description makes it sound like it builds it unconditionally. I can't tell whether some other mechanism sneaks in there and downloads pre-built wheels from the Internet when available.