FIX: configure bundled macOS ODBC dylibs for all arches, not just build host#661
Draft
bewithgaurav wants to merge 1 commit into
Draft
FIX: configure bundled macOS ODBC dylibs for all arches, not just build host#661bewithgaurav wants to merge 1 commit into
bewithgaurav wants to merge 1 commit into
Conversation
…ld host configure_dylibs.sh rewrote libodbcinst/libltdl references to @loader_path only for $(uname -m). the universal2 wheel bundles both libs/macos/arm64 and libs/macos/x86_64, so on the x86_64 release runner only x86_64 got fixed and the arm64 libmsodbcsql.18.dylib shipped pointing at /opt/homebrew/lib/libodbcinst.2.dylib. on a clean Apple Silicon mac that path is absent, so the driver only loads after `brew install unixodbc` (issue #656). this regressed in 1.8.0 (first release after the driver upgrade). 1.7.1 and earlier are clean. - loop configuration over both arm64 and x86_64 under libs/macos - re-fix the committed arm64 + x86_64 dylibs to @loader_path Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
📊 Code Coverage Report
Diff CoverageDiff: main...HEAD, staged and unstaged changesNo lines with coverage information in this diff. 📋 Files Needing Attention📉 Files with overall lowest coverage (click to expand)mssql_python.pybind.logger_bridge.cpp: 59.2%
mssql_python.pybind.ddbc_bindings.h: 59.9%
mssql_python.pybind.logger_bridge.hpp: 70.8%
mssql_python.pybind.connection.connection.cpp: 76.2%
mssql_python.pybind.ddbc_bindings.cpp: 76.3%
mssql_python.__init__.py: 77.3%
mssql_python.row.py: 77.6%
mssql_python.ddbc_bindings.py: 79.6%
mssql_python.logging.py: 85.5%
mssql_python.connection.py: 85.6%🔗 Quick Links
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Work Item / Issue Reference
Summary
on Apple Silicon the bundled ODBC driver in the macOS wheel points at an absolute Homebrew path (
/opt/homebrew/lib/libodbcinst.2.dylib) instead of the copy shipped inside the package. on a clean machine that path is absent, soimport mssql_pythonfails untilbrew install unixodbccreates it (#656).root cause:
configure_dylibs.shrewrites the bundled dylib dependencies to@loader_pathonly for$(uname -m). the wheel is universal2 and ships bothlibs/macos/arm64andlibs/macos/x86_64, but the release runner is x86_64, so only the x86_64 driver got fixed. the arm64 driver shipped with its raw Homebrew path from the driver upgrade in #569. regressed in 1.8.0; 1.7.1 and earlier are clean.fix:
configure_dylibs.shover botharm64andx86_64underlibs/macos, not just the build host arch.install_name_toolandcodesignboth work cross-arch, so one host fixes every bundled arch.@loader_path.verified both arches resolve
libodbcinst/libltdlvia@loader_pathwith no absolute paths remaining, and the fixed arm64 driver dlopens against its bundled siblings (and fails when isolated, so there is no system fallback).