Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 219583 - sys-libs/ncurses-5.6-r2 no longer builds on IRIX
Summary: sys-libs/ncurses-5.6-r2 no longer builds on IRIX
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: All IRIX
: High major (vote)
Assignee: Gentoo Prefix
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-04-28 11:22 UTC by Stuart Shelton
Modified: 2009-10-29 12:03 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stuart Shelton 2008-04-28 11:22:32 UTC
I already have sys-libs.ncurses-5.6-r2 installed, but the USE flags have been altered to remove 'bootstrap' and 'build'.

When I now try to reinstall it, I get the following output:

** Configuration summary for NCURSES 5.6 20061217:

     extended funcs: yes
     xterm terminfo: xterm-new

      bin directory: /opt/portage/usr/bin
      lib directory: /opt/portage/usr/lib
  include directory: /opt/portage/usr/include
      man directory: /opt/portage/usr/share/man
 terminfo directory: /opt/portage/usr/share/terminfo

cd man && make DESTDIR="" sources
make[1]: Entering directory `/usr/opt/portage/var/tmp/portage/sys-libs/ncurses-5.6-r2/work/narrowc/man'
sh /usr/opt/portage/var/tmp/portage/sys-libs/ncurses-5.6-r2/work/ncurses-5.6/man/MKterminfo.sh /usr/opt/portage/var/tmp/portage/sys-libs/ncurses-5.6-r2/work/ncurses-5.6/man/terminfo.head /usr/opt/portage/var/tmp/portage/sys-libs/ncurses-5.6-r2/work/ncurses-5.6/man/../include/Caps /usr/opt/portage/var/tmp/portage/sys-libs/ncurses-5.6-r2/work/ncurses-5.6/man/terminfo.tail >terminfo.5
make[1]: Leaving directory `/usr/opt/portage/var/tmp/portage/sys-libs/ncurses-5.6-r2/work/narrowc/man'
cd include && make DESTDIR="" sources
make[1]: Entering directory `/usr/opt/portage/var/tmp/portage/sys-libs/ncurses-5.6-r2/work/narrowc/include'
cat curses.head >curses.h
AWK=gawk sh /usr/opt/portage/var/tmp/portage/sys-libs/ncurses-5.6-r2/work/ncurses-5.6/include/MKkey_defs.sh /usr/opt/portage/var/tmp/portage/sys-libs/ncurses-5.6-r2/work/ncurses-5.6/include/Caps >>curses.h
sh -c 'if test "chtype" = "cchar_t" ; then cat /usr/opt/portage/var/tmp/portage/sys-libs/ncurses-5.6-r2/work/ncurses-5.6/include/curses.wide >>curses.h ; fi'
cat /usr/opt/portage/var/tmp/portage/sys-libs/ncurses-5.6-r2/work/ncurses-5.6/include/curses.tail >>curses.h
sh /usr/opt/portage/var/tmp/portage/sys-libs/ncurses-5.6-r2/work/ncurses-5.6/include/MKhashsize.sh /usr/opt/portage/var/tmp/portage/sys-libs/ncurses-5.6-r2/work/ncurses-5.6/include/Caps >hashsize.h
/usr/opt/portage/var/tmp/portage/sys-libs/ncurses-5.6-r2/work/ncurses-5.6/include/MKhashsize.sh: line 38: unexpected EOF while looking for matching ``'
/usr/opt/portage/var/tmp/portage/sys-libs/ncurses-5.6-r2/work/ncurses-5.6/include/MKhashsize.sh: line 43: syntax error: unexpected end of file
make[1]: *** [hashsize.h] Error 2
make[1]: Leaving directory `/usr/opt/portage/var/tmp/portage/sys-libs/ncurses-5.6-r2/work/narrowc/include'
make: *** [sources] Error 2
 * ERROR: sys-libs/ncurses-5.6-r2 failed:
 *   make sources failed
 * 
 * Call stack:
 *               ebuild.sh:  49: <call src_compile>
 *             environment:2434: <call do_compile '--without-ada'>
 *             environment: 643:     emake -j1 sources || die "make sources failed";
 * 
 * If you need support, post the topmost build error, and the call stack if relevant.
 * build log: '/usr/opt/portage/var/tmp/portage/sys-libs/ncurses-5.6-r2/temp/build.log'
 * ebuild environment: '/usr/opt/portage/var/tmp/portage/sys-libs/ncurses-5.6-r2/temp/environment'
 * S: '/usr/opt/portage/var/tmp/portage/sys-libs/ncurses-5.6-r2/work/ncurses-5.6'


I have CONFIG_SHELL set to '/opt/portage/usr/bin/bash', but this ebuild still seems to be using (the system?) 'sh' - which probably explains the errors above.

(Also, 'which sh' outputs "/opt/portage/usr/bin/sh", which is a symlink to bash - so is '/bin/sh' hardcoded somewhere?)

Are there any further things which need to be set in order to prevent (incompatible) system /bin/* utilities being used?

My make.profile is 'default-prefix/irix/6.5/mips'.
Comment 1 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2008-04-28 15:49:14 UTC
(In reply to comment #0)

> (Also, 'which sh' outputs "/opt/portage/usr/bin/sh", which is a symlink to bash
> - so is '/bin/sh' hardcoded somewhere?)

It is normally hardcoded in the source code / Makefile(s). Not gentoo related but you can probably created a patch to fix it if it is indeed the issue. (Not much help, am I? ) ;)
Comment 2 Fabian Groffen gentoo-dev 2008-04-28 17:27:49 UTC
% find . -name "*.sh" | xargs head -n1
==> ./c++/edit_cfg.sh <==
#!/bin/sh

==> ./include/edit_cfg.sh <==
#!/bin/sh

==> ./include/MKhashsize.sh <==
#!/bin/sh

==> ./include/MKkey_defs.sh <==
#! /bin/sh

==> ./include/MKncurses_def.sh <==
#! /bin/sh

==> ./include/MKparametrized.sh <==
#!/bin/sh

==> ./man/make_sed.sh <==
#!/bin/sh

==> ./man/MKterminfo.sh <==
#!/bin/sh

==> ./misc/gen_edit.sh <==
#!/bin/sh

==> ./ncurses/base/MKlib_gen.sh <==
#!/bin/sh

==> ./ncurses/tinfo/MKfallback.sh <==
#!/bin/sh

==> ./ncurses/tinfo/MKkeys_list.sh <==
#! /bin/sh

==> ./ncurses/tty/MKexpanded.sh <==
#! /bin/sh

==> ./progs/clear.sh <==
#!/bin/sh

==> ./progs/MKtermsort.sh <==
#!/bin/sh

==> ./tar-copy.sh <==
#!/bin/sh

==> ./test/listused.sh <==
#!/bin/sh


I applied some sed-foo to change those to /usr/bin/env sh.  Hope that helps.
Comment 3 Stuart Shelton 2008-04-29 17:28:55 UTC
Hmm - doesn't seem to have fixed the problem...

I fixed it with the following patch:

--- /usr/opt/portage/var/tmp/portage/sys-libs/ncurses-5.6-r2/work/ncurses-5.6/include/MKhashsize.sh.dist        2008-04-29 18:27:26.697977000 +0100
+++ /usr/opt/portage/var/tmp/portage/sys-libs/ncurses-5.6-r2/work/ncurses-5.6/include/MKhashsize.sh     2008-04-29 18:27:52.059656200 +0100
@@ -35,7 +35,7 @@ echo " * hashsize.h -- hash and token ta
 echo " */"
 
 CAPS="${1-Caps}"
-TABSIZE=`grep -v '^[ #]' $CAPS | grep -v "^$" | grep -v "^capalias"| grep -v "^infoalias" | wc -l`
+TABSIZE="$( grep -v '^[ #]' $CAPS | grep -v "^$" | grep -v "^capalias"| grep -v "^infoalias" | wc -l )"
 
 echo ""
 echo "#define CAPTABSIZE       ${TABSIZE}"

... but I don't know why this helped!
Comment 4 Fabian Groffen gentoo-dev 2008-04-29 17:36:45 UTC
I assume that /bin/sh on IRIX doesn't grok $( ... ), is that right?

If so, the only think I see that should make the difference, are the outermost quotes you added.

Does `grep -v '^[ #]' $CAPS | grep -v "^$" | grep -v "^capalias"| grep
-v "^infoalias" | wc -l` return something with spaces or multiple things for you?
Comment 5 Fabian Groffen gentoo-dev 2008-04-29 17:41:50 UTC
ehm, `wc -l` so it can't return anything weird, unless wc -l doesn't work
Comment 6 Stuart Shelton 2008-04-29 20:03:38 UTC
> I assume that /bin/sh on IRIX doesn't grok $( ... ), is that right?

Yes, exactly right.

On this system, /opt/portage/bin/sh -> /opt/portage/bin/bash though.

(Having said that, does bash in sh-mode understand $(...)?)

As I said, I don't know why the fix I found works - but it seemed a sensible solution to try given that the error seemed the indicate that the closing quotes weren't being seen.  Perhaps the surrounding quotes help anchor it (sounds hugely unlikely...)?
Comment 7 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2008-04-30 15:29:50 UTC
(In reply to comment #6)
> On this system, /opt/portage/bin/sh -> /opt/portage/bin/bash though.

THAT sh is symlinked to bash so it IS bash, there is no "sh mode" or anything like that. You will notice all the calls to "INTERIX sh" in Comment #2. So, the interix sh is being called, not the prefix sh (bash). Your patch in Comment #3 seems more sensible than touching all those other files.

> As I said, I don't know why the fix I found works - but it seemed a sensible

Your fix works because plain, old sh is nasty to work with. Hence the modern approach to symlink it to bash ;)
Comment 8 Stuart Shelton 2008-04-30 20:36:13 UTC
I was under the impression that since bash-3, if the shell is invoked as 'bash' it has full functionality whereas if it is invoked as 'sh' then it drops many of it's improved features to try to be a basic-but-compatible sh-compliant shell.

In any case, the symlink didn't change and the (correct) changes to swap '/bin/sh' for '/usr/bin/env sh' didn't fix the problem - but changing the back-ticks for quotes and $() did... and that's what's (still) confusing me! ;)
Comment 9 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2008-04-30 20:50:18 UTC
(In reply to comment #8)
> I was under the impression that since bash-3, if the shell is invoked as 'bash'
> it has full functionality whereas if it is invoked as 'sh' then it drops many
> of it's improved features to try to be a basic-but-compatible sh-compliant
> shell.

eek, you are right. Sorry, that was un-researched when I made the comment.

What would be interesting to know (for me) is if changing the /bin/sh calls to $EPREFIX/bin/sh changed the behavior. You would think the the sh version in the environment would be the EPREFIX version already but..does portage sanitize paths? (thus giving you IRIX sh again?)

PS. s/interix/irix in Comment #7 ... opps ;)
Comment 10 Stuart Shelton 2008-05-01 10:43:29 UTC
It's a good point - but I don't think that IRIX system 'sh' accepts "$()" syntax under *any* circumstances, so I think it must be using $EPREFIX/usr/bin/sh (symlinked to $EPREFIX/usr/bin/bash).

I am just a little surprised that bash invoked as 'sh' accepts this syntax either, though...
Comment 11 Fabian Groffen gentoo-dev 2008-05-01 11:00:08 UTC
Just an idea, does the original script work with /usr/bin/env bash instead of /usr/bin/env sh?  As far as I know, $( ) is in posix, so it sort of makes sense that 'sh mode' accepts $( ).  Apple made some extra patches against bash to become a real spartan piece of crap when invoked as sh, basically to get this UNIX certification.  The patches were not merged upstream.
Comment 12 Thomas Dickey 2008-08-25 12:51:37 UTC
There was a version of bash which choked on the '#' in '^[ #]'
(I thought that was a year or so ago).  It was fixed a month or
so later.
Comment 13 Fabian Groffen gentoo-dev 2009-10-25 09:44:37 UTC
please report if this still holds for ncurses-5.7
Comment 14 Stuart Shelton 2009-10-29 12:03:45 UTC
Looks as if ncurses-5.7-r2 compiles cleanly without modification :)