After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 654872 - Delete no longer shipped files at install time
Delete no longer shipped files at install time
Status: RESOLVED FIXED
Product: jhbuild
Classification: Infrastructure
Component: general
unspecified
Other All
: Normal enhancement
: ---
Assigned To: Jhbuild maintainers
Jhbuild QA
Depends on: 312910
Blocks: 650995
 
 
Reported: 2011-07-18 20:52 UTC by Colin Walters
Modified: 2011-10-11 15:59 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Delete no longer shipped files at install time (10.23 KB, patch)
2011-07-18 20:52 UTC, Colin Walters
needs-work Details | Review
Delete no longer shipped files at install time (11.78 KB, patch)
2011-09-29 22:31 UTC, Colin Walters
none Details | Review
Delete no longer shipped files at install time (11.77 KB, patch)
2011-09-30 18:32 UTC, Colin Walters
reviewed Details | Review

Description Colin Walters 2011-07-18 20:52:08 UTC
Many very difficult to debug build problems arise when a component at
some point in time ships a file (like a shared library), then later
switches to not shipping it, but the file remains in the jhbuild root.

This patch adjusts jhbuild to finally take advantage of the manifests
we have in the packagedb thanks to using make install DESTDIR.

I unified some work being done in 'jhbuild uninstall' with the install
process in a new 'fileutils.py'.
Comment 1 Colin Walters 2011-07-18 20:52:10 UTC
Created attachment 192215 [details] [review]
Delete no longer shipped files at install time
Comment 2 Craig Keogh 2011-08-30 11:48:22 UTC
Review of attachment 192215 [details] [review]:

Thank you for the patch. I am getting the following failure:

jhbuild tinderbox
Traceback (most recent call last):
  • File "/home/oxyde/.local/bin/jhbuild", line 31 in <module>
    jhbuild.main.main(sys.argv[1:])
  • File "/home/oxyde/gnome/jhbuild/jhbuild/main.py", line 153 in main
    rc = jhbuild.commands.run(command, config, args, help=lambda: print_help(parser))
  • File "/home/oxyde/gnome/jhbuild/jhbuild/commands/__init__.py", line 123 in run
    return cmd.execute(config, args, help)
  • File "/home/oxyde/gnome/jhbuild/jhbuild/commands/__init__.py", line 52 in execute
    return self.run(config, options, args, help)
  • File "/home/oxyde/gnome/jhbuild/jhbuild/commands/tinderbox.py", line 89 in run
    return build.build()
  • File "/home/oxyde/gnome/jhbuild/jhbuild/frontends/buildscript.py", line 152 in build
    error, altphases = module.run_phase(self, phase)
  • File "/home/oxyde/gnome/jhbuild/jhbuild/modtypes/__init__.py", line 327 in run_phase
    method(buildscript)
  • File "/home/oxyde/gnome/jhbuild/jhbuild/modtypes/autotools.py", line 275 in do_install
    self.process_install(buildscript, self.get_revision())
  • File "/home/oxyde/gnome/jhbuild/jhbuild/modtypes/__init__.py", line 307 in process_install
    buildscript.moduleset.packagedb.add(self.name, revision or '', absolute_new_contents)
  • File "/home/oxyde/gnome/jhbuild/jhbuild/utils/packagedb.py", line 176 in add
    self.entries[package].manifest = self._accumulate_dirtree_contents(destdir)
AttributeError: PackageDB instance has no attribute '_accumulate_dirtree_contents'

Comment 3 Matthias Clasen 2011-09-05 13:50:00 UTC
I think this would be a very nice improvement.
Comment 4 Colin Walters 2011-09-29 22:31:47 UTC
Created attachment 197827 [details] [review]
Delete no longer shipped files at install time

Rebased on top of bug 312910
Comment 5 Colin Walters 2011-09-30 18:32:39 UTC
Created attachment 197899 [details] [review]
Delete no longer shipped files at install time

Rebased to master
Comment 6 Frederic Peters 2011-10-10 16:08:21 UTC
Review of attachment 197899 [details] [review]:

Another important benifit is the removal of the previous library files, making $prefix/lib/ much cleaner.

Two unimportant comments.

::: jhbuild/modtypes/__init__.py
@@ +293,3 @@
             raise CommandError(_("Module failed to install into DESTDIR %(dest)r") % {'dest': broken_name})
+        else:
+            absolute_new_contents = map(lambda x: '/' + x, new_contents)

I'd favour list comprehensions over map/lambda, not important.

@@ +306,3 @@
+                        logging.info(_('Deleted: %(file)r') % { 'file': path, })
+                    elif error_string is None:
+                        pass

In my checks this condition happens at the moment because directories were stored in the manifest files, are there other possible situations? (would a comment explaining those be helpful?)
Comment 7 Colin Walters 2011-10-11 15:20:21 UTC
Attachment 197899 [details] pushed as 9dcbb9a - Delete no longer shipped files at install time
Comment 8 Colin Walters 2011-10-11 15:59:10 UTC
(In reply to comment #6)
> 
> In my checks this condition happens at the moment because directories were
> stored in the manifest files, are there other possible situations? (would a
> comment explaining those be helpful?)

Yeah in the old manifests we stored all directories leading up to the install path.  As a side effect this patch stops adding them.  You will see harmless e.g. "12 leftover files" after applying this patch - those are the directories for the prefix.  We don't delete them.