Bug 39783 - ksh93 build fails
Summary: ksh93 build fails
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Christian Weisgerber
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-06-24 16:10 UTC by Joe Kelsey
Modified: 2002-07-22 15:53 UTC (History)
0 users

See Also:


Attachments
make.out (1.13 MB, text/plain)
2002-07-01 16:37 UTC, Joe Kelsey
no flags Details
Makefile.diff (1.21 KB, patch)
2002-07-18 20:46 UTC, Joe Kelsey
no flags Details | Diff
patch-src_lib_libast_comp_conf.sh (265 bytes, text/plain)
2002-07-18 20:46 UTC, Joe Kelsey
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Joe Kelsey 2002-06-24 16:10:01 UTC
	ksh93 build fails during ast build

How-To-Repeat: 	Try to build ksh93 with 2002-06-14 sources.  ast build fails.

+ mv 1.27985.x /usr/ports/shells/ksh93/work/arch/freebsd.i386/include/ast/prototyped.h
mamake: *** exit code 1 making lib/libast
+ mamake -C lib/libcmd -k install
+ cc -O -pipe -I. -I/usr/ports/shells/ksh93/work/src/lib/libcmd -I/usr/ports/shells/ksh93/work/arch/freebsd.i386/include/ast -D_PACKAGE_ast -D_BLD_cmd -c /usr/ports/shells/ksh93/work/src/lib/libcmd/cmdinit.c
In file included from /usr/ports/shells/ksh93/work/src/lib/libcmd/cmdinit.c:30:
/usr/ports/shells/ksh93/work/src/lib/libcmd/cmdlib.h:34: ast.h: No such file or directory
In file included from /usr/ports/shells/ksh93/work/src/lib/libcmd/cmdlib.h:35,
                 from /usr/ports/shells/ksh93/work/src/lib/libcmd/cmdinit.c:30:
/usr/ports/shells/ksh93/work/src/lib/libcmd/cmd.h:35: ast.h: No such file or dir
	I have no idea why the mv during the ast build/install fails,
	but it aborts the rest of the ast install and then the rest of
	the ksh93 build fails horribly...
Comment 1 Christian Weisgerber freebsd_committer freebsd_triage 2002-06-24 20:25:36 UTC
Responsible Changed
From-To: freebsd-ports->naddy

my port
Comment 2 Larry Rosenman freebsd_committer freebsd_triage 2002-06-24 20:31:55 UTC
It built just fine for me out of portupgrade on a 4.6-STABLE box.

Just a data point.


-- 
Larry Rosenman                     http://www.lerctr.org/~ler
Phone: +1 972-414-9812                 E-Mail: ler@lerctr.org
US Mail: 1905 Steamboat Springs Drive, Garland, TX 75044-6749
Comment 3 parv 2002-06-27 04:00:37 UTC
another data point ... i recently installed ksh93 port w/ most
recent changes (2002.06.23.11.55.28) on freebsd 4.6-release w/o
problems.

--
Comment 4 Christian Weisgerber 2002-06-28 17:24:01 UTC
> >Number:         39783
> >Category:       ports
> >Synopsis:       ksh93 build fails

> >How-To-Repeat:
> 	Try to build ksh93 with 2002-06-14 sources.  ast build fails.

I just updated the port to the 2002-06-28 release.
Can the people who previously were affected try again and see if the
problem persists?

-- 
Christian "naddy" Weisgerber                          naddy@mips.inka.de
Comment 5 Joe Kelsey 2002-07-01 16:37:11 UTC
Christian Weisgerber wrote:

>>>Number:         39783
>>>Category:       ports
>>>Synopsis:       ksh93 build fails
>>>      
>>>
>
>  
>
>>>How-To-Repeat:
>>>      
>>>
>>	Try to build ksh93 with 2002-06-14 sources.  ast build fails.
>>    
>>
>
>I just updated the port to the 2002-06-28 release.
>Can the people who previously were affected try again and see if the
>problem persists?
>
>  
>
No luck, see attached.

Comment 6 Joe Kelsey 2002-07-18 19:30:58 UTC
After much wailing and gnashing of teeth, I have found a clue.

There is a file (src/ast/libast/comp/conf.sh) which is used to generate 
various header files within the ast library.  For reasons that I still 
cannot figure out, the following excerpt from this script does not 
perform as expected:

            cat <<!
    printf("#undef    ${macro}\n");
    printf("#define ${macro}    ${fmt}\n", ${var});
!
            case $minmax in
            "")    cat <<!
#endif
!
                ;;
            esac

For reasons beyond my knowing at this time, the newline after the second 
printf is not generated, thus causing the following line to be catenated 
to the printf.  If the following line is a simple C statement, no 
problem.  If, however, the following line is #if or #endif, chaos ensues!

I corrected the problem by adding another newline before the ! following 
the printf.  This is so obviously a kludge, I cannot begin to comprehend it.

Another point to ponder is that in order to get this far, I had to be 
able to get conf to actually run.  The problem with that is that when I 
su to root, PATH does not contain '.'.  This means, that when we run 
bin/package with a PATH that does not contain '.', it is not able to 
actually run it!

I modified the do-install target thusly:

env -i SHELL=/bin/sh LDFLAGS=-static CCFLAGS='-O -pipe' 
PATH=/bin:/usr/bin:. /bin/sh bin/package make

If PATH contains anything other than the three directories, chaos 
ensues.  If anything other /bin/sh is used to run bin/package, chaos 
ensues.  bin/package is apparantly a very delicate command.  Using ksh 
to run it causes core dumps!

I will continue to play with this and hope to figure out what is really 
happening...
Comment 7 Joe Kelsey 2002-07-18 20:46:14 UTC
I am attaching two files, one is the difference between the installed 
port Makefile and the Makefile that actually works for me.  The basic 
change is to force SHELL to /bin/sh and also force the use of /bin/sh to 
run bin/package.

I have added two other things to this Makefile:
* Allow installation of standard ksh93 functions from the arch/*/fun 
directory into the share/examples/ksh93 directory if WANT_FUN is defined.
* If PREFIX==/, then you have to modify the editing of /etc/shells to 
prevent //bin/ksh93 from appearing there.

I have also included files/patch-src_lib_libast_comp_conf.sh which fixes 
the mysterious problem I have with this script.

Please let me know if these changes meet with your approval.

Thank you.
Comment 8 Christian Weisgerber freebsd_committer freebsd_triage 2002-07-22 15:52:49 UTC
State Changed
From-To: open->closed

Should be fixed now, thanks for your input!