Open Bug 1279915 Opened 8 years ago Updated 2 years ago

mach test truncates last_log.json

Categories

(Firefox Build System :: Mach Core, enhancement)

enhancement

Tracking

(Not tracked)

UNCONFIRMED

People

(Reporter: oliver.henshaw, Unassigned)

References

Details

I can't get any output from "mach show-log" after running a test, whereas viewing the log after "mach build" works as expected. Seems that the last_log is truncated but the test output isn't written to it.

$ ./mach build
...
$ ll OBJDIR/.mozbuild/last_log.json
-rw-r--r--. 1 oliver henshaw 34952 Jun 13 14:49 obj-x86_64-pc-linux-gnu-asan/.mozbuild/last_log.json
$ ./mach test devtools/client/debugger/test/mochitest/browser_dbg_server-conditional-bp-05.js
...
$ ll OBJDIR/.mozbuild/last_log.json
-rw-r--r--. 1 oliver henshaw 0 Jun 13 15:02 obj-x86_64-pc-linux-gnu-asan/.mozbuild/last_log.json
Not sure who to ask for to look at this bug, but maybe Mike knows better?
Flags: needinfo?(mh+mozilla)
The core problem here is that mach's last_log records the log of the last mach command, assuming the command uses mach's logging. Unfortunately test harnesses use their own separate logging, so mach's logging gets nothing, and last_log is updated with an empty log.

Cf. the discussion in bug 985857, which implemented last_log, a possibility would be to have a last_log.$command.log, but at the time, I hadn't figured how to hook things up such as to get the command name at the time the logging is setup. The extra complication with this scheme is that mach show-log becomes less useful without giving it an argument.
Blocks: 985857
Flags: needinfo?(mh+mozilla)
Product: Core → Firefox Build System
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.