Skip to content

Conversation

@bewithgaurav
Copy link
Collaborator

@bewithgaurav bewithgaurav commented Jun 2, 2025

This pull request introduces improvements to the Python library detection process, updates dependency handling for macOS dynamic libraries, enhances security in connection string sanitization, and refactors the setup.py file to use a different module for wheel building.

Python library detection improvements:

  • mssql_python/pybind/CMakeLists.txt: Added logic to handle cases where PYTHON_LIB_DIR is not set or is empty on Windows, using Python's sysconfig to locate the library directory. Additionally, support for a custom environment variable CUSTOM_PYTHON_LIB_DIR was added to override the library directory.

Dependency handling updates for macOS:

  • mssql_python/pybind/configure_dylibs.sh: Updated install_name_tool commands to use @loader_path for dynamic library paths, ensuring better portability. Added commands to set library IDs explicitly using @loader_path.

Security enhancement in connection string sanitization:

  • mssql_python/pybind/ddbc_bindings_mac.cpp: Improved the SanitizeConnectionString function to perform case-insensitive removal of sensitive parameters (UID and Pwd) by converting the string to lowercase for comparison.

Refactor in wheel building:

  • setup.py: Changed the import from setuptools.command.bdist_wheel to wheel.bdist_wheel for building platform-specific wheels.

Copilot AI review requested due to automatic review settings June 2, 2025 14:18
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances macOS support by improving dynamic library path handling in the shell script and simplifies dependency management in the wheel build process.

  • Updated library path handling in configure_dylibs.sh to use @loader_path for dynamic linking and set library IDs.
  • Updated setup.py to import bdist_wheel directly from the wheel package.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

File Description
setup.py Changed import of bdist_wheel to use the wheel package.
mssql_python/pybind/configure_dylibs.sh Updated dynamic linking paths and added library ID settings.

@bewithgaurav bewithgaurav changed the title FEAT: Build process on Mac Support FEAT: Build process for Mac Support Jun 2, 2025
@bewithgaurav bewithgaurav merged commit 19f35fa into main Jun 2, 2025
4 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.

4 participants