зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1440507 - Remove link.py wrapper script for linking xul. r=nalexander
MozReview-Commit-ID: BXrhdPzQ2jy --HG-- extra : rebase_source : 801b1876af8639996f58a1985d47fb42cc3065a6
This commit is contained in:
Родитель
d7ade7ebd0
Коммит
c94fd30a84
|
@ -1,47 +0,0 @@
|
|||
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
import expandlibs_exec
|
||||
import sys
|
||||
import threading
|
||||
import time
|
||||
|
||||
def periodically_print_status(proc):
|
||||
"""
|
||||
Print something to the console every 20 minutes to prevent the build job
|
||||
from getting killed when linking a large binary.
|
||||
Check status of the linker every 0.5 seconds.
|
||||
"""
|
||||
idleTime = 0
|
||||
while proc.returncode is None:
|
||||
time.sleep(0.5)
|
||||
idleTime += 0.5
|
||||
if idleTime > 20 * 60:
|
||||
print "Still linking, 20 minutes passed..."
|
||||
sys.stdout.flush()
|
||||
idleTime = 0
|
||||
|
||||
def wrap_linker(args):
|
||||
"""
|
||||
Execute |args| and pass resulting |proc| object to a second thread that
|
||||
will track the status of the started |proc|.
|
||||
"""
|
||||
|
||||
# This needs to be a list in order for the callback to set the
|
||||
# variable properly with python-2's scoping rules.
|
||||
t = [None]
|
||||
def callback(proc):
|
||||
t[0] = threading.Thread(target=periodically_print_status,
|
||||
args=(proc,))
|
||||
t[0].start()
|
||||
exitcode = expandlibs_exec.main(args, proc_callback=callback)
|
||||
# Wait for the background thread to finish.
|
||||
t[0].join()
|
||||
return exitcode
|
||||
|
||||
if __name__ == "__main__":
|
||||
if len(sys.argv) < 2:
|
||||
print >>sys.stderr, "Usage: link.py <commandline>"
|
||||
sys.exit(1)
|
||||
sys.exit(wrap_linker(sys.argv[1:]))
|
|
@ -6,10 +6,6 @@ include $(topsrcdir)/toolkit/library/libxul.mk
|
|||
|
||||
include $(topsrcdir)/config/config.mk
|
||||
|
||||
# Wrap linker to print linking status periodically to prevent the linking
|
||||
# process from getting killed
|
||||
EXPAND_LIBS_EXEC := $(PYTHON) $(topsrcdir)/config/link.py
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
.PHONY: gtestxul
|
||||
|
|
|
@ -25,8 +25,4 @@ include $(topsrcdir)/toolkit/library/libxul.mk
|
|||
|
||||
include $(topsrcdir)/config/config.mk
|
||||
|
||||
# Wrap linker to print linking status periodically to prevent the linking
|
||||
# process from getting killed
|
||||
EXPAND_LIBS_EXEC := $(PYTHON) $(topsrcdir)/config/link.py
|
||||
|
||||
endif
|
||||
|
|
Загрузка…
Ссылка в новой задаче