Open Bug 1597858 Opened 8 months ago Updated 2 months ago

Cannot run mach try on esr-68

Categories

(Firefox Build System :: Try, defect)

defect
Not set
normal

Tracking

(Not tracked)

REOPENED

People

(Reporter: ehsan, Unassigned)

References

(Blocks 1 open bug)

Details

STR:
Check out a branch based off of esr-68.

$ ./mach try -b do -p all -u all
Error running mach:

    ['try', '-b', 'do', '-p', 'all', '-u', 'all']

The error occurred in mach itself. This is likely a bug in mach itself or a
fundamental problem with a loaded module.

You can invoke |./mach busted| to check if this issue is already on file. If it
isn't, please use |./mach busted file| to report it. If |./mach busted| is
misbehaving, you can also inspect the dependencies of bug 1543241.

If filing a bug, please include the full output of mach, including this error
message.

The details of the failure are as follows:

ImportError: cannot import name import_sibling_modules

  File "/home/ehsan/moz/1527287/python/mach/mach/main.py", line 358, in run
    return self._run(argv)
  File "/home/ehsan/moz/1527287/python/mach/mach/main.py", line 415, in _run
    args = parser.parse_args(argv)
  File "/usr/lib/python2.7/argparse.py", line 1705, in parse_args
    args, argv = self.parse_known_args(args, namespace)
  File "/usr/lib/python2.7/argparse.py", line 1737, in parse_known_args
    namespace, args = self._parse_known_args(args, namespace)
  File "/usr/lib/python2.7/argparse.py", line 1925, in _parse_known_args
    positionals_end_index = consume_positionals(start_index)
  File "/usr/lib/python2.7/argparse.py", line 1902, in consume_positionals
    take_action(action, args)
  File "/usr/lib/python2.7/argparse.py", line 1811, in take_action
    action(self, namespace, argument_values, option_string)
  File "/home/ehsan/moz/1527287/python/mach/mach/dispatcher.py", line 172, in __call__
    if handler.parser:
  File "/home/ehsan/moz/1527287/python/mach/mach/decorators.py", line 81, in parser
    self._parser = self._parser()
  File "/home/ehsan/moz/1527287/tools/tryselect/mach_commands.py", line 41, in generic_parser
    from tryselect.cli import BaseTryParser
  File "/home/ehsan/moz/1527287/build/mach_bootstrap.py", line 393, in __call__
    module = self._original_import(name, globals, locals, fromlist, level)
  File "/home/ehsan/moz/1527287/tools/tryselect/cli.py", line 12, in <module>
    from .templates import all_templates
  File "/home/ehsan/moz/1527287/build/mach_bootstrap.py", line 393, in __call__
    module = self._original_import(name, globals, locals, fromlist, level)
  File "/home/ehsan/moz/1527287/tools/tryselect/templates.py", line 20, in <module>
    from .tasks import resolve_tests_by_suite
  File "/home/ehsan/moz/1527287/build/mach_bootstrap.py", line 393, in __call__
    module = self._original_import(name, globals, locals, fromlist, level)
  File "/home/ehsan/moz/1527287/tools/tryselect/tasks.py", line 21, in <module>
    from taskgraph.generator import TaskGraphGenerator
  File "/home/ehsan/moz/1527287/build/mach_bootstrap.py", line 393, in __call__
    module = self._original_import(name, globals, locals, fromlist, level)
  File "/home/ehsan/moz/1527287/taskcluster/taskgraph/generator.py", line 15, in <module>
    from .optimize import optimize_task_graph
  File "/home/ehsan/moz/1527287/build/mach_bootstrap.py", line 393, in __call__
    module = self._original_import(name, globals, locals, fromlist, level)
  File "/home/ehsan/moz/1527287/taskcluster/taskgraph/optimize/__init__.py", line 24, in <module>
Component: Mach Core → Try

Try running mach clobber python

Duplicate of this bug: 1597864
Status: NEW → RESOLVED
Closed: 8 months ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1590265

(In reply to Mike Hommey [:glandium] (high latency) from comment #1)

Try running mach clobber python

It doesn't help.

Status: RESOLVED → REOPENED
Resolution: DUPLICATE → ---

Is there a chance you ran mach clobber python, and then updated to central and ran mach try again? This would cause the .pyc to be regenerated and introduce the problem again. Before running ./mach try from ESR, ensure the file taskcluster/taskgraph/optimize/__init__.pyc does not exist.

You can also try setting the PYTHONDONTWRITEBYTECODE=1 env (which will cause Python to ignore those .pyc files at the cost of a small perf hit). Bug 1576155 has some more explanations.

(In reply to Andrew Halberstadt [:ahal] from comment #5)

Is there a chance you ran mach clobber python,

I did run mach clobber python and it did not help.

and then updated to central and ran mach try again?

No, I did not.

This would cause the .pyc to be regenerated and introduce the problem again. Before running ./mach try from ESR, ensure the file taskcluster/taskgraph/optimize/__init__.pyc does not exist.

It turns out that file isn't deleted by mach clobber python. Deleting this file manually fixes the issue: https://treeherder.mozilla.org/#/jobs?repo=try&revision=28c5c446708e0334856e2705bd47f658c8f5a57c

You can also try setting the PYTHONDONTWRITEBYTECODE=1 env (which will cause Python to ignore those .pyc files at the cost of a small perf hit). Bug 1576155 has some more explanations.

Thanks, that is helpful.

You need to log in before you can comment on or make changes to this bug.