GNU bug report logs - #22139
Indirect dependencies are not grafted

Previous Next

Package: guix;

Reported by: ludo <at> gnu.org (Ludovic Courtès)

Date: Thu, 10 Dec 2015 09:40:02 UTC

Severity: serious

Fixed in version 0.9.1

Done: ludo <at> gnu.org (Ludovic Courtès)

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 22139 in the body.
You can then email your comments to 22139 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#22139; Package guix. (Thu, 10 Dec 2015 09:40:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to ludo <at> gnu.org (Ludovic Courtès):
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Thu, 10 Dec 2015 09:40:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: bug-guix <at> gnu.org
Subject: Indirect dependencies are not grafted
Date: Thu, 10 Dec 2015 10:38:53 +0100
The grafting mechanism has a shortcoming: it is not recursive.

Suppose we use ‘replace’ to provide a patch libpng.  If a package has a
direct dependency on libpng, it is appropriately grafted to refer to the
new libpng.  However, if a package depends on libfoo, which in turn
depends on libpng, then that package will keep referring to the old
libfoo, which refers to the old libpng.

Ludo’.




Information forwarded to bug-guix <at> gnu.org:
bug#22139; Package guix. (Wed, 17 Feb 2016 17:02:02 GMT) Full text and rfc822 format available.

Message #8 received at 22139 <at> debbugs.gnu.org (full text, mbox):

From: Christopher Allan Webber <cwebber <at> dustycloud.org>
To: 22139 <at> debbugs.gnu.org
Subject: Re: Indirect dependencies are not grafted
Date: Wed, 17 Feb 2016 08:59:17 -0800
Mark Weaver laid out a plan that he thinks would work on IRC a couple of
years ago, and referenced it yesterday on #guix.  Here it is:
  https://gnunet.org/bot/log/guix/2014-09-25#T480219

Some further conversation:
  https://gnunet.org/bot/log/guix/2014-10-27#T502706




Severity set to 'serious' from 'normal' Request was from ludo <at> gnu.org (Ludovic Courtès) to control <at> debbugs.gnu.org. (Mon, 22 Feb 2016 14:35:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-guix <at> gnu.org:
bug#22139; Package guix. (Mon, 29 Feb 2016 23:37:01 GMT) Full text and rfc822 format available.

Message #13 received at 22139 <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: 22139 <at> debbugs.gnu.org
Cc: Mark H Weaver <mhw <at> netris.org>, Leo Famulari <leo <at> famulari.name>
Subject: Re: bug#22139: Indirect dependencies are not grafted
Date: Tue, 01 Mar 2016 00:35:59 +0100
[Message part 1 (text/plain, inline)]
ludo <at> gnu.org (Ludovic Courtès) skribis:

> The grafting mechanism has a shortcoming: it is not recursive.
>
> Suppose we use ‘replace’ to provide a patch libpng.  If a package has a
> direct dependency on libpng, it is appropriately grafted to refer to the
> new libpng.  However, if a package depends on libfoo, which in turn
> depends on libpng, then that package will keep referring to the old
> libfoo, which refers to the old libpng.

The ‘wip-recursive-grafts’ branch fixes that.  It also changes
‘graft-derivation’ to choose whether to graft something based on its
*run-time* dependencies (as reported by ‘guix gc -R’) instead of its
compile-time dependencies.

The advantage is that fewer things will be grafted; the disadvantage is
that things like --dry-run will seem to have no effect since sometimes,
the thing will start by building/downloading stuff.  I think the
advantage outweighs the disadvantage, but we’ll see how it goes in
practice.

There’s room for optimization in a few places, but overall it performs
well and there’s no performance regression in the absence of grafts
AFAICS.  So I think I may merge it real soon, possibly so we can use it
for the OpenSSL fix tomorrow and crash-test it.  Thoughts?

Here’s a patch I used to test grafting (it artificially adds a
‘replacement’ for OpenSSL that is slightly different and yields a
different derivation):

[Message part 2 (text/x-patch, inline)]
--- a/gnu/packages/tls.scm
+++ b/gnu/packages/tls.scm
@@ -1,5 +1,5 @@
 ;;; GNU Guix --- Functional package management for GNU
-;;; Copyright © 2012, 2013, 2014, 2015 Ludovic Courtès <ludo <at> gnu.org>
+;;; Copyright © 2012, 2013, 2014, 2015, 2016 Ludovic Courtès <ludo <at> gnu.org>
 ;;; Copyright © 2014, 2015, 2016 Mark H Weaver <mhw <at> netris.org>
 ;;; Copyright © 2014 Ian Denhardt <ian <at> zenhack.net>
 ;;; Copyright © 2013, 2015 Andreas Enge <andreas <at> enge.fr>
@@ -177,7 +177,7 @@ protocols, as well as to parse and write X.5009, PKCS 12, OpenPGP and other
 required structures.")
     (license license:lgpl2.1+)))
 
-(define-public openssl
+(define openssl/fixed
   (package
    (name "openssl")
    (version "1.0.2f")
@@ -191,9 +191,7 @@ required structures.")
             (sha256
              (base32
               "171fkdg9v6j29d962nh6kb79kfm8kkhy7n9makw39d7jvvj4wawk"))
-            (patches (map search-patch
-                          '("openssl-runpath.patch"
-                            "openssl-c-rehash.patch")))))
+            (patches (map search-patch '("openssl-runpath.patch")))))
    (build-system gnu-build-system)
    (native-inputs `(("perl" ,perl)))
    (arguments
@@ -282,6 +280,26 @@ required structures.")
    (license license:openssl)
    (home-page "http://www.openssl.org/")))
 
+(define-public openssl
+  (package
+    (inherit openssl/fixed)
+    (name "openssl")
+    (version "1.0.2f")
+    (source (origin
+              (method url-fetch)
+              (uri (list (string-append "ftp://ftp.openssl.org/source/"
+                                        name "-" version ".tar.gz")
+                         (string-append "ftp://ftp.openssl.org/source/old/"
+                                        (string-trim-right version char-set:letter)
+                                        "/" name "-" version ".tar.gz")))
+              (sha256
+               (base32
+                "171fkdg9v6j29d962nh6kb79kfm8kkhy7n9makw39d7jvvj4wawk"))
+              (patches (map search-patch
+                            '("openssl-runpath.patch"
+                              "openssl-c-rehash.patch")))))
+    (replacement openssl/fixed)))
+
 (define-public libressl
   (package
     (name "libressl")
[Message part 3 (text/plain, inline)]
Then you can run things like:

  guix gc -R $(guix build git | head -1) | grep openssl

and compare with:

  guix gc -R $(guix build git --no-grafts | head -1) | grep openssl

There should be exactly one ‘openssl’ reference in both cases; in the
first case it should be the replacement, and in the second case the
original.

Feedback very much welcome!

Ludo’.

Information forwarded to bug-guix <at> gnu.org:
bug#22139; Package guix. (Tue, 01 Mar 2016 17:26:01 GMT) Full text and rfc822 format available.

Message #16 received at 22139 <at> debbugs.gnu.org (full text, mbox):

From: ludo <at> gnu.org (Ludovic Courtès)
To: 22139 <at> debbugs.gnu.org
Cc: Mark H Weaver <mhw <at> netris.org>, Leo Famulari <leo <at> famulari.name>
Subject: Re: bug#22139: Indirect dependencies are not grafted
Date: Tue, 01 Mar 2016 18:25:08 +0100
ludo <at> gnu.org (Ludovic Courtès) skribis:

> The ‘wip-recursive-grafts’ branch fixes that.  It also changes
> ‘graft-derivation’ to choose whether to graft something based on its
> *run-time* dependencies (as reported by ‘guix gc -R’) instead of its
> compile-time dependencies.

Merged in c22a132 and currently being crash-tested by everyone.  :-)

Ludo’.




bug marked as fixed in version 0.9.1, send any further explanations to 22139 <at> debbugs.gnu.org and ludo <at> gnu.org (Ludovic Courtès) Request was from ludo <at> gnu.org (Ludovic Courtès) to control <at> debbugs.gnu.org. (Mon, 07 Mar 2016 12:22:01 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Tue, 05 Apr 2016 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 7 years and 359 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.