GNU bug report logs - #37850
Glib documentation is missing

Previous Next

Package: guix;

Reported by: Pierre Neidhardt <mail <at> ambrevar.xyz>

Date: Mon, 21 Oct 2019 10:46:01 UTC

Severity: normal

Done: Pierre Neidhardt <mail <at> ambrevar.xyz>

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 37850 in the body.
You can then email your comments to 37850 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#37850; Package guix. (Mon, 21 Oct 2019 10:46:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Pierre Neidhardt <mail <at> ambrevar.xyz>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Mon, 21 Oct 2019 10:46:01 GMT) Full text and rfc822 format available.

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

From: Pierre Neidhardt <mail <at> ambrevar.xyz>
To: bug-guix <at> gnu.org
Cc: Ricardo Wurmus <rekado <at> elephly.net>
Subject: Glib documentation is missing
Date: Mon, 21 Oct 2019 12:45:29 +0200
[Message part 1 (text/plain, inline)]
Since the last core-update merge, glib 2.58.1+ does not include the
documentation anymore (it was in the "doc" output).

Documentation for Glib/GTK-based libraries is very useful for
developers: it allows offline and contextual access from any text
editor.

This is why it would be nice to include it back.

Commit 6c237a2d7bfa3c7be02c069e5c24a2b401a51864 (June 21st) states

--8<---------------cut here---------------start------------->8---
[outputs]: Remove "doc" as the documentation files are no longer included.
--8<---------------cut here---------------end--------------->8---

However looking at the source of Glib I cannot find trace of this in the
NEWS file nor in the INSTALL.in file.  Disclaimer: I haven't tried
building glib.

Maybe we miss a compilation flag?

What do you think?  Ricardo?

Cheers!

-- 
Pierre Neidhardt
https://ambrevar.xyz/
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#37850; Package guix. (Wed, 23 Oct 2019 18:23:01 GMT) Full text and rfc822 format available.

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

From: Marius Bakke <mbakke <at> fastmail.com>
To: Pierre Neidhardt <mail <at> ambrevar.xyz>, 37850 <at> debbugs.gnu.org
Subject: Re: bug#37850: Glib documentation is missing
Date: Wed, 23 Oct 2019 20:22:33 +0200
[Message part 1 (text/plain, inline)]
Pierre Neidhardt <mail <at> ambrevar.xyz> writes:

> Since the last core-update merge, glib 2.58.1+ does not include the
> documentation anymore (it was in the "doc" output).
>
> Documentation for Glib/GTK-based libraries is very useful for
> developers: it allows offline and contextual access from any text
> editor.
>
> This is why it would be nice to include it back.
>
> Commit 6c237a2d7bfa3c7be02c069e5c24a2b401a51864 (June 21st) states
>
> --8<---------------cut here---------------start------------->8---
> [outputs]: Remove "doc" as the documentation files are no longer included.
> --8<---------------cut here---------------end--------------->8---
>
> However looking at the source of Glib I cannot find trace of this in the
> NEWS file nor in the INSTALL.in file.  Disclaimer: I haven't tried
> building glib.
>
> Maybe we miss a compilation flag?

Installing the GLib documentation now requires 'gtk-doc' at build time:

https://gitlab.gnome.org/GNOME/glib/blob/master/meson_options.txt

'gtk-doc' unsurprisingly depends on GLib, so I'm not sure what the best
approach is.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#37850; Package guix. (Wed, 23 Oct 2019 18:39:01 GMT) Full text and rfc822 format available.

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

From: Pierre Neidhardt <mail <at> ambrevar.xyz>
To: Marius Bakke <mbakke <at> fastmail.com>, 37850 <at> debbugs.gnu.org
Subject: Re: bug#37850: Glib documentation is missing
Date: Wed, 23 Oct 2019 20:38:13 +0200
[Message part 1 (text/plain, inline)]
Marius Bakke <mbakke <at> fastmail.com> writes:

> Installing the GLib documentation now requires 'gtk-doc' at build time:
>
> https://gitlab.gnome.org/GNOME/glib/blob/master/meson_options.txt

Thanks for looking into this!

> 'gtk-doc' unsurprisingly depends on GLib, so I'm not sure what the best
> approach is.

What about the following:

1. Turn our current glib into glib-minimal.

2. Build gtk-doc against glib-minimal.

3. Define a new glib package that inherits from glib-minimal and adds
gtk-doc as native-inputs so that we can restore the "doc" output.

-- 
Pierre Neidhardt
https://ambrevar.xyz/
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#37850; Package guix. (Fri, 25 Oct 2019 21:24:02 GMT) Full text and rfc822 format available.

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

From: Ludovic Courtès <ludo <at> gnu.org>
To: Pierre Neidhardt <mail <at> ambrevar.xyz>
Cc: Marius Bakke <mbakke <at> fastmail.com>, 37850 <at> debbugs.gnu.org
Subject: Re: bug#37850: Glib documentation is missing
Date: Fri, 25 Oct 2019 23:23:10 +0200
Hi,

Pierre Neidhardt <mail <at> ambrevar.xyz> skribis:

> Marius Bakke <mbakke <at> fastmail.com> writes:

[...]

>> 'gtk-doc' unsurprisingly depends on GLib, so I'm not sure what the best
>> approach is.
>
> What about the following:
>
> 1. Turn our current glib into glib-minimal.
>
> 2. Build gtk-doc against glib-minimal.
>
> 3. Define a new glib package that inherits from glib-minimal and adds
> gtk-doc as native-inputs so that we can restore the "doc" output.

Alternately, we could define a new “glib-doc” package that would depend
on the current “glib” package, assuming the build system allows us to
build nothing but documentation.

Ludo’.




Information forwarded to bug-guix <at> gnu.org:
bug#37850; Package guix. (Sat, 26 Oct 2019 09:05:01 GMT) Full text and rfc822 format available.

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

From: Pierre Neidhardt <mail <at> ambrevar.xyz>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: Marius Bakke <mbakke <at> fastmail.com>, 37850 <at> debbugs.gnu.org
Subject: Re: bug#37850: Glib documentation is missing
Date: Sat, 26 Oct 2019 11:04:53 +0200
[Message part 1 (text/plain, inline)]
Ludovic Courtès <ludo <at> gnu.org> writes:

> Alternately, we could define a new “glib-doc” package that would depend
> on the current “glib” package, assuming the build system allows us to
> build nothing but documentation.

Some possible drawbacks:

- It's not consistent with the other Glib/GNOME libraries like gtk+ or
  webkitgtk which have a "doc" output.

- Previously we had glib:doc and no measure can be taken to let the user
  know that it's now "glib-doc".

So I would got for the glib-minimal route.

This bring me to another problem: "glib:doc" was not deprecated, so
users who installed "glib:doc" cannot update their manifests / profiles
after a guix pull.

Can we actually deprecate single outputs?
If not, isn't it a bug?

-- 
Pierre Neidhardt
https://ambrevar.xyz/
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#37850; Package guix. (Tue, 29 Oct 2019 10:38:02 GMT) Full text and rfc822 format available.

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

From: Pierre Neidhardt <mail <at> ambrevar.xyz>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: Marius Bakke <mbakke <at> fastmail.com>, 37850 <at> debbugs.gnu.org
Subject: Re: bug#37850: Glib documentation is missing
Date: Tue, 29 Oct 2019 11:36:41 +0100
[Message part 1 (text/plain, inline)]
I can send a patch for Glib.

--8<---------------cut here---------------start------------->8---
> guix refresh -l glib
Building the following 1645 packages would ensure 4428 dependent packages are rebuilt: a
--8<---------------cut here---------------end--------------->8---

I guess this is going to core-updates.

-- 
Pierre Neidhardt
https://ambrevar.xyz/
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#37850; Package guix. (Sun, 03 Nov 2019 16:41:02 GMT) Full text and rfc822 format available.

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

From: Pierre Neidhardt <mail <at> ambrevar.xyz>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: Marius Bakke <mbakke <at> fastmail.com>, 37850 <at> debbugs.gnu.org
Subject: Re: bug#37850: Glib documentation is missing
Date: Sun, 03 Nov 2019 17:39:56 +0100
[Message part 1 (text/plain, inline)]
Find a patch attached.  What do you think?

-- 
Pierre Neidhardt
https://ambrevar.xyz/
[signature.asc (application/pgp-signature, inline)]
[0001-gnu-Add-glib-minimal-and-build-glib-doc.patch (text/x-patch, attachment)]

Information forwarded to bug-guix <at> gnu.org:
bug#37850; Package guix. (Sun, 03 Nov 2019 19:05:02 GMT) Full text and rfc822 format available.

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

From: Marius Bakke <mbakke <at> fastmail.com>
To: Pierre Neidhardt <mail <at> ambrevar.xyz>, Ludovic Courtès
 <ludo <at> gnu.org>
Cc: 37850 <at> debbugs.gnu.org
Subject: Re: bug#37850: Glib documentation is missing
Date: Sun, 03 Nov 2019 20:04:28 +0100
[Message part 1 (text/plain, inline)]
Pierre Neidhardt <mail <at> ambrevar.xyz> writes:

> From 893613a3b99c20688cc331d2926dbee28cc143d7 Mon Sep 17 00:00:00 2001
> From: Pierre Neidhardt <mail <at> ambrevar.xyz>
> Date: Sun, 3 Nov 2019 17:36:17 +0100
> Subject: [PATCH] gnu: Add glib-minimal and build glib doc.
>
> glib documentation must be built with gtk-doc which in turn depends on glib,
> so we need to define glib-minimal which does not depend on gtk-doc.
>
> * gnu/packages/glib.scm (glib-minimal): New variable.
> (glib)[source]: Don't use `name'.
> * gnu/packages/avahi.scm: Use glib-minimal when necessary.
> * gnu/packages/cups.scm: Use glib-minimal when necessary.
> * gnu/packages/gnome.scm: Use glib-minimal when necessary.
> * gnu/packages/graphviz.scm: Use glib-minimal when necessary.
> * gnu/packages/gtk.scm: Use glib-minimal when necessary.
> * gnu/packages/inkscape.scm: Use glib-minimal when necessary.
> * gnu/packages/pdf.scm: Use glib-minimal when necessary.

Please mention all changed variables and inputs here, as we always do.

That said, I'm not certain this is a good solution.  Why do some
packages use glib-minimal and others not?  What does "necessary" mean in
this context?

What about 'hiding' the normal glib package, and expose a
'glib-with-documentation' variant to end users, similar to how the
'cmake' package works?
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#37850; Package guix. (Mon, 04 Nov 2019 09:48:01 GMT) Full text and rfc822 format available.

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

From: Pierre Neidhardt <mail <at> ambrevar.xyz>
To: Marius Bakke <mbakke <at> fastmail.com>, Ludovic Courtès
 <ludo <at> gnu.org>
Cc: 37850 <at> debbugs.gnu.org
Subject: Re: bug#37850: Glib documentation is missing
Date: Mon, 04 Nov 2019 10:46:55 +0100
[Message part 1 (text/plain, inline)]
Marius Bakke <mbakke <at> fastmail.com> writes:

> Pierre Neidhardt <mail <at> ambrevar.xyz> writes:
>
>> From 893613a3b99c20688cc331d2926dbee28cc143d7 Mon Sep 17 00:00:00 2001
>> From: Pierre Neidhardt <mail <at> ambrevar.xyz>
>> Date: Sun, 3 Nov 2019 17:36:17 +0100
>> Subject: [PATCH] gnu: Add glib-minimal and build glib doc.
>>
>> glib documentation must be built with gtk-doc which in turn depends on glib,
>> so we need to define glib-minimal which does not depend on gtk-doc.
>>
>> * gnu/packages/glib.scm (glib-minimal): New variable.
>> (glib)[source]: Don't use `name'.
>> * gnu/packages/avahi.scm: Use glib-minimal when necessary.
>> * gnu/packages/cups.scm: Use glib-minimal when necessary.
>> * gnu/packages/gnome.scm: Use glib-minimal when necessary.
>> * gnu/packages/graphviz.scm: Use glib-minimal when necessary.
>> * gnu/packages/gtk.scm: Use glib-minimal when necessary.
>> * gnu/packages/inkscape.scm: Use glib-minimal when necessary.
>> * gnu/packages/pdf.scm: Use glib-minimal when necessary.
>
> Please mention all changed variables and inputs here, as we always do.

Sure, I didn't because I wasn't sure it was a good idea either :p

> That said, I'm not certain this is a good solution.  Why do some
> packages use glib-minimal and others not?  What does "necessary" mean in
> this context?
>
> What about 'hiding' the normal glib package, and expose a
> 'glib-with-documentation' variant to end users, similar to how the
> 'cmake' package works?

cmake-minimal builds the doc already, I don't see a
cmake-with-documentation.  Did you mean something else?
I see a couple packages with the "-documentation" prefix, so we could
use "glib-documentation".

In a previous email, I explained that I wanted to put the documentation
in the "doc" output of glib for 2 reasons:

- For consistency with the other packages from the GTK family.
- To restore the missing "gtk:doc" output.  If I understand correctly,
  we don't have a provision to deprecate outputs, only packages.  I
  think this is a bug.

Now my current patch is admittedly not pretty.
If we fix the output deprecation feature, then glib:doc could be
forwarded to glib-documentation.  And I guess we can live without
complete consistency.

Thoughts?

-- 
Pierre Neidhardt
https://ambrevar.xyz/
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#37850; Package guix. (Sat, 09 Nov 2019 02:04:02 GMT) Full text and rfc822 format available.

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

From: Alexandros Theodotou <alex <at> zrythm.org>
To: 37850 <at> debbugs.gnu.org
Subject: Re: Glib documentation is missing
Date: Sat, 09 Nov 2019 03:03:46 +0100
I am new to guix so please excuse my ignorance, but is there an issue 
with just adding a "doc" output to the current glib, as mentioned in the 
manual?
http://guix.gnu.org/manual/en/guix.html#Packages-with-Multiple-Outputs

I find this approach nice and clean and I am personally not too fond of 
the idea of having "*-minimal" and "*-with-documentation" packages.




Information forwarded to bug-guix <at> gnu.org:
bug#37850; Package guix. (Sat, 09 Nov 2019 02:11:01 GMT) Full text and rfc822 format available.

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

From: Alexandros Theodotou <alex <at> zrythm.org>
To: 37850 <at> debbugs.gnu.org
Subject: Re: Glib documentation is missing
Date: Sat, 09 Nov 2019 03:10:47 +0100
I missed this part.

> glib documentation must be built with gtk-doc which in turn depends on 
> glib,
> so we need to define glib-minimal which does not depend on gtk-doc.

In this case the way I have seen other distros do it is by having a 
*-bootstrap package (same as the *-minimal that you mention), which 
doesn't sound like a bad approach.

> What about 'hiding' the normal glib package

Maybe the *-bootstrap package can be hidden. Then the normal glib 
package can have its "doc" back?




Information forwarded to bug-guix <at> gnu.org:
bug#37850; Package guix. (Sat, 09 Nov 2019 23:21:02 GMT) Full text and rfc822 format available.

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

From: Marius Bakke <mbakke <at> fastmail.com>
To: Pierre Neidhardt <mail <at> ambrevar.xyz>, Ludovic Courtès
 <ludo <at> gnu.org>
Cc: 37850 <at> debbugs.gnu.org
Subject: Re: bug#37850: Glib documentation is missing
Date: Sun, 10 Nov 2019 00:20:14 +0100
[Message part 1 (text/plain, inline)]
Pierre Neidhardt <mail <at> ambrevar.xyz> writes:

> Marius Bakke <mbakke <at> fastmail.com> writes:
>
>> Pierre Neidhardt <mail <at> ambrevar.xyz> writes:
>>
>>> From 893613a3b99c20688cc331d2926dbee28cc143d7 Mon Sep 17 00:00:00 2001
>>> From: Pierre Neidhardt <mail <at> ambrevar.xyz>
>>> Date: Sun, 3 Nov 2019 17:36:17 +0100
>>> Subject: [PATCH] gnu: Add glib-minimal and build glib doc.
>>>
>>> glib documentation must be built with gtk-doc which in turn depends on glib,
>>> so we need to define glib-minimal which does not depend on gtk-doc.
>>>
>>> * gnu/packages/glib.scm (glib-minimal): New variable.
>>> (glib)[source]: Don't use `name'.
>>> * gnu/packages/avahi.scm: Use glib-minimal when necessary.
>>> * gnu/packages/cups.scm: Use glib-minimal when necessary.
>>> * gnu/packages/gnome.scm: Use glib-minimal when necessary.
>>> * gnu/packages/graphviz.scm: Use glib-minimal when necessary.
>>> * gnu/packages/gtk.scm: Use glib-minimal when necessary.
>>> * gnu/packages/inkscape.scm: Use glib-minimal when necessary.
>>> * gnu/packages/pdf.scm: Use glib-minimal when necessary.
>>
>> Please mention all changed variables and inputs here, as we always do.
>
> Sure, I didn't because I wasn't sure it was a good idea either :p
>
>> That said, I'm not certain this is a good solution.  Why do some
>> packages use glib-minimal and others not?  What does "necessary" mean in
>> this context?
>>
>> What about 'hiding' the normal glib package, and expose a
>> 'glib-with-documentation' variant to end users, similar to how the
>> 'cmake' package works?
>
> cmake-minimal builds the doc already, I don't see a
> cmake-with-documentation.  Did you mean something else?
> I see a couple packages with the "-documentation" prefix, so we could
> use "glib-documentation".

I meant this part:

(define-public cmake
  (package
    (inherit cmake-minimal)
    (name "cmake")
    (arguments
     (substitute-keyword-arguments (package-arguments cmake-minimal)
       ((#:configure-flags configure-flags ''())
        `(append ,configure-flags
                ;; Extra configure flags used to generate the documentation.
                '("--sphinx-info"
                  "--sphinx-man"
                  "--sphinx-html")))

Do you think it would make sense to do something similar with GLib,
and "hiding" the normal variant?

> In a previous email, I explained that I wanted to put the documentation
> in the "doc" output of glib for 2 reasons:
>
> - For consistency with the other packages from the GTK family.
> - To restore the missing "gtk:doc" output.  If I understand correctly,
>   we don't have a provision to deprecate outputs, only packages.  I
>   think this is a bug.
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#37850; Package guix. (Mon, 11 Nov 2019 09:30:02 GMT) Full text and rfc822 format available.

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

From: Pierre Neidhardt <mail <at> ambrevar.xyz>
To: Marius Bakke <mbakke <at> fastmail.com>, Ludovic Courtès
 <ludo <at> gnu.org>
Cc: 37850 <at> debbugs.gnu.org
Subject: Re: bug#37850: Glib documentation is missing
Date: Mon, 11 Nov 2019 10:29:03 +0100
[Message part 1 (text/plain, inline)]
Hi Marius,

you are right, this seems to be a much saner approach.
So I've tried the following:

- add `(properties '((hidden? . #t)) )` to glib.
- Add the following new package definition:

--8<---------------cut here---------------start------------->8---
(define-public glib-with-documentation
  (package
    (inherit glib)
    (properties '((hidden? . #f)))
    (outputs (cons "doc" (package-outputs glib))) ; 20 MiB of GTK-Doc reference
    (native-inputs
     `(("gtk-doc" ,gtk-doc)             ; for the doc
       ,@(package-native-inputs glib)))
    (arguments
     (substitute-keyword-arguments (package-arguments glib)
       ((#:configure-flags flags)
        `(cons "-Dgtk_doc=true" ,flags))
       ;; TODO: Fix 1 failing test.
       ((#:phases phases)
        `(modify-phases ,phases
           (delete 'check)))))))
--8<---------------cut here---------------end--------------->8---

Sadly the above does not build the doc.

Looking at the source, it seems that no provision is taken for building
the doc with Meson.  I wonder if this is an upstream mistake, but my
knowledge of Meson is very limited and I could be wrong.

Any idea, anyone?

-- 
Pierre Neidhardt
https://ambrevar.xyz/
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#37850; Package guix. (Tue, 12 Nov 2019 12:33:02 GMT) Full text and rfc822 format available.

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

From: "pelzflorian (Florian Pelz)" <pelzflorian <at> pelzflorian.de>
To: Pierre Neidhardt <mail <at> ambrevar.xyz>
Cc: Marius Bakke <mbakke <at> fastmail.com>,
 Ludovic Courtès <ludo <at> gnu.org>, 37850 <at> debbugs.gnu.org
Subject: Re: bug#37850: Glib documentation is missing
Date: Tue, 12 Nov 2019 13:32:33 +0100
On Mon, Nov 11, 2019 at 10:29:03AM +0100, Pierre Neidhardt wrote:
> Sadly the above does not build the doc.
> 
> Looking at the source, it seems that no provision is taken for building
> the doc with Meson.  I wonder if this is an upstream mistake, but my
> knowledge of Meson is very limited and I could be wrong.
> 
> Any idea, anyone?
> 

I have not checked, but

https://mesonbuild.com/Gnome-module.html

says about gtkdoc

> This creates a $module-doc target that can be ran to build docs and
> normally these are only built on install.

Since GNOME is a big supporter of Meson, I believe they make no
mistakes in GLib’s meson files.

Regards,
Florian




Information forwarded to bug-guix <at> gnu.org:
bug#37850; Package guix. (Tue, 12 Nov 2019 13:23:01 GMT) Full text and rfc822 format available.

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

From: "pelzflorian (Florian Pelz)" <pelzflorian <at> pelzflorian.de>
To: Pierre Neidhardt <mail <at> ambrevar.xyz>
Cc: 37850 <at> debbugs.gnu.org
Subject: Re: bug#37850: Glib documentation is missing
Date: Tue, 12 Nov 2019 14:22:54 +0100
Sorry for my past unhelpful email.  This module is not used by glib.
When I try your package, it seems -Dgtk_doc=true is not applied like
when manually running meson.  I do not understand why.  (Manually
running it leads to a crash later.)

Regards,
Florian




Information forwarded to bug-guix <at> gnu.org:
bug#37850; Package guix. (Tue, 12 Nov 2019 16:01:02 GMT) Full text and rfc822 format available.

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

From: Pierre Neidhardt <mail <at> ambrevar.xyz>
To: "pelzflorian \(Florian Pelz\)" <pelzflorian <at> pelzflorian.de>
Cc: 37850 <at> debbugs.gnu.org
Subject: Re: bug#37850: Glib documentation is missing
Date: Tue, 12 Nov 2019 17:00:40 +0100
[Message part 1 (text/plain, inline)]
Hmmm, you are right, it does not get built during the install phase.

I had a look at the bugtracker:

https://gitlab.gnome.org/GNOME/glib/issues

Could not find anything related to this.

Could our Meson build system be buggy?
As a side note, it does not seem to print any command line flags, which
is a bit inconvenient for debugging.  Something we could improve at least.


-- 
Pierre Neidhardt
https://ambrevar.xyz/
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#37850; Package guix. (Tue, 12 Nov 2019 18:36:02 GMT) Full text and rfc822 format available.

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

From: "pelzflorian (Florian Pelz)" <pelzflorian <at> pelzflorian.de>
To: Pierre Neidhardt <mail <at> ambrevar.xyz>
Cc: 37850 <at> debbugs.gnu.org
Subject: Re: bug#37850: Glib documentation is missing
Date: Tue, 12 Nov 2019 19:34:58 +0100
On Tue, Nov 12, 2019 at 05:00:40PM +0100, Pierre Neidhardt wrote:
> Hmmm, you are right, it does not get built during the install phase.
> 
> I had a look at the bugtracker:
> 
> https://gitlab.gnome.org/GNOME/glib/issues
> 
> Could not find anything related to this.
> 
> Could our Meson build system be buggy?
> As a side note, it does not seem to print any command line flags, which
> is a bit inconvenient for debugging.  Something we could improve at least.
> 

Moving a call to the “error” procedure in various places in the
package and Guix’ meson-build-system.scm reveals (I think) that the
package arguments are correctly rewritten by
substitute-keyword-arguments, but the meson-build procedure from
meson-build-system.scm is called with the original package’s args.

Regards,
Florian




Information forwarded to bug-guix <at> gnu.org:
bug#37850; Package guix. (Fri, 15 Nov 2019 11:18:01 GMT) Full text and rfc822 format available.

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

From: Pierre Neidhardt <mail <at> ambrevar.xyz>
To: "pelzflorian \(Florian Pelz\)" <pelzflorian <at> pelzflorian.de>
Cc: Ricardo Wurmus <rekado <at> elephly.net>, Marius Bakke <mbakke <at> fastmail.com>,
 37850 <at> debbugs.gnu.org, petermikkelsen10 <at> gmail.com
Subject: Re: bug#37850: Glib documentation is missing
Date: Fri, 15 Nov 2019 12:17:30 +0100
[Message part 1 (text/plain, inline)]
You are right, something is wrong with substitute-keyword-arguments.

If I copy-paste the arguments from glib, then add the stuff to build the
doc, everything is fine.

Peter, Ricardo, Marius, any clue what's going on?

Here follows a working definition for glib-with-documentation.
Obviously the copy-pasting of arguments is less than ideal.

--8<---------------cut here---------------start------------->8---
(define-public glib-with-documentation
  (package
    (inherit glib)
    (properties '((hidden? . #f)))
    (outputs (cons "doc" (package-outputs glib))) ; 20 MiB of GTK-Doc reference
    (native-inputs
     `(("gtk-doc" ,gtk-doc)             ; for the doc
       ("docbook-xml" ,docbook-xml)
       ,@(package-native-inputs glib)))
    (arguments
     `( ;; TODO: Uncomment on the next rebuild cycle.
       ;; #:disallowed-references (,tzdata-for-tests)

       #:configure-flags (list "-Dgtk_doc=true")
       #:phases
       (modify-phases %standard-phases
         (add-before 'build 'pre-build
           (lambda* (#:key inputs outputs #:allow-other-keys)
             ;; For tests/gdatetime.c.
             (setenv "TZDIR"
                     (string-append (assoc-ref inputs "tzdata")
                                    "/share/zoneinfo"))

             ;; Some tests want write access there.
             (setenv "HOME" (getcwd))
             (setenv "XDG_CACHE_HOME" (getcwd))
             #t))
         (add-after 'unpack 'disable-failing-tests
           (lambda _
             (let ((disable
                    (lambda (test-file test-paths)
                      (define pattern+procs
                        (map (lambda (test-path)
                               (cons
                                ;; XXX: only works for single line statements.
                                (format #f "g_test_add_func.*\"~a\".*" test-path)
                                (const "")))
                             test-paths))
                      (substitute test-file pattern+procs)))
                   (failing-tests
                    '(("glib/tests/thread.c"
                       ( ;; prlimit(2) returns ENOSYS on Linux 2.6.32-5-xen-amd64
                        ;; as found on hydra.gnu.org, and strace(1) doesn't
                        ;; recognize it.
                        "/thread/thread4"))

                      ;; This tries to find programs in FHS directories.
                      ("glib/tests/utils.c"
                       ("/utils/find-program"))

                      ;; This fails because "glib/tests/echo-script" cannot be
                      ;; found.
                      ("glib/tests/spawn-singlethread.c"
                       ("/gthread/spawn-script"))

                      ("glib/tests/timer.c"
                       ( ;; fails if compiler optimizations are enabled, which they
                        ;; are by default.
                        "/timer/stop"))

                      ("gio/tests/gapplication.c"
                       ( ;; XXX: proven to be unreliable.  See:
                        ;;  <https://bugs.debian.org/756273>
                        ;;  <http://bugs.gnu.org/18445>
                        "/gapplication/quit"

                        ;; XXX: fails randomly for unknown reason. See:
                        ;;  <https://lists.gnu.org/archive/html/guix-devel/2016-04/msg00215.html>
                        "/gapplication/local-actions"))

                      ("gio/tests/contenttype.c"
                       ( ;; XXX: requires shared-mime-info.
                        "/contenttype/guess"
                        "/contenttype/guess_svg_from_data"
                        "/contenttype/subtype"
                        "/contenttype/list"
                        "/contenttype/icon"
                        "/contenttype/symbolic-icon"
                        "/contenttype/tree"))

                      ("gio/tests/appinfo.c"
                       ( ;; XXX: requires update-desktop-database.
                        "/appinfo/associations"))

                      ("gio/tests/desktop-app-info.c"
                       ( ;; XXX: requires update-desktop-database.
                        "/desktop-app-info/delete"
                        "/desktop-app-info/default"
                        "/desktop-app-info/fallback"
                        "/desktop-app-info/lastused"
                        "/desktop-app-info/search"))

                      ("gio/tests/gdbus-peer.c"
                       ( ;; Requires /etc/machine-id.
                        "/gdbus/codegen-peer-to-peer"))

                      ("gio/tests/gdbus-unix-addresses.c"
                       ( ;; Requires /etc/machine-id.
                        "/gdbus/x11-autolaunch"))

                      ("gio/tests/gsocketclient-slow.c"
                       ( ;; These tests tries to resolve "localhost", and fails.
                        "/socket-client/happy-eyeballs/slow"
                        "/socket-client/happy-eyeballs/cancellation/delayed")))))
               (for-each (lambda (x) (apply disable x)) failing-tests)
               #t)))
         (replace 'check
           (lambda _
             (setenv "MESON_TESTTHREADS"
                     (number->string (parallel-job-count)))
             ;; Do not run tests marked as "flaky".
             (invoke "meson" "test" "--no-suite" "flaky")))
         ;; TODO: meson does not permit the bindir to be outside of prefix.
         ;; See https://github.com/mesonbuild/meson/issues/2561
         ;; We can remove this once meson is patched.
         (add-after 'install 'move-executables
           (lambda* (#:key outputs #:allow-other-keys)
             (let ((out (assoc-ref outputs "out"))
                   (bin (assoc-ref outputs "bin")))
               (mkdir-p bin)
               (rename-file (string-append out "/bin")
                            (string-append bin "/bin"))
               ;; Do not refer to "bindir", which points to "${prefix}/bin".
               ;; We don't patch "bindir" to point to "$bin/bin", because that
               ;; would create a reference cycle between the "out" and "bin"
               ;; outputs.
               (substitute* (list (string-append out "/lib/pkgconfig/gio-2.0.pc")
                                  (string-append out "/lib/pkgconfig/glib-2.0.pc"))
                 (("bindir=\\$\\{prefix\\}/bin") "")
                 (("=\\$\\{bindir\\}/") "="))
               #t)))
         (add-after 'unpack 'make-local-docbook-xml
           (lambda* (#:key inputs #:allow-other-keys)
             (let ((replace-http (lambda (file)
                                   (substitute* file
                                     ;; Warning: gio.xml uses docbook 4.2.
                                     (("http://www.oasis-open.org/docbook/xml/4../docbookx.dtd")
                                      (string-append (assoc-ref inputs "docbook-xml")
                                                     "/xml/dtd/docbook/docbookx.dtd")))) ))
               (replace-http "gio/gdbus-2.0/codegen/codegen_docbook.py")
               (for-each replace-http (find-files "." "\\.xml$"))
               #t)))
         (add-after 'install 'move-doc
           (lambda* (#:key outputs #:allow-other-keys)
             (let ((out (assoc-ref outputs "out"))
                   (doc (assoc-ref outputs "doc"))
                   (html (string-append "/share/gtk-doc")))
               (copy-recursively (string-append out html)
                                 (string-append doc html))
               (delete-file-recursively (string-append out html))
               #t))))))))
--8<---------------cut here---------------end--------------->8---

-- 
Pierre Neidhardt
https://ambrevar.xyz/
[signature.asc (application/pgp-signature, inline)]

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

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

From: "pelzflorian (Florian Pelz)" <pelzflorian <at> pelzflorian.de>
To: Pierre Neidhardt <mail <at> ambrevar.xyz>
Cc: Ricardo Wurmus <rekado <at> elephly.net>, Marius Bakke <mbakke <at> fastmail.com>,
 37850 <at> debbugs.gnu.org, petermikkelsen10 <at> gmail.com
Subject: Re: bug#37850: Glib documentation is missing
Date: Fri, 15 Nov 2019 13:14:08 +0100
On Fri, Nov 15, 2019 at 12:17:30PM +0100, Pierre Neidhardt wrote:
> You are right, something is wrong with substitute-keyword-arguments.
> 

No, I did not say that, I said that despite
substitute-keyword-arguments returning the correct arguments – as is
visible by enclosing the args with a call to (error …) –, meson builds
with the old arguments.  However now you say it works when copying the
arguments from Glib, which is strange.

Regards,
Florian




Information forwarded to bug-guix <at> gnu.org:
bug#37850; Package guix. (Fri, 15 Nov 2019 14:11:01 GMT) Full text and rfc822 format available.

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

From: Marius Bakke <mbakke <at> fastmail.com>
To: Pierre Neidhardt <mail <at> ambrevar.xyz>,
 "pelzflorian \(Florian Pelz\)" <pelzflorian <at> pelzflorian.de>
Cc: 37850 <at> debbugs.gnu.org
Subject: Re: bug#37850: Glib documentation is missing
Date: Fri, 15 Nov 2019 15:10:10 +0100
[Message part 1 (text/plain, inline)]
Pierre Neidhardt <mail <at> ambrevar.xyz> writes:

> You are right, something is wrong with substitute-keyword-arguments.

The problem is that GLib has no configure-flags from before.  I'm not
sure why we get no error from substitute-keyword-arguments (is it
swallowed?  never run?), but if you change this part:

 (substitute-keyword-arguments (package-arguments glib)
   ((#:configure-flags flags)
    `(cons "-Dgtk_doc=true" ,flags)))

...to read like this:

 (substitute-keyword-arguments (package-arguments glib)
   ((#:configure-flags flags ''())
    `(cons "-Dgtk_doc=true" ,flags)))

Then it should work.  The difference is that "flags" gets initialized as
the empty list when not already set.
[signature.asc (application/pgp-signature, inline)]

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

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

From: Pierre Neidhardt <mail <at> ambrevar.xyz>
To: Marius Bakke <mbakke <at> fastmail.com>,
 "pelzflorian \(Florian Pelz\)" <pelzflorian <at> pelzflorian.de>
Cc: 37850 <at> debbugs.gnu.org
Subject: Re: bug#37850: Glib documentation is missing
Date: Fri, 15 Nov 2019 16:06:15 +0100
[Message part 1 (text/plain, inline)]
Oh, that makes total sense, thanks for the explanation Marius!

Alright, final patch attached.
Let me know if I should merge on master.

-- 
Pierre Neidhardt
https://ambrevar.xyz/
[signature.asc (application/pgp-signature, inline)]
[0001-gnu-Add-glib-with-documentation.patch (text/x-patch, attachment)]

Information forwarded to bug-guix <at> gnu.org:
bug#37850; Package guix. (Thu, 21 Nov 2019 19:51:05 GMT) Full text and rfc822 format available.

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

From: Marius Bakke <mbakke <at> fastmail.com>
To: Pierre Neidhardt <mail <at> ambrevar.xyz>,
 "pelzflorian \(Florian Pelz\)" <pelzflorian <at> pelzflorian.de>
Cc: 37850 <at> debbugs.gnu.org
Subject: Re: bug#37850: Glib documentation is missing
Date: Thu, 21 Nov 2019 20:50:16 +0100
[Message part 1 (text/plain, inline)]
Pierre Neidhardt <mail <at> ambrevar.xyz> writes:

> Oh, that makes total sense, thanks for the explanation Marius!
>
> Alright, final patch attached.
> Let me know if I should merge on master.

Looks good!

> From 29d27b64fb7bbf96a2ed59a3e1c4179717770f5c Mon Sep 17 00:00:00 2001
> From: Pierre Neidhardt <mail <at> ambrevar.xyz>
> Date: Mon, 11 Nov 2019 15:38:11 +0100
> Subject: [PATCH] gnu: Add glib-with-documentation.
>
> * gnu/packages/glib.scm (glib-with-documentation): New variable.
> (glib): Hide package.

This should say (glib)[properties]: ...

[...]
  
> +(define-public glib-with-documentation
> +  ;; glib's doc must be built in a separate package since it requires gtk-doc,
> +  ;; which in turn depends on glib.
> +  (package
> +    (inherit glib)
> +    (properties '((hidden? . #f)))

Using (alist-delete 'hidden? (package-properties glib)) is more future
proof.  :-)

> +    (outputs (cons "doc" (package-outputs glib))) ; 20 MiB of GTK-Doc reference
> +    (native-inputs
> +     `(("gtk-doc" ,gtk-doc)             ; for the doc
> +       ("docbook-xml" ,docbook-xml)
> +       ,@(package-native-inputs glib)))
> +    (arguments
> +     (substitute-keyword-arguments (package-arguments glib)
> +       ((#:configure-flags flags ''())
> +        `(cons "-Dgtk_doc=true" ,flags))
> +       ((#:phases phases)
> +        `(modify-phases ,phases
> +           (add-after 'unpack 'make-local-docbook-xml
> +             (lambda* (#:key inputs #:allow-other-keys)
> +               (let ((replace-http
> +                      (lambda (file)
> +                        (substitute* file
> +                          ;; Warning: gio.xml uses docbook 4.2, hence the "4.." pattern.
> +                          (("http://www.oasis-open.org/docbook/xml/4../docbookx.dtd")
> +                           (string-append (assoc-ref inputs "docbook-xml")
> +                                          "/xml/dtd/docbook/docbookx.dtd"))))))
> +                 (replace-http "gio/gdbus-2.0/codegen/codegen_docbook.py")
> +                 (for-each replace-http (find-files "." "\\.xml$"))
> +                 #t)))

Can this phase be removed if you add 'libxml2' to inputs (for the
$XML_CATALOG_FILES search path)?

Otherwise LGTM!
[signature.asc (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#37850; Package guix. (Wed, 27 Nov 2019 12:38:01 GMT) Full text and rfc822 format available.

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

From: Pierre Neidhardt <mail <at> ambrevar.xyz>
To: Marius Bakke <mbakke <at> fastmail.com>,
 "pelzflorian \(Florian Pelz\)" <pelzflorian <at> pelzflorian.de>
Cc: 37850 <at> debbugs.gnu.org
Subject: Re: bug#37850: Glib documentation is missing
Date: Wed, 27 Nov 2019 13:37:24 +0100
[Message part 1 (text/plain, inline)]
Marius Bakke <mbakke <at> fastmail.com> writes:

> This should say (glib)[properties]: ...

Fixed.

> Using (alist-delete 'hidden? (package-properties glib)) is more future
> proof.  :-)

Done.

> Can this phase be removed if you add 'libxml2' to inputs (for the
> $XML_CATALOG_FILES search path)?

It worked, thanks!

Merged!

-- 
Pierre Neidhardt
https://ambrevar.xyz/
[signature.asc (application/pgp-signature, inline)]

bug closed, send any further explanations to 37850 <at> debbugs.gnu.org and Pierre Neidhardt <mail <at> ambrevar.xyz> Request was from Pierre Neidhardt <mail <at> ambrevar.xyz> to control <at> debbugs.gnu.org. (Wed, 27 Nov 2019 12:38: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. (Thu, 26 Dec 2019 12:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 5 years and 177 days ago.

Previous Next


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