]> granicus.if.org Git - python/commitdiff
Visious hackery to solve a build-control problem related to our use of
authorFred Drake <fdrake@acm.org>
Thu, 6 Dec 2001 22:59:54 +0000 (22:59 +0000)
committerFred Drake <fdrake@acm.org>
Thu, 6 Dec 2001 22:59:54 +0000 (22:59 +0000)
distutils for the library modules built as shared objects.  A better solution
appears possible, but with the threat that the distutils becomes more
magical ("complex").
This closes SF bug #458343.

Lib/distutils/command/build_ext.py
setup.py

index c9e30623065b90b42870da7a88079a92fdddb254..7a39314bcd00b6178c1c5b807271c38821b9a3d3 100644 (file)
@@ -456,6 +456,17 @@ class build_ext (Command):
                                         debug=self.debug,
                                         extra_postargs=extra_args)
 
+        # XXX -- this is a Vile HACK!
+        #
+        # The setup.py script for Python on Unix needs to be able to
+        # get this list so it can perform all the clean up needed to
+        # avoid keeping object files around when cleaning out a failed
+        # build of an extension module.  Since Distutils does not
+        # track dependencies, we have to get rid of intermediates to
+        # ensure all the intermediates will be properly re-built.
+        #
+        self._built_objects = objects[:]
+
         # Now link the object files together into a "shared object" --
         # of course, first we have to figure out all the other things
         # that go into the mix.
index 183c45e06c2e11088435c1bfcd5f91d1ef031c95..693d64c9783c854b7a001c7401d4c6d1bc135e9d 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -172,6 +172,13 @@ class PyBuildExt(build_ext):
                                         self.get_ext_filename(fullname))
             os.remove(ext_filename)
 
+            # XXX -- This relies on a Vile HACK in
+            # distutils.command.build_ext.build_extension().  The
+            # _built_objects attribute is stored there strictly for
+            # use here.
+            for filename in self._built_objects:
+                os.remove(filename)
+
     def get_platform (self):
         # Get value of sys.platform
         platform = sys.platform