cbcbox macOS libraries are killed on load
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- macos, python
- Domain
- build-system
Research direction
Start in setup.py, where install_name_tool and strip -x process the bundled macOS libraries. Reproduce the failure with the provided ctypes command, then verify that the shipped OpenBLAS and CBC libraries load successfully after packaging; confirm with codesign -dv and the Model(solver_name="CBC") path.
Written by the indexing model from the issue text.
Description
@h-g-s: I'm requesting a fix in your cbcbox repo, but I can't open a pull request or issue against it due to it being a fork, so I'm doing that here.
I've only verified this behavior on on macOS 26.7 (arm64), but it seems that cbcbox 2.935 dies as soon as its bundled OpenBLAS is loaded:
python -c 'import cbcbox, ctypes, os; ctypes.CDLL(os.path.join(cbcbox.cbc_lib_dir(), "libopenblas.0.dylib"))'
Exit 137, no traceback. Model(solver_name="CBC") dies the same way, because libCbc.dylib pulls that library in.
The problem seems to be that setup.py runs install_name_tool and then strip -x on the bundled binaries. Both invalidate the linker's signature, and nothing re-signs afterwards. codesign -dv on the shipped library reports flags=0x20002(adhoc,linker-signed).
Signing after both steps seems to fix the issue:
codesign --force --sign - <path>
The signature then becomes flags=0x2(adhoc), and the library loads.
Here's a patch to setup.py: https://github.com/ghackebeil/cbcbox/commit/39243b2e30a2a71a28120db4c660d6b6d69d2284
- Dominant language
- Linear Programming
- Stars
- 601
- Forks
- 108
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from coin-or/python-mip
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
coin-or/python-mip#426 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
coin-or/python-mip#425 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
coin-or/python-mip#423 · 4 comments · 3 reactions ·
-
Difficulty 3/5 1-2 days Newbie friendliness 55/100
coin-or/python-mip#422 · 1 comment ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
coin-or/python-mip#420 · 4 comments ·
All issues in coin-or/python-mip
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
bazel-contrib/rules_go#4721 · 2 comments ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
agent-research-recommend agent-review-finding chore
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
jordansmall/spindrift#3717 · 1 comment ·
-
type/automation type/tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100