Here is a set of patches, for starting discussion...

I only build-tested them natively on/for x86_64 (and
cross built for aarch64 for the sudo one)

On Mon, Mar 30, 2020 at 11:25 PM Vincent Legoll
<vincent.leg...@gmail.com> wrote:
>
> Hello Mathieu,
>
> On Mon, Mar 30, 2020 at 8:57 AM Mathieu Othacehe <m.othac...@gmail.com> wrote:
> > > Are those changes useful to do on their own ?
> >
> > Well yes it may reduce the closure size of the package (run `guix size
> > sudo`) to get it.
>
> I'm not seeing any size difference, but groff is not in the output:
>
> on master, groff in inputs:
>
> $ ./pre-inst-env guix size sudo
> store item                                                       total    self
> /gnu/store/ahqgl4h89xqj695lgqvsaf6zh2nhy4pj-glibc-2.29
> 37.4    35.8  36.9%
> /gnu/store/2plcy91lypnbbysb18ymnhaw3zwk8pg1-gcc-7.4.0-lib
> 70.0    32.6  33.7%
> /gnu/store/9kzrrccpzl6i1sfwb0drb00gi2gwk0x0-coreutils-8.31
> 90.0    16.5  17.0%
> /gnu/store/vsvba1ilj2zj536pvsil6r0mf5rnjj45-sudo-1.8.31p1
> 96.9     3.5   3.6%
> /gnu/store/dvs3acxwfnwgc7yma6h3y937ri2li47y-gmp-6.1.2
> 72.6     2.6   2.7%
> /gnu/store/vkj5rdiavl87m21d9i0k69rfw79p13gj-linux-pam-1.3.1
> 73.2     2.1   2.2%
> /gnu/store/cp72ncw4prnsga65n3pzll07hpsg524f-bash-static-5.0.7
> 1.6     1.6   1.7%
> /gnu/store/29jhbbg1hf557x8j53f9sxd9imlmf02a-bash-minimal-5.0.7
> 38.4     1.0   1.1%
> /gnu/store/nffbgghxyvrj29lcgxs5fpmi3sx9zzql-acl-2.2.53
> 70.7     0.5   0.5%
> /gnu/store/in1738m2zvhgpz78n2yqa972sdzc42ss-attr-2.4.48
> 70.3     0.3   0.3%
> /gnu/store/qx7p7hiq90mi7r78hcr9cyskccy2j4bg-zlib-1.2.11
> 70.2     0.2   0.2%
> /gnu/store/waw5ci4lazbf2a1x9v6gw1v274nk0gny-libcap-2.27
> 70.2     0.2   0.2%
> total: 96.9 MiB
>
> on a branch with groff in native-inputs:
>
> $ ./pre-inst-env guix size sudo
> store item                                                       total    self
> /gnu/store/ahqgl4h89xqj695lgqvsaf6zh2nhy4pj-glibc-2.29
> 37.4    35.8  36.9%
> /gnu/store/2plcy91lypnbbysb18ymnhaw3zwk8pg1-gcc-7.4.0-lib
> 70.0    32.6  33.7%
> /gnu/store/9kzrrccpzl6i1sfwb0drb00gi2gwk0x0-coreutils-8.31
> 90.0    16.5  17.0%
> /gnu/store/l320ig872ny66d1yi6v7n4zb93iz50dx-sudo-1.8.31p1
> 96.9     3.5   3.6%
> /gnu/store/dvs3acxwfnwgc7yma6h3y937ri2li47y-gmp-6.1.2
> 72.6     2.6   2.7%
> /gnu/store/vkj5rdiavl87m21d9i0k69rfw79p13gj-linux-pam-1.3.1
> 73.2     2.1   2.2%
> /gnu/store/cp72ncw4prnsga65n3pzll07hpsg524f-bash-static-5.0.7
> 1.6     1.6   1.7%
> /gnu/store/29jhbbg1hf557x8j53f9sxd9imlmf02a-bash-minimal-5.0.7
> 38.4     1.0   1.1%
> /gnu/store/nffbgghxyvrj29lcgxs5fpmi3sx9zzql-acl-2.2.53
> 70.7     0.5   0.5%
> /gnu/store/in1738m2zvhgpz78n2yqa972sdzc42ss-attr-2.4.48
> 70.3     0.3   0.3%
> /gnu/store/qx7p7hiq90mi7r78hcr9cyskccy2j4bg-zlib-1.2.11
> 70.2     0.2   0.2%
> /gnu/store/waw5ci4lazbf2a1x9v6gw1v274nk0gny-libcap-2.27
> 70.2     0.2   0.2%
> total: 96.9 MiB
>
> > It can also fix cross-compilation. Because when cross-compiling, if
> > groff needs to be run at build-time, it needs to be for the native
> > architecture and not the target one.
> >
> > You can check it by running `guix build --target=aarch64-linux-gnu sudo`
> > for instance.
>
> That fails on master (libpaper) whereas with the patch it works,
> so I guess the patch is useful on that front.
>
> The patch for sudo will be in the following emails.
>
> Is there anything else to check / test ?
>
> --
> Vincent Legoll



-- 
Vincent Legoll
From a782816fe096e786673c03dca3b2866e62933fff Mon Sep 17 00:00:00 2001
From: Vincent Legoll <vincent.leg...@gmail.com>
Date: Mon, 30 Mar 2020 22:21:08 +0200
Subject: [PATCH 1/4] gnu: privoxy: Make some inputs native.

* gnu/packages/tor.scm (privoxy)[native-inputs]: New field.
[inputs]: Move autoconf & automake to native-inputs.
---
 gnu/packages/tor.scm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/tor.scm b/gnu/packages/tor.scm
index 61e52ba22c..841158871e 100644
--- a/gnu/packages/tor.scm
+++ b/gnu/packages/tor.scm
@@ -141,8 +141,9 @@ rejects UDP traffic from the application you're using.")
     (inputs
      `(("w3m" ,w3m)
        ("pcre" ,pcre)
-       ("zlib" ,zlib)
-       ("autoconf" ,autoconf)
+       ("zlib" ,zlib)))
+    (native-inputs
+     `(("autoconf" ,autoconf)
        ("automake" ,automake)))
     (home-page "https://www.privoxy.org";)
     (synopsis "Web proxy with advanced filtering capabilities for enhancing privacy")
-- 
2.25.2

From 3887538d37256424d5654da5fce4c94c924a4e67 Mon Sep 17 00:00:00 2001
From: Vincent Legoll <vincent.leg...@gmail.com>
Date: Mon, 30 Mar 2020 22:42:28 +0200
Subject: [PATCH 4/4] gnu: procenv: Make some inputs native & make multiline.

* gnu/packages/linux.scm (procenv)[native-inputs]: New field.
[inputs]: Move groff to native-inputs, move each remaining item on its own line.
---
 gnu/packages/linux.scm | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index a45847cbe5..945c15d972 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -5867,9 +5867,11 @@ the MTP device as a file system.")
       (base32 "1javw97yw0qvjmj14js8vw6nsfyf2xc0kfiyq5f2hsp0553w2cdq"))))
    (build-system gnu-build-system)
    (arguments `(#:configure-flags '("--disable-silent-rules")))
-   (native-inputs `(("pkg-config" ,pkg-config)))
-   (inputs `(("expat" ,expat) ("libcap" ,libcap) ("check" ,check)
-             ("groff" ,groff)           ; for tests
+   (native-inputs `(("groff" ,groff) ; for tests
+                    ("pkg-config" ,pkg-config)))
+   (inputs `(("check" ,check)
+             ("expat" ,expat)
+             ("libcap" ,libcap)
              ("libselinux" ,libselinux)))
    (synopsis "Utility to show process environment")
    (description "Procenv is a command-line tool that displays as much detail about
-- 
2.25.2

From 60e400cc78a6f2caf991800a13622906b6e6dabb Mon Sep 17 00:00:00 2001
From: Vincent Legoll <vincent.leg...@gmail.com>
Date: Mon, 30 Mar 2020 22:38:44 +0200
Subject: [PATCH 3/4] gnu: nftables: Make some inputs native.

* gnu/packages/linux.scm (procenv)[native-inputs]: New field.
[inputs]: Move bison & flex to native-inputs.
---
 gnu/packages/linux.scm | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 701df764cd..a45847cbe5 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -5647,13 +5647,13 @@ used by nftables.")
     (build-system gnu-build-system)
     (arguments `(#:configure-flags
                  '("--disable-man-doc"))) ; FIXME: Needs docbook2x.
-    (inputs `(("bison" ,bison)
-              ("flex" ,flex)
-              ("gmp" ,gmp)
+    (inputs `(("gmp" ,gmp)
               ("libmnl" ,libmnl)
               ("libnftnl" ,libnftnl)
               ("readline" ,readline)))
-    (native-inputs `(("pkg-config" ,pkg-config)))
+    (native-inputs `(("pkg-config" ,pkg-config)
+                     ("bison" ,bison)
+                     ("flex" ,flex)))
     (home-page "https://www.nftables.org";)
     (synopsis "Userspace utility for Linux packet filtering")
     (description "nftables is the project that aims to replace the existing
-- 
2.25.2

From bd2f9cac9229bb31cc64f5d647b6ef8085f46db4 Mon Sep 17 00:00:00 2001
From: Vincent Legoll <vincent.leg...@gmail.com>
Date: Mon, 30 Mar 2020 22:28:55 +0200
Subject: [PATCH 2/4] gnu: sudo: Make some inputs native.

* gnu/packages/admin.scm (sudo)[native-inputs]: New field.
[inputs]: Move groff to native-inputs.
---
 gnu/packages/admin.scm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm
index 2f661f5e81..457dc1e3dc 100644
--- a/gnu/packages/admin.scm
+++ b/gnu/packages/admin.scm
@@ -1268,9 +1268,10 @@ system administrator.")
        ;; XXX: The 'testsudoers' test series expects user 'root' to exist, but
        ;; the chroot's /etc/passwd doesn't have it.  Turn off the tests.
        #:tests? #f))
+    (native-inputs
+     `(("groff" ,groff)))
     (inputs
-     `(("groff" ,groff)
-       ("linux-pam" ,linux-pam)
+     `(("linux-pam" ,linux-pam)
        ("zlib" ,zlib)
        ("coreutils" ,coreutils)))
     (home-page "https://www.sudo.ws/";)
-- 
2.25.2

Reply via email to