Closed Bug 179895 Opened 22 years ago Closed 22 years ago

Build of mkdepend requires mkdepend

Categories

(SeaMonkey :: Build Config, defect)

x86
OpenVMS
defect
Not set
critical

Tracking

(Not tracked)

VERIFIED FIXED
mozilla1.3alpha

People

(Reporter: colin, Assigned: netscape)

Details

Attachments

(1 file, 3 obsolete files)

At the very start of the build, I get an error in the first build directory,
config/mkdepend. Its trying to build mkdepend, but in doing so, wants to run
mkdepend to generate the dependancy files (MAKE_DEPS_AUTO). But mkdepend hasn't
been built yet; that's what we're trying to build!

/gnu/bin/make -C config export
/gnu/bin/make[1]: Entering directory `/dkb300/m130opt/config'
Creating .deps
/gnu/bin/make[2]: Entering directory `/dkb300/m130opt/config/mkdepend'
Creating .deps
cppsetup.c
/gnu/bin/make[2]: *** [cppsetup.o] Error 1
/gnu/bin/make[2]: Leaving directory `/dkb300/m130opt/config/mkdepend'
/gnu/bin/make[1]: *** [export] Error 2
/gnu/bin/make[1]: Leaving directory `/dkb300/m130opt/config'
/gnu/bin/make: *** [default] Error 2

There's a chicken and egg situation here, but obviously everyone
else manages to get around this. What am I missing on OpenVMS? Why
am I the only one getting stuck here?
It may be a shell issue.  We're using "set -e" which should cause the shell to
exit if a command fails.  However, according to this snippet from the bash
manpage, the option is being ignored.  Ksh has similar exceptions.  We should
just remove it and/or change mkdepend to be built as a HOST_PROGRAM.

              -e      Exit  immediately  if a simple command (see
                      SHELL GRAMMAR above) exits with a  non-zero
                      status.   The  shell  does  not exit if the
                      command that fails is part of an  until  or
                      while  loop,  part of an if statement, part
                      of a && or || list,  or  if  the  command's
                      return value is being inverted via !.
Oh, so because mkdepend is run as part of a &&, the "set -e" is ignored, and an
exit does NOT occur. But wouldn't that shell command still return with a
non-zero, and shouldn't that cause make to barf?
Nope.  The mkdepend command fails and returns non-zero as the result of that
block of && commands but we never check the status of that command set.  We run
the echo command right after that so the final result of the entire command that
make runs, the whole if-fi block, is zero.  If we didn't have the echo, then the
block would fail everytime that mkdepend or any of its chained commands failed.
I would have thought that the && commands exiting with non-zero would have
caused the if statement to exit with non-zero. That's what seems to be happening
with our GNV bash, at least.
Sounds like a bug in GNV bash.  In a normal shell script, a bogus command
doesn't  change the flow of control and cause the script to end.  It shouldn't
be any different inside the if-statement.

Now, that said, I do think we should be stopping the build if we fail to create
dependencies.  However, we shouldn't bother creating dependencies for nsinstall
& mkdepend.  Both of those programs should be built using HOST_PROGRAM and we
don't bother creating dependencies for host objects.
I'm confused then. Here's a simple test in CygWin which shows that one bogus
command causes everything to stop dead.

$ cat test.mk
all:
        @echo "Start"
        @ls no-such-file
        @echo "End"
$
$ make -f test.mk
Start
ls: no-such-file: No such file or directory
make: *** [all] Error 1

See? No "End" message.
But that's not a shell script.  That's make.  Make checks the return status of
each command set and fails if a non-zero status is returned (unless make -k is
used). If you put those individual commands (without the tab & the @) into a
file, and then did 'sh file', you should see:

Start
ls: no-such-file: No such file or directory
End

If you added a '; echo Middle' to the end of the ls line in your test Makefile,
make shouldn't fail there and you would see:

Start
ls: no-such-file: No such file or directory
Middle
End
OK, got it. And I see that in Cygwin and GNV bash on OpenVMS. If I add "; echo
Middle" to the ls command command, then it continues and I see the end message.
So I need to play around some more and find out why GNV bash is seeing a
non-zero return come back from the MAKE_DEPS_AUTO line, when clearly the echo
command at the end should cause the command to always exit successfully.
Attached patch Check for all win32 host types (obsolete) — Splinter Review
Attachment #106146 - Attachment is obsolete: true
Its the "set -e" that's causing MAKE_DEPS_AUTO under GNV bash on OpenVMS to exit
with non-zero, even though a trailing "; echo ...." is present. So I agree with
your earlier conclusion, that the "set -e" should go.
Attached patch fix win32 issues (obsolete) — Splinter Review
Attachment #106148 - Attachment is obsolete: true
Attachment #106160 - Attachment is obsolete: true
Attachment #106161 - Flags: review+
Patch has been checked in.
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.3alpha
verified
Status: RESOLVED → VERIFIED
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: