pkgsrc-Users archive

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

Re: Can't compile perl5 on Soalris 10



Hi,
I tried to debug the last line of code before the error but I came out wth some weirder bug. 
As you can see the last line of code kinda filter the files in /var/tmp/pkgbuild/lang/perl5/work/.destdir/usr/pkg.
One of the first condition is :

if [ ! -x "$file" ]; 
then                              
 continue;                                      
fi;   
If file is not executable then continue to the next file. Do not go any further with this file. Not a big deal here. However it seems this simple test does not behave as it should on Solaris 10 :

[root@zone2 pkg]$ echo $SHELL
/usr/bin/bash 
[root@zone2 pkg]$ ls -lh /root/whatever
-rw-r--r--   1 root     root           0 Mar 22 20:42 /root/whatever
[root@zone2 pkg]$ if test -x /root/whatever;then echo file is executable; else echo file is not executable; fi
file is executable

I've tried on 3 differents Solaris boxes and they all behaved the same way. However, if you switch to ksh for instance, everything looks all right :

# echo $SHELL
/usr/bin/ksh
# ls -lh /root/whatever
-rw-r--r--   1 root     root           0 Mar 22 20:42 /root/whatever
# if test -x /root/whatever;then echo file is executable; else echo file is not executable; fi
file is not executable

I switched my shell to KSH and I tried to compile perl. But it still fails with the same error. Almost like it's still using bash.
Then, I installed bash (version 4.3) from CSW I tried to make pkgsrc use it this way :

TOOLS_PLATFORM.sh?=             /opt/csw/bin/bash
TOOLS_PLATFORM.bash?=           /opt/csw/bin/bash

But that didn't work either. So I replaced the binary in /usr/bin by the one provided by CSW (mv /opt/csw/bin/bash /usr/bin/bash) and guess what ? I now have functionnal perl5 build.  

IMHO, there is a bug with SFW bash (version 3.2) on Solaris 10. Perl5 ( and possibly more packages ) has some kind of depedency on bash and do not rely on TOOLS_PLATFORM but on env/$PATH to know which bash to use and where to find it.
If someone can confirm this bug it might be a great idea to write it somewhere in the README.solaris not to use bash SFW !!!

On Thu, Feb 28, 2019 at 5:21 PM Julien Savard <juliensavard17%gmail.com@localhost> wrote:
Hi,
actually there is no empty files... there is simply no files at all :

[root@zone2 perl5]$ ls -lh /var/tmp/pkgbuild/lang/perl5/work/.error
total 0
[root@zone2 perl5]$ ls -lh /var/tmp/pkgbuild/lang/perl5/work/.warning
total 0

However there is something there :

[root@zone2 perl5]$ cat /var/tmp/pkgbuild/lang/perl5/work/.error-done/_check-interpreter
[check-interpreter.mk] The interpreter "perl" of "/var/tmp/pkgbuild/lang/perl5/work/.destdir/usr/pkg/lib/perl5/5.28.0/Math/BigFloat/Trace.pm" does not exist.
[check-interpreter.mk] The interpreter "perl" of "/var/tmp/pkgbuild/lang/perl5/work/.destdir/usr/pkg/lib/perl5/5.28.0/Math/BigInt/Trace.pm" does not exist.

[root@zone2 perl5]$ head -1 "/var/tmp/pkgbuild/lang/perl5/work/.destdir/usr/pkg/lib/perl5/5.28.0/Math/BigInt/Trace.pm"
#!perl
[root@zone2 perl5]$ head -1 "/var/tmp/pkgbuild/lang/perl5/work/.destdir/usr/pkg/lib/perl5/5.28.0/Math/BigFloat/Trace.pm"
#!perl

I'll try to take a look to mk/bsd.pkg.mk.  


On Thu, Feb 28, 2019 at 3:20 PM Roland Illig <roland.illig%gmx.de@localhost> wrote:


Am 25.02.2019 um 18:15 schrieb Julien Savard:
>  cd /var/tmp/pkgbuild/lang/perl5/work/.error;                           
>                     for file in ./*; do                                 
>                test "$file" != "./*" || exit 0;                       
>     break;                                                  done;       
>                                                        /usr/bin/cat * |
>     /usr/pkg/bin/nbsed -e "s|^|ERROR: |" 1>&2;                         
>                if /usr/pkg/bin/nawk 'END { exit (NR > 0) ? 0 : 1; }'
>     ./*; then                                 /usr/bin/mv -f ./*
>     /var/tmp/pkgbuild/lang/perl5/work/.error-done;                     
>      exit 1;                                                         fi
>     *** Error code 1

Please have a look at the files in
/var/tmp/pkgbuild/lang/perl5/work/.error and
/var/tmp/pkgbuild/lang/perl5/work/.warning. I suspect that there is an
empty file there.

These files are created by ${ERROR_MSG}, ${FAIL_MSG} and ${WARNING_MSG}.
These commands are defined in mk/bsd.pkg.mk. To further analyze this,
you may override these with a custom command that pauses until you press
Enter. Then you will see exactly at which point these files are written.

The actual cause might be an error message that has a shell redirection
in it, such as:

    ${ERROR_MSG} Cannot continue -> stopping.

This would interpret the ">" as a shell redirection. That's my first
guess, it may also be something entirely different.

Best,
Roland


Home | Main Index | Thread Index | Old Index