Closed Bug 1555824 Opened 3 months ago Closed 3 months ago

|mach help| requires a build environment

Categories

(Firefox Build System :: Mach Core, defect)

defect
Not set

Tracking

(firefox69 fixed)

RESOLVED FIXED
mozilla69
Tracking Status
firefox69 --- fixed

People

(Reporter: ahal, Assigned: ahal)

Details

Attachments

(1 file)

STR

$ ./mach clobber
$ ./mach help

Expected

Help text is displayed.

Actual

BuildEnvironmentNotFoundException: config.status not available. Run configure.

  File "/home/ahal/dev/mozilla-central/python/mach/mach/main.py", line 361, in run
    return self._run(argv)
  File "/home/ahal/dev/mozilla-central/python/mach/mach/main.py", line 418, in _run
    args = parser.parse_args(argv)
  File "/home/ahal/.pyenv/versions/2.7.15/lib/python2.7/argparse.py", line 1701, in parse_args
    args, argv = self.parse_known_args(args, namespace)
  File "/home/ahal/.pyenv/versions/2.7.15/lib/python2.7/argparse.py", line 1733, in parse_known_args
    namespace, args = self._parse_known_args(args, namespace)
  File "/home/ahal/.pyenv/versions/2.7.15/lib/python2.7/argparse.py", line 1942, in _parse_known_args
    stop_index = consume_positionals(start_index)
  File "/home/ahal/.pyenv/versions/2.7.15/lib/python2.7/argparse.py", line 1898, in consume_positionals
    take_action(action, args)
  File "/home/ahal/.pyenv/versions/2.7.15/lib/python2.7/argparse.py", line 1807, in take_action
    action(self, namespace, argument_values, option_string)
  File "/home/ahal/dev/mozilla-central/python/mach/mach/dispatcher.py", line 114, in __call__
    self._handle_main_help(parser, namespace.verbose)
  File "/home/ahal/dev/mozilla-central/python/mach/mach/dispatcher.py", line 266, in _handle_main_help
    if not c(instance):
  File "/home/ahal/dev/mozilla-central/python/mozbuild/mozbuild/base.py", line 1010, in is_non_artifact_build
    return not MachCommandConditions.is_artifact_build(cls)
  File "/home/ahal/dev/mozilla-central/python/mozbuild/mozbuild/base.py", line 1005, in is_artifact_build
    return getattr(cls, 'substs', {}).get('MOZ_ARTIFACT_BUILDS')
  File "/home/ahal/dev/mozilla-central/python/mozbuild/mozbuild/base.py", line 356, in substs
    return self.config_environment.substs
  File "/home/ahal/dev/mozilla-central/python/mozbuild/mozbuild/base.py", line 339, in config_environment
    raise BuildEnvironmentNotFoundException('config.status not available. Run configure.')

Invoking MozbuildObject.substs causes an exception to be raised if there is no
BuildEnvironment. This means that we hit an error on |mach help| if there is no
build, which is not ideal for people trying to learn how to build :).

Pushed by ahalberstadt@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/87017ac1c788
Don't call MozbuildObject.substs from a MachCommandCondition r=nalexander
Status: ASSIGNED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla69
You need to log in before you can comment on or make changes to this bug.