cibuildwheel icon indicating copy to clipboard operation
cibuildwheel copied to clipboard

How do I build one specific wheel from the command line?

Open Strilanc opened this issue 3 years ago • 4 comments

I'm running cibuildwheel from the command line on my local machine. I want to debug a build failure for the cp39-musllinux_i686 wheel. But I can't figure out how to say "only build cp39-musllinux_i686 not anything else; I don't have all day here".

I was expecting this to work:

cibuildwheel --build-identifiers cp39-musllinux_i686

but there is no such flag.

Strilanc avatar Apr 12 '22 22:04 Strilanc

Okay, I have found a way to do it:

CIBW_BUILD=cp39-musllinux_i686 cibuildwheel --platform linux

Not sure why I need to go through an env variable, or why I have to repeat the "linux" part since it should be obvious from the identifier. A flag would still be preferable.

Strilanc avatar Apr 12 '22 23:04 Strilanc

The reason for this is that until recently, we only supported running cibuildwheel in CI, so env vars are more convenient.

I think there is an argument for --build PATTERN and --skip PATTERN command line arguments, given that we now support building wheels on a local machine. But I think I'd draw the line there, I don't think we want all options specifyable from command line. --build and --skip sorta fit with the existing --platform and --archs as "build selection".

joerick avatar Apr 22 '22 10:04 joerick

I see --build being quite useful, not so sure about --skip - skipping to me is more of a list of things that are not supported, not really a runtime "please build this portion only" type of a thing. I would expect this mostly would be used as --build=cp39-musllinux_i686 or --build=cp39*, can't see a reason to use --skip. But if it's easy and more consistent, I guess it wouldn't hurt.

henryiii avatar Apr 28 '22 01:04 henryiii

FYI, this will not work very well for the common case of --build=cp39*, since the shell will expand that - you'd need --build='cp39*', which already kind of defeats part of the purpose of having a shortcut. The other useful part, the fact the syntax is the same even in cmd, is still useful, though.

henryiii avatar Apr 28 '22 04:04 henryiii