Bug 1047621 - Move link.py to config for importing expandlibs_exec; r=gps a=NPOTB
authorMike Shal <mshal@mozilla.com>
Wed, 13 Aug 2014 14:23:11 -0400
changeset 208334 a09c51fcbd98
parent 208333 2a617532286d
child 208335 bd02db1d22d0
push id3829
push userryanvm@gmail.com
push date2014-08-19 11:52 +0000
treeherdermozilla-beta@bd02db1d22d0 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgps, NPOTB
bugs1047621
milestone32.0
Bug 1047621 - Move link.py to config for importing expandlibs_exec; r=gps a=NPOTB
build/link.py
config/link.py
toolkit/library/build/Makefile.in
deleted file mode 100644
--- a/build/link.py
+++ /dev/null
@@ -1,53 +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/.
-
-from __future__ import with_statement
-import os, subprocess, sys, threading, time
-from win32 import procmem
-
-def measure_vsize_threadfunc(proc, output_file):
-    """
-    Measure the virtual memory usage of |proc| at regular intervals
-    until it exits, then print the maximum value and write it to
-    |output_file|.  Also, print something to the console every
-    half an hour to prevent the build job from getting killed when
-    linking a large PGOed binary.
-    """
-    maxvsize = 0
-    idleTime = 0
-    while proc.returncode is None:
-        maxvsize, vsize = procmem.get_vmsize(proc._handle)
-        time.sleep(0.5)
-        idleTime += 0.5
-        if idleTime > 30 * 60:
-          print "Still linking, 30 minutes passed..."
-          sys.stdout.flush()
-          idleTime = 0
-    print "TinderboxPrint: linker max vsize: %d" % maxvsize
-    with open(output_file, "w") as f:
-        f.write("%d\n" % maxvsize)
-
-def measure_link_vsize(output_file, args):
-    """
-    Execute |args|, and measure the maximum virtual memory usage of the process,
-    printing it to stdout when finished.
-    """
-    proc = subprocess.Popen(args)
-    t = threading.Thread(target=measure_vsize_threadfunc,
-                         args=(proc, output_file))
-    t.start()
-    # Wait for the linker to finish.
-    exitcode = proc.wait()
-    # ...and then wait for the background thread to finish.
-    t.join()
-    return exitcode
-
-if __name__ == "__main__":
-    if sys.platform != "win32":
-        print >>sys.stderr, "link.py is only for use on Windows!"
-        sys.exit(1)
-    if len(sys.argv) < 3:
-        print >>sys.stderr, "Usage: link.py <output filename> <commandline>"
-        sys.exit(1)
-    sys.exit(measure_link_vsize(sys.argv[1], sys.argv[2:]))
new file mode 100644
--- /dev/null
+++ b/config/link.py
@@ -0,0 +1,53 @@
+# 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/.
+
+from __future__ import with_statement
+import os, subprocess, sys, threading, time
+from win32 import procmem
+
+def measure_vsize_threadfunc(proc, output_file):
+    """
+    Measure the virtual memory usage of |proc| at regular intervals
+    until it exits, then print the maximum value and write it to
+    |output_file|.  Also, print something to the console every
+    half an hour to prevent the build job from getting killed when
+    linking a large PGOed binary.
+    """
+    maxvsize = 0
+    idleTime = 0
+    while proc.returncode is None:
+        maxvsize, vsize = procmem.get_vmsize(proc._handle)
+        time.sleep(0.5)
+        idleTime += 0.5
+        if idleTime > 30 * 60:
+          print "Still linking, 30 minutes passed..."
+          sys.stdout.flush()
+          idleTime = 0
+    print "TinderboxPrint: linker max vsize: %d" % maxvsize
+    with open(output_file, "w") as f:
+        f.write("%d\n" % maxvsize)
+
+def measure_link_vsize(output_file, args):
+    """
+    Execute |args|, and measure the maximum virtual memory usage of the process,
+    printing it to stdout when finished.
+    """
+    proc = subprocess.Popen(args)
+    t = threading.Thread(target=measure_vsize_threadfunc,
+                         args=(proc, output_file))
+    t.start()
+    # Wait for the linker to finish.
+    exitcode = proc.wait()
+    # ...and then wait for the background thread to finish.
+    t.join()
+    return exitcode
+
+if __name__ == "__main__":
+    if sys.platform != "win32":
+        print >>sys.stderr, "link.py is only for use on Windows!"
+        sys.exit(1)
+    if len(sys.argv) < 3:
+        print >>sys.stderr, "Usage: link.py <output filename> <commandline>"
+        sys.exit(1)
+    sys.exit(measure_link_vsize(sys.argv[1], sys.argv[2:]))
--- a/toolkit/library/build/Makefile.in
+++ b/toolkit/library/build/Makefile.in
@@ -1,17 +1,17 @@
 # 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/.
 
 include $(topsrcdir)/toolkit/library/libxul.mk
 
 ifeq (WINNT_1,$(OS_TARGET)_$(MOZ_PROFILE_USE))
 # Wrap linker to measure peak virtual memory usage.
-LD := $(PYTHON) $(topsrcdir)/build/link.py $(DEPTH)/toolkit/library/linker-vsize $(LD)
+LD := $(PYTHON) $(topsrcdir)/config/link.py $(DEPTH)/toolkit/library/linker-vsize $(LD)
 endif
 
 ifneq (,$(filter WINNT,$(OS_ARCH)))
 SDK_LIBRARY = $(IMPORT_LIBRARY)
 else
 SDK_LIBRARY = $(SHARED_LIBRARY)
 endif