Closed Bug 1669505 Opened 4 years ago Closed 4 years ago

mach test throws "fatal error processing mozbuild file"

Categories

(Firefox Build System :: General, defect)

x86_64
Windows 10
defect

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1669413

People

(Reporter: tgiles, Assigned: mhentges)

Details

I recently pulled the latest changes in m-c and rebased my work, which has caused mach test to break. The rest of the mach commands are working. I am on Firefox version 83.0a1 and the Build ID is 20201006041051. I'm not sure if this is a Windows specific issue or not, but I am on Windows 10.

STR:

  1. Check out 7ba9ec4d39f3 (the latest central tag at time of writing)
  2. Clobber and build
  3. Run mach test browser/components/aboutlogins
  4. mach test fails to build tests and throws the following output:
$ ./mach test browser/components/aboutlogins/
Test configuration changed. Regenerating backend.
Error running mach:

    ['test', 'browser/components/aboutlogins/']

The error occurred in code that was called by the mach command. This is either
a bug in the called code itself or in the way that mach is calling it.
You can invoke |./mach busted| to check if this issue is already on file. If it
isn't, please use |./mach busted file test| 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:

BuildReaderError:
==============================
FATAL ERROR PROCESSING MOZBUILD FILE
==============================

The error occurred while processing the following file:

    d:/Repos/mozilla/mozilla-central/toolkit/components/glean/metrics_index.py

This file was included as part of processing:

    d:/Repos/mozilla/mozilla-central/toolkit/components/glean/moz.build

The underlying problem is a Python syntax error on line 0:

    None

Fix the syntax error and try again.


  File "d:\Repos\mozilla\mozilla-central\testing/mach_commands.py", line 319, in test
    run_suites, run_tests = resolver.resolve_metadata(what)
  File "d:\Repos\mozilla\mozilla-central\testing/mozbase/moztest\moztest\resolve.py", line 890, in resolve_metadata
    tests = list(self.resolve_tests(paths=[relpath]))
  File "d:\Repos\mozilla\mozilla-central\testing/mozbase/moztest\moztest\resolve.py", line 857, in resolve_tests
    for test in self._resolve(**kwargs):
  File "d:\Repos\mozilla\mozilla-central\testing/mozbase/moztest\moztest\resolve.py", line 638, in _resolve
    if (path in self.test_dirs or
  File "d:\Repos\mozilla\mozilla-central\testing/mozbase/moztest\moztest\resolve.py", line 555, in test_dirs
    for test in self.tests:
  File "d:\Repos\mozilla\mozilla-central\testing/mozbase/moztest\moztest\resolve.py", line 521, in tests
    for test in self.load_tests():
  File "d:\Repos\mozilla\mozilla-central\testing/mozbase/moztest\moztest\resolve.py", line 402, in __call__
    gen_test_backend()
  File "d:\Repos\mozilla\mozilla-central\python/mozbuild\mozbuild\gen_test_backend.py", line 50, in gen_test_backend
    backend.consume(data)
  File "d:\Repos\mozilla\mozilla-central\python/mozbuild\mozbuild\backend\base.py", line 128, in consume
    for obj in objs:
  File "d:\Repos\mozilla\mozilla-central\python/mozbuild\mozbuild\frontend\emitter.py", line 169, in emit
    for out in output:
  File "d:\Repos\mozilla\mozilla-central\python/mozbuild\mozbuild\frontend\reader.py", line 886, in read_topsrcdir
    for r in self.read_mozbuild(path, self.config):
  File "d:\Repos\mozilla\mozilla-central\python/mozbuild\mozbuild\frontend\reader.py", line 1056, in read_mozbuild
    raise bre
Sentry is attempting to send 0 pending error messages
Waiting up to 2 seconds
Press Ctrl-Break to quit
Assignee: nobody → mhentges
Status: NEW → ASSIGNED

Thanks for the report! I was able to reproduce, I'm going to see if I can dig into the regressing revision - sounds like it was a recent breakage.
🤞that I don't need to ./mach clobber && ./mach build all the way along this bisect :P

The clobber might be redundant in this case. I end up clobbering and rebuilding whenever I do a rebase, but if you're checking the issue from a clean state I don't think you'll need the clobber.

Good luck 👍

Ah, found the cause, and digging in found that there appears to be a solution too!
EDIT: tested 1669413's solution locally, it resolves the problem 👍

Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → DUPLICATE

Glad to hear, thanks for your help Mitchell!

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