Fast `guix environment --container' switch

2020-12-09 Thread Pierre Neidhardt
Hi Guix!

`guix environment --container ... -- my-foo-program` is great but a bit
slow to start.

Is there a way to speed this up?

I know that without --container, one can use --root to create a link and
source the etc/profile from there.

Is it possible to switch to such a root in a container?

Alternatively, how do you load a etc/profile purely, i.e. without
inheriting from the parent environment, just like --pure does?

Cheers!

-- 
Pierre Neidhardt
https://ambrevar.xyz/


signature.asc
Description: PGP signature


Re: Fast `guix environment --container' switch

2020-12-09 Thread zimoun
Hi Pierre,

On Wed, 09 Dec 2020 at 10:40, Pierre Neidhardt  wrote:

> `guix environment --container ... -- my-foo-program` is great but a bit
> slow to start.
>
> Is there a way to speed this up?

I get, cold cache:

--8<---cut here---start->8---
$ sudo sh -c 'echo 3 > /proc/sys/vm/drop_caches'
$ time guix environment --container --ad-hoc hello -- hello
Hello, world!

real0m2.815s
user0m1.852s
sys 0m0.238s

$ sudo sh -c 'echo 3 > /proc/sys/vm/drop_caches'
$ time guix environment --pure --ad-hoc hello -- hello
Hello, world!

real0m2.656s
user0m1.733s
sys 0m0.240s
--8<---cut here---end--->8---

and warm cache:

--8<---cut here---start->8---
$ time guix environment --container --ad-hoc hello -- hello
Hello, world!

real0m1.399s
user0m1.544s
sys 0m0.104s

$ time guix environment --pure --ad-hoc hello -- hello
Hello, world!

real0m1.250s
user0m1.492s
sys 0m0.094s
--8<---cut here---end--->8---


Do you have examples where the difference is significant?


All the best,
simon



Re: Fast `guix environment --container' switch

2020-12-09 Thread Pierre Neidhardt
Hi Simon,

Maybe a misunderstanding, the question is not about --pure.  I'd like a
`containerized hello' to start about as fast as non-containerized
`hello', without the 1 s overhead.

Cheers!

-- 
Pierre Neidhardt
https://ambrevar.xyz/


signature.asc
Description: PGP signature


Re: Fast `guix environment --container' switch

2020-12-09 Thread zimoun
Hi,

On Wed, 09 Dec 2020 at 11:13, Pierre Neidhardt  wrote:

> Maybe a misunderstanding, the question is not about --pure.  I'd like a
> `containerized hello' to start about as fast as non-containerized
> `hello', without the 1 s overhead.

Which 1s overhead?

The overhead between --pure and --container is 0.2s in both cases, which
is linux namespace creation and co.

Thereofore, on my machine, «“containerized hello” starts as fast as
“non-containerized hello”», with a 0.2s overhead.  So I am missing what
you are asking. :-)

I guess, in some case, this overhead is bigger.  That’s why I asked if
you have examples.


Cheers,
simon



Re: Fast `guix environment --container' switch

2020-12-09 Thread Pierre Neidhardt
`guix environment` incurs an overhead:

--8<---cut here---start->8---
time /gnu/store/a462kby1q51ndvxdv3b6p0rsixxrgx1h-hello-2.10/bin/hello
Hello, world!

real0m0.002s
user0m0.002s
sys 0m0.000s
--8<---cut here---end--->8---

--8<---cut here---start->8---
$ time guix environment --ad-hoc hello -- hello
Hello, world!

real0m0.921s
user0m1.003s
sys 0m0.091s
--8<---cut here---end--->8---

It's possible to bypass this overhead by using --root:

--8<---cut here---start->8---
$ guix environment --ad-hoc hello --root=foo
[env]$ exit

$ source foo/etc/profile && time hello
Hello, world!

real0m0.003s
user0m0.003s
sys 0m0.000s
--8<---cut here---end--->8---

The above `source' is of course not containerized.

So is it possible to use a similar trick to run something containerized
"instantly", i.e.  with less than, say, 100ms overhead?

-- 
Pierre Neidhardt
https://ambrevar.xyz/


signature.asc
Description: PGP signature


Re: Fast `guix environment --container' switch

2020-12-09 Thread zimoun
On Wed, 09 Dec 2020 at 11:55, Pierre Neidhardt  wrote:
> `guix environment` incurs an overhead:
>
> --8<---cut here---start->8---
> time /gnu/store/a462kby1q51ndvxdv3b6p0rsixxrgx1h-hello-2.10/bin/hello
> Hello, world!
>
> real  0m0.002s
> user  0m0.002s
> sys   0m0.000s
> --8<---cut here---end--->8---
>
> --8<---cut here---start->8---
> $ time guix environment --ad-hoc hello -- hello
> Hello, world!
>
> real  0m0.921s
> user  0m1.003s
> sys   0m0.091s
> --8<---cut here---end--->8---
>
> It's possible to bypass this overhead by using --root:

It by-passes the computations of derivations and profiles.  Somehow,
using --root is using a precomputed profile. IIUC.

> So is it possible to use a similar trick to run something containerized
> "instantly", i.e.  with less than, say, 100ms overhead?

I see, you would like to be able to run a profile in container, right?
Somehow, it is similar to the wanted [1], IIUC.

1: 


Cheers,
simon



Re: NAS drive

2020-12-09 Thread Roy Lemmon
Hi,

So I'm afraid it still doesn't work. Though with the following there are at
least no errors.

Here is the top section of the .scm file.

Cheers
Roy


config.scm
***

(use-modules (gnu))
(use-package-modules nfs emacs-xyz)
(use-service-modules desktop networking ssh xorg mail docker)

(operating-system

  (setuid-programs
   (cons*
(file-append nfs-utils "/sbin/mount.nfs")
%setuid-programs))

 (locale "en_GB.utf8")
 (host-name "parton")
 (timezone "Europe/London")

 (keyboard-layout (keyboard-layout "gb" "extd"))

  (bootloader
(bootloader-configuration
  (bootloader grub-efi-bootloader)
  (target "/boot/efi")
  (keyboard-layout keyboard-layout)))

 cont.

On Tue, Dec 8, 2020 at 6:46 PM Tobias Geerinckx-Rice  wrote:

> Roy Lemmon 写道:
> > Sorry but it's been a long day ...
>
> Here too :-)
>
> > I have to specify the nfs package don't I ?
>
> The ‘NFS package’ in
>
>   (file-append nfs-utils "/sbin/mount.nfs")
>
> is nfs-utils, which is a variable defined in the (gnu packages
> nfs) Guile module.
>
> As you note, modules need to be imported first, which is what
>
> > (use-modules (gnu packages nfs))
> > (use-service-modules desktop networking ssh xorg mail)
>
> does.  This is the correct variant for your use case: you care
> only about the package which provides mount.nfs to clients, not
> about the server which is what (gnu services nfs) provides.
>
> Aside: the above snippet is completely equivalent to both:
>
>   (use-modules (gnu packages nfs))
>   (use-modules (gnu services desktop)
>(gnu services networking)
>(gnu services ssh)
>(gnu services xorg)
>(gnu services mail))
>
> and
>
>   (use-package-modules nfs)
>   (use-service-modules desktop networking ssh xorg mail)
>
> USE-{PACKAGE,SERVICE}-MODULES is Guix-specific syntactic sugar
> that saves a lot of space and typing when you're importing many
> package & service modules, as most people do.
>
> Kind regards,
>
> T G-R
>


-- 

Roy Lemmon
STFC Daresbury Laboratory
United Kingdom



Can I easily install GNU Emacs 27.1.50 via Guix?

2020-12-09 Thread Jorge P. de Morais Neto
Hi.  For GNU Emacs I manually compile the latest code from the emacs-27
branch (and install it with GNU Stow).  That's because I want the latest
features and fixes, but I fear that the master branch could be
unreliable when used together with certain external packages such as
Notmuch.  When there's a pretest version of emacs-28, I intend to switch
to it---before it is stable---but first I'll ask on the Notmuch mailing
list.

The problem with locally compiling Emacs is that it doesn't see
Guix-installed Elisp packages.  I currently get packages from ELPA (GNU,
Org, Melpa and Melpa-Stable) but the last two have ethical problems, so
I would prefer to get my packages via Guix.  I haven't yet studied Guix
packaging, however, so I need an easy solution.  So is it possible and
easy to get Emacs 27.1.50 via Guix?

Regards

-- 
- 
- If an email of mine arrives at your spam box, please notify me.
- Please adopt free/libre formats like PDF, ODF, Org, LaTeX, Opus, WebM and 7z.
- Free/libre software for Replicant, LineageOS and Android: https://f-droid.org
- [[https://www.gnu.org/philosophy/free-sw.html][What is free software?]]



Re: NAS hardware recommendations

2020-12-09 Thread david larsson

On 2020-12-08 16:51, Pierre Neidhardt wrote:

Hi Guix!

Has anyone had luck installing Guix on a NAS?
If so, which one?

If not, which NAS hardware would you recommend?
I'm looking for

- something as open as possible;
- 3-4 bays;
- lowest consumption possible;
- Btrfs support.

Any tips?

Cheers!


Ive always wanted a GnuBee which is very open. Idle power is 11.64 W. 
There is both a 3.5" and 2.5" version - it has a MIPS processor though. 
Also, I don't know if you can actually still order them anywhere:


https://www.crowdsupply.com/gnubee/personal-cloud-1

Guix has some old support for installing on MIPS:

https://lists.gnu.org/archive/html/guix-devel/2015-08/msg00500.html


Otherwise, the very open Vikings D8, has 6 SATA 300mb/s slots, but 
perhaps not really what you are looking for and it's pretty expensive.


https://store.vikings.net/libre-friendly-hardware/d8ryf



Best regards,
David



Re: NAS drive

2020-12-09 Thread Tobias Geerinckx-Rice

Roy,

Roy Lemmon 写道:

So I'm afraid it still doesn't work.


That's unfortunate :-(


Here is the top section of the .scm file.


I'm recompiling my kernel with NFS support to test you command for 
myself.


I wonder if it's because we configure util-linux with:

 "--enable-fs-paths-default=/run/current-system/profile/sbin"

If so the attached patch might help, but it's merely a total 
guess.


Kind regards,

T G-R

From 7d481e79076d8feb9e69fe0ca3a9eb1b3bb26573 Mon Sep 17 00:00:00 2001
From: Tobias Geerinckx-Rice 
Date: Wed, 9 Dec 2020 22:03:47 +0100
Subject: [PATCH] gnu: util-linux: Support setuid mount helpers on Guix System.

* gnu/packages/linux.scm (util-linux)[argument]: Add /run/setuid-programs
to --enable-fs-paths-default.
---
 gnu/packages/linux.scm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 3d36468172..03a1bcbf71 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -1513,7 +1513,9 @@ providing the system administrator with some help in common tasks.")
"static"))   ;2.9 MiB static .a libraries
 (arguments
  `(#:configure-flags (list "--disable-use-tty-group"
-   "--enable-fs-paths-default=/run/current-system/profile/sbin"
+   (string-append "--enable-fs-paths-default="
+  "/run/setuid-programs:"
+  "/run/current-system/profile/sbin")
;; Don't try to chown root:root mount and umount
"--disable-makeinstall-chown"
"--localstatedir=/var"
-- 
2.29.2



signature.asc
Description: PGP signature


help with emacs package

2020-12-09 Thread Adam Kandur via
hi everyone!
i'm trying to pack this https://melpa.org/#/roguel-ike
to do this, i wrote this package:
---
(define-public emacs-roguel-ike
  ;; tagged branch is outdated.
  (let ((revision "0")
    (commit "706dcb0687e8016d7d776f9d9e5ace9fdbbca43c"))
    (package
  (name "emacs-roguel-ike")
  (version (git-version "0.1.0" revision commit))
  (source
   (origin
 (method git-fetch)
 (uri (git-reference
       (url "https://github.com/stevenremot/roguel-ike";)
       (commit "master")))
 (file-name (git-file-name name version))
 (sha256
  (base32 "0rgv4y9aa5cc2ddz3y5z8d22xmr8kf5c60h0r3g8h91jmcw3rb4z"
  (build-system emacs-build-system)
  (home-page "https://github.com/stevenremot/roguel-ike.git";)
  (synopsis "Coffee-break roguelike for Emacs")
  (description "The goal of this project was to develop a coffee-break 
roguelike for Emacs.  
The complete game would allow the player to create various characters and to 
make them fulfill challenges like arena fight and short dungeon explorations.")
  (license license:gpl3
---

so, when i'm trying to build it i get this error:
---
starting phase `build'
Checking 
/gnu/store/fgzyhpkf1ysf7z4nynyqky8yp1idn5yc-emacs-roguel-ike-0.1.0-0.706dcb0/share/emacs/site-lisp/...
Compiling 
/gnu/store/fgzyhpkf1ysf7z4nynyqky8yp1idn5yc-emacs-roguel-ike-0.1.0-0.706dcb0/share/emacs/site-lisp/roguel-ike-autoloads.el...
Compiling 
/gnu/store/fgzyhpkf1ysf7z4nynyqky8yp1idn5yc-emacs-roguel-ike-0.1.0-0.706dcb0/share/emacs/site-lisp/roguel-ike.el...
../../../../../../tmp/guix-build-emacs-roguel-ike-0.1.0-0.706dcb0.drv-0/source/roguel-ike/hero-data.el:
 Obsolete name arg "Hero data" to constructor rlk--hero-data
Creating directory: Permission denied, /homeless-shelter
command 
"/gnu/store/k826y34z8zzjj57jv2nldmpw6vsdd145-emacs-minimal-27.1/bin/emacs" 
"--quick" "--batch" "--eval=(eval '(progn (setq byte-compile-debug t) 
(byte-recompile-directory (file-name-as-directory 
\"/gnu/store/fgzyhpkf1ysf7z4nynyqky8yp1idn5yc-emacs-roguel-ike-0.1.0-0.706dcb0/share/emacs/site-lisp\")
 0 1)) t)" failed with status 255
builder for 
`/gnu/store/c44xk4nzrmif59xqiwxmnb6w3vds9zsi-emacs-roguel-ike-0.1.0-0.706dcb0.drv'
 failed with exit code 1
build of 
/gnu/store/c44xk4nzrmif59xqiwxmnb6w3vds9zsi-emacs-roguel-ike-0.1.0-0.706dcb0.drv
 failed
View build log at 
'/var/log/guix/drvs/c4/4xk4nzrmif59xqiwxmnb6w3vds9zsi-emacs-roguel-ike-0.1.0-0.706dcb0.drv.bz2'.
guix build: error: build of 
`/gnu/store/c44xk4nzrmif59xqiwxmnb6w3vds9zsi-emacs-roguel-ike-0.1.0-0.706dcb0.drv'
 failed---

maybe somebody had same problem?