tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: patch for REQUIRES



On 19. 3. 2012, at 2:21, OBATA Akio wrote:

> On Mon, 19 Mar 2012 06:47:26 +0900, Filip Hajny <filip%joyent.com@localhost> 
> wrote:
> 
>> On 18. 3. 2012, at 21:46, Joerg Sonnenberger wrote:
>> 
>>> On Sun, Mar 18, 2012 at 08:57:53PM +0100, Filip Hajny wrote:
>>>> On 18. 3. 2012, at 19:06, Joerg Sonnenberger wrote:
>>>> 
>>>>> On Sun, Mar 18, 2012 at 01:55:44PM +0100, Filip Hajny wrote:
>>>>>> Without the patch, for instance 'expat' has /usr/lib/libexpat.so.1 (or
>>>>>> whatever else 'ldd' resolved under the DESTDIR environment) recorded
>>>>>> in its REQUIRES, even though the binary (xmlwf) is in fact linked
>>>>>> against the package's own libexpat.so.1.
>>>>> 
>>>>> BTW, you should look at getting the readelf based shared library check
>>>>> to work for Solaris, since it is more precise and reliable.
>>>> 
>>>> Thanks, but that's not a good option IMO. readelf is not a guaranteed
>>>> part of the SunOS platform. And bringing in devel/binutils opens
>>>> a different can of worms.
>>> 
>>> Solaris has no tools to extract the necessary data directly in the base
>>> installation? It doesn't have to be readelf. I.e. what is needed is
>>> DT_RPATH and DT_NEEDED.
>> 
>> There is elfdump, but I don't see how it helps in this case. The only 
>> information you can get from NEEDED are the base names of the libraries, and 
>> RPATH reports (typically) the single ${PREFIX}/lib path, so you can't get a 
>> full list of "what's required from where", let alone identify which libs are 
>> to be ignored for the REQUIRES meta, for they are in fact part of the 
>> PROVIDES meta.
>> 
>> Or am I missing something?
> 
> pkgsrc/pkgtools/bootstrap-extras/files/fakeldd-Haiku may help you.
> 
> Haiku does not have `ldd', then use `objdump' to read NEEDED and RPATH, and
> print as `ldd' doing (LIBRARY_PATH environment variable has default library 
> search path).
> 

Yes, that's a nice script, but doesn't help in this situation, when the package 
is not installed yet, and we're checking linking on objects inside the DESTDIR 
sandbox:

[root /tmp/pkgsrc/textproc/expat/work]# LIBRARY_PATH=/lib:/usr/lib bash 
/opt/pkgsrc/pkgtools/bootstrap-extras/files/fakeldd-Haiku 
.destdir/opt/local/bin/xmlwf 
.destdir/opt/local/bin/xmlwf:
        libexpat.so.1 => /usr/lib/libexpat.so.1
        libc.so.1 => /lib/libc.so.1

The only workaround for that would be to make such script DESTDIR compatible, 
so that it'd set LIBRARY_PATH to something like 
"${DESTDIR}${PREFIX}/lib:${_OPSYS_SYSTEM_RPATH}", then take out the ${DESTDIR} 
part from any output.

Rewriting the check shlib scripts to support elfdump on SunOS is a little too 
much for how much time I have now, but I'll add to the list of stuff to do once 
we finally succeed in hiring for pkgsrc work… ;)

My concern for the patch original shared was to avoid having binary packages 
polluted with REQUIRES having the wrong stuff. One could add 
LD_LIBRARY_PATH=${DESTDIR}${PREFIX}/lib to the ldd calls, and sed out the 
DESTDIR later, and pretty much achieve the same. Though anythin having 
LD_LIBRARY_PATH in it sounds pretty evil to me.

I think I'll hold on patching - I'll be running with a forked pkgsrc for some 
time still anyway. Since the pkgformat/pkg/metadata.mk logic is already taking 
out PLIST files from REQUIRES, it makes sense to fix the ldd output instead.

-F


Home | Main Index | Thread Index | Old Index