Re: Defining a toolchain with musl libc

2022-05-09 Thread David Arroyo
Hi Simon, thanks for your reply!

I must confess that I started this thread with an XY problem; my problem was 
with execline binaries segfaulting after I performed a pivot_root operation. I 
don't fully recall why, but I suspected the segfault occurred  when execv() 
tried to load and/or use a dynamic library. I was trying to verify this theory 
by statically linking execline and trying to reproduce the crash.

But since then there some updates to the glibc package and I cannot reproduce 
the issue anymore. I could try to go back with the time-machine and reproduce 
again but it's not urgent for me anymore.

On Mon, May 9, 2022, at 13:09, zimoun wrote:
> On Mon, 11 Apr 2022 at 22:34, "David Arroyo"  wrote:
> Maybe “guix graph --path” could help.  Well, maybe skalibs and/or
> execline retain a reference to bash or bash-minimal which probably drags
> glibc and gcc.

That is a nifty tool, I didn't know about the `--path` option. Unfortunately it 
didn't seem to work here, I tried the following from the root of my channel 
repo:

$ guix graph --path --type=bag-emerged -L $(pwd) -e '(@ (aqwari 
packages skaware) execline-musl-static)' glibc
guix graph: error: no path from 'execline-musl-static@2.8.1.0' to 
'glibc@2.33'

However, if I render the full `--type=bag-emerged` graph, massive as it is, 
glibc is clearly present and referenced by dozens of other nodes. There are too 
many edges for me to trace each one, but it looks like the path you predicted 
from execline -> bash-minimal -> glibc is there.

> Note that usually musl comes from a wrapper around gcc, named
> ’musl-gcc’.  It is specifically disabled by the musl package:
>
>#:configure-flags
>(list "--disable-gcc-wrapper")))
>
> I do not know why.  Maybe because at the time of commit
> ce728f70e5ef8783a28652e382c2c9f61c7b4c06, it was not necessary or maybe
> because the license of musl is incompatible with the one of GCC.

Newer versions of GCC actually have an `-mmusl` flag and allow for target
triplets include `-musl-`, which appear to accomplish something similar. In 
fact, in a separate project this G-expression worked well for compiling a 
single C file with musl, statically:

https://git.sr.ht/~droyo/guix-channel/tree/640fe1b4eabe9a3aaa4b532c0ed71e7abb74dae8/item/aqwari/namespace.scm#L288-299

> Well, I would take this path: rebuild a variant of musl with the wrapper
> and try to make a C toolchain using this wrapper.

This sounds like a reasonable approach. The only potential issue I see is this 
option in mus-gcc's spec file:

*link:
-dynamic-linker /lib/ld-musl-x86_64.so.1 -nostdlib %{shared:-shared} 
%{static:-static} %{rdynamic:-export-dynamic}

but I'm not producing dynamically linked binaries anyway. While this is not 
urgent for me anymore, I'm still interested and I will probably try this in the 
next few weeks.

> Maybe the package musl-cross could be interesting.

I will take a look. Initially I was put off because that package hard-codes its 
own gcc, linux headers, and binutils versions rather than tracking the common 
packages. But it could be good inspiration.

Thanks again!
David



Re: Defining a toolchain with musl libc

2022-05-09 Thread zimoun
Hi,

This sounds cool!


On Mon, 11 Apr 2022 at 22:34, "David Arroyo"  wrote:

>   $ out=$(guix build -L $(pwd) -e '(@ (aqwari packages skaware) 
> execline-musl)')
>   $ file $out/bin/fdmove
>   
> /gnu/store/82r5ilk3jir7cssmhc8bi87qqj46p29h-execline-2.8.1.0/bin/fdmove: ELF 
> 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, 
> interpreter 
> /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33/lib/ld-linux-x86-64.so.2,
>  for GNU/Linux 2.6.32, not stripped
>   
>   $ guix gc --requisites $out
>   /gnu/store/720rj90bch716isd8z7lcwrnvz28ap4y-bash-static-5.1.8
>   /gnu/store/hxxbjrm4iw6aj203zli6hj4ds1l27s3k-skalibs-2.11.0.0
>   /gnu/store/5h2w4qi9hk1qzzgi1w83220ydslinr4s-glibc-2.33
>   /gnu/store/4y5m9lb8k3qkb1y9m02sw9w9a6hacd16-bash-minimal-5.1.8
>   /gnu/store/094bbaq6glba86h1d4cj16xhdi6fk2jl-gcc-10.3.0-lib
>   /gnu/store/82r5ilk3jir7cssmhc8bi87qqj46p29h-execline-2.8.1.0
>
> I don't know how gcc and glibc ended up in there. I tried reading the
> code, but I am not familiar enough with it to follow it yet. I think
> they may get added as implicit inputs by gnu-build-system, and I might
> not be using the package-input-rewriting transform correctly.

Maybe “guix graph --path” could help.  Well, maybe skalibs and/or
execline retain a reference to bash or bash-minimal which probably drags
glibc and gcc.

But that does not explain the “dynamically linked“ above.


> On my second try, I tried to create a GCC+musl toolchain and use that
> I tried to create a toolchain like so:
>
>   (define my-toolchain (make-gcc-toolchain gcc musl))

[...]

>   (package-with-c-toolchain hello my-toolchain)
>
> This rebuilds the musl package, and gets to the 'patch-source-shebangs
> phase of the gcc rebuild, where it fails with the error:

[...]

> Throw to key `encoding-error' with args `("scm_to_stringn" "cannot convert 
> narrow string to output locale" 84 #f #f)'.
> builder for 
> `/gnu/store/vnysv6hbb8zwyy8jawy1ayd2nfv38l4y-gcc-musl-1.2.2-10.3.0.drv' 
> failed with exit code 1
> build of 
> /gnu/store/vnysv6hbb8zwyy8jawy1ayd2nfv38l4y-gcc-musl-1.2.2-10.3.0.drv failed
> View build log at 
> '/var/log/guix/drvs/vn/ysv6hbb8zwyy8jawy1ayd2nfv38l4y-gcc-musl-1.2.2-10.3.0.drv.bz2'.

Well, I do not know if GCC needs some locales from Glibc to build.  It
is rebuilt because,

--8<---cut here---start->8---
(define* (make-gcc-toolchain gcc
[...]
  (let ((gcc (if libc (make-gcc-libc gcc libc) gcc))
--8<---cut here---end--->8---

where ’make-gcc-libc’ is defined in (gnu packages base).  Therefore, it
is probably not straightforward to use ’make-gcc-toolchain’ with musl as
libc.

Note that usually musl comes from a wrapper around gcc, named
’musl-gcc’.  It is specifically disabled by the musl package:

   #:configure-flags
   (list "--disable-gcc-wrapper")))

I do not know why.  Maybe because at the time of commit
ce728f70e5ef8783a28652e382c2c9f61c7b4c06, it was not necessary or maybe
because the license of musl is incompatible with the one of GCC.

Well, I would take this path: rebuild a variant of musl with the wrapper
and try to make a C toolchain using this wrapper.

Maybe the package musl-cross could be interesting.


Cheers,
simon



How do you debug a channel?

2022-05-09 Thread Wil deBeest
Hi!
Something in my `local' channel causes this error when I execute `guix pull':

building /gnu/store/blb4jxbhdckbpcqf46yk74jrml1ds7wy-local.drv...
-builder for `/gnu/store/blb4jxbhdckbpcqf46yk74jrml1ds7wy-local.drv' failed to 
produce output path `/gnu/store/2klsbdwip925viqv5q8qla4zvnjqqr1i-local'
build of /gnu/store/blb4jxbhdckbpcqf46yk74jrml1ds7wy-local.drv failed
Could not find build log for 
'/gnu/store/blb4jxbhdckbpcqf46yk74jrml1ds7wy-local.drv'.
cannot build derivation 
`/gnu/store/7q1pb80q9jf2rpx40zpz2lklk6v5yvy7-profile.drv': 1 dependencies 
couldn't be built
guix pull: error: build of 
`/gnu/store/7q1pb80q9jf2rpx40zpz2lklk6v5yvy7-profile.drv' failed


I tried another pull with the `keep-failed' and `keep-going' flags added & 
`verbose' and `debug' set to 7*, piping the output through `tee' in the hope of 
having a complete log, but the file ended up empty.  The part I could copy from 
the terminal was rejected as spam by paste.debian.net, so I appended it to this 
mail.

Removing more and more packages from the channel until there wasn't any file 
left didn't help.  `guix pull' worked again only after removing the channel 
itself.

Any ideas what might be wrong or how to find out more?


Cheers!
Bo


* What levels are there?  I couldn't find the answer in 
`guix.git/guix/scripts/pull.scm'



|   |   building of 
`/gnu/store/yfig30krw0mnh6kwn1z7z6jkjnph3yr4-module-import-compiled.drv': init
|   |   building of 
`/gnu/store/yfig30krw0mnh6kwn1z7z6jkjnph3yr4-module-import-compiled.drv': 
loading derivation
|   |   acquiring write lock on `/var/guix/temproots/6626'
|   |   downgrading to read lock on `/var/guix/temproots/6626'
|   |   acquiring write lock on `/var/guix/temproots/6626'
|   |   downgrading to read lock on `/var/guix/temproots/6626'
|   |   substitution of 
`/gnu/store/ckf3mxanybfv6rbqysahpsa3p46f6g1m-module-import-compiled': created
|   |   substitution of 
`/gnu/store/ckf3mxanybfv6rbqysahpsa3p46f6g1m-module-import-compiled': woken up
|   |   building of 
`/gnu/store/5sjh4grn2g5sypzllcyxcp3qwv8awg0h-module-import.drv': init
|   |   building of 
`/gnu/store/5sjh4grn2g5sypzllcyxcp3qwv8awg0h-module-import.drv': loading 
derivation
|   |   acquiring write lock on `/var/guix/temproots/6626'
|   |   downgrading to read lock on `/var/guix/temproots/6626'
|   |   acquiring write lock on `/var/guix/temproots/6626'
|   |   downgrading to read lock on `/var/guix/temproots/6626'
|   |   building of 
`/gnu/store/5sjh4grn2g5sypzllcyxcp3qwv8awg0h-module-import.drv': all outputs 
substituted (maybe)
|   |   building of `/gnu/store/35np5f5gdsl6qayp45d7368bac08hyq3-git.scm.drv': 
created
|   |   acquiring write lock on `/var/guix/temproots/6626'
|   |   downgrading to read lock on `/var/guix/temproots/6626'
|   |   building of `/gnu/store/35np5f5gdsl6qayp45d7368bac08hyq3-git.scm.drv': 
woken up
|   |   building of 
`/gnu/store/7vnql8i8z3b7q9xkp28wdxd632sxjbbb-guile-3.0.7.drv': created
|   |   acquiring write lock on `/var/guix/temproots/6626'
|   |   downgrading to read lock on `/var/guix/temproots/6626'
|   |   building of 
`/gnu/store/7vnql8i8z3b7q9xkp28wdxd632sxjbbb-guile-3.0.7.drv': woken up
|   |   building of 
`/gnu/store/j9jhim8y26kvzhll5dnpxdd0fjspls2a-config.scm.drv': created
|   |   acquiring write lock on `/var/guix/temproots/6626'
|   |   downgrading to read lock on `/var/guix/temproots/6626'
|   |   building of 
`/gnu/store/j9jhim8y26kvzhll5dnpxdd0fjspls2a-config.scm.drv': woken up
|   |   building of `/gnu/store/sywnigcng0jqc1lwcvy7g9aakcdxawy1-hash.scm.drv': 
created
|   |   acquiring write lock on `/var/guix/temproots/6626'
|   |   downgrading to read lock on `/var/guix/temproots/6626'
|   |   building of `/gnu/store/sywnigcng0jqc1lwcvy7g9aakcdxawy1-hash.scm.drv': 
woken up
|   |   substitution of 
`/gnu/store/17fi3vg87j1lw9ygy3pcjf3pmpi79vkg-records.scm': created
|   |   substitution of 
`/gnu/store/17fi3vg87j1lw9ygy3pcjf3pmpi79vkg-records.scm': woken up
|   |   substitution of `/gnu/store/1f2frr4fcdb8gib7x3akr6vz3562g73v-i18n.scm': 
created
|   |   substitution of `/gnu/store/1f2frr4fcdb8gib7x3akr6vz3562g73v-i18n.scm': 
woken up
|   |   substitution of 
`/gnu/store/1n4yp3f1gfzixq6rzhn07glr5kxcfrpk-diagnostics.scm': created
|   |   substitution of 
`/gnu/store/1n4yp3f1gfzixq6rzhn07glr5kxcfrpk-diagnostics.scm': woken up
|   |   substitution of 
`/gnu/store/1qgssicbsibn03a5bhdx591jmpraxhnw-grafts.scm': created
|   |   substitution of 
`/gnu/store/1qgssicbsibn03a5bhdx591jmpraxhnw-grafts.scm': woken up
|   |   substitution of 
`/gnu/store/2kw5wrnpisgwf30cxgav3xdjcwgd81nk-trivial.scm': created
|   |   substitution of 
`/gnu/store/2kw5wrnpisgwf30cxgav3xdjcwgd81nk-trivial.scm': woken up
|   |   substitution of 
`/gnu/store/315axnaqf07pzkd1iqvmhc64xi2wjy1a-utils.scm': created
|   |   substitution of 
`/gnu/store/315axnaqf07pzkd1iqvmhc64xi2wjy1a-utils.scm': woken up
|   |   substitution of 
`/gnu/store/35h3vchibsm1gh1rmq8q24c6akm2sw4x-module-import-builder': created
|   |   substitution of 

Re: how can I find the terminal output

2022-05-09 Thread Gottfried

Dear Guixers,

thank you very much for your patience and infos, Simon and Kyle,

now I understand how script works and I can use it.
Thanks also for mentioning tealdeer.That's great, exactly what I need, 
examples of usage.


I still have trouble to understand the man pages. I am not a hacker or 
programmer and am not using the commandline on a daily basis. So I am 
still "hacking" on the basis. I am not used to understanding the 
programmers language yet. I am learning day by day.


Gottfried


Am 09.05.22 um 13:42 schrieb Kyle:

I have never used the command script, but I thought you might benefit from installing the 
tldr utility: whose name is short for "too long didn't read" It gives examples 
instead of all the unwanted details that man pages throw at you first even though they 
don't make a lick of sense without the right background knowledge and perspective. There 
are many implementations, but I like tealdeer.

   guix install tealdeer

Then type:

   tldr script

That produces a few examples for me.


On May 7, 2022 11:42:28 AM EDT, zimoun  wrote:

Hi,

On Fri, 06 May 2022 at 20:18, Gottfried  wrote:


How do I have to use "script"?


Only you can answer. ;-)  The question is: what is your needs?  Do you
need to record and track the output for each command?

Personally, I only do that for the very rare cases when I am demoing.
Otherwise, I only redirect the output of a command to a file using ’>’.



Do I have to enter "script" in the terminal before I start other
commands, so that it will start to log my shell?


Yes.


or can I, after a command with output, enter "script" and it will log my
output in a file typescript?


No.

However, you can redo the same command to append the output to a
previous ’typescript’.  For instance, in your terminal:

ls
script
ls
exit
pwd
script -a
cd /tmp/
ls
pwd
exit

Then the file ’typescript’ contains the session (input and output)
between ’script’ and ’exit’ (included).  Therefore, the first ’pwd’ will
be not recorded.




I tried several times, but it didn't work. It didn't record anything,
when I opened the file typescript.

So can you show me an example how to use it?
What Options are useful?


Well, have you read the manpage of ’script’?  Type ’man script’.


Hope that helps,
simon






--
()  ascii ribbon campaign - against html e-mail
/\  www.asciiribbon.org   - against proprietary attachments

Why is HTML email a security nightmare? See https://useplaintext.email/

Please avoid sending me MS-Office attachments.
See http://www.gnu.org/philosophy/no-word-attachments.html


OpenPGP_0x61FAF349C9FB7F94.asc
Description: OpenPGP public key


OpenPGP_signature
Description: OpenPGP digital signature


Re: D compiler installation ldc failed

2022-05-09 Thread zimoun
Hi,

On Fri, 29 Apr 2022 at 11:54, Martin Michel  wrote:

> guix install: error: build of 
> `/gnu/store/gnc9jbwxwbplvpygb276p5fkp3q1l7v2-dub-1.7.2.drv' failed

Thanks for the report.

This web page [1] provides a clue.

1: 



Indeed, this first commit (6dffced0) failing is a merge.

--8<---cut here---start->8---
6dffced09ecda024e0884e352778c221ad066fd6
Author: Maxim Cournoyer 
AuthorDate: Mon Dec 13 16:29:21 2021 -0500
Commit: Maxim Cournoyer 
CommitDate: Mon Dec 13 16:29:21 2021 -0500

Parent: b603554ed0 gnu: emacs-geiser-guile: Update to 0.19.
Parent: e3196755e6 gnu: Further simplify package inputs.
Follows:v1.3.0 (12212)

Merge branch 'core-updates-frozen' into 'master'.

At last!

865 files changed, 88327 insertions(+), 84591 deletions(-)
--8<---cut here---end--->8---

This introduces a regression for the package ’dub’.

Find exactly which commit introduces the failure could be tricky using
regular bisect with good as b603554e and bad as e3196755e6 since the
history is quite complex and many substitutes are not available.

Moreover, even after burning some CPU, for many commits in this range,
Guix is simply not able to pull (or to ’guix time-machine --commit=’).
Well, ’git bisect’ says it could be any of 154 commits (see below) –
using this snippet:

--8<---cut here---start->8---
$ cat bisect.sh

ci=$(git log --format="%H" -1)
if guix time-machine --commit=$ci -- help ;then
guix time-machine --commit=$ci \
 -- build dub --no-grafts
exit $?
else
exit 125
fi

$ git bisect start
$ git bisect good 8d27e6a7
$ git bisect bad  e3196755e6
$ git bisect run ./bisect.sh
--8<---cut here---end--->8---


Well, the error message is:

--8<---cut here---start->8---
starting phase `build'
./build.sh: line 45: git: command not found
Could not determine a version with git.
Using existing version file.
Running ldmd2...
source/dub/semver.d(107): Deprecation: Usage of the `body` keyword is 
deprecated. Use `do` instead.
--8<---cut here---end--->8---

and I guess this ’ldmd2’ comes from the ’ldc’ package.  Therefore, let
consider,

--8<---cut here---start->8---
$ git log --grep=ldc --oneline -1
5a1ddd146b gnu: ldc: Update to 1.27.1.
--8<---cut here---end--->8---

and this commit is part of the “skipped” commits (see below).


BTW, note that ’rdmd’ is also broken.  Well, both ’dub’ and ’rdmd’ would
deserve an update.  But it implies to unknot some D packages bootstrap.



Note that the parent b603554ed0 builds fine.  So, waiting a complete
fix, you can still use:

guix time-machine --commit=b603554ed0 -- install dub ldc


Cheers,
simon



The first bad commit could be any of:
7b5824f1a77f02016639aeee72538b5d39d397e3
2e2c6482c9d02fe456df8a0d3d35612f6f61ba64
a248421cbdd27730f436c76aefe322b3091d88b6
68ce9c38848982b53b41d1c6bb44eafb78d981b9
e976789754c0af63aef4acea18971c9f41ed2826
df20439d442759473579323d62fd2eb566d849e6
fa3878f0606818a2108a2f16fa155308044995b8
175018f162b5d24d1e0530ed5d8812a123c9cccd
8f78f61c029bb45c39fa782f8ac2c6962e44cdab
4a43e64b41e51f906258e0a2f238adbd6dcaed7e
b8324050ada78a6da96717aee972ceddaa77e528
33c7e1834739da8905aecd09fa44c8744bf7d773
fdae245a753d77a8266764fdcc8e11434a57d046
12b9810ede8795ff633145ccec4dd99482865cd8
86528cab04b16a4fbc3e81368b4cd405e85a4c8e
a0bf66ab9432675f86095d9a2533d7b80f58a668
a4ad0187d38325531b02062b46c552d1a52511bd
c60449434bf64d42ba5c2de456823448088d3573
daf54a3953e807d46c4c21bbc709879c6e8d31e8
000291fd4325d2afd1f9f93125986275f6e7ab7a
33b28e9553435a58f8e34c785ff3fd451165b634
222b461878179dbe3b5fdce8cb59cf6841579df7
feab09f72abc6d6eec16a1b8d27c231c747c0e00
831c08d8f263f476e0293f8a5422e7314a159c91
b9595a7659e5695faf4b0948ee48beb2aa913cf3
20e3dd052d7e4f59273e3646d3533d43c87c30b0
2fc08ccde4e134ccbbf7c1182165015d92712bbd
5a1ddd146bfd6cd874d0617872fe45148832113b
e0d9c3798229b041072e39dde1048bb02f1bfbcc
00bd5d3e4f05b73dfe0f5838823483349ae4ff3f
7541598fe28b93453814e19e52a778779717dc1b
00c78f8dbcfeee1bbfdace72f0cc73e8b2035929
35b91ada739e08d7ef3be130a5af5955195055b4
5f818705b4527f8aaae411d25b6f0cd55021614d
daa46cd151657ac4df991bf6651d46aae739fcef
06d2227e7eb2c45709a23a5b81f43dd6249f2399
879252e234f501bd18a63eb3c23a0bb370d72244
7137befc4388031a57eb52b338b049c0a66eed0f
d2fffa79863745e8be7c6ce8a720ba0839aa3a25
a46b8bbfabc0ebf4a476fbeae4066c8c94b6a45f
bc4f219ba472559b5d54e9262589fd9a83b4edaf
26457b40faa30d61a5cbe616ca355b5a0da41cf0
c6f3cb5f03e74c54e6dda527045aec91d70feb4e
4621cd7b8db00fd8230c8c5e51929f926aaf3795
f7d88cd4707eeaf02f9b854f05803d8d0428f670
698e6f17bb448c36fa7efdb2d24175078716c339
bcfff754ff4e7a9084868a0910540eb6a82f881f
22ebc35efd97b7745b0afbbe10ded80c52ca7dcb

Re: Questions regarding substitutes with debug output

2022-05-09 Thread zimoun
Hi,

On Mon, 09 May 2022 at 15:33, Ricardo Wurmus  wrote:

>> Indeed.  Where %my-channels would refer to a channels.scm file, right?
>
> A list of channels rather than a file.

Do yo mean

(define %my-channels
  (read-this-channel-file "path/to/one-channels-file.scm"))

(with-channels %my-channels
  (package …))

?


>> What seems still missing is a way to select these variants from the
>> channel.
>>
>> I am proposing to somehow add a field to ’properties’.  WDYT?
>
> Can we not infer this when adding package modules to the load path?

It depends on you walk the packages list.  I agree that it should be
done automatically at “guix pull” time (or at inferior time).

> Doing this once per channel seems better than having channel maintainers
> add this to every package.

I agree.


Cheers,
simon



Re: docker containers stop when doing guix install

2022-05-09 Thread Remco van 't Veer


2022/05/09 15:39, zimoun:

> Hi,
>
> On Mon, 09 May 2022 at 12:04, Remco van 't Veer  wrote:
>
>> Outside in the guix installation which runs the docker service defined
>> using:
>>
>>   (service docker-service-type)
>
> [...]
>
>> The docker images are images like "postgres:10.10" taken from docker hub
>> so nothing special.  It seems the docker-services sends signals to
>> process running in managed containers and some of those process stop?
>
> It is not easy to connect the dots. :-)
>
> IIUC, you are running Guix System and using the ’docker-service-type’.
> Right?

Yes.

> You have several Docker images running.  This images are launched via
> the ’docker-service-type’, right?

Yes.

> Unrelated to Docker, when you run one Guix subcommand as “guix install”
> or “guix pull”, then the some Docker images are stopped as the ones
> containing mysql or postgres, whereas the other containing an
> elasticsearch still runs.  Right?

Guix install, shell or pull.  And yes, some are stopped but some (for
instance elasticsearch) still run.

> Could you be precise on which containers downloaded from where are
> working and which containers downloaded from where are stopped?
>
> Other said, how can I reproduce the bug?

As follows:

  $ docker ps
  CONTAINER ID  IMAGE   COMMAND  CREATED STATUS 
   PORTS NAMES
  $ docker run -d postgres:10.10
  ..
  2b52ee072b1f5584cae597afb033cdcc0e560bbe9145b17b41502c204034e60b
  $ docker ps
  CONTAINER ID  IMAGE   COMMAND  CREATED STATUS 
   PORTS NAMES
  2b52ee072b1f  postgres:10.10  "docker-entrypoint.s…"  2 seconds ago   Up 1 
seconds  5432/tcp  blah_blah
  $ guix shell xeyes -- xeyes
  substitute: updating substitutes from 'https://ci.guix.gnu.org'... 100.0%
  0.0 MB will be downloaded
   xeyes-1.1.2  11KiB   
613KiB/s 00:00 [##] 100.0%
  The following derivation will be built:
/gnu/store/xc002hxl4g8mskqmpm0grsk8s45m91gz-profile.drv

  applying 4 grafts for xeyes-1.1.2 ...
  building CA certificate bundle...
  listing Emacs sub-directories...
  building fonts directory...
  building directory of Info manuals...
  building profile with 1 package...
  $ docker ps
  CONTAINER ID  IMAGE   COMMAND  CREATED STATUS 
   PORTS NAMES
  $ exit

First we see no docker containers are running, then we start postgres-10
from docker hub, now we see its container is running, then we do
something using guix-shell on an application *not already available on
this system*, now the container died.  This does not work the second
time when the "derivation" is already "built".

Weird huh?

Cheers,
Remco



Re: docker containers stop when doing guix install

2022-05-09 Thread zimoun
Hi,

On Mon, 09 May 2022 at 12:04, Remco van 't Veer  wrote:

> Outside in the guix installation which runs the docker service defined
> using:
>
>   (service docker-service-type)

[...]

> The docker images are images like "postgres:10.10" taken from docker hub
> so nothing special.  It seems the docker-services sends signals to
> process running in managed containers and some of those process stop?

It is not easy to connect the dots. :-)

IIUC, you are running Guix System and using the ’docker-service-type’.
Right?

You have several Docker images running.  This images are launched via
the ’docker-service-type’, right?

Unrelated to Docker, when you run one Guix subcommand as “guix install”
or “guix pull”, then the some Docker images are stopped as the ones
containing mysql or postgres, whereas the other containing an
elasticsearch still runs.  Right?

Could you be precise on which containers downloaded from where are
working and which containers downloaded from where are stopped?

Other said, how can I reproduce the bug?


Cheers,
simon



Re: Questions regarding substitutes with debug output

2022-05-09 Thread Ricardo Wurmus


zimoun  writes:

> Hi,
>
> On Fri, 29 Apr 2022 at 22:08, Ricardo Wurmus  wrote:
>
 (with-channels %my-channels
   (package
 (name "yay")
 …
 (inputs
   (list foo bar baz)) ;these are all looked up in %my-channels
>
> [...]
>
>> We already have all the tools for WITH-CHANNELS — that’s (guix
>> inferior).  We just don’t have a convenient syntax to do this without a
>> lot of boilerplate.
>
> Indeed.  Where %my-channels would refer to a channels.scm file, right?

A list of channels rather than a file.

> What seems still missing is a way to select these variants from the
> channel.
>
> I am proposing to somehow add a field to ’properties’.  WDYT?

Can we not infer this when adding package modules to the load path?
Doing this once per channel seems better than having channel maintainers
add this to every package.

-- 
Ricardo



Re: Questions regarding substitutes with debug output

2022-05-09 Thread zimoun
Hi,

On Fri, 29 Apr 2022 at 22:08, Ricardo Wurmus  wrote:

>>> (with-channels %my-channels
>>>   (package
>>> (name "yay")
>>> …
>>> (inputs
>>>   (list foo bar baz)) ;these are all looked up in %my-channels

[...]

> We already have all the tools for WITH-CHANNELS — that’s (guix
> inferior).  We just don’t have a convenient syntax to do this without a
> lot of boilerplate.

Indeed.  Where %my-channels would refer to a channels.scm file, right?

However, as Olivier mentioned it, Guix commonly uses package name and
version to refer to concrete defined packages; where the channel origin
is not in the picture.

Therefore, we generally add a string to the package name or version if a
channel creates a variant for this very same package name and version.
Otherwise it becomes hard to find back such variant.

This hypothetical ’with-channel’ would ease to create new variants.

What seems still missing is a way to select these variants from the
channel.

I am proposing to somehow add a field to ’properties’.  WDYT?


Cheers,
simon



Re: how can I find the terminal output

2022-05-09 Thread Kyle
I have never used the command script, but I thought you might benefit from 
installing the tldr utility: whose name is short for "too long didn't read" It 
gives examples instead of all the unwanted details that man pages throw at you 
first even though they don't make a lick of sense without the right background 
knowledge and perspective. There are many implementations, but I like tealdeer.

  guix install tealdeer

Then type:

  tldr script

That produces a few examples for me.


On May 7, 2022 11:42:28 AM EDT, zimoun  wrote:
>Hi,
>
>On Fri, 06 May 2022 at 20:18, Gottfried  wrote:
>
>> How do I have to use "script"?
>
>Only you can answer. ;-)  The question is: what is your needs?  Do you
>need to record and track the output for each command?
>
>Personally, I only do that for the very rare cases when I am demoing.
>Otherwise, I only redirect the output of a command to a file using ’>’.
>
>
>> Do I have to enter "script" in the terminal before I start other 
>> commands, so that it will start to log my shell?
>
>Yes.
>
>> or can I, after a command with output, enter "script" and it will log my 
>> output in a file typescript?
>
>No.
>
>However, you can redo the same command to append the output to a
>previous ’typescript’.  For instance, in your terminal:
>
>ls
>script
>ls
>exit
>pwd
>script -a
>cd /tmp/
>ls
>pwd
>exit
>
>Then the file ’typescript’ contains the session (input and output)
>between ’script’ and ’exit’ (included).  Therefore, the first ’pwd’ will
>be not recorded.
>
>
>
>> I tried several times, but it didn't work. It didn't record anything, 
>> when I opened the file typescript.
>>
>> So can you show me an example how to use it?
>> What Options are useful?
>
>Well, have you read the manpage of ’script’?  Type ’man script’.
>
>
>Hope that helps,
>simon
>


Re: Seeking suggestions for fixing the R gpg package

2022-05-09 Thread Kyle
Thanks so much, that worked! It was not at all clear to me that such a 
dependency existed or that if it did it would not already be encapsulated by 
GPGME itself. 



On May 6, 2022 4:56:00 AM EDT, zimoun  wrote:
>Hi,
>
>On Thu, 05 May 2022 at 13:37, Kyle Andrews  wrote:
>
>> (propagated-inputs (list r-askpass r-curl))
>> (native-inputs (list pkg-config r-knitr gpgme))
>
>[...]
>
>> 8<-
>> Error: package or namespace load failed for ‘gpg’:
>
>I have looked at all the details, but ’gpg’ seems required, no?
>
>Maybe try to add it as native-inputs.
>
>
>Cheers,
>simon


Re: docker containers stop when doing guix install

2022-05-09 Thread Remco van 't Veer
Hi,

2022/05/09 11:01, zimoun:

> On Thu, 28 Apr 2022 at 10:22, Remco van 't Veer  wrote:
>> Why are (some) running docker containers stopped when doing guix install
>> or other guix operations like pull?  I noticed this happing to mysql and
>> postgres containers but an elasticsearch container just keeps running.
>>
>> Is stopping containers on guix actions on purpose and, if so, why?  Why
>> aren't all containers stopped?
>
> Where is “guix pull”?  Outside or inside the container?  Is Guix
> managing the containers or other tools?

Outside in the guix installation which runs the docker service defined
using:

  (service docker-service-type)

> The issue seems to come from how the containers are managed so the
> answer of “why” would probably be somewhere in the configuration
> files. ;-)

The docker images are images like "postgres:10.10" taken from docker hub
so nothing special.  It seems the docker-services sends signals to
process running in managed containers and some of those process stop?

Cheers,
R.



Re: docker containers stop when doing guix install

2022-05-09 Thread zimoun
Hi,

On Thu, 28 Apr 2022 at 10:22, Remco van 't Veer  wrote:
> Why are (some) running docker containers stopped when doing guix install
> or other guix operations like pull?  I noticed this happing to mysql and
> postgres containers but an elasticsearch container just keeps running.
>
> Is stopping containers on guix actions on purpose and, if so, why?  Why
> aren't all containers stopped?

Where is “guix pull”?  Outside or inside the container?  Is Guix
managing the containers or other tools?

The issue seems to come from how the containers are managed so the
answer of “why” would probably be somewhere in the configuration
files. ;-)

Cheers,
simon



Re: using dpkg-deb in a Guix package definition

2022-05-09 Thread zimoun
Hi,

On Sat, 30 Apr 2022 at 11:48, Benjamin Slade  wrote:

> I've been using this package [
> 
> ] from Nix on top of Guix System, but I'd like to create my own Guix
> package for it instead. Are there any good examples of writing a Guix
> package definition using dpkg? 

I do not know what is «this package». :-)

Well, if by using ’dpkg’ you mean reuse the binary inside a .deb
archive, then no, not good examples.  Guix tries hard to build from
source.

For your curiosity, you could give a look at the ’copy-build-system’;
maybe that could fit your needs.


Cheers,
simon