[PATCH]: Use 'gtk-doc/stable' instead of 'gtk-doc' in native-inputs

  • Open
  • quality assurance status badge
Details
2 participants
  • Maxime Devos
  • Mark H Weaver
Owner
unassigned
Submitted by
Maxime Devos
Severity
normal
M
M
Maxime Devos wrote on 29 Mar 2021 21:20
(address . guix-patches@gnu.org)(address . mhw@netris.org)
1c4c6ea95c20b74e020a762ac2618e87ceff1f81.camel@telenet.be
Hi Guix,


* Patch #1: Use 'gtk-doc/stable' instead of 'gtk-doc' in native-inputs

To test packages can still be built:

<start snip>
PACKAGES="thermald glimpse glib mate-desktop atril caja-extensions"
PACKAGES+=" mate-utils eom engrampa pluma mate-polkit"
PACKAGES+=" libgnt loudmouth denemo gsequencer libu2f-host libu2f-server"
PACKAGES+=" keybinder keybinder-3.0"

./pre-inst-env guix build $PACKAGES -M

# Output:
The following derivation will be built:
/gnu/store/n84fwcigw3djfxv12iqv76bwp2gx9mnf-denemo-2.5.0.drv
The following files will be downloaded:
[...]

./pre-inst-env guix build denemo
[Bla bla.]
# Success!

<end snip>

To test no references to imagemagick or gtk-doc are retained:

./pre-inst-env guix graph --type=references $PACKAGES
# ^ search for imagemagick in output
# ^ TODO it should not be required to substitute $PACKAGES
# first, as the 'references' information is in the narinfo.

* Patch #2: Export canonicalize-reference
* Patch #3: Add a '#:disallowed-references' argument to 'python-build'.

Used in later patches.

* Patch #4: Let 'python-sphinx' use 'imagemagick/stable'.

python-sphinx depends on imagemagick. As (before this patch series),
many packages depend on 'python-sphinx' ...

<start snip>
guix refresh --list-dependent python-sphinx
Building the following 199 packages would ensure 427 dependent packages are rebuilt: [...]
<end snip>

... it may be worthwile to depend a /stable variant of python-sphinx,
and use it when sphinx is used only for generating the documentation.
However, defining a variant of python-sphinx is not required,
as python-sphinx does not retain its reference to imagemagick.

Thus, I simply replaced 'imagemagick' with 'imagemagick/stable' in the
inputs. To make sure python-sphinx does not retain references to imagemagick/stable,
I added #:disallowed-references `(,imagemagick/stable) to #:arguments.

It is commented out in the patch to avoid rebuilds:

$ ./pre-inst-env guix build python-sphinx
Toggle quote (8 lines)
> substitute: updating substitutes from 'https://ci.guix.gnu.org'... 100.0%
> 1.6 MB will be downloaded:
> /gnu/store/sf2kdppaf8z2ri40rlp27l7ffkd8kvyf-python-sphinx-3.3.1
> substituting /gnu/store/sf2kdppaf8z2ri40rlp27l7ffkd8kvyf-python-sphinx-3.3.1...
> downloading from https://ci.guix.gnu.org/nar/lzip/sf2kdppaf8z2ri40rlp27l7ffkd8kvyf-python-sphinx-3.3.1 ...
> python-sphinx-3.3.1 1.5MiB 121KiB/s 00:13 [##################] 100.0%
> [...]

When uncommented, 'python-sphinx' still builds.


* Patch #5 .. #10: I replaced imagemagick with imagemagick/stable in some packages

* After this patch series: how many packages would be rebuild if imagemagick
is updated?

$ ./pre-inst-env guix refresh --list-dependent imagemagick@6.9.12-4
Toggle quote (2 lines)
> Building the following 47 packages would ensure 73 dependent packages are rebuilt: [..]

Also, I verified ./pre-inst-env guix build guix still succeeds.

Greetings,
Maxime.
Attachment: file
Attachment: file
From afef6d080ef5eec5538e8924d37ab9eb12bc7d50 Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Mon, 29 Mar 2021 12:52:56 +0200
Subject: [PATCH 03/10] build-system: python: Add #:disallowed-references.

* gnu/build-system/python.scm
(python-build)[disallowed-references]: Add support for
#:disallowed-references.
---
guix/build-system/python.scm | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)

Toggle diff (34 lines)
diff --git a/guix/build-system/python.scm b/guix/build-system/python.scm
index 80895162f8..41cf0999f6 100644
--- a/guix/build-system/python.scm
+++ b/guix/build-system/python.scm
@@ -173,9 +173,13 @@ pre-defined variants."
(guile #f)
(imported-modules %python-build-system-modules)
(modules '((guix build python-build-system)
- (guix build utils))))
+ (guix build utils)))
+ disallowed-references)
"Build SOURCE using PYTHON, and with INPUTS. This assumes that SOURCE
provides a 'setup.py' file as its build system."
+ (define specialized-canonicalize-reference
+ (cut canonicalize-reference store system <>))
+
(define builder
`(begin
(use-modules ,@modules)
@@ -212,7 +216,11 @@ provides a 'setup.py' file as its build system."
#:system system
#:modules imported-modules
#:outputs outputs
- #:guile-for-build guile-for-build))
+ #:guile-for-build guile-for-build
+ #:disallowed-references
+ (and disallowed-references
+ (map specialized-canonicalize-reference
+ disallowed-references))))
(define python-build-system
(build-system
--
2.31.1
From cb66411484eeb7b8423c31336275c5a70e4f57a8 Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Mon, 29 Mar 2021 12:58:42 +0200
Subject: [PATCH 04/10] gnu: sphinx: Use 'imagemagick/stable' variant.

As the store item does not retain a reference to imagemagick,
it should be safe to use the 'imagemagick/stable' variant.

* gnu/packages/sphinx.scm (python-sphinx):
[arguments]<#:phases>: Suggest using #:disallowed-references
to make sure no references to imagemagick are retained, but
don't do that yet to avoid rebuilds.
[native-inputs]: Use 'imagemagick/stable' instead of 'imagemagick'
and explain why that's a safe thing to do.
---
gnu/packages/sphinx.scm | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)

Toggle diff (42 lines)
diff --git a/gnu/packages/sphinx.scm b/gnu/packages/sphinx.scm
index e85e4a0f7e..b3c5384f30 100644
--- a/gnu/packages/sphinx.scm
+++ b/gnu/packages/sphinx.scm
@@ -15,6 +15,7 @@
;;; Copyright © 2019 Brett Gilio <brettg@gnu.org>
;;; Copyright © 2020 Giacomo Leidi <goodoldpaul@autistici.org>
;;; Copyright © 2021 Eric Bavier <bavier@posteo.net>
+;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -62,7 +63,13 @@
"0023vc2i29pjxmvdqbz1wdbi7gbj56y1br1b2z8h8wa44li5k38y"))))
(build-system python-build-system)
(arguments
- `(#:phases
+ `(;; Make sure it is safe to use 'imagemagick' instead
+ ;; of 'imagemagick/stable' (see the comment for the
+ ;; "imagemagick" input).
+ ;;
+ ;; TODO: uncomment this line on the next package update.
+ ;; #:disallowed-references (,imagemagick/stable)
+ #:phases
(modify-phases %standard-phases
(replace 'check
(lambda _
@@ -92,7 +99,11 @@
,python-sphinxcontrib-serializinghtml)))
(native-inputs
`(("graphviz" ,graphviz)
- ("imagemagick" ,imagemagick) ;for "convert"
+ ;; For "convert". The store item does not retain a reference
+ ;; to imagemagick, so it should be safe to use 'imagemagick/stable'
+ ;; instead of 'imagemagick'. This is enforced by the
+ ;; '#:disallowed-references' above.
+ ("imagemagick" ,imagemagick/stable)
("python-html5lib" ,python-html5lib)
("python-mock" ,python-mock)
("python-nose" ,python-nose)
--
2.31.1
From d372ac0ed52aa5f70a5da30dc7a8fa0efff2a821 Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Mon, 29 Mar 2021 13:47:01 +0200
Subject: [PATCH 05/10] gnu: wpa-supplicant-gui: Use 'imagemagick/stable'
variant.

* gnu/packages/admin.scm (wpa-supplicant-gui):
[native-inputs]: Use the 'imagemagick/stable' variant.
[arguments]<#:disallowed-phases>: Prevent 'imagemagick/stable'
from entering the closure.
---
gnu/packages/admin.scm | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)

Toggle diff (23 lines)
diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm
index 3bafa71edc..b430528a39 100644
--- a/gnu/packages/admin.scm
+++ b/gnu/packages/admin.scm
@@ -1780,11 +1780,14 @@ command.")
,@(package-inputs wpa-supplicant)))
(native-inputs
;; For icons.
- `(("imagemagick" ,imagemagick)
+ `(("imagemagick" ,imagemagick/stable)
("inkscape" ,inkscape)
,@(package-native-inputs wpa-supplicant)))
(arguments
- `(#:phases (modify-phases %standard-phases
+ ;; Make sure the (rarely updated) package 'imagemagick/stable'
+ ;; does not end up in the closure.
+ `(#:disallowed-references (,imagemagick/stable)
+ #:phases (modify-phases %standard-phases
(add-after 'unpack 'chdir
(lambda _
(chdir "wpa_supplicant/wpa_gui-qt4")
--
2.31.1
From ac0c5309968bb62110171893fd3ac8fc680b0de1 Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Mon, 29 Mar 2021 16:01:53 +0200
Subject: [PATCH 06/10] gnu: wpa-supplicant-gui: Don't return #t from phases.

* gnu/packages/admin.scm
(wpa-supplicant-gui)[argument]<#:phases>: Don't return #t from
phases, as returning #t isn't required anymore.
---
gnu/packages/admin.scm | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)

Toggle diff (26 lines)
diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm
index b430528a39..542651a355 100644
--- a/gnu/packages/admin.scm
+++ b/gnu/packages/admin.scm
@@ -1790,8 +1790,7 @@ command.")
#:phases (modify-phases %standard-phases
(add-after 'unpack 'chdir
(lambda _
- (chdir "wpa_supplicant/wpa_gui-qt4")
- #t))
+ (chdir "wpa_supplicant/wpa_gui-qt4")))
(delete 'configure)
(replace 'build
(lambda _
@@ -1812,8 +1811,7 @@ command.")
,(map (lambda (label)
(string-append (assoc-ref inputs label)
"/lib/qt5/plugins/"))
- qt)))
- #t))))))
+ qt)))))))))
(synopsis "Graphical user interface for WPA supplicant")))
(define-public hostapd
--
2.31.1
From 3c656c4423a209d092734c3c1533c7aadefe37c2 Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Mon, 29 Mar 2021 17:14:08 +0200
Subject: [PATCH 07/10] guix: build-system: qt: Support
#:disallowed-references.

* guix/build-system/qt.scm
(qt-build): Support #:disallowed-references,
using 'canonicalize-reference'.
(qt-cross-build): Support #:disallowed-references,
using 'canonicalize-cross-reference'.
---
guix/build-system/qt.scm | 22 ++++++++++++++++++++--
1 file changed, 20 insertions(+), 2 deletions(-)

Toggle diff (75 lines)
diff --git a/guix/build-system/qt.scm b/guix/build-system/qt.scm
index 118022ec45..ad9309af11 100644
--- a/guix/build-system/qt.scm
+++ b/guix/build-system/qt.scm
@@ -3,6 +3,7 @@
;;; Copyright © 2013 Cyril Roelandt <tipecaml@gmail.com>
;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2019 Hartmut Goebel <h.goebel@crazy-compilers.com>
+;;; Copyright © 2021 Maxime Devos <maximedevos@telenet.be>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -29,6 +30,7 @@
#:use-module (guix build-system gnu)
#:use-module (guix packages)
#:use-module (ice-9 match)
+ #:use-module (srfi srfi-26)
#:export (%qt-build-system-modules
qt-build
qt-build-system))
@@ -127,9 +129,13 @@
(system (%current-system))
(imported-modules %qt-build-system-modules)
(modules '((guix build qt-build-system)
- (guix build utils))))
+ (guix build utils)))
+ disallowed-references)
"Build SOURCE using CMAKE, and with INPUTS. This assumes that SOURCE
provides a 'CMakeLists.txt' file as its build system."
+ (define specialized-canonicalize-reference
+ (cut canonicalize-reference store system <>))
+
(define builder
`(begin
(use-modules ,@modules)
@@ -175,6 +181,10 @@ provides a 'CMakeLists.txt' file as its build system."
#:inputs inputs
#:modules imported-modules
#:outputs outputs
+ #:disallowed-references
+ (and disallowed-references
+ (map specialized-canonicalize-reference
+ disallowed-references))
#:guile-for-build guile-for-build))
@@ -209,10 +219,14 @@ provides a 'CMakeLists.txt' file as its build system."
(build (nix-system->gnu-triplet system))
(imported-modules %qt-build-system-modules)
(modules '((guix build qt-build-system)
- (guix build utils))))
+ (guix build utils)))
+ disallowed-references)
"Cross-build NAME using CMAKE for TARGET, where TARGET is a GNU triplet and
with INPUTS. This assumes that SOURCE provides a 'CMakeLists.txt' file as its
build system."
+ (define specialized-canonicalize-reference
+ (cut canonicalize-cross-reference store target system <>))
+
(define builder
`(begin
(use-modules ,@modules)
@@ -284,6 +298,10 @@ build system."
#:inputs (append native-drvs target-drvs)
#:outputs outputs
#:modules imported-modules
+ #:disallowed-references
+ (and disallowed-references
+ (map specialized-canonicalize-reference
+ disallowed-references))
#:guile-for-build guile-for-build))
(define qt-build-system
--
2.31.1
From 9bbac1da0cd30eac1c42ff42d0b8460852e03510 Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Mon, 29 Mar 2021 17:46:36 +0200
Subject: [PATCH 08/10] gnu: bandage: Do not yet use the 'imagemagick/stable'
variant.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

(‘Closure of bandage is way too large’) has been fixed,
the variant will probably be usable.

* gnu/packages/bioinformatics.scm (bandage):
[arguments]<#:disallowed-references>: Once the issue
has been fixed, prevent the imagemagick/stable package
from ending up in the closure.
[native-inputs]: Note that 'imagemagick/stable' cannot
be used yet.
---
gnu/packages/bioinformatics.scm | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)

Toggle diff (30 lines)
diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index a81c873371..290946455a 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -12548,7 +12548,13 @@ Thus the per-base error rate is similar to the raw input reads.")
(base32 "1bbsn5f5x8wlspg4pbibqz6m5vin8c19nl224f3z3km0pkc97rwv"))))
(build-system qt-build-system)
(arguments
- `(#:phases
+ ;; TODO: Once <https://issues.guix.gnu.org/47475> is fixed,
+ ;; consider uncommenting the following:
+ ;;
+ ;; Prevent the (rarely updated) imagemagick/stable package
+ ;; from ending up in the closure.
+ `(;;#:disallowed-references (,imagemagick/stable)
+ #:phases
(modify-phases %standard-phases
(replace 'configure
(lambda _
@@ -12572,6 +12578,8 @@ Thus the per-base error rate is similar to the raw input reads.")
`(("qtbase" ,qtbase)
("qtsvg" ,qtsvg)))
(native-inputs
+ ;; imagemagick/stable cannot be used here, as it will end up in the
+ ;; closure. See <https://issues.guix.gnu.org/47475>.
`(("imagemagick" ,imagemagick)))
(home-page "https://rrwick.github.io/Bandage/")
(synopsis
--
2.31.1
From 97fd9a8ab7e37602f5d857dd37fceeba399f43de Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Mon, 29 Mar 2021 19:20:04 +0200
Subject: [PATCH 09/10] guix: build-system: cmake: Support
#:disallowed-references.

* guix/build-system/cmake.scm
(cmake-build): Add #:disallowed-references.
(cmake-cross-build): Likewise.
---
guix/build-system/cmake.scm | 22 ++++++++++++++++++++--
1 file changed, 20 insertions(+), 2 deletions(-)

Toggle diff (75 lines)
diff --git a/guix/build-system/cmake.scm b/guix/build-system/cmake.scm
index f590b6ea42..c15197508a 100644
--- a/guix/build-system/cmake.scm
+++ b/guix/build-system/cmake.scm
@@ -3,6 +3,7 @@
;;; Copyright © 2013 Cyril Roelandt <tipecaml@gmail.com>
;;; Copyright © 2017 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2020 Efraim Flashner <efraim@flashner.co.il>
+;;; Copyright © 2021 Maxime Devos <maximdevos@telenet.be>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -28,6 +29,7 @@
#:use-module (guix build-system gnu)
#:use-module (guix packages)
#:use-module (ice-9 match)
+ #:use-module (srfi srfi-26)
#:export (%cmake-build-system-modules
cmake-build
cmake-build-system))
@@ -117,9 +119,13 @@
(substitutable? #t)
(imported-modules %cmake-build-system-modules)
(modules '((guix build cmake-build-system)
- (guix build utils))))
+ (guix build utils)))
+ disallowed-references)
"Build SOURCE using CMAKE, and with INPUTS. This assumes that SOURCE
provides a 'CMakeLists.txt' file as its build system."
+ (define specialized-canonicalize-reference
+ (cut canonicalize-reference store system <>))
+
(define builder
`(begin
(use-modules ,@modules)
@@ -165,6 +171,10 @@ provides a 'CMakeLists.txt' file as its build system."
#:modules imported-modules
#:outputs outputs
#:substitutable? substitutable?
+ #:disallowed-references
+ (and disallowed-references
+ (map specialized-canonicalize-reference
+ disallowed-references))
#:guile-for-build guile-for-build))
@@ -200,10 +210,14 @@ provides a 'CMakeLists.txt' file as its build system."
(build (nix-system->gnu-triplet system))
(imported-modules %cmake-build-system-modules)
(modules '((guix build cmake-build-system)
- (guix build utils))))
+ (guix build utils)))
+ disallowed-references)
"Cross-build NAME using CMAKE for TARGET, where TARGET is a GNU triplet and
with INPUTS. This assumes that SOURCE provides a 'CMakeLists.txt' file as its
build system."
+ (define specialized-canonicalize-reference
+ (cut canonicalize-cross-reference store target system <>))
+
(define builder
`(begin
(use-modules ,@modules)
@@ -276,6 +290,10 @@ build system."
#:outputs outputs
#:modules imported-modules
#:substitutable? substitutable?
+ #:disallowed-references
+ (and disallowed-references
+ (map specialized-canonicalize-reference
+ disallowed-references))
#:guile-for-build guile-for-build))
(define cmake-build-system
--
2.31.1
From d7e7187f2387424d6b37e903efe4aed809733dd4 Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Mon, 29 Mar 2021 20:14:35 +0200
Subject: [PATCH 10/10] gnu: inkscape-1.0: Do *not* yet use
'imagemagick/stable'.

First, https://issues.guix.gnu.org/47479 will have to be fixed.

* gnu/packages/inkscape (inkscape-1.0)[native-inputs]: Do not yet
replace 'imagemagick' with 'imagemagick/stable', as 'imagemagick'
ends up in the closure.
---
gnu/packages/inkscape.scm | 9 +++++++++
1 file changed, 9 insertions(+)

Toggle diff (36 lines)
diff --git a/gnu/packages/inkscape.scm b/gnu/packages/inkscape.scm
index 075f901b2d..3b774ceaa1 100644
--- a/gnu/packages/inkscape.scm
+++ b/gnu/packages/inkscape.scm
@@ -7,6 +7,7 @@
;;; Copyright © 2020 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;; Copyright © 2020 Boris A. Dekshteyn <boris.dekshteyn@gmail.com>
;;; Copyright © 2020 Ekaitz Zarraga <ekaitz@elenq.tech>
+;;; Copyright © 2021 Maxim Devos <maximedevos@telenet.be>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -221,6 +222,11 @@ endif()~%~%"
#:modules ((guix build cmake-build-system)
((guix build glib-or-gtk-build-system) #:prefix glib-or-gtk:)
(guix build utils))
+ ;; TODO: uncomment this when <https://issues.guix.gnu.org/47479>
+ ;; has been fixed.
+ ;; Prevent the 'imagemagick/stable' package from ending
+ ;; up in the closure.
+ ;; #:disallowed-references (,imagemagick/stable)
#:phases
(modify-phases %standard-phases
(add-after 'unpack 'patch-icon-cache-generator
@@ -291,6 +297,9 @@ endif()~%~%"
("python-numpy" ,python-numpy)
("python-lxml" ,python-lxml)))
(native-inputs
+ ;; TODO: it would be nice to use 'imagemagick/stable' here,
+ ;; but that is not possible yet. See
+ ;; <https://issues.guix.gnu.org/47479>.
`(("imagemagick" ,imagemagick) ;for tests
("intltool" ,intltool)
("glib" ,glib "bin")
--
2.31.1
-----BEGIN PGP SIGNATURE-----

iI0EABYIADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYGIogxccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7tMyAQCcr3Ftl+eeGDh7wODDOb9XINmO
kwf5lfb8InNvGhkX3QD/eUfEAd/aK0YTTNAvos61oiwjelXpT5DVZ82es+flZgo=
=nn5w
-----END PGP SIGNATURE-----


M
M
Mark H Weaver wrote on 1 Apr 2021 20:56
87v995al5u.fsf@netris.org
Hi Maxime,

Thanks so much for taking this on. The reason for my delayed response
is that I'm a bit nervous about using these known-buggy "*/stable"
packages more comprehensively until we have a better understanding of
https://bugs.gnu.org/47479 and how to address it.

Mark
?