unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Ungrafted dependency
@ 2023-04-21 15:11 Greg Hogan
  2023-04-21 16:25 ` Leo Famulari
  0 siblings, 1 reply; 3+ messages in thread
From: Greg Hogan @ 2023-04-21 15:11 UTC (permalink / raw)
  To: guix-devel

mariadb is grafted on master. Why does libreoffice depend on the
ungrafted mariadb rather than the grafted version? And, perhaps
related, since libreoffice depends on mariadb's "dev" output, why does
libreoffice pull in "out"? mariadb:dev was created specifically as a
libreoffice dependency in the commits referenced by 2c9d3416.

--8<---------------cut here---------------start------------->8---
$ guix describe
Generation 43   Apr 18 2023 20:30:44    (current)
  guix bb721d8
    repository URL: https://git.savannah.gnu.org/git/guix.git
    branch: master
    commit: bb721d88618d93d38aa5dfc33629e223c8b1c884

$ guix build mariadb
/gnu/store/3ygd7xks9glpnppjs3ir9q9py3cqr14f-mariadb-10.10.2-dev
/gnu/store/0a1v0adgk43552hnjcy13pn4yj7rcimh-mariadb-10.10.2-lib
/gnu/store/iyns06rxvm865a3fp7dclm2q2ff0nay8-mariadb-10.10.2

$ guix build --no-grafts mariadb
/gnu/store/fjk994z0s3g429napn7cxgrdvqgbrj6p-mariadb-10.10.2-dev
/gnu/store/08nbg7cm6fqkyxls5ap5p1ypr1s2f988-mariadb-10.10.2-lib
/gnu/store/cdsdm8mqs13hp3pf013q1i4lka19g1sc-mariadb-10.10.2

$ guix size libreoffice
store item                                                       total    self
/gnu/store/chry5wjnf1hyj2ib7jxrw0fsf3yl9lgn-libreoffice-7.5.1.2
2398.0   423.8  17.7%
/gnu/store/cdsdm8mqs13hp3pf013q1i4lka19g1sc-mariadb-10.10.2
406.5   209.2   8.7%
<...cut...>
/gnu/store/9pdhgsdmnddgdnwpn0jalp1ryyjjkp56-libpthread-stubs-0.4
0.0     0.0   0.0%
total: 2398.0 MiB
--8<---------------cut here---------------end--------------->8---


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Ungrafted dependency
  2023-04-21 15:11 Ungrafted dependency Greg Hogan
@ 2023-04-21 16:25 ` Leo Famulari
  2023-05-03 20:53   ` Ludovic Courtès
  0 siblings, 1 reply; 3+ messages in thread
From: Leo Famulari @ 2023-04-21 16:25 UTC (permalink / raw)
  To: Greg Hogan; +Cc: guix-devel

On Fri, Apr 21, 2023 at 11:11:07AM -0400, Greg Hogan wrote:
> mariadb is grafted on master. Why does libreoffice depend on the
> ungrafted mariadb rather than the grafted version? And, perhaps
> related, since libreoffice depends on mariadb's "dev" output, why does
> libreoffice pull in "out"? mariadb:dev was created specifically as a
> libreoffice dependency in the commits referenced by 2c9d3416.

Thanks for pointing this out.

TLDR: Libreoffice does not depend on the ungrafted mariadb. But there is
something weird going on.

First, to be clear, mariadb is not itself grafted on the master branch
as of commit 13ebf5e36cc676627a19072d3712c399b7aae61f (currently the
latest commit).

The package variable 'mariadb' in 'gnu/packages/databases.scm' does not
contain a '(replacement ...)' field. There are not any replacements in
the databases module at all.

However, the mariadb package is affected by other package grafts, as you
saw when building it with and without grafting enabled:

------
> $ guix build mariadb
> /gnu/store/3ygd7xks9glpnppjs3ir9q9py3cqr14f-mariadb-10.10.2-dev
> /gnu/store/0a1v0adgk43552hnjcy13pn4yj7rcimh-mariadb-10.10.2-lib
> /gnu/store/iyns06rxvm865a3fp7dclm2q2ff0nay8-mariadb-10.10.2
> 
> $ guix build --no-grafts mariadb
> /gnu/store/fjk994z0s3g429napn7cxgrdvqgbrj6p-mariadb-10.10.2-dev
> /gnu/store/08nbg7cm6fqkyxls5ap5p1ypr1s2f988-mariadb-10.10.2-lib
> /gnu/store/cdsdm8mqs13hp3pf013q1i4lka19g1sc-mariadb-10.10.2
------

Moving on to the specific case:

------
> $ guix size libreoffice
------

Now, I'm not totally sure, but I don't think that `guix size` is aware
of grafts, but I don't think it is, due to reasons:

https://git.savannah.gnu.org/cgit/guix.git/tree/guix/scripts/size.scm?id=13ebf5e36cc676627a19072d3712c399b7aae61f#n317

However, the correct way to inspect run-time dependencies of store items
on your system is `guix gc --references`, for example like this:

------
$ guix gc --references $(./pre-inst-env guix build libreoffice) | grep mariadb
/gnu/store/6xn39pwxa4rqjf43di84fyrvr90sfw54-mariadb-10.10.2-lib
/gnu/store/hdz68bigrndswi0kh2mn8rbf3lbfpxmp-mariadb-10.10.2-dev
$ guix gc --references $(./pre-inst-env guix build --no-grafts libreoffice) | grep mariadb
/gnu/store/08nbg7cm6fqkyxls5ap5p1ypr1s2f988-mariadb-10.10.2-lib
/gnu/store/fjk994z0s3g429napn7cxgrdvqgbrj6p-mariadb-10.10.2-dev
------

These 'references' are the actual strings in the store items that point
to other store items.

We see that, with grafts enabled, libreoffice does not refer to the
ungrafted mariadb.

Instead, it refers to some other mariadb, and I don't know where that
comes from. I wonder if libreoffice depending on `(,mariadb "dev")
accidentally creates a new derivation:

https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/libreoffice.scm?id=13ebf5e36cc676627a19072d3712c399b7aae61f#n1120

If so, that's a bug. Any ideas?


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Ungrafted dependency
  2023-04-21 16:25 ` Leo Famulari
@ 2023-05-03 20:53   ` Ludovic Courtès
  0 siblings, 0 replies; 3+ messages in thread
From: Ludovic Courtès @ 2023-05-03 20:53 UTC (permalink / raw)
  To: Leo Famulari; +Cc: Greg Hogan, guix-devel

Hi,

Leo Famulari <leo@famulari.name> skribis:

> Instead, it refers to some other mariadb, and I don't know where that
> comes from. I wonder if libreoffice depending on `(,mariadb "dev")
> accidentally creates a new derivation:

Yes, it does.  Since commit 482fda2729c3e76999892cb8f9a0391a7bd37119 in
2017, the grafting code attempts to pull in just the output it needs—in
this case the “dev” output of mariadb.

But as a result, it can end up producing different grafting derivations:
one for the case where you need mariadb:out, and a different one for
when you need mariadb:dev.  Annoying.

HTH!

Ludo’.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-05-03 20:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-21 15:11 Ungrafted dependency Greg Hogan
2023-04-21 16:25 ` Leo Famulari
2023-05-03 20:53   ` Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).