]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Do not copy glibc sources in build-many-glibcs.py.
authorJoseph Myers <joseph@codesourcery.com>
Wed, 28 Nov 2018 17:28:50 +0000 (17:28 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Wed, 28 Nov 2018 17:28:50 +0000 (17:28 +0000)
Now that build-many-glibcs.py touches at checkout time all files that
might get rebuilt in the glibc source directory in a normal glibc
build and test run, this patch stops the script from copying the glibc
source directory, so that all builds use the original directory
directly (and less disk space is used, less I/O is involved and cached
copies of the sources in memory can be shared between all the builds -
as well as avoiding spurious failures from copying while "git gc" is
running).  This is similar to how all other components were already
handled.  Any bugs involving writing into the source directory can be
dealt with in future as normal bugs, just as such bugs already are
handled.

Tested with build-many-glibcs.py runs with a read-only glibc source
directory, with all files not touched by the script having timestamps
in forwards alphabetical order and separately with all files not
touched by the script having timestamps in backwards alphabetical
order.

* scripts/build-many-glibcs.py (Glibc.build_glibc): Use original
source directory instead of a copy.
(CommandList.create_copy_dir): Remove.

ChangeLog
scripts/build-many-glibcs.py

index 485555ff48b3c0602f2f0bcd8e940f14a1a183ce..28d7735ab3c5813853bfc368525b373475f55661 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2018-11-28  Joseph Myers  <joseph@codesourcery.com>
+
+       * scripts/build-many-glibcs.py (Glibc.build_glibc): Use original
+       source directory instead of a copy.
+       (CommandList.create_copy_dir): Remove.
+
 2018-11-28  Stefan Liebler  <stli@linux.ibm.com>
 
        * sysdeps/s390/fpu/libm-test-ulps: Regenerated.
index 376382d4a4e7a66b540510a7b57e1eef40b072fa..98acabc7a09e4e1be875e14c7cd38755ba58ffc6 100755 (executable)
@@ -1440,25 +1440,14 @@ class Glibc(object):
                                                    self.compiler.name, 'glibc',
                                                    self.name)
             installdir = self.compiler.sysroot
-            srcdir_copy = self.ctx.component_builddir('compilers',
-                                                      self.compiler.name,
-                                                      'glibc-src',
-                                                      self.name)
         else:
             builddir = self.ctx.component_builddir('glibcs', self.name,
                                                    'glibc')
             installdir = self.ctx.glibc_installdir(self.name)
-            srcdir_copy = self.ctx.component_builddir('glibcs', self.name,
-                                                      'glibc-src')
         cmdlist.create_use_dir(builddir)
-        # glibc builds write into the source directory, and even if
-        # not intentionally there is a risk of bugs that involve
-        # writing into the working directory.  To avoid possible
-        # concurrency issues, copy the source directory.
-        cmdlist.create_copy_dir(srcdir, srcdir_copy)
         use_usr = self.os != 'gnu'
         prefix = '/usr' if use_usr else ''
-        cfg_cmd = [os.path.join(srcdir_copy, 'configure'),
+        cfg_cmd = [os.path.join(srcdir, 'configure'),
                    '--prefix=%s' % prefix,
                    '--enable-profile',
                    '--build=%s' % self.ctx.build_triplet,
@@ -1497,7 +1486,6 @@ class Glibc(object):
             cmdlist.add_command('check', ['make', 'check'])
             cmdlist.add_command('save-logs', [self.ctx.save_logs],
                                 always_run=True)
-        cmdlist.cleanup_dir('cleanup-src', srcdir_copy)
         cmdlist.cleanup_dir()
 
 
@@ -1582,14 +1570,6 @@ class CommandList(object):
         self.add_command_dir('mkdir', None, ['mkdir', '-p', dir])
         self.use_dir(dir)
 
-    def create_copy_dir(self, src, dest):
-        """Remove a directory and recreate it as a copy from the given
-        source."""
-        self.add_command_dir('copy-rm', None, ['rm', '-rf', dest])
-        parent = os.path.dirname(dest)
-        self.add_command_dir('copy-mkdir', None, ['mkdir', '-p', parent])
-        self.add_command_dir('copy', None, ['cp', '-a', src, dest])
-
     def add_command_dir(self, desc, dir, command, always_run=False):
         """Add a command to run in a given directory."""
         cmd = Command(self.desc_txt(desc), len(self.cmdlist), dir, self.path,