Refactor mach's configuration

NEW
Unassigned

Status

()

Core
Build Config
5 years ago
4 years ago

People

(Reporter: gps, Unassigned)

Tracking

(Blocks: 2 bugs)

Trunk
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Mach/mozbuild maintains its own configuration file. It is like a .mozconfig file except better.

There are some obvious features missing from the configuration file. But, I'd like this bug to focus on making the design more robust.

Desirable features:

* Strict validation. Values must have a type and types are strongly validated. Bad config files should be detected early and cause mach to refuse to work. I would rather mach stop running than execute in an undefined state. This includes ensuring that unrecognized config values cause an error. This is mostly how things are implemented today.

* Versioning of the config file. Similar to the way that web site frameworks like Django handle database schemas, I'd like the config file to be versioned. This serves a few purposes. 1) It allows config contents to be "upgraded" if needed. 2) It can be used to detect when mach has been upgraded. I think it would be a really cool feature if, upon upgrade of mach, the user was prompted with a little notice saying "hey, you can now do X and Y. Would you like to configure that?"

* l10n. Currently the config settings descriptions are inline in the config.py file. We should probably define them in a standalone file (mostly for readability). While we're at it, we should leave the door open for l10n.
Blocks: 774136
It would also be nice if mach could maintain separate trees. So, for example, I have the following setup on my machine:

> /home/sjohnson/Source
>   - mozilla-central/
>     - mozilla (sourcedir)
>     - obj (objdir)
>   - mozilla-inbound/
>     - mozilla (sourcedir)
>     - obj-android (objdir)
>   ...  other trees as necessary (e.g. beta, aurora)

It would be nice if I had a single mach command, and could run something like:
> mach build <name of tree> 
> e.g. $ mach build central

I currently use a tool for this, called JMozMake, which is, essentially a less-feature rich version of mach. One of the additional tools I have available as part of that toolset is to be able to cd directly into the source or objdir of a given tree. The command:

> JMozTeleport -s central

will take me to the source directory of my mozilla-central tree. If we were to maintain separate trees within the mach configuration file (and it was global), we could support something like this, which is basically just a convenience function. (I suppose no different than the google or mxr searches available within mach).

Comment 2

4 years ago
This seems to be about mach.ini / MACH_SETTINGS_FILE <http://mxr.mozilla.org/mozilla-central/source/python/mach/mach/main.py#504>, which is currently disabled per bug 799648 comment 5. (Couldn't find a bug about enabling it back, which would be useful for bug 958033, for example.)
You need to log in before you can comment on or make changes to this bug.