Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
MusicalNinjaDad opened this issue Jun 3, 2024 · 3 comments · Fixed by #1851
Closed

Comments

@MusicalNinjaDad
Copy link
Contributor

MusicalNinjaDad commented Jun 3, 2024

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:

============================== 11 passed in 0.05s ==============================
  Traceback (most recent call last):
    File "/Users/runner/work/_temp/cibw/bin/cibuildwheel", line 8, in <module>
      sys.exit(main())
               ^^^^^^
    File "/Users/runner/work/_temp/cibw/lib/python3.12/site-packages/cibuildwheel/__main__.py", line 143, in main
      build_in_directory(args)
    File "/Users/runner/work/_temp/cibw/lib/python3.12/site-packages/cibuildwheel/__main__.py", line 315, in build_in_directory
      platform_module.build(options, tmp_path)
    File "/Users/runner/work/_temp/cibw/lib/python3.12/site-packages/cibuildwheel/macos.py", line 643, in build
      (build_options.output_dir / repaired_wheel.name).unlink()
    File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/pathlib.py", line 1342, in unlink
      os.unlink(self)
  NotADirectoryError: [Errno 20] Not a directory: '/Users/runner/work/FizzBuzz/FizzBuzz/wheelhouse/fizzbuzz-2.1.0-cp39-cp39-macosx_11_0_arm64.whl'
  Error: Process completed with exit code 1.

Build log

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

CI config

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

@MusicalNinjaDad
Copy link
Contributor Author

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
Copy link
Contributor

henryiii commented Jun 3, 2024

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
Copy link
Contributor

henryiii commented Jun 3, 2024

You shouldn’t have to make the wheelhouse directory.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants