Re: [Viking-devel] another portability nit

2020-03-21 Thread Greg Troxel

On 2020-03-21 09:07, Robert Norris wrote:


NB We spoke about the $RANDOM issue back in November 2016.


I had a note in the patchfile that I might have sent mail, but not 100% 
clear.  I had just updated pkgsrc to 1.8 and found the problem still 
there.  This one turns out to be quite different, but every previous 
instance of non-POSIX constructs in configure has turned out to be 
non-portable constructs in configure.ac, so unfortunately I blindly 
assumed that was the case.



So I suppose you are using the one of the compressed releases of VIking and 
running the './configure' file provided directly? Since the 'configure' file 
itself is generated on my Debian Linux machine I guess it therefore thinks 
$RANDOM is available.


I am using the release tarball, which seems like the standard approach 
for users and packaging.  (My understanding is that autoconf intends to 
produce configure scripts that rely only on POSIX sh, so it would be a 
bug if when run on Debian it used $RANDOM.)



Perhaps you should try running the autotools stuff directly to generate the 
configure file for your system(s).
c.f. When acquiring Viking directly from source code repository there is no 
configure file; so here one needs to run the ./autogen.sh script to generate 
one. However ATM autogen.sh is not in the compressed releases.


I updated my git clone and ran autogen, and the RANDOM appeared, just 
like in the release tarball.



I don't why Viking would be any different to any other typical program 
autotools build systems though.


I now don't think Viking is different here.

It turns out the problem is that ${prefix}/share/aclocal/intltool.m4, 
installed by intltool-0.51.0, contains $RANDOM.  So any configure script 
that uses the intltool macro will pull that in and inherit the bug.


intltool's code only actually uses $RANDOM for obsolete versions of 
intltool, so this won't actually cause problems, except in a -Werror 
sort of way which is the present case.


I put a longer note in our patchfile, including a todo to file a bug 
with intltool.  I think it's quite likely that text will stop me from 
writing again in 2024!


Thanks for taking the time to think about this,
Greg


___
Viking-devel mailing list
Viking-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/viking-devel
Viking home page: http://viking.sf.net/


[Viking-devel] another portability nit

2020-03-18 Thread Greg Troxel
In configure, we patch

  $(INTLTOOL_V_MERGE)_it_tmp_dir=tmp.intltool.$$RANDOM

to

  $(INTLTOOL_V_MERGE)_it_tmp_dir=tmp.intltool.not-random

$RANDOM is a bashism not specified by POSIX, and not available in a
number of shells.  (It is available in NetBSD's /bin/sh, but pkgsrc has
a bunch of portability checks because pkgsrc does not require that a
platforms /bin/sh have anything beyond what POSIX requires.)


I'd suggest changing to


  $(INTLTOOL_V_MERGE)_it_tmp_dir=tmp.intltool.viking.

I have not tested; I am guessing this passes $$ to the shell after make
quoting.

That should be enough not to collide, even if there are multiple viking
builds happening at once.



___
Viking-devel mailing list
Viking-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/viking-devel
Viking home page: http://viking.sf.net/