Author: David Schneider <[email protected]>
Branch: decouple-builds
Changeset: r792:4a99cfab8997
Date: 2013-04-21 21:45 +0200
http://bitbucket.org/pypy/buildbot/changeset/4a99cfab8997/

Log:    Avoid copying files and instead symlink the nigtly pypy build into
        pypy/goal/pypy-c

diff --git a/bot2/pypybuildbot/builds.py b/bot2/pypybuildbot/builds.py
--- a/bot2/pypybuildbot/builds.py
+++ b/bot2/pypybuildbot/builds.py
@@ -452,17 +452,23 @@
         setup_steps(platform, self)
 
         # download corresponding nightly build
+        basepath = '%(workdir)s/%(buildnumber)s/'
+        nightlydir = WithProperties(basepath)
+        nightly_pypy_c = WithProperties(basepath + 'bin/pypy')
+        extension = get_extension(platform)
+        name = build_name(platform, pypyjit, translationArgs,
+                            placeholder='%(revision)s') + extension
+        localname = 'pypy_build' + extension
         self.addStep(ShellCmd(
-            description="Clear pypy-c",
-            command=['rm', '-rf', 'pypy-c'],
-            workdir='.'))
-        extension = get_extension(platform)
-        name = build_name(platform, pypyjit, translationArgs, 
placeholder='%(revision)s') + extension
+                        description="Clear pypy-c",
+                        command=['rm', '-rf', 'pypy-c'],
+                        workdir='.'))
+        #
         self.addStep(PyPyDownload(
             basename=name,
             mastersrc='~/nightly',
-            slavedest='pypy_build' + extension,
-            workdir='pypy-c'))
+            slavedest=localname,
+            workdir=nightlydir))
 
         # extract downloaded file
         if platform.startswith('win'):
@@ -470,27 +476,28 @@
         else:
             self.addStep(ShellCmd(
                 description="decompress pypy-c",
-                command=['tar', '--extract', '--file=pypy_build'+ extension, 
'--strip-components=1', '--directory=.'],
-                workdir='pypy-c'))
+                command=['tar', '--extract', '--file=' + localname,
+                         '--strip-components=1', '--directory=.'],
+                workdir=nightlydir))
 
-        # copy pypy-c to the expected location within the pypy source checkout
+        # link pypy-c to the expected location within the pypy source checkout
         self.addStep(ShellCmd(
-            description="move pypy-c",
-            command=['cp', '-v', 'pypy-c/bin/pypy', 'build/pypy/goal/pypy-c'],
-            workdir='.'))
-        # copy generated and copied header files to build/include
-        self.addStep(ShellCmd(
-            description="move header files",
-            command=['cp', '-vr', 'pypy-c/include', 'build'],
-            workdir='.'))
-        # copy ctypes_resource_cache generated during translation
-        self.addStep(ShellCmd(
-            description="move ctypes resource cache",
-            command=['cp', '-rv', 'pypy-c/lib_pypy/ctypes_config_cache', 
'build/lib_pypy'],
-            workdir='.'))
+            description="Symlink pypy-c",
+            command=['ln', '-sf', nightly_pypy_c, 'pypy/goal/pypy-c'],
+            workdir='build/'))
 
         add_translated_tests(self, prefix, platform, app_tests, lib_python, 
pypyjit)
 
+        self.addStep(ShellCmd(
+            description="Clear symlink to pypy-c",
+            command=['rm', 'pypy/goal/pypy-c'],
+            workdir='build/'))
+
+        self.addStep(ShellCmd(
+            description="Clear downloaded nightly build",
+            command=['rm', '-rf', nightlydir]))
+
+
 
 class NightlyBuild(factory.BuildFactory):
     def __init__(self, platform='linux',
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to