Closed Bug 591152 Opened 13 years ago Closed 12 years ago

mozilla/js/src/configure: line 10134: test: : integer expression expected


(Firefox Build System :: General, defect)

Not set


(Not tracked)



(Reporter: ishikawa, Assigned: tuukka.tolvanen)




(2 files, 3 obsolete files)

During the config/build cycle of TB3, I noticed a warning generated 
by ./mozilla/js/src/configure which looks very suspicious.

I reported the problem and analsys in the newsgroup posting.

I found that a code in configure looks like this at the line where the warning is generated:

10134   if test -z "$MACOS_DEPLOYMENT_TARGET" -o "$MACOS_DEPLOYMENT_TARGET" -ge "100300"; then
          ... blahblahblah ... 

The "-o" should be rewritten as "|| test " so that the null-string is not
passed to `test'.
Under my linux configuration, MACOS_DEPLOYMENT_TARGET is null.

Now I figured the problem is in and very easy to fix.
So I am attaching the patch to ./mozilla/ms/src/

Assignee: nobody → ishikawa
Attachment #469753 - Flags: review?(ted.mielczarek) → review+
oh, the other needs this too. (and comm)
there's also
which should be suspectible to the same sort of issue, but the other numerical comparison stuff seems ok
Thank you for looking at the problem.
This one seems to need the fix.
This one, also.

It is hard to tell which "test" requires changes because
we can't tell easily whether a particular string is defined at all.
it seems to me
 - that certain version of MACOS deployment target may not
   define this string at all, and
 - if defined, there are version cases (larger than a given number)
   that need to be tested.

Depending on the strings chosen, they may or may not be defined
and being undefined means one thing to a particular test, and
so only the original coder, and the testers with various configurations
would be able to tell. (MACOS builder probably never see the
original problem I reported.)

The two patches I saw seemed to be an attempt to premature optimization
efforts. A series of extra exec()s  of "test" don't seem to
be a big issue to me for a configuration of big suite like TB3.
(Yes, it certainly adds time during configuration, but we have
bigger problems of real bugs and too many spurious compiler warnings that need
clean up before cleanup IMHO.)

Attached patch central (obsolete) — Splinter Review
covers gt/ge/lt/le/eq that were touched (ok, so there were only ge)
Attachment #469753 - Attachment is obsolete: true
Attachment #489972 - Flags: review?(khuey)
Attached patch comm (obsolete) — Splinter Review
Attachment #489973 - Flags: review?(bugspam.Callek)
Attached patch centralSplinter Review
oh bother. can't have blame for lines with bashisms ;>
Attachment #489972 - Attachment is obsolete: true
Attachment #489978 - Flags: review?(khuey)
Attachment #489972 - Flags: review?(khuey)
Attached patch commSplinter Review
Attachment #489973 - Attachment is obsolete: true
Attachment #489980 - Flags: review?(bugspam.Callek)
Attachment #489973 - Flags: review?(bugspam.Callek)
Comment on attachment 489980 [details] [diff] [review]

I'm cheating and letting this get one single round of reviews, and will accept kyle's review here (provided the changed lines are == between m-c and c-c which they appear to be).
Attachment #489980 - Flags: review?(bugspam.Callek) → review?(khuey)
Another choice:

if test -z "$MACOS_DEPLOYMENT_TARGET" -o "${MACOS_DEPLOYMENT_TARGET:-0}" -ge "100300"; then

Here's just for information.
Comment on attachment 489978 [details] [diff] [review]

Maybe I still don't quite understand the problem here, my shell-fu is a bit weak, but why shouldn't

>     AC_MSG_CHECKING([for Unicode NSIS with major version == $REQ_NSIS_MAJOR_VER and minor version >= $MIN_NSIS_MINOR_VER])
>-    if test "$MAKENSISU_VER" == "" -o \
>+    if test "$MAKENSISU_VER" = "" ||
>+       test ! "$MAKENSISU_MAJOR_VER" = "$REQ_NSIS_MAJOR_VER" -o \
>+            ! "$MAKENSISU_MINOR_VER" -ge $MIN_NSIS_MINOR_VER; then

be changed to '||' in both places?
Other than that, these look fine, but I'd like to understand the question posted in comment 12 before I r+ these.
Nothing's checking MAKENSISU_MAJOR/MINOR_VER REQ_NSIS_MAJOR/MINOR_VER themselves for integerness or nonblankness there, and in a successful case it wants to look at both anyhow, so it should be no more broken written like that. The patch is just to isolate "not blank" tests from being part of the same syntax that will fail in the "blank" case.
> themselves for integerness or nonblankness there, and in a successful case it

("there" being the second "test" as patched -- if $MAKENSISU_VER is blank in the first test that does imply that the MAJOR/MINOR derived from it are as well, so the syntax would be broken if those two parts are not isolated.)
Keywords: checkin-needed
Pushed the m-c parts in

Leaving open until the c-c parts are landed.
Whiteboard: [needs landing attachment 489980]
Whiteboard: [needs landing attachment 489980] → [needs landing attachment 489980 to comm-central]
Pushed in c-c:
Assignee: ishikawa → tuukka.tolvanen
Closed: 12 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Whiteboard: [needs landing attachment 489980 to comm-central]
Flags: in-testsuite-
Target Milestone: --- → mozilla6
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.