author Mike Hommey <>
Tue, 13 Nov 2018 23:47:36 +0000
changeset 446126 bfb4ee856c7115899960e3bd1fcf72b5e764314d
parent 440551 84e2040e592add53094c718a6d766d9559ab2498
child 449217 b46490e922b4b404359830f21aa1f01097201335
permissions -rw-r--r--
Bug 1496503 - Move MOZ_CrashOOL to Assertions.h. r=froydnj Ideally, we'd want the function to stay in Assertions.cpp, but that's only part of MFBT proper, and that doesn't have access to WalkTheStack like MOZ_CRASH has from being in Assertion.h, when included from Gecko code. Moving WalkTheStack to mozglue, putting it close together with MozStackWalk would be prefered, but that causes problems linking MFBT tests (which don't have access to mozglue), and other things. Overall, this was too deep a rabbit hole, and moving MOZ_CrashOOL to Assertions.h is much simpler. Since it's essentially the same as MOZ_CRASH, except it allows non-literal strings, we can make it inlined, and leave it to the compiler to drop the filename argument when it's not used. Differential Revision:

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this,
# file, You can obtain one at

from __future__ import absolute_import, print_function, unicode_literals

from mach.decorators import (

from mach.base import (

class CompareLocales(object):
    """Run compare-locales."""

    @Command('compare-locales', category='build',
             description='Run source checks on a localization.')
    @CommandArgument('config_paths', metavar='l10n.toml', nargs='+',
                     help='TOML or INI file for the project')
    @CommandArgument('l10n_base_dir', metavar='l10n-base-dir',
                     help='Parent directory of localizations')
    @CommandArgument('locales', nargs='*', metavar='locale-code',
                     help='Locale code and top-level directory of '
                          'each localization')
    @CommandArgument('-m', '--merge',
                     help='''Use this directory to stage merged files''')
    @CommandArgument('-D', action='append', metavar='var=value',
                     default=[], dest='defines',
                     help='Overwrite variables in TOML files')
    @CommandArgument('--unified', action="store_true",
                     help="Show output for all projects unified")
    @CommandArgument('--full', action="store_true",
                     help="Compare projects that are disabled")
    def compare(self, **kwargs):
        from compare_locales.commands import CompareLocales

        class ErrorHelper(object):
            '''Dummy ArgumentParser to marshall compare-locales
            commandline errors to mach exceptions.
            def error(self, msg):
                raise FailedCommandError(msg)

            def exit(self, message=None, status=0):
                raise FailedCommandError(message, exit_code=status)

        cmd = CompareLocales()
        cmd.parser = ErrorHelper()
        return cmd.handle(**kwargs)