Skip to content

Fix for macos local wheels issue#2874

Open
kipawaa wants to merge 2 commits into
mainfrom
fix-macos-local-wheels
Open

Fix for macos local wheels issue#2874
kipawaa wants to merge 2 commits into
mainfrom
fix-macos-local-wheels

Conversation

@kipawaa
Copy link
Copy Markdown
Contributor

@kipawaa kipawaa commented May 26, 2026

Context:
MacOS locally-built wheels would fail thanks to install_name_tool preferring the wrong dylib.

Description of the Change:
Prefers the correct dylib.

Benefits:
working wheels

Possible Drawbacks:

Related GitHub Issues:

@kipawaa kipawaa added the author:build-wheels Run the wheel building workflows on this Pull Request label May 26, 2026
@kipawaa kipawaa requested review from mehrdad2m and paul0403 May 26, 2026 16:05
@github-actions
Copy link
Copy Markdown
Contributor

Hello. You may have forgotten to update the changelog!
Please edit doc/releases/changelog-dev.md on your branch with:

  • A one-to-two sentence description of the change. You may include a small working example for new features.
  • A link back to this PR.
  • Your name (or GitHub username) in the contributors section.

Comment thread setup.py Outdated
lib_with_r_path = "@rpath/libcustom_calls.so"

original_path = frontend_path[0] if frontend_path else build_path[0]
original_path = build_path[0] if build_path else frontend_path[0]
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I wondering if this would fail when the order of installation is reversed? i.e. installing the wheel first and then make all.
Would it make sense to run install_name_tool on both? 🤔

Copy link
Copy Markdown
Contributor Author

@kipawaa kipawaa May 26, 2026

Choose a reason for hiding this comment

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

When building from source the INSTALLED python variable is set to false, and the path resolution searches static relative paths. I think this would cause the dylib resolution to fail, but maybe I'm wrong. Can test this tomorrow and report back.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@mehrdad2m it seems that running install_name_tool on both succeeds! (4fb384f)

Copy link
Copy Markdown
Contributor

@dime10 dime10 May 28, 2026

Choose a reason for hiding this comment

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

Isn't this writing to the same field twice?
EDIT: oh nvm it's the opposite, you're writing the same value to different libraries

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Good catch on this build folder thing! I wonder if instead of us searching particular paths, shouldn't we able to find the lib we just built directly (since this is the code that builds it in the first place)?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

shouldn't we able to find the lib we just built directly

coming back to this, I think this makes sense to me. Looking at the build_ext class, it has a get_ext_filename method that we could potentially use but I am not familiar with that module enough to know for sure without testing.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I was wondering why I was seeing this line in River's PR, I thought we had already merged this 😅

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

But yeah I think it's worth updating this properly for good, if it doesn't take too long

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I likely won't be able to get back to this today, but I can try to check that out tomorrow/monday.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.01%. Comparing base (9798aa3) to head (4fb384f).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2874   +/-   ##
=======================================
  Coverage   97.01%   97.01%           
=======================================
  Files         167      167           
  Lines       18828    18828           
  Branches     1768     1768           
=======================================
  Hits        18266    18266           
  Misses        417      417           
  Partials      145      145           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kipawaa kipawaa requested a review from mehrdad2m June 2, 2026 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author:build-wheels Run the wheel building workflows on this Pull Request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants