This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mjpieters
Recipients mjpieters
Date 2020-05-16.15:27:29
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1589642850.04.0.521709964482.issue40647@roundup.psfhosted.org>
In-reply-to
Content
This issue goes back a long time. The libreadline handling in the modules setup.py doesn't add the location of the readline library to the runtime library paths:

    self.add(Extension('readline', ['readline.c'],
                       library_dirs=['/usr/lib/termcap'],
                       extra_link_args=readline_extra_link_args,
                       libraries=readline_libs))

This requires the readline library to have been added to a traditional location or has taken care of either ld.so.conf or LD_LIBRARY_PATH.

I'm building a series of Python binaries with a custom `--prefix` where I also installed a local copy of readline (so both are configured with the same prefix), and while setup.py finds the correct library, importing the compiled result fails because no `RPATH` is set.

This could be fixed by adding the parent path of the located `libreadline` shared library as a `runtime_library_dirs` entry:

    readline_libdirs = None
    if do_readline not in self.lib_dirs:
        readline_libdirs = [
            os.path.abspath(os.path.dirname(do_readline))
        ]

    self.add(Extension('readline', ['readline.c'],
                       library_dirs=['/usr/lib/termcap'],
                       extra_link_args=readline_extra_link_args,
                       runtime_library_dirs=readline_libdirs,
                       libraries=readline_libs))
History
Date User Action Args
2020-05-16 15:27:30mjpieterssetrecipients: + mjpieters
2020-05-16 15:27:30mjpieterssetmessageid: <1589642850.04.0.521709964482.issue40647@roundup.psfhosted.org>
2020-05-16 15:27:30mjpieterslinkissue40647 messages
2020-05-16 15:27:29mjpieterscreate