Re: 'guix reconfigure' fail to build 'rsnapshot'

2021-07-17 Thread Simon Josefsson via
br...@waegenei.re writes:

> First we go back to our failing build² and have a look in its log⁷. At the
> end of it there is 2 failing tests t/backup_exec/backup_exec.t and
> t/cmd-post_pre-exec/cmd-post_pre-exec.t. That's what we need to repair or
> disable. Now we need to build it locally and inspect it more in depth, we
> do that with “guix build rsnapshot --keep-failed --no-offload” and
> obviously it fail as expected and guix guide us to the build directory
> “/tmp/guix-build-rsnapshot-1.4.4.drv-1”.
>
> To find out why thoses 2 tests ae failing we are gonna run them manually.
> We change directory to
> “/tmp/guix-build-rsnapshot-1.4.4.drv-0/rsnapshot-1.4.4” the failed build
> and find the build “rsnapshot“ program in it but it's not executable, so we
> make it so “chmod +x rsnapshot”. Then we inspect the build tests

Hi Brice.  May thanks for this excellent walk-through, I followed the
steps locally here to learn, hoping my next problem follows the same
pattern.

/Simon


signature.asc
Description: PGP signature


Re: 'guix reconfigure' fail to build 'rsnapshot'

2021-07-17 Thread Tobias Geerinckx-Rice

On 2021-07-17 19:49, br...@waegenei.re wrote:

Maybe removing our substitution will fix our build issue:
--8<---cut here---start->8---
@@ -526,15 +526,6 @@ rdiff-backup is easy to use and settings have
sensible defaults.")
(modify-phases %standard-phases
  (replace 'check
(lambda _
- (substitute* 
'("t/cmd-post_pre-exec/conf/pre-true-post-true.conf"

-"t/backup_exec/conf/backup_exec_fail.conf"
-"t/backup_exec/conf/backup_exec.conf")
-   (("/bin/true") (which "true"))
-   (("/bin/false") (which "false")))
-
- ;; Disable a test that tries to connect to localhost on 
port 22.

- (delete-file "t/ssh_args/ssh_args.t.in")
-
  (invoke "make" "test"))
 (inputs
  `(("perl" ,perl)
--8<---cut here---end--->8---


This is probably cleaner if you've verified that the tests are still 
run.  LGTM!


Kind regards,

T G-R

Sent from a Web browser. Excuse or enjoy my brevity.



Re: 'guix reconfigure' fail to build 'rsnapshot'

2021-07-17 Thread Tobias Geerinckx-Rice

Simon,

On 2021-07-17 18:07, Simon Josefsson via wrote:

Hi!  Since some time, 'guix reconfigure' on my machine fails:


Thanks!  Fixed on master.


aren't all packages built centrally


Yes: .


to make sure things build?


It doesn't do more than try to build things (yet).

Kind regards,

T G-R

Sent from a Web browser. Excuse or enjoy my brevity.



Re: 'guix reconfigure' fail to build 'rsnapshot'

2021-07-17 Thread brice
Hello Simon,

On 17 July, 2021 18:07 CEST, Simon Josefsson via  wrote:

> How can I fix this?  Is this something unique on my machine, or does it
> indicate a bug in the packaging of 'rsnapshot'?  I'm not sure how to
> proceed with debugging.

Let's see, Cuirass says this packaged failed to build since the 20th of
June¹ on the branch master for all the systems. So it's not just you
that aren't able to build it.

The build for x86_64_linux², is for the version 1.4.4 of rsnapshot and we
also see that the previous successfully build (and the only one) date from
March 11 for version 1.4.3 and dependencies haven't changed between those
tow build. So an update of the package from 1.4.3 to 1.4.4 probably caused that.

If we want to find that specific commit, this build is part of the
evaluation #50819⁴for the commit d027858e70c4a37aca90b1d4ecb2f0421a95d987⁵.
The great-father of that commit is the one updating rsnapshot “gnu:
rsnapshot: Update to 1.4.4.”⁶. Now that we know what broke the package,
just a plain update, we can start trying to fix the failing build.

First we go back to our failing build² and have a look in its log⁷. At the
end of it there is 2 failing tests t/backup_exec/backup_exec.t and
t/cmd-post_pre-exec/cmd-post_pre-exec.t. That's what we need to repair or
disable. Now we need to build it locally and inspect it more in depth, we
do that with “guix build rsnapshot --keep-failed --no-offload” and
obviously it fail as expected and guix guide us to the build directory
“/tmp/guix-build-rsnapshot-1.4.4.drv-1”.

To find out why thoses 2 tests ae failing we are gonna run them manually.
We change directory to
“/tmp/guix-build-rsnapshot-1.4.4.drv-0/rsnapshot-1.4.4” the failed build
and find the build “rsnapshot“ program in it but it's not executable, so we
make it so “chmod +x rsnapshot”. Then we inspect the build tests

--8<---cut here---start->8---
$ cat t/backup_exec/backup_exec.t
#!/gnu/store/8zvc5mvk0xm3ygrxsgpyy5ilxb5rzjry-perl-5.30.2/bin/perl

use strict;
use Test::More tests => 2;
use SysWrap;

# Ensure passing behavior
ok(2 == rsnapshot("-c 
/tmp/guix-build-rsnapshot-1.4.4.drv-0/rsnapshot-1.4.4//t//backup_exec/conf/backup_exec.conf
 hourly"));
# Ensure failing behavior
ok(1 == rsnapshot("-c 
/tmp/guix-build-rsnapshot-1.4.4.drv-0/rsnapshot-1.4.4//t//backup_exec/conf/backup_exec_fail.conf
 hourly"));
--8<---cut here---end--->8---

Seems that it just call rsnapshot with some argument, let's do it manually:

--8<---cut here---start->8---
$ ./rsnapshot -c 
/tmp/guix-build-rsnapshot-1.4.4.drv-0/rsnapshot-1.4.4//t//backup_exec/conf/backup_exec.conf
 hourly
drwxr-xr-x   1 root root   16 06-05 15:11 /usr
hello world!
hello world!
Can't exec 
"/gnu/store/57xj5gcy1jbl9ai2lnrqnpr0dald9i65-coreutils-8.32/gnu/store/57xj5gcy1jbl9ai2lnrqnpr0dald9i65-coreutils-8.32/bin/true":
 No such file or directory at ./rsnapshot line 4427.

rsnapshot encountered an error! The program was invoked with these options:
./rsnapshot -c \

/tmp/guix-build-rsnapshot-1.4.4.drv-0/rsnapshot-1.4.4//t//backup_exec/conf/backup_exec.conf
 \
hourly

ERROR: get_retval() was passed -1, a number is required
--8<---cut here---end--->8---

It is the path to "true" which is wrong, it contains “/gun/store” twice:
« 
/gnu/store/57xj5gcy1jbl9ai2lnrqnpr0dald9i65-coreutils-8.32/gnu/store/57xj5gcy1jbl9ai2lnrqnpr0dald9i65-coreutils-8.32/bin/true
 ».
The configure script did not build that path properly by itself, maybe we can
specify it directly. If we have a look to the rsnapshot definition⁸ we see the
"check" phase modifying the path for those program; while the changelog
for 1.4.4⁹ say the added option for setting their paths « - Minor tidy up rel
configure options --with-test-(true|false). Refs #189 (#248) ».

Maybe removing our substitution will fix our build issue:
--8<---cut here---start->8---
@@ -526,15 +526,6 @@ rdiff-backup is easy to use and settings have sensible 
defaults.")
(modify-phases %standard-phases
  (replace 'check
(lambda _
- (substitute* '("t/cmd-post_pre-exec/conf/pre-true-post-true.conf"
-"t/backup_exec/conf/backup_exec_fail.conf"
-"t/backup_exec/conf/backup_exec.conf")
-   (("/bin/true") (which "true"))
-   (("/bin/false") (which "false")))
-
- ;; Disable a test that tries to connect to localhost on port 22.
- (delete-file "t/ssh_args/ssh_args.t.in")
-
  (invoke "make" "test"))
 (inputs
  `(("perl" ,perl)
--8<---cut here---end--->8---

Oh! It worked, nice! I'll push it later.

On 17 July, 2021

'guix reconfigure' fail to build 'rsnapshot'

2021-07-17 Thread Simon Josefsson via
Hi!  Since some time, 'guix reconfigure' on my machine fails:

building /gnu/store/chilbs792mqssmi726zmvff5zg49gija-provenance.drv...
building /gnu/store/9skvgwsl0vxccv5sbgvqimkhk3938v8y-rsnapshot-1.4.4.drv...
\ 'check' phasebuilder for 
`/gnu/store/9skvgwsl0vxccv5sbgvqimkhk3938v8y-rsnapshot-1.4.4.drv' failed with 
exit code 1
build of /gnu/store/9skvgwsl0vxccv5sbgvqimkhk3938v8y-rsnapshot-1.4.4.drv failed
View build log at 
'/var/log/guix/drvs/9s/kvgwsl0vxccv5sbgvqimkhk3938v8y-rsnapshot-1.4.4.drv.bz2'.
cannot build derivation 
`/gnu/store/a9kw0xkbx6wy0w893b4kzzrxh3a5lnx6-profile.drv': 1 dependencies 
couldn't be built
building 
/gnu/store/89hsi8xglfybbvrjrqf0zhkg546ahjyd-shepherd-console-font-tty1.scm.drv...
cannot build derivation 
`/gnu/store/mx5zqmx388ixzr55rzak59wfygpyn6fm-system.drv': 1 dependencies 
couldn't be built
guix system: error: build of 
`/gnu/store/mx5zqmx388ixzr55rzak59wfygpyn6fm-system.drv' failed
root@hamster ~# bzcat 
/var/log/guix/drvs/9s/kvgwsl0vxccv5sbgvqimkhk3938v8y-rsnapshot-1.4.4.drv.bz2|tail
 
  Failed test:  1
  Non-zero exit status: 1
t/cmd-post_pre-exec/cmd-post_pre-exec.t
(Wstat: 256 Tests: 4 Failed: 1)
  Failed test:  4
  Non-zero exit status: 1
Files=12, Tests=38,  3 wallclock secs ( 0.04 usr  0.01 sys +  1.51 cusr  0.23 
csys =  1.79 CPU)
Result: FAIL
Failed 2/12 test programs. 2/38 subtests failed.
make: *** [Makefile:938: test] Error 255
command "make" "test" failed with status 2
root@hamster ~# 

How can I fix this?  Is this something unique on my machine, or does it
indicate a bug in the packaging of 'rsnapshot'?  I'm not sure how to
proceed with debugging.

How come others haven't noticed this, aren't all packages built
centrally to make sure things build?

Thanks,
/Simon


signature.asc
Description: PGP signature


Re: Docker image sizes

2021-07-17 Thread Edouard Klein
Hi !

You can use guix graph to see what depends on what, and find out why a
specific dependency is needed:

https://guix.gnu.org/manual/en/html_node/Invoking-guix-graph.html

I just invoked:
guix graph elixir > /tmp/toto.dot

and by manually inspecting the dot file I can see that e.g. webkit is needed
by wxWidgets, whether you need those or not is up to you.

You can generate the visual graph with
dot -T pdf < /tmp/toto.dot > /tmp/toto.pdf

I'm looking at it right now, and I see that elixir depends on erlang and
git, and that git is pulling perl with it.

I doubt that's needed, so maybe you can create a new package
"lean-elixir", and forego the dependency on git somehow ? If you cut a
branch early in the DAG you may get huge returns on investment,
size-wise.


This may not be the best approach, maybe some wizards here will have
better ideas.

Cheers,

Edouard.
TJ writes:

> Hi,
>
> I was trying to package a project in docker and to start I did a fairly
> straightforward command:
>
> $ guix pack --format=docker elixir
>
> It generated an image quite a bit larger than I expected.
>
> -r--r--r--2 root  root  461M Dec 31  1969 
> gfnqg760z22vr8kbvyzdzhs1hc5766c9-elixir-docker-pack.tar.gz
>
> After uncompressing, this is taking 1.5GB and is including quite a few
> unnecessary packages for a minimal image - see below for the top 30.
>
> $ du -s * |sort -g -r | head -n 30
> 155804  g3idjpqsp2p2d163qfzskxj4k58nrx7f-llvm-11.0.0
> 145164  m59c9hj9d4n65maimbpmx2xq56d2mvqs-mesa-20.2.4
> 111708  q233v022vziq8ry18y8q959k110vclvf-webkitgtk-2.32.1
> 110840  cgqj7xswlpvhzxwri3mcqfs1fhbgnka8-erlang-23.2.1
> 103940  qk5v5vzwfl066zch67nxlv4x7aspf0fx-samba-4.13.4
> 93972   cw8brvxkzp4kmdqldsv1wkvi2cv4kq4x-python-3.8.2
> 64620   8zvc5mvk0xm3ygrxsgpyy5ilxb5rzjry-perl-5.30.2
> 56300   18hp7flyb3yid3yp49i6qcdq0sbi5l1n-guile-3.0.2
> 52748   nscar35x261xky08qih2ddxq1b105qwd-gtk+-3.24.24
> 41092   fa6wj5bxkj5ll1d7292a70knmyl7a0cr-glibc-2.31
> 39544   2wqjj3mkqdvsvksndr2hpjpi7qqwi7kr-icu4c-66.1
> 35848   fi1mdh30b5q6zvplvayn68lb575xcd1k-ghostscript-with-cups-9.52
> 34768   01b4w3m6mp55y531kyi1g8shh722kwqm-gcc-7.5.0-lib
> 34188   wjmydimw608k61qxmsifkam11jwgpric-wxwidgets-3.0.5.1
> 24224   jv6v8p8jbjf6hpscgp3dgdfylrdhldi1-gdk-pixbuf+svg-2.40.0
> 18488   n8awazyldv9hbzb7pjcw76hiifmvrpvd-coreutils-8.32
> 18464   57xj5gcy1jbl9ai2lnrqnpr0dald9i65-coreutils-8.32
> 16596   jsqxxnaj5p8a22mrsvl679gi7jl26z4j-glib-2.62.6
> 16400   aza259fsrb841zwb4rjzfzs2nrsf28f1-eudev-3.2.9
> 16060   9z185s19zp2p9yq8gdayxgibaphxfcps-cups-2.3.3
> 15604   4l2il4wcxjb443xwc2arwixpq28pbfvl-cups-minimal-2.3.3
> 14140   02z5vgdhgxw4gcjvhx51mvy1ax4lzxmp-fftwf-3.3.8
> 13912   zzkly5rbfvahwqgcs7crz0ilpi7x5g5p-ncurses-6.2
> 13096   lv92cmzqjpb8mxygpqdvh0mkkkfi9vmz-libxcb-1.14
> 10876   n3pjsbpd51x6vqikfglmrdbijflammf6-gst-plugins-base-1.18.2
> 10588   sayvymkqjl328rsivzlp9r46337rvdmz-pulseaudio-14.0
> 10084   7y3lvk3xf4im8n44337mc6y0ccysvfia-font-dejavu-2.37
> 9888hr1p9l1waam8lk2csdwbzaipf14h9n33-gstreamer-1.18.2
> 9576a45p39mgqvfd8kjwibyr0q42k1mw7gmf-util-linux-2.35.1-lib
> 8812z3vbqvpgcz7lag9qci074hjry4j3120i-shared-mime-info-1.15
>
> I wouldn't expect to need llvm, mesa, webkit, samba, python, perl, gtk, cups, 
> pulseaudio, etc, etc. in a production image.
>
> What would be the recommended way to minimize the derivation?
>
> Thanks,
>
> TJ




Docker image sizes

2021-07-17 Thread TJ


Hi,

I was trying to package a project in docker and to start I did a fairly
straightforward command:

$ guix pack --format=docker elixir

It generated an image quite a bit larger than I expected.

-r--r--r--2 root  root  461M Dec 31  1969 
gfnqg760z22vr8kbvyzdzhs1hc5766c9-elixir-docker-pack.tar.gz

After uncompressing, this is taking 1.5GB and is including quite a few
unnecessary packages for a minimal image - see below for the top 30.

$ du -s * |sort -g -r | head -n 30
155804  g3idjpqsp2p2d163qfzskxj4k58nrx7f-llvm-11.0.0
145164  m59c9hj9d4n65maimbpmx2xq56d2mvqs-mesa-20.2.4
111708  q233v022vziq8ry18y8q959k110vclvf-webkitgtk-2.32.1
110840  cgqj7xswlpvhzxwri3mcqfs1fhbgnka8-erlang-23.2.1
103940  qk5v5vzwfl066zch67nxlv4x7aspf0fx-samba-4.13.4
93972   cw8brvxkzp4kmdqldsv1wkvi2cv4kq4x-python-3.8.2
64620   8zvc5mvk0xm3ygrxsgpyy5ilxb5rzjry-perl-5.30.2
56300   18hp7flyb3yid3yp49i6qcdq0sbi5l1n-guile-3.0.2
52748   nscar35x261xky08qih2ddxq1b105qwd-gtk+-3.24.24
41092   fa6wj5bxkj5ll1d7292a70knmyl7a0cr-glibc-2.31
39544   2wqjj3mkqdvsvksndr2hpjpi7qqwi7kr-icu4c-66.1
35848   fi1mdh30b5q6zvplvayn68lb575xcd1k-ghostscript-with-cups-9.52
34768   01b4w3m6mp55y531kyi1g8shh722kwqm-gcc-7.5.0-lib
34188   wjmydimw608k61qxmsifkam11jwgpric-wxwidgets-3.0.5.1
24224   jv6v8p8jbjf6hpscgp3dgdfylrdhldi1-gdk-pixbuf+svg-2.40.0
18488   n8awazyldv9hbzb7pjcw76hiifmvrpvd-coreutils-8.32
18464   57xj5gcy1jbl9ai2lnrqnpr0dald9i65-coreutils-8.32
16596   jsqxxnaj5p8a22mrsvl679gi7jl26z4j-glib-2.62.6
16400   aza259fsrb841zwb4rjzfzs2nrsf28f1-eudev-3.2.9
16060   9z185s19zp2p9yq8gdayxgibaphxfcps-cups-2.3.3
15604   4l2il4wcxjb443xwc2arwixpq28pbfvl-cups-minimal-2.3.3
14140   02z5vgdhgxw4gcjvhx51mvy1ax4lzxmp-fftwf-3.3.8
13912   zzkly5rbfvahwqgcs7crz0ilpi7x5g5p-ncurses-6.2
13096   lv92cmzqjpb8mxygpqdvh0mkkkfi9vmz-libxcb-1.14
10876   n3pjsbpd51x6vqikfglmrdbijflammf6-gst-plugins-base-1.18.2
10588   sayvymkqjl328rsivzlp9r46337rvdmz-pulseaudio-14.0
10084   7y3lvk3xf4im8n44337mc6y0ccysvfia-font-dejavu-2.37
9888hr1p9l1waam8lk2csdwbzaipf14h9n33-gstreamer-1.18.2
9576a45p39mgqvfd8kjwibyr0q42k1mw7gmf-util-linux-2.35.1-lib
8812z3vbqvpgcz7lag9qci074hjry4j3120i-shared-mime-info-1.15

I wouldn't expect to need llvm, mesa, webkit, samba, python, perl, gtk, cups, 
pulseaudio, etc, etc. in a production image.

What would be the recommended way to minimize the derivation?

Thanks,

TJ