If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

Don't change CWD when mach loads .mozconfig

NEW
Unassigned

Status

()

Core
Build Config
--
enhancement
5 years ago
5 years ago

People

(Reporter: neil@parkwaycc.co.uk, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

5 years ago
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.

Comment 1

5 years ago
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)

Comment 2

5 years ago
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.
(Reporter)

Comment 3

5 years ago
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)

Comment 4

5 years ago
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.
(Reporter)

Comment 5

5 years ago
(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.
(Reporter)

Comment 6

5 years ago
(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.
You need to log in before you can comment on or make changes to this bug.