mozconfig Switcher

A simple TUI utility to switch between different mozconfigs in the Mozilla source code.

Installation

gem install mozconfig

Usage

Your mozconfig should be formatted like this, for example:

mk_add_options AUTOCLOBBER=1

# Firefox
ac_add_options --with-branding=browser/branding/nightly
ac_add_options --with-ccache=sccache

# Firefox (artifact build)
# ac_add_options --with-branding=browser/branding/nightly
# ac_add_options --enable-artifact-builds

# SpiderMonkey (debug)
# mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-js-debug-@CONFIG_GUESS@
# ac_add_options --enable-project=js
# ac_add_options --with-ccache=sccache
# ac_add_options --enable-debug
# ac_add_options --disable-optimize

# SpiderMonkey (optimized)
# mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-js-opt-@CONFIG_GUESS@
# ac_add_options --enable-project=js
# ac_add_options --with-ccache=sccache
# ac_add_options --enable-optimize
# ac_add_options --disable-debug

# Thunderbird
# mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-mail-@CONFIG_GUESS@
# ac_add_options --with-branding=comm/mail/branding/nightly
# ac_add_options --enable-project=comm/mail
# ac_add_options --with-ccache=sccache

# Thunderbird (artifact build)
# mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-mail-@CONFIG_GUESS@
# ac_add_options --with-branding=comm/mail/branding/nightly
# ac_add_options --enable-project=comm/mail
# ac_add_options --enable-artifact-builds

The options are separated into "paragraphs", each one a separate configuration. This tool will comment out all of the inactive configurations. The comment above each paragraph will be the name displayed in the TUI. Any paragraph without a comment above it will remain active in all configurations.

Run mozconfig at the root of the source tree and you will be presented with a picker where you can select your configuration, e.g.:

Screenshot of
TUI