pypa / cibuildwheel

🎡 Build Python wheels for all the platforms with minimal configuration.
https://cibuildwheel.pypa.io
Other
1.78k stars 227 forks source link

Macos-14 builds fail if output_dir does not already exist AND testing is enabled #1850

Closed MusicalNinjaDad closed 3 weeks ago

MusicalNinjaDad commented 3 weeks ago

Description

Building for Macos14 (in github actions = arm64) fails when attempting to move the wheel after testing if the output directory does not already exist.

Contrary to the documentation pathlib.Path.unlink() throws a NotADirectoryError in this case, and apparently only on this platform. (I will raise an Issue in cpython for that as well - at least to update the docs ...)

Compare:

Build log

https://github.com/MusicalNinjaDad/FizzBuzz/actions/runs/9351587993/job/25744497746

CI config

https://github.com/MusicalNinjaDad/FizzBuzz/tree/pr48

MusicalNinjaDad commented 3 weeks ago

Happy to also put in a PR for this as it should be a quick fix to replace with suppress with (missing_ok=True). I'll also see if I can update the CI to catch this in future. Cloning now ...

henryiii commented 3 weeks ago

I believe CPython just translates the OS error code into Python errors. The error code 20 becomes NotADirectoryError. My initial uninformed guess would be the code is different.

I can’t quickly replicate on macOS 14 Intel or macOS 14 ARM locally. There must be something specific about the setup when it happened in cibuildwheel that I’m not capturing.

henryiii commented 3 weeks ago

You shouldn’t have to make the wheelhouse directory.