Open Bug 831695 Opened 11 years ago Updated 2 years ago

Don't change CWD when mach loads .mozconfig

Categories

(Firefox Build System :: General, enhancement)

All
Android
enhancement

Tracking

(Not tracked)

People

(Reporter: neil, Unassigned)

Details

Rather than setting up the MOZCONFIG environment variable every time I want an objdir with different build settings I simply create a mozconfig in the objdir and source it from the default mozconfig (which used to live in ~ but sadly now has to live in the srcdir, so it has to be careful not to source itself by mistake). Then I can make -f ../srcdir/client.mk to update the current objdir.

It would be nice if this worked with mach.
There is a lot to unpack in your bug description. Could you please post exact scenarios that work with |make -f client.mk| but don't with mach?
Flags: needinfo?(neil)
Example: I checked out m-c into ~/mozilla and I have three objdirs
~/profiling
~/debug
~/dmd
~/mozilla/.mozconfig contains . .mozconfig
~/profiling/.mozconfig contains --enable-profiling
~/debug/.mozconfig contains --enable-debug
~/dmd/.mozconfig contains --enable-dmd

So if I make -f ~/mozilla/client.mk it loads ~/mozilla/.mozconfig which loads ./.mozconfig which contains the configure options that I want.
Flags: needinfo?(neil)
OK. So I /think/ the problem is that mach is always looking in $topsrcdir/.mozconfig whereas client.mk is looking in CWD (your topobjdir in the examples).

The request is for mach to look in CWD instead of or in addition to topsrcdir.
(In reply to comment #3)
> ~/mozilla/.mozconfig contains . .mozconfig
Sorry that should be ./.mozconfig of course.

(In reply to Gregory Szorc from comment #2)
> FWIW, the mozconfig logic for mach is in python/mozbuild/mozbuild/mozconfig.py #77
I tried a quick tweak but that just made it assert, so I probably did something wrong.
(In reply to Gregory Szorc from comment #4)
> OK. So I /think/ the problem is that mach is always looking in
> $topsrcdir/.mozconfig whereas client.mk is looking in CWD (your topobjdir in
> the examples).

client.mk always looks in $topsrcdir/.mozconfig which is why I set that to . ./.mozconfig which then finds it in my current objdir.
Product: Core → Firefox Build System
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.