pkgsrc-Changes archive

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

Re: CVS commit: pkgsrc/devel/libffi



On Tue, 21 Apr 2020 at 00:06, Joerg Sonnenberger <joerg%bec.de@localhost> wrote:
On Mon, Apr 20, 2020 at 10:00:54AM +0000, David Sainty wrote:
> Module Name:  pkgsrc
> Committed By: dsainty
> Date:         Mon Apr 20 10:00:54 UTC 2020
>
> Modified Files:
>       pkgsrc/devel/libffi: Makefile
>
> Log Message:
> Use bash for this build unconditionally, the difficulty in parsing the shell
> script is not limited to Irix.
>
> Fixes the build when using ksh (on MacOS) as the preferred shell.
>
> No version bump, this change only repairs outright build failures.

I'm not happy wit thhis change at all. can't even parse
what the problem here is supposed to be.


Apologies - here's the gory details :)

It's actually libffi/patches/patch-configure that seems to cause the
problem.  This is what happens without using bash (if you are using
ksh):

===> Building for libffi-3.3nb2
/bin/ksh: : cannot execute [Is a directory]
<hangs>

If patch-configure is removed from distinfo then it also builds ok
without resorting to bash.  And with the shell being bash it also
builds ok.

So what do you do?  It seems better without patching in the first
place, but presumably Irix has its own problems with the unpatched
script.  The easier solution without potentially breaking Irix is to
just use the same shell everywhere and then everything is consistent.

We could instead drop the stated Irix compatibility and remove (most
of) the patch.  It's quite hard to know exactly what was being solved
for Irix too - or indeed why it can be at all possible that the patch
is necessary if the shell is switched to bash on Irix anyway.

I'd probably prefer that approach... but I don't use Irix.

Remove libffi/patches/patch-configure and we end up with perfectly
readable and reasonable script in the Makefiles, which is fine under
all shells (except on Irix?):

$ BUILD=` grep "^#### $$HOST " Makefile | sed -e 's/.*|//' `

But leave patch-configure in, and we get this ugly looking quote
nesting...

$ BUILD="` grep "^#### $HOST " Makefile | sed -e 's/.*|//' `"
ksh: : cannot execute [Is a directory]
^C
% bash
bash-5.0$ BUILD="` grep "^#### $$HOST " Makefile | sed -e 's/.*|//' `"
bash-5.0$ exit
% sh
sh-3.2$ BUILD="` grep "^#### $$HOST " Makefile | sed -e 's/.*|//' `"
sh-3.2$ exit

It's something about the combination of quotes, which does look
unnecessarily hairy.

A somewhat minimum case:

$ : "`echo " "`"
ksh: : cannot execute [Is a directory]



Home | Main Index | Thread Index | Old Index