Skip to content
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

[pybind] Add back extension suffix for portable lib shared object in pip wheel #6363

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions build/executorch-wheel-config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,20 @@
#
cmake_minimum_required(VERSION 3.19)

# Find prebuilt _portable_lib.so. This file should be installed under
# Find prebuilt _portable_lib.<EXT_SUFFIX>.so. This file should be installed under
# <site-packages>/executorch/share/cmake
find_library(_portable_lib_LIBRARY _portable_lib.so PATHS "${CMAKE_CURRENT_LIST_DIR}/../../extension/pybindings/")

# Get the Python version and platform information
execute_process(
COMMAND python -c "import sysconfig; print(sysconfig.get_config_var('EXT_SUFFIX'))"
OUTPUT_VARIABLE EXT_SUFFIX
OUTPUT_STRIP_TRAILING_WHITESPACE
)
find_library(
_portable_lib_LIBRARY
NAMES _portable_lib${EXT_SUFFIX}
PATHS "${CMAKE_CURRENT_LIST_DIR}/../../extension/pybindings/"
)
set(EXECUTORCH_LIBRARIES)
set(EXECUTORCH_FOUND OFF)
if(_portable_lib_LIBRARY)
Expand Down
4 changes: 0 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -687,10 +687,6 @@ def get_ext_modules() -> List[Extension]:
return ext_modules


# Override extension suffix to be ".so", skipping package info such as
# "cpython-311-darwin"
os.environ["SETUPTOOLS_EXT_SUFFIX"] = ".so"

setup(
version=Version.string(),
# TODO(dbort): Could use py_modules to restrict the set of modules we
Expand Down
Loading