Skip to content

Commit

Permalink
[ESI][Runtime] Fix wheel builds (#7795)
Browse files Browse the repository at this point in the history
CMake 3.31 changed the behavior of `install(IMPORTED_RUNTIME_ARTIFACTS` to actually install them instead of merely adding them to the list. This ended up pulling in _all_ of the shared libs (including system libraries like `libm`, `libgcc`, etc.) instead of respecting the filters given in `install(RUNTIME_DEPENDENCY_SET`. As a result, auditwheel was failing. Happened over the weekend when a new version of the `cmake` package was published to PyPI.
  • Loading branch information
teqdruid authored Nov 11, 2024
1 parent 5c19566 commit 78afda8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 13 deletions.
15 changes: 3 additions & 12 deletions lib/Dialect/ESI/runtime/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -186,21 +186,12 @@ else()
endif()
install(TARGETS ESICppRuntime
DESTINATION ${PYLIBDIR}
RUNTIME_DEPENDENCIES
PRE_EXCLUDE_REGEXES .*
PRE_INCLUDE_REGEXES zlibd zlib libz
COMPONENT ESIRuntime
)

if(NOT ESI_STATIC_RUNTIME)
install(IMPORTED_RUNTIME_ARTIFACTS ESICppRuntime
RUNTIME_DEPENDENCY_SET ESICppRuntime_RUNTIME_DEPS
COMPONENT ESIRuntime
)
endif()
install(RUNTIME_DEPENDENCY_SET ESICppRuntime_RUNTIME_DEPS
DESTINATION ${LIB_DIR}
PRE_EXCLUDE_REGEXES .*
PRE_INCLUDE_REGEXES zlibd zlib
COMPONENT ESIRuntime
)
install(FILES ${ESICppRuntimeHeaders}
DESTINATION include/esi
COMPONENT ESIRuntime
Expand Down
2 changes: 1 addition & 1 deletion lib/Dialect/ESI/runtime/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ requires = [
"setuptools>=68",
"setuptools_scm>=8.0",
"wheel",
"cmake>=3.20",
"cmake>=3.31",
"pybind11>=2.9",
"pybind11_stubgen",
]
Expand Down
1 change: 1 addition & 0 deletions lib/Dialect/ESI/runtime/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ def run(self):

# Finally run the cmake configure.
subprocess.check_call(["cmake", src_dir] + cmake_args, cwd=cmake_build_dir)
print(" ".join(["cmake", src_dir] + cmake_args))

# Run the build.
subprocess.check_call([
Expand Down

0 comments on commit 78afda8

Please sign in to comment.