Why bash-minimal is part of sbcl package

2023-12-10 Thread Pan Xie

Hello

I find this interesting thing but I don't have an explanation. When 
query the "references" of my Gnu Store item "sbcl", it shows that sbcl 
references bash-mininal, as the following output shows:


# guix gc --references /gnu/store/sbbp9nvslqcf3bmcnz5wgxf2qpsi757
/gnu/store/6ncav55lbk5kqvwwflrzcr41hp5jbq0c-gcc-11.3.0-lib
/gnu/store/ln6hxqjvz6m9gdd9s97pivlqck7hzs99-glibc-2.35
/gnu/store/mzx7j93w5szyzrgnql8dqhqdgjh6si02-mpfr-4.2.0
/gnu/store/nl194qnq5lhjxpfwcs15xqihnfqif335-zstd-1.5.2-lib
/gnu/store/sbbp9nvslqcf3bmcnz5wgxf2qpsi757i-sbcl-2.3.7
/gnu/store/v9p25q9l5nnaixkhpap5rnymmwbhf9rp-bash-minimal-5.1.16
/gnu/store/ybadavwz1z9kmxanqy3siw38lnkwnkrp-gmp-6.2.1

However when I look into sbcl's package definition, there is no 
bash-minimal as its input. I can use guix graph find a path from sbcl to 
bash-minimal:


# guix graph --path sbcl bash-minimal
sbcl@2.3.7
texlive-updmap.cfg@66594
texlive-scheme-basic@66594
texlive-collection-basic@66594
texlive-bin@20230313
cairo@1.16.0
bash-minimal@5.1.16

bash-minimal is indeed one of cairo's package input. However cairo also 
has inputs like ghostscript and libspectre, which sbcl does not reference.


"guix size sbcl" also reports bash-minimal is part of sbcl package, and 
"guix pack sbcl" will include bash-minimal in its final tarball.


So the question is, which part of sbcl's package definition tells Guix 
it need to add bash-minimal as part of sbcl? Is there a practical method 
to figure that out?





How to find a package file from substitute servers

2023-12-20 Thread Pan Xie

Hello

I ask this question because I encounter a very mundane problem: I want
to use the `at' command on my GuixSD system.

Like what I always do on Archlinux, the first step is to find out which
package includes the `at' command:

#+begin_example
pacman -Fx bin/at$
usr/bin/at is owned by extra/at 3.2.5-2
#+end_example

Then I'll install the package, and so on.

Unfortunately, I can't find a way to do the similar thing on GuixSD. I
know there is a “guix locate” to find files from store items, but
those store items must be already present in my gnu store.

So how to query such informations from a substitute server? Will Guix
plan to add a package file database in the future?

Thanks

Pan




Mandb does not include guix package man pages

2024-03-12 Thread Pan Xie

Hello

I find this issue on both GuixSD and guix package manager on ArchLinux. 
The problem is `man -k' can not find manpages installed by guix. I 
believe the issue is caused by `mandb' does not include guix packages' 
man pages when generating its index database.


Confirm sbcl is installed:
#+begin_example
[0]:root@guix03:~# guix package -I | grep sbcl
sbcl  2.4.0       out 
/gnu/store/093cjg5472s8j8hjzi2as61cs4w3lwrf-sbcl-2.4.0

#+end_example

"man -k" can't find sbcl from its index database. But `manpath' has
the correct setting, thus `man -w' can locate the man page file
#+begin_example
[0]:root@guix03:~# man -k sbcl
sbcl: nothing appropriate.

[16]:root@guix03:~# man -w sbcl
/gnu/store/093cjg5472s8j8hjzi2as61cs4w3lwrf-sbcl-2.4.0/share/man/man1/sbcl.1.gz

[0]:root@guix03:~# manpath
/root/.guix-profile/share/man:/run/current-system/profile/share/man:/gnu/store/gjsxzcc0gqpz4lpbsrbidlnn5ij1lfm1-gzip-1.12/share/man:/gnu/store/g4wn6n3frwnjsay098mqgy046wxl4iym-coreutils-9.1/share/man
#+end_example

"MANPATH" environment variable is empty
#+begin_example
[0]:root@guix03:~# echo $MANPATH
#+end_example

Use `mandb' update the index database, with debug output
#+begin_example
[0]:root@guix03:~# mandb -d
From the config file 
/gnu/store/w427xcp2628gg2wcxivvccw2pm2ijjk9-man-db-2.11.1/etc/man_db.conf:

  Mandatory mandir `/usr/man'.
  Mandatory mandir `/usr/share/man'.
  Mandatory mandir `/usr/local/share/man'.
  Path `/bin' mapped to mandir `/usr/share/man'.
  Path `/usr/bin' mapped to mandir `/usr/share/man'.
  Path `/sbin' mapped to mandir `/usr/share/man'.
  Path `/usr/sbin' mapped to mandir `/usr/share/man'.
  Path `/usr/local/bin' mapped to mandir `/usr/local/man'.
  Path `/usr/local/bin' mapped to mandir `/usr/local/share/man'.
  Path `/usr/local/sbin' mapped to mandir `/usr/local/man'.
  Path `/usr/local/sbin' mapped to mandir `/usr/local/share/man'.
  Path `/usr/X11R6/bin' mapped to mandir `/usr/X11R6/man'.
  Path `/usr/bin/X11' mapped to mandir `/usr/X11R6/man'.
  Path `/usr/games' mapped to mandir `/usr/share/man'.
  Path `/opt/bin' mapped to mandir `/opt/man'.
  Path `/opt/sbin' mapped to mandir `/opt/man'.
  Global mandir `/usr/man', catdir `/var/cache/man/fsstnd'.
  Global mandir `/usr/share/man', catdir `/var/cache/man'.
  Global mandir `/usr/local/man', catdir `/var/cache/man/oldlocal'.
  Global mandir `/usr/local/share/man', catdir `/var/cache/man/local'.
  Global mandir `/usr/X11R6/man', catdir `/var/cache/man/X11R6'.
  Global mandir `/opt/man', catdir `/var/cache/man/opt'.
  Global mandir `/snap/man', catdir `/var/cache/man/snap'.
  Added sections: `1', `n', `l', `8', `3', `0', `2', `3type', `5', `4', 
`9', `6', `7'.

path directory /root/.guix-profile/bin is not in the config file
  adding /root/.guix-profile/share/man to manpath
path directory /root/Projects/config/scripts is not in the config file
path directory /run/setuid-programs is not in the config file
path directory /root/.config/guix/current/bin is not in the config file
path directory /root/.guix-profile/bin is not in the config file
path directory /run/current-system/profile/bin is not in the config file
  adding /run/current-system/profile/share/man to manpath
path directory /run/current-system/profile/sbin is not in the config file
path directory /gnu/store/gjsxzcc0gqpz4lpbsrbidlnn5ij1lfm1-gzip-1.12/bin 
is not in the config file
  adding 
/gnu/store/gjsxzcc0gqpz4lpbsrbidlnn5ij1lfm1-gzip-1.12/share/man to manpath
path directory 
/gnu/store/g4wn6n3frwnjsay098mqgy046wxl4iym-coreutils-9.1/bin is not in 
the config file
  adding 
/gnu/store/g4wn6n3frwnjsay098mqgy046wxl4iym-coreutils-9.1/share/man to 
manpath

adding mandatory man directories
warning: /usr/man: No such file or directory
warning: /usr/share/man: No such file or directory
warning: /usr/local/share/man: No such file or directory
warning: /usr/man: No such file or directory
warning: /usr/share/man: No such file or directory
warning: /usr/local/man: No such file or directory
warning: /usr/local/share/man: No such file or directory
warning: /usr/X11R6/man: No such file or directory
warning: /opt/man: No such file or directory
warning: /snap/man: No such file or directory
final search path =
0 man subdirectories contained newer manual pages.
0 manual pages were added.
0 stray cats were added.
0 old database entries were purged.
#+end_example

"man -k" still can't find sbcl from its database
#+begin_example
[0]:root@guix03:~# man -k sbcl
sbcl: nothing appropriate.
#+end_example

Please enlighten me how to include guix manpages into mandb. Will there 
be improvement to guix's mandb to make it include manpages by default in 
guix's future release?


Thanks

Pan





chez scheme can't load system shared library

2025-03-24 Thread Pan Xie

Hello


I'm using a Chez scheme installed by guix package manager. The problem 
is *this* chez scheme can not load system shared library correctly:



#+begin_example

> (load-shared-object "libssl.so")

Exception: (while loading libssl.so) libssl.so: cannot open shared 
object file: No such file or directory

Type (debug) to enter the debugger.

#+end_example


The `libssl.so' is in the standard `/usr/lib/' directory, the expression 
above *should* load the library without problem. Now if I provide a full 
path,


there is another error:


#+begin_example

> (load-shared-object "/usr/lib/libssl.so")

Exception: (while loading /usr/lib/libssl.so) libcrypto.so.3: cannot 
open shared object file: No such file or directory

Type (debug) to enter the debugger.

#+end_example


This time, it complains `libcrypto.so.3' is missing, which essentially 
is the same problem as above, that is, the scheme system can't find system


shared library from standard paths (libssl.so depends on libcrypto.so).


A full session is provided below:


#+begin_example

$ type scheme
scheme is hashed (/home/pxie/.guix-profile/bin/scheme)

$ ldd $(type -p scheme)
    linux-vdso.so.1 (0x71587e645000)
    libm.so.6 => 
/gnu/store/hw6g2kjayxnqi8rwpnmpraalxi0djkxc-glibc-2.39/lib/libm.so.6 
(0x71587e55f000)
    libncursesw.so.6 => 
/gnu/store/q84lbjp7m6a6nsj98c8cpd2f57x0sn7n-ncurses-6.2.20210619/lib/libncursesw.so.6 
(0x71587e4ed000)
    libz.so.1 => 
/gnu/store/0nszzzvmy0vnb8rhpknx7j3rhdlh5b37-zlib-1.3/lib/libz.so.1 
(0x71587e4cf000)
    liblz4.so.1 => 
/gnu/store/f3pd9h4bv2ipx1qlzisl3ahx1fsi2wp3-lz4-1.9.3/lib/liblz4.so.1 
(0x71587e49c000)
    libgcc_s.so.1 => 
/gnu/store/8j43fffgm8vgx4mnrbwgy0pr4rimm2k8-gcc-11.4.0-lib/lib/libgcc_s.so.1 
(0x71587e48)
    libc.so.6 => 
/gnu/store/hw6g2kjayxnqi8rwpnmpraalxi0djkxc-glibc-2.39/lib/libc.so.6 
(0x71587e2a2000)
/gnu/store/hw6g2kjayxnqi8rwpnmpraalxi0djkxc-glibc-2.39/lib/ld-linux-x86-64.so.2 
=> /usr/lib64/ld-linux-x86-64.so.2 (0x71587e647000)


$ scheme
Chez Scheme Version 10.1.0
Copyright 1984-2024 Cisco Systems, Inc.

> (load-shared-object "libssl.so")

Exception: (while loading libssl.so) libssl.so: cannot open shared 
object file: No such file or directory

Type (debug) to enter the debugger.

> (load-shared-object "/usr/lib/libssl.so")

Exception: (while loading /usr/lib/libssl.so) libcrypto.so.3: cannot 
open shared object file: No such file or directory

Type (debug) to enter the debugger.

> (putenv "LD_LIBRARY_PATH" "/usr/lib/")

> (getenv "LD_LIBRARY_PATH")
"/usr/lib/"

> (load-shared-object "/usr/lib/libssl.so")

Exception: (while loading /usr/lib/libssl.so) libcrypto.so.3: cannot 
open shared object file: No such file or directory

Type (debug) to enter the debugger.
#+end_example

It seems the Chez scheme, which installed by guix, does not not follow 
the searching mechanism described in "man 8 ld.so". On the


other hand, if I build a Chez scheme from source code, without any 
dependency of guix, then there is not any problem of loading system


libraries.

Since guix is essential to me, please give advice on how to resolve the 
problem.



Regards

Pan





Re: chez scheme can't load system shared library

2025-03-25 Thread Pan Xie

Hi Felix Lechner,


Thanks for your response. Unfortunately, it does not work:


`LD_LIBRARY_PATH' is empty in my shell:

$ echo $LD_LIBRARY_PATH


scheme can't start up with LD_LIBRARY_PATH set:

$ LD_LIBRARY_PATH=/usr/lib:$LD_LIBRARY_PATH scheme
Segmentation fault (core dumped)

$ LD_LIBRARY_PATH='/usr/lib' scheme
Segmentation fault (core dumped)


`scheme' is the binary executable file of chez scheme.  Chez scheme 
built directly from source code (no guix) can startup with above command 
line.



Regards,

Pan


On 3/25/25 11:51 AM, Felix Lechner wrote:

Hi Xie Pan,

On Tue, Mar 25 2025, Pan Xie wrote:


*this* chez scheme can not load system shared library correctly:

I have never used Chez Scheme but suspect you have to set
LD_LIBRARY_PATH.  In Bash, it might look like something like this:

   $ LD_LIBRARY_PATH=/usr/lib:$LD_LIBRARY_PATH chez-scheme-executable

Guix refers to prerequisites by absolute paths into the store whenever
possible, including for shared libraries.  Installing prerequisites into
a profile, as you seem to have done, and then finding them in /usr/lib
is known as "propagating" a prerequisite.  It can be convenient, but
people generally consider it subobtimal, because it tends to restrict
the versions usable at the same time (although shared libraries employ a
lesser versioning scheme of their own).

I hope I was of help.  Please stick around for answers from more
competent contributors.

Kind regards
Felix





Re: chez scheme can't load system shared library

2025-03-25 Thread Pan Xie

Hello Sebastian


Based on your suggestion, now I figure out that I have to install guix 
openssl, even though I already I have openssl libraries installed in 
"/usr/lib".



The following works for me now:


$ guix install openssl

$ LD_LIBRARY_PATH=~/.guix-profile/lib scheme

(load-shared-object "libssl.so")


Thanks

Pan


On 3/25/25 6:25 PM, Sebastian Dümcke wrote:
Not sure how to answer to a particular meesage from the digest emals I 
am receiving. Hope this finds the right person and thus not upset anyone.


Hi Pan,

you need to set LD_LIBRARY_PATH to your profile library path (and then 
load without absolute path in chez). The following works for me:


> guix shell -CP coreutils-minimal chez-scheme openssl
> ls ~/.guix-profile/lib
csv10.1.0 engines-3 libcrypto.so libcrypto.so.3 libssl.so libssl.so.3 
ossl-modules pkgconfig

> LD_LIBRARY_PATH=~/.guix-profile/lib scheme
(load-shared-object "libssl.so")

Best
Sebastian





A silly concern about substitute servers

2025-04-02 Thread Pan Xie

Hi there


While reading the Guix reference manual, I get a silly concern. I 
believe it is silly because this concern must have been addressed, but I 
am still interested in details.



My concern is about the storage resources of the substitute servers. 
Since guix is a functional package manager, each package (e.g. emacs) 
must have lots of builds, with (sometimes, even slightly)


differences of inputs.  The value of a substitute server is to pre-build 
these packages, and provide them on demand. I can't figure out how many 
different emacs builds exist at a time on


a substitute server, but I guess there are many. On the other hand, guix 
also provides time-machine functionality, which allow users use versions 
of packages years ago. So my concern and questions:



1. Does a substitute server keeps all the packages it build? If the 
answer is yes, won't it consume huge storage resources? If the answer is 
no, then the user who use time-machine travel back to


    years before have to build all the packages from scratch?


2. If I am going to create a mirror of guix's official substitute 
server, what is the requirement of the storage?



3. Does a package really has lots of build on a substitute server? For 
example, emacs-29.1 has lots of inputs. I guess each time there is a 
commit to guix repository which change the inputs, there will be a build


    of it, so there must be lots of emacs-29.1 builds, with different 
hash numbers. Or am I wrong?



Regards

Pan