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?
FWIW, the mozconfig logic for mach is in https://hg.mozilla.org/mozilla-central/file/d29ffd335728/python/mozbuild/mozbuild/mozconfig.py#l77. Tests live at https://hg.mozilla.org/mozilla-central/file/d29ffd335728/python/mozbuild/mozbuild/test/test_mozconfig.py.
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.
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.