Skip to content

Commit

Permalink
Bug 1252556 - Make profileserver.py fail when running Firefox fails. …
Browse files Browse the repository at this point in the history
…r=chmanchester

Currently, when Firefox crashes when running the PGO profile, the error
is ignored, and the result is a build that is not optimized as expected.
So instead of such things going unnoticed, we make profileserver.py
return an error code, further failing the build.

Unfortunately, this does not make the output useful to know what went
wrong exactly, but the most important thing is that the build fails
instead of going through and leading to bad results.
  • Loading branch information
glandium committed Dec 18, 2018
1 parent 37d7135 commit 07d4e8e
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions build/pgo/profileserver.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import json
import os
import sys

from buildconfig import substs
from mozbuild.base import MozbuildObject
Expand Down Expand Up @@ -96,7 +97,12 @@
cmdargs=['data:text/html,<script>Quitter.quit()</script>'],
env=env)
runner.start()
runner.wait()
ret = runner.wait()
if ret:
print("Firefox exited with code %d during profile initialization"
% ret)
httpd.stop()
sys.exit(ret)

jarlog = os.getenv("JARLOG_FILE")
if jarlog:
Expand All @@ -109,5 +115,8 @@
cmdargs=cmdargs,
env=env)
runner.start(debug_args=debug_args, interactive=interactive)
runner.wait()
ret = runner.wait()
httpd.stop()
if ret:
print("Firefox exited with code %d during profiling" % ret)
sys.exit(ret)

0 comments on commit 07d4e8e

Please sign in to comment.