Failure to ,expand use-package-module

2017-11-15 Thread Chris Marusich
Hi Guix,

At the Guile REPL, why does macro expansion of a use-package-modules
invocation fail when the package in question doesn't exist, but it
succeeds when the package exists?

Here's an example:

--8<---cut here---start->8---
scheme@(guile-user)> ,use (gnu)
scheme@(guile-user)> ,expand (use-package-modules foo)
While executing meta-command:
ERROR: no code for module (gnu packages foo)
scheme@(guile-user)> ,expand (use-package-modules base)
$1 = (begin
  ((@@ (guile) process-use-modules)
   ((@@ (guile) list) '((gnu packages base
  (if #f #f))
--8<---cut here---end--->8---

Since ,expand is supposed to expand macros in a form, I did not expect
the existence or non-existence of the package to matter.  There's a gap
in my understanding here, and I'm hoping you can help to fill it.

-- 
Chris


signature.asc
Description: PGP signature


"guix-latest" differs when two users run "guix pull" from same commit

2017-11-15 Thread Chris Marusich
Hi,

When two users run "guix pull" using the same commit, two different
versions of "guix-latest" get built.  This surprised me, and in any case
it seems inefficient to build the same version of Guix two times.  Why
do two different derivations get built?

Here's an invocation of "guix pull" as an unprivileged user:

--8<---cut here---start->8---
$ guix pull
...
Building from Git commit ed0f9f53abef57b9f33d3b2eada40375894bdff6...
...
The following derivation will be built:
   /gnu/store/m3x8069x5aspc29m9ay7idndz0kpfxlb-guix-latest.drv
copying and compiling to 
'/gnu/store/dn13gs9w16h5w6l77pnpbclqxnbyhh4m-guix-latest' with Guile 2.2.2...
--8<---cut here---end--->8---

And here's an invocation of "guix pull" as root:

--8<---cut here---start->8---
# guix pull
...
Building from Git commit ed0f9f53abef57b9f33d3b2eada40375894bdff6...
...
The following derivation will be built:
   /gnu/store/675pz9f4qz9dd4jikzcgzv62kjrxfhmg-guix-latest.drv
copying and compiling to 
'/gnu/store/cvc0rf65s3mjw9rjps80ram3898qdws3-guix-latest' with Guile 2.2.2...
--8<---cut here---end--->8---

I am surprised that these two invocations of "guix pull" build different
derivations.  I understand that the overall "guix pull" action requires
side effects outside of the store which will be different depending on
who invoked the command (e.g., to update the $HOME/.config/guix/latest
symlink), but that stuff isn't performed by a derivation.  I expect two
derivations that build Guix (or any software component) from the same
source to be identical, so I am surprised.

I have looked at the source code for "guix pull," and I cannot find any
obvious reason why the derivations should differ.  Does anyone know why
they differ?

-- 
Chris


signature.asc
Description: PGP signature


Re: partitions and filesystems

2017-11-15 Thread Oleg Pykhalov
Hello Marco,

Thank you for catching this!

Marco van Hulten  writes:

> Something is not so clear to me on this page:
>
> https://www.gnu.org/software/guix/manual/html_node/Preparing-for-Installation.html
>
> under section "6.1.4.3 Disk Partitioning":
>
>> Preferably, assign partitions a label so that you can easily and
>> reliably refer to them in file-system declarations (see File
>> Systems). This is typically done using the -L option of mkfs.ext4 and
>> related commands. So, assuming the target root partition lives
>> at /dev/sda1, a file system with the label my-root can be created
>> with: mkfs.ext4 [...]
>
> and
>
>> mount the target root partition under /mnt with a command like
>> (again, assuming my-root is the label of the root partition)
>
> Wait, "my-root" was the label of the filesystem, right?
>
>
> I think the terms "partition" and "filesystem" are confused here.  I
> propose that this be correct and consistent, so
>
> - a partition has a "partition label";
> - a filesystem has a "filesystem label", or "volume label" when
>   following mkfs(8) terminology.

This makes sense.  Also here is additional information.

https://superuser.com/questions/1099232/what-is-the-difference-between-a-partition-name-and-a-partition-label/1099292

The GPT disk format can simply contain more data than its
predecessors.  One of these fields is the partition name, which,
as you have found, can be set by gdisk or similar.  However,
before GPT, there were formats which didn't support labels in
the partition table (e.g. MBR), so the data was stored in the fs
as a filesystem label.  Using GPT with a filesystem that
supports labels (i.e.  basically anything) therefore produces
the slightly confusing combination of partition name/label and
filesystem name/label.

These values are totally independent, (although I don't exactly
recommend making them totally different) and most programs will
use the fs label, as that one is available across basically all
file systems, unlike the partition name, which is only on GPT.
However, some programs can use the partition name too.  (E.g.
/dev/disk/ contains by-label/ as well as by-partlabel/.)

--8<---cut here---start->8---
$ sudo blkid
/dev/sda1: SEC_TYPE="msdos" UUID="…" TYPE="vfat" PARTLABEL="EFI System 
Partition" PARTUUID="…"
/dev/sda2: LABEL="magnolia-root" UUID="…" TYPE="ext4" PARTUUID="…"
/dev/sdb1: LABEL="magnolia-data" UUID="…" TYPE="ext4" PARTUUID="…"
--8<---cut here---end--->8---

--8<---cut here---start->8---
$ ls /dev/disk/{by-label,by-partlabel}

/dev/disk/by-label:
magnolia-data  magnolia-root

/dev/disk/by-partlabel:
'EFI\x20System\x20Partition'
--8<---cut here---end--->8---

> Could someone make this consistent?  Or I could propose an updated text.
> Should I send them in plain text to guix-devel?

We need someone to make a patch.  I attached one below.  If it is not
good enough, you could send “updated text” as a “plain text” file or as
a patch to this mailing list or guix-de...@gnu.org or bug-g...@gnu.org.

From 3d39f3c02b4e7192ce8879b86f75434b1bd692e0 Mon Sep 17 00:00:00 2001
From: Marco van Hulten 
Date: Thu, 16 Nov 2017 06:21:23 +0300
Subject: [PATCH] doc: Unconfuse my-root file system label and partition label.

* doc/guix.texi (Preparing for Installation): Unconfuse 'my-root' file system
  label and partition label.
---
 doc/guix.texi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 098ff5e54..8045312e5 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -8072,7 +8072,7 @@ types.}.  For the ESP, if you have one and assuming it is
 mkfs.fat -F32 /dev/sda2
 @end example
 
-Preferably, assign partitions a label so that you can easily and
+Preferably, assign file system a label so that you can easily and
 reliably refer to them in @code{file-system} declarations (@pxref{File
 Systems}).  This is typically done using the @code{-L} option of
 @command{mkfs.ext4} and related commands.  So, assuming the target root
@@ -8099,7 +8099,7 @@ mkfs.ext4 -L my-root /dev/mapper/my-partition
 
 Once that is done, mount the target root partition under @file{/mnt}
 with a command like (again, assuming @code{my-root} is the label of the
-root partition):
+root file system):
 
 @example
 mount LABEL=my-root /mnt
-- 
2.15.0


Oleg.


signature.asc
Description: PGP signature