Closed Bug 703930 Opened 8 years ago Closed 8 years ago

Add |set -o errexit| to * to abort the build on errors rather than just hiding them


(Firefox Build System :: General, defect)

Not set


(Not tracked)



(Reporter: emorley, Assigned: emorley)



(1 file)

As suggested by Joey, to avoid typos such as that fixed by bug 698526 slipping through again, we should ensure the * scripts bail with a non-zero exit code and thus abort the build, if something goes awry. says we can do this with |set -e| or |set -o errexit|. I prefer the latter since it's more readable.
Attached patch Patch v1Splinter Review
|set -o errexit| is set for all scripts from that point onwards, so has to be turned off at the end of, otherwise multiple places in the rest of configure will error out (eg: the |mv -f config/ config/ 2> /dev/null| line shortly after is executed, and many more).
Attachment #575716 - Flags: review?(khuey)
Meant to say, deliberately making a typo in services/ with this patch applied, correctly gives:
../inbound/services/ line 56: add_FOOmakefiles: command not found
*** Fix above errors and then restart with               "c:/mozilla-build/python/python.exe c:/mozilla/repos/inbound/build/pymake/pymake/../ -f build"
c:\mozilla\repos\inbound\ command 'cd . &&   ../inbound/configure  \
  || ( echo "*** Fix above errors and then restart with\
               \"c:/mozilla-build/python/python.exe c:/mozilla/repos/inbound/build/pymake/pymake/../ -f build\"" && exit 1 )' failed, return code 1
c:\mozilla\repos\inbound\ command 'c:/mozilla-build/python/python.exe c:/mozilla/repos/inbound/build/pymake/pymake/../ -f ../inbound/ configure' failed, return code 2
c:\mozilla\repos\inbound\ command 'c:/mozilla-build/python/python.exe c:/mozilla/repos/inbound/build/pymake/pymake/../ -f ../inbound/ realbuild' failed, return code 2
Comment on attachment 575716 [details] [diff] [review]
Patch v1

Review of attachment 575716 [details] [diff] [review]:

Is this going to make the "people remove a directory from tree but leave it in *" case error out?
Attachment #575716 - Flags: review?(khuey) → review+
It shouldn't, since errexit will be turned off at the end of, before configure calls

Do you want it to?
I don't really care either way, I was just curious.
Flags: in-testsuite-
Target Milestone: --- → mozilla11
Closed: 8 years ago
Resolution: --- → FIXED
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.