Re: How do I install libgcc_s in a container?

2023-09-06 Thread Wujun Li
   You can try the package: libgccjit



   29.08.2023, 15:51, "Jonas Møller via" :

 Hi! I'm trying to follow along with
 [1]https://guix.gnu.org/en/blog/2023/the-filesystem-hierarchy-standa
 rd-comes-to-guix-containers/
 But I'm unable to install libgcc_s, as lib is no longer an output of
 gcc-toolchain, so I can't manage to run any foreign binaries.

References

   1. 
https://guix.gnu.org/en/blog/2023/the-filesystem-hierarchy-standard-comes-to-guix-containers/


"guix system init" from regular system fails

2022-10-28 Thread li
Hello,

  I am trying to prepare a new system on new drive from my current Guix
installation, i.e., the first way mentioned in (info "(guix)System
Images").  The documentation at (info "(guix)Invoking guix system)") is
sparse, so I followed those in (info "(guix)Manual Installation"), which
I have successfully done before a couple of times.

  I have made sure the partitions are mounted (/ and /boot/efi @ /mnt
and /mnt/boot/efi) and that that they are correctly configured in
/mnt/etc/config.scm.

  The only difference is that I did not run "herd start cow-store /mnt".
That service is only available when using the installer.  I also believe
that it is not necessary because the documentation says that

> This makes ‘/gnu/store’ copy-on-write, such that packages added to it
> during the installation phase are written to the target disk on ‘/mnt’
> rather than kept in memory.  This is necessary because the first phase
> of the ‘guix system init’ command (see below) entails downloads or
> builds to ‘/gnu/store’ which, initially, is an in-memory file system.

  In this case /gnu/store is not an in-memory file system, so I assume
this is not necessary.  But maybe something equivalent is necessary?

  "sudo guix system init /mnt/etc/config.scm /mnt" succeeds quickly
with output:

<...snip...>
/gnu/store/dhk4hrjpqfcph2alliwg18iiqwc3j86x-system
/gnu/store/q6b71455an8dl1hg8y859rkja22fxk4j-grub.cfg

initializing operating system under '/mnt/'...
copying to '/mnt'...
populating '/mnt'...
The following derivation will be built:
  /gnu/store/sjg10gcq9m88ad7q3znqxfc7qyq4aq8j-install-bootloader.scm.drv

building 
/gnu/store/sjg10gcq9m88ad7q3znqxfc7qyq4aq8j-install-bootloader.scm.drv...
guix system: bootloader successfully installed on /boot/efi


  After this /mnt/gnu/store is populated and the bootloader also appears
to be installed.  However, this is not a usable system. /mnt/{bin,etc,
home,run} are all empty (except for /mnt/etc/config.scm).  Where did I
go wrong?

  Thanks for your help!
  L



python2-rpython failed to build

2020-11-30 Thread hong li
Hello,

I want to install python2-rpython 0.2.1 in guix, but the building
process failed with messages below.
I also checked the building history of the package, but found no
successful build in the output history.
https://data.guix.gnu.org/repository/1/branch/master/package/python2-rpython/output-history
Does anybody know how to fix this? Thanks in advance.

$ guix package -i python2 python2-rpython
The following packages will be installed:
   python2 2.7.17
   python2-rpython 0.2.1

substitute: updating substitutes from 'https://ci.guix.gnu.org'... 100.0%
The following derivation will be built:
   /gnu/store/l37vwcricp91905rw19v6avgw86sbml1-python2-rpython-0.2.1.drv

1,2 MB will be downloaded
downloading from
https://ci.guix.gnu.org/nar/gzip/72fg0cnwzm6s6jlw2dvipxd1jwyf4z8v-python2-contextlib2-0.6.0.post1
...
 python2-contextlib2-0.6.0.post1  13KiB

  2.1MiB/s 00:00 [##] 100.0%

downloading from
https://ci.guix.gnu.org/nar/gzip/nra2xdjpkqgingw6lynkdrrbkx2q8j0a-python2-funcsigs-1.0.2
...
 python2-funcsigs-1.0.2  18KiB

  3.5MiB/s 00:00 [##] 100.0%

downloading from
https://ci.guix.gnu.org/nar/gzip/m6l9d71wipa0x6b6pcxz7kyiy02w8hyc-python2-importlib-metadata-1.5.0
...
 python2-importlib-metadata-1.5.0  40KiB

  8.2MiB/s 00:00 [##] 100.0%

downloading from
https://ci.guix.gnu.org/nar/gzip/02mxrcvw1gvk9g03yvpf1bqqp5c9sawx-python2-importlib-resources-1.0.2
...
 python2-importlib-resources-1.0.2  30KiB

  6.6MiB/s 00:00 [##] 100.0%

downloading from
https://ci.guix.gnu.org/nar/gzip/l6qbfg81np8vjl3whr9ingzbswb9pj7n-python2-mock-3.0.5
...
 python2-mock-3.0.5  51KiB

 12.2MiB/s 00:00 [##] 100.0%

downloading from
https://ci.guix.gnu.org/nar/gzip/is78cy2wjk75diikpffwfhiyqv7ibgk1-python2-pathlib2-2.3.5
...
 python2-pathlib2-2.3.5  35KiB

  8.0MiB/s 00:00 [##] 100.0%

downloading from
https://ci.guix.gnu.org/nar/gzip/f72hps00xyn3299fr887dgav7hbf49v1-python2-pluggy-0.13.1
...
 python2-pluggy-0.13.1  26KiB

  6.2MiB/s 00:00 [##] 100.0%

downloading from
https://ci.guix.gnu.org/nar/gzip/qbix20f565276zgczpn9hqzv4c05hyx9-python2-pytest-bootstrap-4.6.11
...
 python2-pytest-bootstrap-4.6.11  450KiB

  1.8MiB/s 00:00 [##] 100.0%

downloading from
https://ci.guix.gnu.org/nar/gzip/7sg0b53apa0vm18n3zd3d6087wcxvwx0-python2-six-1.14.0
...
 python2-six-1.14.0  21KiB

  3.9MiB/s 00:00 [##] 100.0%

downloading from
https://ci.guix.gnu.org/nar/gzip/xxs4wa51yhzz5954433nc1ih4cqn2nkf-python2-zipp-1.0.0
...
 python2-zipp-1.0.0  5KiB

  1.2MiB/s 00:00 [##] 100.0%

downloading from
https://ci.guix.gnu.org/nar/gzip/wv6g6ja4xasf026qfm2ws69l3q2hq0yh-python2-pytest-4.6.11
...
 python2-pytest-4.6.11  450KiB

  1.6MiB/s 00:00 [##] 100.0%

building 
/gnu/store/l37vwcricp91905rw19v6avgw86sbml1-python2-rpython-0.2.1.drv...
/ 'check' phasebuilder for
`/gnu/store/l37vwcricp91905rw19v6avgw86sbml1-python2-rpython-0.2.1.drv'
failed with exit code 1
build of /gnu/store/l37vwcricp91905rw19v6avgw86sbml1-python2-rpython-0.2.1.drv
failed
View build log at
'/gnu/var/log/guix/drvs/l3/7vwcricp91905rw19v6avgw86sbml1-python2-rpython-0.2.1.drv'.
guix package: error: build of
`/gnu/store/l37vwcricp91905rw19v6avgw86sbml1-python2-rpython-0.2.1.drv'
failed

$ guix --version
guix (GNU Guix) 265e1858fb730bdc57c2059127109520bb2fc3cb
Copyright (C) 2020 the Guix authors
License GPLv3+: GNU GPL version 3 or later 
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.


with best regards,
Hong



Re: Guix installing different package versions on different machines

2019-09-29 Thread Hebi Li
On Sat, Sep 28 2019, Zelphir Kaltstahl wrote:

> $ which guix
> /usr/local/bin/guix
>
> So there seems to be an issue here.

Hi Zelphir,

You just need to add the correct path to $PATH:

export PATH="$HOME/.config/guix/current/bin:$PATH"

--
Hebi




Defining service: service does not take effect after rebooting

2019-09-16 Thread Hebi Li


Hi Guix,

I'm defining a service, and the service works. However, when I reboot
the system, the service does not work, and I have to reconfigure the
system to make it work again. The detailed steps I'm following are as
attacked below. Is there anything I'm missing?

Thanks,
Hebi



The detailed steps are as follows.  I'm defining a simple one-shot
service that creates a file /tmp/hello:

(define (hello-shepherd-service config)
  (list (shepherd-service
 (provision '(hello))
 (requirement '())
 (start #~(make-forkexec-constructor
   (list "touch" "/tmp/hello")))
 (one-shot? #t)
 (auto-start? #f)
 (respawn? #f

(define hello-service-type
  (service-type
   (name 'hello)
   (extensions
(list (service-extension shepherd-root-service-type 
hello-shepherd-service)))
   (default-value '(

I add this service to my config.scm:

(services
   (append
(list
 (service hello-service-type))
%desktop-services))

Then I reconfigure the system:

sudo -E guix system reconfigure config.scm

Then *reboot*. After rebooting, I start the service via:

sudo herd start hello

However, there is no /tmp/hello created. Then I reconfigure the system again:

sudo -E guix system reconfigure config.scm

Now, I start the service

sudo herd start hello

And the file /tmp/hello shows up.





Re: Looking for Guix alternative to /lib/modules/$(uname -r)/build

2019-09-11 Thread Hebi Li
Thanks, I've managed to use linux-module-build-system to build the
module, and I got the output
/gnu/store/...my-module-0.0.1/extra/xxx.ko. I can load the module via
insmod with the full path.

Now I want to load the module via modprobe, instead of specifying the
full path. For that, I need to place the .ko file in the modprobe
search directory. I notice that in
gnu/packages/patches/kmod-module-directory.patch, the modprobe is
modified to honor the LINUX_MODULE_DIRECTORY env variable, which is
set to /run/booted-system/kernel/lib/modules. However,
/run/booted-system/kernel/ is symlink to
/gnu/store/9rq5y83c9y1kplv6r7a2vksswyjzs57k-linux-libre-5.2.13, which
is read-only.

Further, it seems that modprobe can only scan exactly *one* directory,
be it from the LINUX_MODULE_DIRECTORY env variable, or the original
hard coded "/lib/modules/"

So my question is, is it possible to let modprobe be aware of my
external module?

Hebi



Looking for Guix alternative to /lib/modules/$(uname -r)/build

2019-09-11 Thread Hebi Li
Hi Guix,

I'm trying to compile and package a kernel module. Kernel modules
require the kernel "build folder" with Makefile, Kconfig, etc, and
compile with:

make -C /lib/modules/$(uname -r)/build modules

I'm looking for Guix alternative to the folder /lib/modules/$(uname -r)/build.

The linux-libre and linux-libre-headers do not seem to serve that
purpose. In particular, linux-libre-headers contains only header
files, and no Makefiles. The linux-libre:

$ ls -l /gnu/store/...-linux-libre-5.2.13/modules/5.2.13-gnu

lrwxrwxrwx  3 root root  53 Dec 31  1969 build ->
/tmp/guix-build-linux-libre-5.2.13.drv-0/linux-5.2.13
dr-xr-xr-x 13 root root4096 Dec 31  1969 kernel/
lrwxrwxrwx  3 root root  53 Dec 31  1969 source ->
/tmp/guix-build-linux-libre-5.2.13.drv-0/linux-5.2.13

The build/ and source/ folders are symlinks to the
/tmp/guix-build-..., and thus only available when using guix build
--check --keep-failed linux-libre. When I do that, the
/tmp/guix-build-... folder
does function as I expected. But I'm not sure if it is possible to access
them in a Guix package build.  The kernel/ folder contains only .ko files,
thus won't work for my purpose.

So my question is, is there a Guix alternative to the folder
/lib/modules/$(uname -r)/build ?

Thanks,
Hebi



Re: GuixSD system reconfigure error

2018-11-11 Thread Hebi Li


Thanks for the help. I didn't research into it because it was not an
urgent need. I only have GuixSD installed on one machine.

> To my knowledge the simplest way, albeit not automatic, is to login as
> the user and install a manifest with
> $ guix package --manifest (see the manual for details)

Previously I was keeping the output of `guix package --list-installed`
under version control. Reading the document, looks like the manifest is
exactly what I was looking for. I'm going to use the manifest instead.

-- 
Hebi



Re: How to properly use channels? (my 'guix pull' throws error)

2018-10-02 Thread Hebi Li
On Tue, Oct 02 2018, Ricardo Wurmus wrote:

>> On Tue, Oct 02 2018, Ricardo Wurmus wrote:
>>
>>> AFAIK this defect has been fixed a couple of days ago.  Unfortunately,
>>> you need to upgrade Guix with “guix pull” but without channels.  Once
>>> upgraded you can use channels again.
>>>
>>
>> I actually ran "guix pull" right before I tried Ludovic's suggestion
>> earlier today. Anyway I pulled again, and did a full system upgrade
>> (guix package -u) and also reconfigure (sudo -E guix system reconfigure
>> config.scm), and even a reboot.  The "guix pull" command is still
>> complaining "no code for module (gcrypt hash)".
>
> Could you please tell us which “guix” you are using?  “guix pull”
> installs a new Guix to ~/.config/guix/current/bin.  Are you using Guix
> from that directory?

Now I see the problem. I'm using ~/.guix-profile/bin/guix. Using
~/.config/guix/current/bin/guix, I'm able to build the chromium
package.

So does this mean that, I should put this path
(~/.config/guix/current/bin) before (~/.guix-profile/bin) in $PATH?
Otherwise it will appear that "guix pull" does not upgrade "guix".

What is the purpose of ~/.guix-profile/bin/guix then? Since it is
symbolic linked to /gnu/store/xxx-guix, it is only updated after "guix
package -u"?


>> I thought ~/.config/guix/current symlink *is* the local source tree, and
>> this document says both "./pre-inst-env guix pull" and "guix pull"
>> upgrade it.
>
> ~/.config/guix is merely where “guix pull” installs new versions of
> Guix.  The source tree is wherever you run Guix via “pre-inst-env”.
>

I see. Thanks!


-- 
Hebi



Re: How to properly use channels? (my 'guix pull' throws error)

2018-10-02 Thread Hebi Li
Hi Ricardo,

On Tue, Oct 02 2018, Ricardo Wurmus wrote:

> AFAIK this defect has been fixed a couple of days ago.  Unfortunately,
> you need to upgrade Guix with “guix pull” but without channels.  Once
> upgraded you can use channels again.
>

I actually ran "guix pull" right before I tried Ludovic's suggestion
earlier today. Anyway I pulled again, and did a full system upgrade
(guix package -u) and also reconfigure (sudo -E guix system reconfigure
config.scm), and even a reboot.  The "guix pull" command is still
complaining "no code for module (gcrypt hash)".

However, it succeeded when I tried the latest guix source [1], and ran
with ./pre-inst-env [2]. This time, "./pre-inst-env guix pull" did
finish compiling the package successfully:

New in this revision:
  2 new packages: chromium, gn

But, I have no idea how to build and install the newly retrieved
chromium package. Seems that both "guix" and "./pre-inst-env guix" do
not see the new package (i.e. "(./pre-inst-env) guix install chromium"
complains no chromium package, no chromium is listed by
"(./pre-inst-env) guix package --list-avaiable").

Thus, I'm confused of what is the effect of the command "./pre-inst-env
guix pull". The document [2] is saying:

Note that ./pre-inst-env guix pull does not upgrade the local source
tree; it simply updates the ~/.config/guix/current symlink (see Invoking
guix pull). Run git pull instead if you want to upgrade your local
source tree.

I thought ~/.config/guix/current symlink *is* the local source tree, and
this document says both "./pre-inst-env guix pull" and "guix pull"
upgrade it.


[1] https://www.gnu.org/software/guix/manual/en/html_node/Building-from-Git.html
[2] 
https://www.gnu.org/software/guix/manual/en/html_node/Running-Guix-Before-It-Is-Installed.html


-- 
Hebi



Re: How to properly use channels? (my 'guix pull' throws error)

2018-10-02 Thread Hebi Li


Thanks, Ludovic.

On Tue, Oct 02 2018, Ludovic Courtès wrote:

> Hello,
>
> Hebi Li  skribis:
>
>> Hi guys,
>
> s/guys/people/ :-)

Oh, cool :)

>> I was trying to use Marius's channel [1] for Chromium. However,
>> following Marius's instruction, when my ~/.config/guix/channels.scm is
>> in place, 'guix pull' throws me this error:
>>
>> guix pull: error: failed to load '/home/hebi/.config/guix/channels.scm':
>> system/base/compile.scm:144:21: In procedure compile-file:
>> failed to create path for auto-compiled file
>> "/home/hebi/.config/guix/channels.scm"
>
> Could it be that ~/.cache/guile/… is read-only or owned by a different
> user?
>
> As a test you could try to “rm -rf ~/.cache/guile”.  This is the place
> where Guile stores object files resulting from auto-compilation.

That is the problem, "~/.cache/guile" is owned by root. I don't know
why, but I think it is not supposed to be root, so maybe we need to fix
it somewhere or mention it in trouble shooting. Anyway removing it
solved the problem and guix pull is able to continue.

Then I encountered another problem. In channels.scm, I was using (branch
"master"), and got this error:

--8<---cut here---start->8---
Updating channel 'guix-chromium' from Git repository at
'https://gitlab.com/mbakke/guix-chromium.git'...
guix pull: error: Git error: cannot locate remote-tracking branch 'master'
--8<---cut here---end--->8---

Changing it to '(branch "origin/master")' solved the problem. I mention
this because I have seen '(branch "master")' in a couple of places, thus
was wondering whether it is supposed to be the correct way.

Next, guix pull is finally able to compile chromium.scm, but
unfortunately failed to finish. This might not be a problem of guix
itself. However the error was "no code for module (gcrypt hash)", so I
think it is related. I have installed both libgcrypt and
guile-gcrypt. The following is the full error message:

--8<---cut here---start->8---
[ 1/ 1] Compiling './chromium/chromium.scm'...
Backtrace:
In ice-9/boot-9.scm:
  2788:17 19 (resolve-interface (guix store) #:select _ #:hide _ # _ ?)
  2714:10 18 (_ (guix store) _ _ #:ensure _)
  2982:16 17 (try-module-autoload _ _)
   2312:4 16 (save-module-excursion #)
  3002:22 15 (_)
In unknown file:
  14 (primitive-load-path "guix/store" #)
In guix/store.scm:
 20:0 13 (_)
In ice-9/boot-9.scm:
   2862:4 12 (define-module* _ #:filename _ #:pure _ #:version _ # _ ?)
  2875:24 11 (_)
   222:29 10 (map1 (((guix utils)) ((guix config)) ((guix #)) ((?)) ?))
   222:29  9 (map1 (((guix config)) ((guix memoization)) ((guix ?)) ?))
   222:29  8 (map1 (((guix memoization)) ((guix serialization)) (#) ?))
   222:29  7 (map1 (((guix serialization)) ((guix monads)) ((# #)) ?))
   222:29  6 (map1 (((guix monads)) ((guix base16)) ((guix #)) (#) ?))
   222:29  5 (map1 (((guix base16)) ((guix base32)) ((gcrypt #)) # ?))
   222:29  4 (map1 (((guix base32)) ((gcrypt hash)) ((guix #)) (#) ?))
   222:17  3 (map1 (((gcrypt hash)) ((guix profiling)) ((rnrs #)) # ?))
   2791:6  2 (resolve-interface _ #:select _ #:hide _ #:prefix _ # _ ?)
In unknown file:
   1 (scm-error misc-error #f "~A ~S" ("no code for modu?" ?) ?)
In ice-9/boot-9.scm:
   752:25  0 (dispatch-exception _ _ _)

ice-9/boot-9.scm:752:25: In procedure dispatch-exception:
no code for module (gcrypt hash)
builder for `/gnu/store/60blzvp2by5j8mkp2xyml42al703cdza-guix-chromium.drv' 
failed with exit code 1 
 
cannot build derivation 
`/gnu/store/vjf98q40yrpgqfp4wjpgk2brjhzlcyn2-guix-chromium.drv': 1 dependencies 
couldn't be built
cannot build derivation 
`/gnu/store/cwnlydihlzn0z42lk00w9wa60vrsa6b3-profile.drv': 1 dependencies 
couldn't be built  
guix pull: error: build failed: build of 
`/gnu/store/cwnlydihlzn0z42lk00w9wa60vrsa6b3-profile.drv' failed

hebi@antelope ~$ guix pull
Updating channel 'guix-chromium' from Git repository at 
'https://gitlab.com/mbakke/guix-chromium.git'...
 
guix pull: error: Git error: cannot locate remote-tracking branch 'master'
--8<---cut here---end--->8---




-- 
Hebi



How to properly use channels? (my 'guix pull' throws error)

2018-09-26 Thread Hebi Li


Hi guys,

I was trying to use Marius's channel [1] for Chromium. However,
following Marius's instruction, when my ~/.config/guix/channels.scm is
in place, 'guix pull' throws me this error:


--8<---cut here---start->8---
guix pull: error: failed to load '/home/hebi/.config/guix/channels.scm':
system/base/compile.scm:144:21: In procedure compile-file:
failed to create path for auto-compiled file
"/home/hebi/.config/guix/channels.scm"
--8<---cut here---end--->8---

My guix version is > 0.15:

--8<---cut here---start->8---
guix (GNU Guix) 0.15.0-3.3d43017
Copyright (C) 2018 the Guix authors
License GPLv3+: GNU GPL version 3 or later

This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
--8<---cut here---end--->8---

The channel feature should be available, as I have the file
~/.guix-profile/share/guile/site/2.2/guix/channels.scm. Is there
anything I did wrong when using channels?

[1] https://gitlab.com/mbakke/guix-chromium

-- 
Hebi



Re: GuixSD system reconfigure error

2018-08-30 Thread Hebi Li
Awesome, removing the modules and adding --skip-checks fixed my
problem. Thanks!

-- 
Hebi



Re: GuixSD system reconfigure error

2018-08-30 Thread Hebi Li
Hi Ricardo,

Thanks, I believe this is the reason. Today when I run several rounds of
build, the `kernel module not found "shpchp"` error pops out here and
there (it isn't there yesterday ..)

I used initrd-modules and "shpchp", because back when I first installed
the system, the example configure file had them. I don't think I really
need the modules. So I tried removing it, but system seems to prevent me
from doing that, by throwing the error:

   : error: you may need these modules in the initrd
   for /dev/sda2: shpchp

It seems weired to me, in two ways:

1. why the system is preventing me from removing "shpchp" module? How
does it relate to /dev/sda2 (which is my root partition in ext4)?

2. I downloaded the latest QEMU image [1], run as root the `guix pull`
and `guix system reconfigure` with the exact config.scm (with modified
boot loader configure of course), and there isn't any issue. I believe
that build should also use the latest kernel, which should also have
missed the module "shpchp".

Next, I would probably try to reinstall the system, without the
`initrd-modules` configuration.


[1] https://alpha.gnu.org/gnu/guix/guixsd-vm-image-0.15.0.x86_64-linux.xz

-- 
Hebi



CDN Mirrors for GNU Guix

2017-02-04 Thread Tom Li
Currently, GNU Guix is still in the early stage of development, and there is a 
great
lack of mirrors worldwide. For example. in my region, using GNU Guix is 
incredibly
slow, the speed is around 4 KiB/s and rendering it almost unusable.

Therefore, I created two CDN mirrors of https://mirror.hydra.gnu.org/, by using
CloudFlare and Amazon CloudFront's service. I know some have the concerns about
such type of centralized corporation-controlled service. Personally, I have 
done my
best to minimized the security risks (HTTPS only, untouched signatures) and set 
ip
up faithfully. Please use it according to your own judgement.

they are available at:

* https://guix-cloudflare.tomli.me/
* https://guix-amazon.tomli.me/

Since they are identical mirrors of Hydra, you just need to use 
`--substitute-urls=`
in order to use it.

I have no experience on setting up mirrors. I expected to have some problems
related to cache things for too long. Please report any problems.

Happy Hacking!
Tom.