Skip to content

Improving build error messages when build fails due to missing wheels #2303

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

Merged
merged 15 commits into from
May 29, 2025

Conversation

pjfan
Copy link
Contributor

@pjfan pjfan commented May 20, 2025

Description of changes

I added more helpful error messages (via the install_hint parameter on _pip_install) when build iOS and build macOS fail. I also added a new install_hint parameter to _install_app_requirements per suggestion so that it could be passed in directly instead of having to get passed in via pip_kwargs.

What problem is solved

build macOS and build iOS commands can sometimes fail because of a single missing wheel for a particular platform's version of a library.

Ex. 1 - a project that relies on a version of numpy before 1.2.0 won't be able to build on macOS if universal_build=true because there's no arm64 wheel for numpy versions before 1.2.0.

Ex. 2 - accidentally deleting the iphonesimulator wheel will cause build iOS to fail even if iphoneos is present but the error message won't indicate this / will make it sound like both wheels are missing.

What issue is this PR related to

Fixes #2230

PR Checklist:

  • All new features have been tested
  • All new features have been documented
  • I have read the CONTRIBUTING.md file
  • I will abide by the code of conduct

Copy link
Member

@freakboy3742 freakboy3742 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great; the one missing piece at this point is some extra test code to verify that the helper messages are being included when required.

@pjfan pjfan force-pushed the build-wheel-error-message branch from 8bfc063 to 7d7b6fd Compare May 23, 2025 22:17
@pjfan
Copy link
Contributor Author

pjfan commented May 23, 2025

Apologies for the delay, but I made the changes and added two tests. Not super familiar with pytest so let me know if the tests make sense and/or if they need modification.

Also rebased the branch with main.

Copy link
Member

@freakboy3742 freakboy3742 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for that update; two problems noted inline:

  1. The error message for the macOS case is incorrect, as the universal_build=False fix won't work if the initial install fails. If that build fails, the problem is that either wheels for the native platform aren't available, or the minimum macOS version for the app doesn't match the available wheels.
  2. You've added test cases, but you haven't covered all the possible failure modes.

@pjfan
Copy link
Contributor Author

pjfan commented May 28, 2025

Updated tests to test for each error mode

Copy link
Member

@freakboy3742 freakboy3742 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome - thanks for those updates!

I've made some cosmetic tweaks to the error message text, but otherwise, this is good to land - Thanks for the PR!

@freakboy3742 freakboy3742 merged commit ef758eb into beeware:main May 29, 2025
57 checks passed
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 this pull request may close these issues.

Improve error message when a wheel for one platform is missing
2 participants