Re: Cannot boot GuixSD after system reconfigure

2017-09-22 Thread Roel Janssen

Ludovic Courtès writes:

> Danny Milosavljevic  skribis:
>
>> On Fri, 22 Sep 2017 16:03:47 +0200
>> l...@gnu.org (Ludovic Courtès) wrote:
>>
>>> However, there’s one thing I’d like to double-check with Danny, which is
>>> the word order.  With this patch, I have:
>>> 
>>>   (fat32-uuid->string (string->fat32-uuid "aabb-ccdd"))
>>>   $7 = "CCDD-AABB"
>>> 
>>> Danny: are you sure the most-significant 16-bit word comes last?
>>
>> See 
>> https://github.com/karelzak/util-linux/blob/master/libblkid/src/superblocks/vfat.c#L48
>>
>> blkid_probe_sprintf_uuid(pr, vol_serno, 4, "%02X%02X-%02X%02X",
>> vol_serno[3], vol_serno[2], vol_serno[1], vol_serno[0]);
>
> I see, thanks!
>
> Roel, with commit 8a7d81a5e23c4d59fbabf2550db32d4ba5572e4b, you should
> be able to write:
>
>   (uuid "abcd-1234" 'fat32)
>
> in your config, and it should work.
>
> Let me know if it doesn’t.  :-)
>
> Ludo’.

I could generate a new system, but upon booting it, I was dropped to a
Guile REPL.

So it doesn't seem to work.  How can I troubleshoot from there?

I used the following configuration for the EFI partition:

  (file-system
(title 'uuid)
(device (uuid "72E5-26A0" 'fat32))
(mount-point "/boot/efi")
(needed-for-boot? #t)
(type "vfat"))

Thanks for your work!

Kind regards,
Roel Janssen



Should I upgrade root user's guix too?

2017-09-22 Thread Attic Hermit
I use guix for using the softwares that Parabola GNU+Linux doesn't
provide. Everything works great, but I have a question on the upgrade of
guix itself.

I regularly do `guix pull && guix package -u` in my default user, but I
rarely do it in root user. I don't know if I'm right, but the guix build
users runs the guix of the version of root, so if I don't upgrade the
guix of root, that will stay on the old version for good. Therefore, the
guix of root should be upgraded as well, when the guix of the default
user is upgraded; Am I right?

If upgrading the root's guix is valid, then which guix should be
upgraded before? I usually upgrade non-root user's guix before
and then root's.

I couldn't find a related topic on the manual, so I'm little bit
confused.

-- 
Attic Hermit



Re: Cannot boot GuixSD after system reconfigure

2017-09-22 Thread Danny Milosavljevic
On Fri, 22 Sep 2017 16:03:47 +0200
l...@gnu.org (Ludovic Courtès) wrote:

> However, there’s one thing I’d like to double-check with Danny, which is
> the word order.  With this patch, I have:
> 
>   (fat32-uuid->string (string->fat32-uuid "aabb-ccdd"))
>   $7 = "CCDD-AABB"
> 
> Danny: are you sure the most-significant 16-bit word comes last?

See 
https://github.com/karelzak/util-linux/blob/master/libblkid/src/superblocks/vfat.c#L48

blkid_probe_sprintf_uuid(pr, vol_serno, 4, "%02X%02X-%02X%02X",
vol_serno[3], vol_serno[2], vol_serno[1], vol_serno[0]);



Re: guix pull fails on powerful server

2017-09-22 Thread Ludovic Courtès
Hi Ricardo,

Ricardo Wurmus  skribis:

> The following derivation will be built:
>/gnu/store/yvyfkns3w3vm7ynwbr7mvxcmin4gd2a0-guix-latest.drv
> copying and compiling to 
> '/gnu/store/7m52dkr98nhwgpsx20mmpwyw2yzj58d3-guix-latest' with Guile 2.2.2...
> loading...   25.4% of 629 filesrandom seed for tests: 1506066913
> loading...   99.8% of 629 files
> compiling... 69.2% of 629 filesice-9/threads.scm:289:22: In procedure 
> loop:
> ice-9/threads.scm:289:22: Syntax error:
> guix/scripts.scm:130:2: >>=: >>= (bind) used outside of 'with-monad' in form 
> (>>= (apply set-build-options* #:use-substitutes
> ptions)) (lambda (unused-value) (mbegin %store-monad (mlet %store-monad 
> ((derivation (origin->derivation (package-source pack
> tutes? use-substitutes? #:dry-run? dry-run?) (return (show-derivation-outputs 
> derivation)))

This was reported at , and I suspect a
thread-safety issue.  However, syntax parameters are purely functional
AFAICS, so I fail to see why multithreading could be a problem.

Andy, any idea what could be causing this?

Thanks,
Ludo’.



Re: Cannot boot GuixSD after system reconfigure

2017-09-22 Thread Ludovic Courtès
Roel Janssen  skribis:

> Ludovic Courtès writes:

[...]

>>> So, I was able to fix GRUB by manually modifying /boot/grub/grub.cfg:
>>>
>>> -search --label --set /dev/sda3
>>> +search --no-floppy --fs-uuid --set 
>>
>> I believe this is fixed with db4e8fd5d4a07d3be8ce68fb96722ef7077c0eee.
>>
>> Could you please let me know if everything’s OK?
>
> I changed the following pieces of my config:
>
>   (bootloader (bootloader-configuration
>(bootloader grub-efi-bootloader)
>(target "/boot/efi")))
>
>   (file-systems (cons*
>  (file-system
>   (title 'uuid)
>   (device (uuid ""))
>   (mount-point "/boot")
>   (needed-for-boot? #t)
>   (type "ext4"))
>(file-system
>   (title 'device)
>   (device "/dev/sda1")
>   (mount-point "/boot/efi")
>   (needed-for-boot? #t)
>   (type "vfat"))
>  (file-system
>   (mount-point "/")
>   (options "ssd")
>   (title 'uuid)
>   (device (uuid ""))
>   (options "ssd")
>   (type "btrfs"))
>  (file-system
>   (title 'device)
>   (device "tmpfs")
>   (mount-point "/var/guix/temproots")
>   (type "tmpfs"))
>  (file-system
>   (title 'device)
>   (device "tmpfs")
>   (mount-point "/tmp")
>   (type "tmpfs"))
>  %base-file-systems))
>
> And with these changes, I can boot GuixSD again.

You mean the fix was insufficient?

> The vfat partitions have a shorter UUID, which are not accepted by
> Guix.  Is this on purpose?  As you can see in the snippet above, I use
> 'device for the vfat partition and 'uuid for the other disk-based
> partitions.  It would be nice to use UUIDs for every partition.

The attached patch almost gets us there: it would allow you to write

  (uuid "-" 'fat32)

in your config.

However, there’s one thing I’d like to double-check with Danny, which is
the word order.  With this patch, I have:

  (fat32-uuid->string (string->fat32-uuid "aabb-ccdd"))
  $7 = "CCDD-AABB"

Danny: are you sure the most-significant 16-bit word comes last?

Ludo’.

diff --git a/gnu/system/uuid.scm b/gnu/system/uuid.scm
index 1dd6a1133..dea2083c4 100644
--- a/gnu/system/uuid.scm
+++ b/gnu/system/uuid.scm
@@ -41,6 +41,7 @@
 string->ext3-uuid
 string->ext4-uuid
 string->btrfs-uuid
+string->fat32-uuid
 iso9660-uuid->string
 
 ;; XXX: For lack of a better place.
@@ -175,6 +176,22 @@ ISO9660 UUID representation."
 (low (bytevector-uint-ref uuid 2 %fat32-endianness 2)))
 (format #f "~:@(~x-~x~)" low high)))
 
+(define %fat32-uuid-rx
+  (make-regexp "^([[:xdigit:]]{4})-([[:xdigit:]]{4})$"))
+
+(define (string->fat32-uuid str)
+  "Parse STR, which is in FAT32 format, and return a bytevector or #f."
+  (match (regexp-exec %fat32-uuid-rx str)
+(#f
+ #f)
+(rx-match
+ (uint-list->bytevector (list (string->number
+   (match:substring rx-match 1) 16)
+  (string->number
+   (match:substring rx-match 2) 16))
+%fat32-endianness
+2
+
 
 ;;;
 ;;; Generic interface.
@@ -198,6 +215,7 @@ ISO9660 UUID representation."
 (define %uuid-parsers
   (vhashq
('dce 'ext2 'ext3 'ext4 'btrfs 'luks => string->dce-uuid)
+   ('fat32 'fat => string->fat32-uuid)
('iso9660 => string->iso9660-uuid)))
 
 (define %uuid-printers


Re: Which Emacs version used to build Emacs packages with emacs-checkout?

2017-09-22 Thread Oleg Pykhalov
Hello Alex,

Alex Kost  writes:

> Oleg Pykhalov (2017-09-07 21:49 +0300) wrote:
>
>> Hello Guix,
>>
>> Here is a =emacs-checkout= snippet which works for me.  Enjoy it if
>> somebody need it.
>>
>> I'm little bit confused about Emacs **version** that is used inside
>> =emacs-build-systems= and inputs which use =emacs-minimal=.
>>
>> If I define a new package with =-checkout= suffix and install it, for
>> example =guix package -i emacs@26.0.50-1.f0eb70d= it works fine.
>>
>> As I notice all packages which uses =emacs-build-system= will use
>> original Guix Emacs version package.  Am I right?
>
> Right, by default 'emacs-build-system' uses the current 'emacs-minimal'
> package.

OK, I made a new emacs-minimal-checkout package based on emacs-checkout.

--8<---cut here---start->8---
(define-public emacs-minimal-checkout
  ;; This is the version that you should use as an input to packages that just
  ;; need to byte-compile .el files.
  (package
(inherit emacs-checkout)
(name "emacs-minimal")
(synopsis "The extensible text editor (used only for byte-compilation)")
(build-system gnu-build-system)
(arguments
 (substitute-keyword-arguments (package-arguments emacs)
   ((#:phases phases)
`(modify-phases ,phases
   (delete 'install-site-start)
(inputs
 `(("ncurses" ,ncurses)))
(native-inputs
 `(("pkg-config" ,pkg-config)
--8<---cut here---end--->8---

--8<---cut here---start->8---
(define-public emacs-checkout
  (let ((commit "6d6dc246f93486fc8370399b6e1af8a17f371e4f")
(revision "1"))
(package
  (inherit emacs)
  (name "emacs")
  (version (string-append (package-version emacs) "-" revision "."
  (string-take commit 7)))
  (source
   (origin
 (method git-fetch)
 (uri (git-reference
   ;; "git://git.savannah.gnu.org/emacs.git"
   (url "git://localhost/~natsu/src/emacs")
   (commit commit)))
 (file-name (string-append name "-" version "-checkout"))
 (patches (search-patches "emacs-exec-path.patch"
  "emacs-source-date-epoch.patch"))
 (modules '((guix build utils)))
 (snippet
  ;; Delete the bundled byte-compiled elisp files and
  ;; generated autoloads.
  '(with-directory-excursion "lisp"
 (for-each delete-file
   (append (find-files "." "\\.elc$")
   (find-files "." "loaddefs\\.el$")))

 ;; Make sure Tramp looks for binaries in the right places on
 ;; remote GuixSD machines, where 'getconf PATH' returns
 ;; something bogus.
 (substitute* "net/tramp-sh.el"
   ;; Patch the line after "(defcustom tramp-remote-path".
   (("\\(tramp-default-remote-path")
(format #f "(tramp-default-remote-path ~s ~s ~s ~s "
"~/.guix-profile/bin" "~/.guix-profile/sbin"
"/run/current-system/profile/bin"
"/run/current-system/profile/sbin")
 (sha256
  (base32 "17x0jpyg6wrdh5wn9yf1135gkdcprbcx1hj2wiwla57dh7rihils"
  (native-inputs
   `(("autoconf" ,autoconf)
 ("automake" ,automake)
 ("bash" ,bash-minimal)
 ("perl" ,perl)
 ("rc" ,rc)
 ("python" ,python-2.7)
 ("chez-scheme" ,chez-scheme)
 ,@(package-native-inputs emacs)))
  (arguments
   (substitute-keyword-arguments
   `(#:parallel-build? #t
   #:tests? #f
   ,@(package-arguments emacs))
 ((#:phases phases)
  `(modify-phases ,phases
 (add-after 'unpack 'autogen
   (lambda _
 (zero? (system* "sh" "autogen.sh"
 (delete 'reset-gzip-timestamps
--8<---cut here---end--->8---

>> Then, all Emacs packages will be build by =emacs-minimal= which is
>> original Guix Emacs version.
>
> Yes.  Note that this default emacs can be overrided on a package level
> by using #:emacs keyword in the arguments.  See 'emacs-auctex' package
> for example.

Ah, this is bad for me.  Now I need to redefine all those “#:emacs
,emacs” to “#:emacs ,emacs-checkout” as I guess.  Or I need to redefine
“emacs” variable instead of inherit it in “emacs-checkout”.

>> I found =(setq load-prefer-newer t)= way to avoid loading old compiled
>> elisp files, but it's not what I really want.
>
> This (I mean 'load-prefer-newer') is one of my favourite setting :-)
> But it is not clear for me, what do you really want?
>
>> Thoughts?  :-)
>
> Sorry, but I don't understand what you are asking about :-)

I want to have Emacs builded from my local Git repository.  And I 

guix pull fails on powerful server

2017-09-22 Thread Ricardo Wurmus
Hi there,

I have a big server with 1.5T RAM and 192 CPU cores.  “guix pull”
is very slow and crashes with the error below:

--8<---cut here---start->8---
[root@murphy:~] (1001) $ guix pull
guile: warning: failed to install locale
warning: failed to install locale: Invalid argument
substitute: guile: warning: failed to install locale
substitute: warning: failed to install locale: Invalid argument

Starting download of /tmp/guix-file.Px0iiK
>From https://git.savannah.gnu.org/cgit/guix.git/snapshot/master.tar.gz...
 tar.gz 3.9MiB/s 00:03 | 13.6MiB transferred
unpacking '/gnu/store/vl04ygdiyqwbs1ms1rrx495g2yn44ipc-guix-latest.tar.gz'...
substitute: updating list of substitutes from 'https://mirror.hydra.gnu.org'... 
100.0%
The following derivation will be built:
   /gnu/store/yvyfkns3w3vm7ynwbr7mvxcmin4gd2a0-guix-latest.drv
copying and compiling to 
'/gnu/store/7m52dkr98nhwgpsx20mmpwyw2yzj58d3-guix-latest' with Guile 2.2.2...
loading...   25.4% of 629 filesrandom seed for tests: 1506066913
loading...   99.8% of 629 files
compiling... 69.2% of 629 filesice-9/threads.scm:289:22: In procedure loop:
ice-9/threads.scm:289:22: Syntax error:
guix/scripts.scm:130:2: >>=: >>= (bind) used outside of 'with-monad' in form 
(>>= (apply set-build-options* #:use-substitutes
ptions)) (lambda (unused-value) (mbegin %store-monad (mlet %store-monad 
((derivation (origin->derivation (package-source pack
tutes? use-substitutes? #:dry-run? dry-run?) (return (show-derivation-outputs 
derivation)))

Some deprecated features have been used.  Set the environment
variable GUILE_WARN_DEPRECATED to "detailed" and rerun the
program to get more information.  Set it to "no" to suppress
this message.
builder for `/gnu/store/yvyfkns3w3vm7ynwbr7mvxcmin4gd2a0-guix-latest.drv' 
failed with exit code 1
guix pull: error: build failed: build of 
`/gnu/store/yvyfkns3w3vm7ynwbr7mvxcmin4gd2a0-guix-latest.drv' failed
--8<---cut here---end--->8---

Here’s the version of Guix:

--8<---cut here---start->8---
[root@murphy:~] (1003) $ guix --version
guile: warning: failed to install locale
warning: failed to install locale: Invalid argument
guix (GNU Guix) 
Copyright (C) 2017 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.
[root@murphy:~] (1004) $ which guix
/root/.guix-profile/bin/guix
[root@murphy:~] (1005) $ readlink -f /root/.guix-profile/bin/guix
/gnu/store/m6nlmnlyr5d8d97k8lgp6ig2r2nxgf3r-guix-0.13.0-5.228a398/bin/guix
--8<---cut here---end--->8---

Is this related to Guile’s memory problems?

-- 
Ricardo

GPG: BCA6 89B6 3655 3801 C3C6  2150 197A 5888 235F ACAC
https://elephly.net