GNU bug report logs - #38100
'--with-input', '--with-git-url' etc. cause unnecessary rebuilds

Previous Next

Package: guix;

Reported by: Ludovic Courtès <ludovic.courtes <at> inria.fr>

Date: Thu, 7 Nov 2019 12:36:02 UTC

Severity: important

Merged with 42156

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

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 38100 in the body.
You can then email your comments to 38100 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#38100; Package guix. (Thu, 07 Nov 2019 12:36:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ludovic Courtès <ludovic.courtes <at> inria.fr>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Thu, 07 Nov 2019 12:36:02 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludovic.courtes <at> inria.fr>
To: bug-Guix <at> gnu.org
Subject: ‘--with-input’ causes unintended rebuilds
Date: Thu, 07 Nov 2019 13:35:15 +0100
Hello,

Consider this example:

--8<---------------cut here---------------start------------->8---
$ guix build glib -nd
/gnu/store/9zz9hvzaz06f40a4cbvhskb183x676w4-glib-2.60.6.drv
$ guix build glib --with-input=inkscape=libreoffice -nd
/gnu/store/15f9jkpakmsaz8i2a0gy4kir1zyk29vi-glib-2.60.6.drv
$ guix describe
Generacio 114	Nov 02 2019 11:32:51	(nuna)
  guix ab1c063
    repository URL: https://git.savannah.gnu.org/git/guix.git
    branch: master
    commit: ab1c063ab08e069fbe62919828fa634a2e222bbf
--8<---------------cut here---------------end--------------->8---

Since GLib does not depend on Inkscape, the ‘--with-input’ flag should
have no effect: we should get the same glib derivation.  However, we’re
not.

If we diff the ‘glibc-2.60.6-guile-builder’ files of each derivation, we
see that the second one has a duplicate entry:

  (define %build-inputs
    `(…
      ("python" . "/gnu/store/78w7y0lxar70j512iqw8x3nimzj10yga-python-3.7.4")
      ("python" . "/gnu/store/78w7y0lxar70j512iqw8x3nimzj10yga-python-3.7.4")
      …))

whereas the first one doesn’t have this duplicate entry.  IOW, the two
derivations are functionally equivalent but are not bit-identical.

Indeed, evaluating:

  (bag-transitive-inputs
   (package->bag ((package-input-rewriting '()) glib)))

shows that we have two “python” packages there that are not ‘eq?’.

To be continued…

Ludo’.




Information forwarded to bug-guix <at> gnu.org:
bug#38100; Package guix. (Fri, 08 Nov 2019 21:07:01 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: 38100 <at> debbugs.gnu.org
Subject: Re: bug#38100: ‘--with-input’ causes
 unintended rebuilds
Date: Fri, 08 Nov 2019 22:06:32 +0100
Hi,

Ludovic Courtès <ludovic.courtes <at> inria.fr> skribis:

> Indeed, evaluating:
>
>   (bag-transitive-inputs
>    (package->bag ((package-input-rewriting '()) glib)))
>
> shows that we have two “python” packages there that are not ‘eq?’.

The problem is that ‘glib’ depends on ‘python-libxml2’, which uses
‘python-build-system’ and thus has ‘python’ as an implicit input.

‘package-input-rewriting’ doesn’t touch implicit inputs so it leaves
that implicit ‘python’ untouched.

Since ‘transitive-inputs’ (used by ‘bag-transitive-inputs’) uses pointer
equality, we end up with two “python” packages that are not ‘eq?’ but
are functionally equivalent: the one produced by
‘package-input-rewriting’, and the implicit dependency of
‘python-libxml2’.  QED.

(This is essentially the same as <https://bugs.gnu.org/30155>.)

I’m not sure how to address it.

Ludo’.




Merged 38100 42156. Request was from Ludovic Courtès <ludo <at> gnu.org> to control <at> debbugs.gnu.org. (Wed, 01 Jul 2020 22:15:02 GMT) Full text and rfc822 format available.

Severity set to 'important' from 'normal' Request was from Ludovic Courtès <ludo <at> gnu.org> to control <at> debbugs.gnu.org. (Wed, 01 Jul 2020 22:16:03 GMT) Full text and rfc822 format available.

Changed bug title to ''--with-input', '--with-git-url' etc. cause unnecessary rebuilds' from '‘--with-input’ causes unintended rebuilds' Request was from Ludovic Courtès <ludo <at> gnu.org> to control <at> debbugs.gnu.org. (Mon, 03 Aug 2020 14:31:02 GMT) Full text and rfc822 format available.

Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Sun, 27 Sep 2020 21:47:02 GMT) Full text and rfc822 format available.

Notification sent to Ludovic Courtès <ludovic.courtes <at> inria.fr>:
bug acknowledged by developer. (Sun, 27 Sep 2020 21:47:02 GMT) Full text and rfc822 format available.

Message #19 received at 38100-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: 38100-done <at> debbugs.gnu.org
Subject: Re: bug#38100: ‘--with-input’ causes
 unintended rebuilds
Date: Sun, 27 Sep 2020 23:46:22 +0200
Hey there!

Ludovic Courtès <ludo <at> gnu.org> skribis:

> Ludovic Courtès <ludovic.courtes <at> inria.fr> skribis:
>
>> Indeed, evaluating:
>>
>>   (bag-transitive-inputs
>>    (package->bag ((package-input-rewriting '()) glib)))
>>
>> shows that we have two “python” packages there that are not ‘eq?’.
>
> The problem is that ‘glib’ depends on ‘python-libxml2’, which uses
> ‘python-build-system’ and thus has ‘python’ as an implicit input.
>
> ‘package-input-rewriting’ doesn’t touch implicit inputs so it leaves
> that implicit ‘python’ untouched.
>
> Since ‘transitive-inputs’ (used by ‘bag-transitive-inputs’) uses pointer
> equality, we end up with two “python” packages that are not ‘eq?’ but
> are functionally equivalent: the one produced by
> ‘package-input-rewriting’, and the implicit dependency of
> ‘python-libxml2’.  QED.
>
> (This is essentially the same as <https://bugs.gnu.org/30155>.)

Good news, this is fixed by 2bf6f962b91123b0474c0f7123cd17efe7f09a66,
which introduces package rewriting including implicit inputs!

Before getting there, this issue did get on my nerves for a while.  Here
are several ways to address this issue that I thought of:

  1. Have ‘package-input-rewriting/spec’ traverse implicit inputs, at
     least optionally.  We wouldn’t end up with an
     equivalent-but-not-eq? ‘python’ in the example above.  It does
     change the semantics though, and it may be nice to keep a “shallow”
     replacement option.  That’s what
     2bf6f962b91123b0474c0f7123cd17efe7f09a66 does.

  2. Do (delete-duplicates input-drvs) in ‘bag->derivation’.  That seems
     wise, but it’s unfortunately impossible on ‘master’ because of
     <https://issues.guix.gnu.org/43508>.

  3. ‘package-input-rewriting/spec’ preserves eq?-ness for packages not
     transformed; in the example above, the transformation result would
     be eq? to ‘glib’ because ‘--with-input=libreoffice=inkscape’ had no
     effect.  Tricky to implement efficiently, perhaps not worth it.

I think #2 might still be worth investigating, but it may have
undesirable implications too.  #3 is hardly doable.

All in all, I’m glad that #1 addresses the issue, because it’s also
something we wanted anyway.

Ludo’.




Reply sent to Ludovic Courtès <ludo <at> gnu.org>:
You have taken responsibility. (Sun, 27 Sep 2020 21:47:02 GMT) Full text and rfc822 format available.

Notification sent to pkill9 <pkill9 <at> runbox.com>:
bug acknowledged by developer. (Sun, 27 Sep 2020 21:47:02 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. (Mon, 26 Oct 2020 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 183 days ago.

Previous Next


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