From 90c46528a1e9bb9f1bf5125a51337f3e8a341f60 Mon Sep 17 00:00:00 2001 From: Neal Gompa Date: Thu, 7 Jul 2022 12:30:47 -0400 Subject: [PATCH] python: Fix linking to built libraries We incorrectly use RPATH here when we actually want to link to the libraries we produced earlier in the build. Usage of RPATH also causes package builds in Fedora to fail, since RPATHs are forbidden. Fix the tests to load the library from the right place. Signed-off-by: Neal Gompa --- pytests/CMakeLists.txt | 2 +- python/setup.py.in | 9 ++------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/pytests/CMakeLists.txt b/pytests/CMakeLists.txt index ee2e458e..7f564e1b 100644 --- a/pytests/CMakeLists.txt +++ b/pytests/CMakeLists.txt @@ -14,7 +14,7 @@ configure_file( ) add_custom_target(check - COMMAND pytest + COMMAND ${CMAKE_COMMAND} -E env LD_LIBRARY_PATH="${CMAKE_LIBRARY_OUTPUT_DIRECTORY}" pytest WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} COMMENT "Running tests.." ) diff --git a/python/setup.py.in b/python/setup.py.in index 69bbbe04..089a018d 100644 --- a/python/setup.py.in +++ b/python/setup.py.in @@ -10,11 +10,7 @@ from setuptools import setup from distutils.core import Extension cflags = [ - '-I@PYTDNF_INC_DIR@' -] - -link_args = [ - '-Wl,-rpath=@PYTDNF_LIB_DIR@' + '-I@PYTDNF_INC_DIR@', ] pytdnf_sources = [ @@ -29,8 +25,7 @@ tdnfmodule = Extension('tdnf._tdnf', libraries=['tdnf'], library_dirs=['${PYTDNF_LIB_DIR}'], sources=pytdnf_sources, - extra_compile_args=cflags, - extra_link_args=link_args) + extra_compile_args=cflags) setup(name='@PYTDNF_PACKAGE_NAME@', version='@PYTDNF_VERSION@',