On Mon, Oct 28, 2024 at 7:02 AM Ross Burton <[email protected]> wrote:
>
> On 22 Oct 2024, at 07:27, Khem Raj via lists.openembedded.org 
> <[email protected]> wrote:
> > find_library API depends on platform to provide ldconfig, ld, gcc, objdump
> > etc, so either we add these dependencies or avoid them by computing the
> > libarchive library name during build, which we can be done.
>
> OH GOD THAT IS HORRIBLE.
>
> "On Linux, find_library() tries to run external programs (/sbin/ldconfig, 
> gcc, objdump and ld) to find the library file. It returns the filename of the 
> library file.”
>
> > +DEPENDS += "patchelf-native libarchive"
> > +# Avoid using find_library API which needs ldconfig and ld/objdump
> > +# https://docs.python.org/3/library/ctypes.html#ctypes-reference
> > +#
> > +do_configure:append() {
> > +    sed -i -e "s|find_library('archive')|'${libdir}/$(patchelf 
> > --print-soname ${STAGING_LIBDIR}/libarchive.so)'|" ${S}/libarchive/ffi.py
> > +}
>
> Can we patch the source instead:
>
> -libarchive_path = os.environ.get('LIBARCHIVE') or find_library('archive')
> +libarchive_path = @LIBARCHIVE_SONAME@

This would mean we do not respect LIBARCHIVE envvar which is a
documented way of calling
a non-default libarchive.so perhaps we can do

libarchive_path = os.environ.get('LIBARCHIVE') or @LIBARCHIVE_SONAME@

unless we lift the whole expression out into sed op

>
> And then just sed that expression with the right value?  I don’t like magic 
> seds because they can transparently not apply and regress in the future.
>
> Also, thoughts on a solution that doesn’t involve ldconfig so it works on 
> musl would be appreciated.  Can you tell the musl loader to dump its search 
> paths somehow?  We should really file a bug with python…
>
> Ross
>
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#206449): 
https://lists.openembedded.org/g/openembedded-core/message/206449
Mute This Topic: https://lists.openembedded.org/mt/109147889/21656
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to