Last Comment Bug 666140 - should fail if MOZCONFIG is specified but points to a nonexistent file
: should fail if MOZCONFIG is specified but points to a nonexistent file
Product: Core
Classification: Components
Component: Build Config (show other bugs)
: unspecified
: All All
: -- normal (vote)
: mozilla7
Assigned To: Jez Ng [:int3]
Depends on:
  Show dependency treegraph
Reported: 2011-06-22 00:17 PDT by Jez Ng [:int3]
Modified: 2011-07-08 10:37 PDT (History)
4 users (show)
khuey: in‑testsuite-
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

Fix for the issue described. (886 bytes, patch)
2011-06-22 00:21 PDT, Jez Ng [:int3]
khuey: review+
Details | Diff | Splinter Review

Description Jez Ng [:int3] 2011-06-22 00:17:03 PDT
User-Agent:       Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:5.0) Gecko/20100101 Firefox/5.0
Build Identifier: 

I spent a good deal of time trying to figure out why my builds weren't working as expected, when I realized that my MOZCONFIG environment variable was actually pointing to a nonexistent file, and the build was just using its default options. I feel that the build system should highlight this error instead of defaulting silently.

Reproducible: Always
Comment 1 Jez Ng [:int3] 2011-06-22 00:21:27 PDT
Created attachment 540980 [details] [diff] [review]
Fix for the issue described.
Comment 2 Kyle Huey [:khuey] ( 2011-06-22 07:30:55 PDT
Comment on attachment 540980 [details] [diff] [review]
Fix for the issue described.

>+  if [ -n "$_config" ] && ! [ -f "$_config" ]; then

This should be ||, no?
Comment 3 Jez Ng [:int3] 2011-06-22 14:19:38 PDT
Nope. If _config is not defined, then we should look for the mozconfig file in the default places like ~/.mozconfig. But if it is defined _and_ points to a file that doesn't exist, then we should throw an error.
Comment 4 Kyle Huey [:khuey] ( 2011-06-22 14:28:18 PDT
My bad, I read another ! in there because that's what I expected.
Comment 5 Kyle Huey [:khuey] ( 2011-06-24 11:41:25 PDT
Comment 6 Kyle Huey [:khuey] ( 2011-06-25 18:39:22 PDT
Comment 7 David :Bienvenu 2011-06-27 11:49:29 PDT
this broke my pymake builds of Thunderbird. For those builds, I set MOZCONFIG to /c/builds/<tree>/mozconfig, which was working earlier.
Comment 8 Benjamin Smedberg AWAY UNTIL 2-AUG-2016 [:bsmedberg] 2011-06-27 11:53:11 PDT
Does it not work to set MOZCONFIG=c:/builds/<tree>/mozconfig?
Comment 9 David :Bienvenu 2011-06-27 12:07:00 PDT
(In reply to comment #8)
> Does it not work to set MOZCONFIG=c:/builds/<tree>/mozconfig?

No, it fails the same way:

g --disable-optimize --enable-chrome-format=jar --enable-application=../mail --d
isable-official-branding --with-branding=../mail/branding/nightly --cache-file=.
././config.cache --srcdir=../../mozilla
../../mozilla/./build/autoconf/mozconfig2configure: line 118: Specified MOZCONFI
G "../.mozconfig" does not exist!: No such file or directory
configure: error: ../../mozilla/configure failed for mozilla

It's odd that it's looking for ../.mozconfig - maybe it's an issue that Thunderbird builds out of <tree>/mozilla
Comment 10 2011-07-01 16:36:44 PDT
Also breaks for me using a relative configure i.e. invoking ../configure with my mozconfig living in my srcdir so not actually specified in $MOZCONFIG.
Comment 11 Siddharth Agarwal [:sid0] (inactive) 2011-07-04 23:53:06 PDT
Strange, running MOZCONFIG=/c/Users/Sid/mozilla/comm-central/.mozconfig-opt ../configure works fine for me with an updated mozilla-central.
Comment 12 Kyle Huey [:khuey] ( 2011-07-08 10:37:22 PDT
So ... do we need to back this out our not?

Note You need to log in before you can comment on or make changes to this bug.