bug#62932: emacs-git-timemachine broken `define-transient-command'

2023-04-18 Thread Jan Nieuwenhuizen
Hi!

Trying to use M-x git-timemachine gives

command-execute: Symbol’s function definition is void: 
define-transient-command

Greetings,
Janneke

-- 
Janneke Nieuwenhuizen   | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com





bug#41264: bug#49985: Bootstrap packages fail to build due to mes-libc lacking 'stat64' etc. syscalls

2023-02-13 Thread Jan Nieuwenhuizen
Jan Nieuwenhuizen writes:

Hello!

> Mathieu Othacehe writes:
[..]
>> lib/linux/stat.c should be modified this way:
>>
>> #if __i386__
>> #define STAT_SYSCALL SYS_stat64
>> #else
>> #define STAT_SYSCALL SYS_stat
>> #endif
>
> Ah...the stat64 syscall is meant for i386; now it at starts making at
> least some sense to me.
[..]
>> This way, we would replicate the glibc behavior.
>
> Beautiful, thanks for getting to the bottom of this.  Now that you
> already have gone this far, would you like to whip-up a full patch for
> GNU Mes?
[..]

To use stat64 and friends on 32bit, I created the attached patch for GNU
Mes and hope to create a 0.24.2 release from

https://gitlab.com/janneke/mes/-/tree/wip-stat64

Also, I have update my core-updates branch with preliminary 0.24.2 mes
and mes-boot packages here

https://gitlab.com/janneke/guix/-/tree/core-updates

Greetings,
Janneke

>From bc1fa57851d360abb161c54dce5339ad9d7af7aa Mon Sep 17 00:00:00 2001
From: "Jan (janneke) Nieuwenhuizen" 
Date: Sat, 29 Oct 2022 13:17:58 +0200
Subject: [PATCH] lib: stat: Use SYS_stat64 for 32bit platforms.

This fixes <https://debbugs.gnu.org/41264>.

* include/linux/arm/syscall.h (SYS_stat64, SYS_lstat64,
SYS_fstat64)[__SIZEOF_LONG_LONG__ == 8]:
New defines.
(SYS_stat, SYS_lstat, SYS_fstat)[__SIZEOF_LONG_LONG__ == 8]: Redefine them.
* include/linux/x86/syscall.h (SYS_stat64, SYS_lstat64,
SYS_fstat64)[__SIZEOF_LONG_LONG__ == 8]:
New defines.
(SYS_stat, SYS_lstat, SYS_fstat)[__SIZEOF_LONG_LONG__ == 8]: Redefine them.
* include/sys/stat.h (struct stat): Move definition to...
* include/linux/arm/kernel-stat.h,
include/linux/m2/kernel-stat.h,
include/linux/x86/kernel-stat.h,
include/linux/x86_64/kernel-stat.h: These new files.
* include/gnu/x86/kernel-stat.h: New file.
* configure (main): Copy include///*.h to
include/.
* configure.sh: Likewise.
* .gitignore: Ignore them.  Add copyright header.
* build-aux/GNUmakefile.in (X86_ARCH_HEADERS, ARCH_HEADERS): New
variables.
(build): Use them.
(include/arch/%.h, arch-dir): New targets.
* build-aux/bootstrap.sh.in (AM_CPPFLAGS): Replace
include// with built ../include.
* build-aux/build.sh.in (AM_CPPFLAGS): Likewise.
* build-aux/install.sh.in: Also install built include.
* include/m2/types.h: New file.
* kaem.run: Use it.
* simple.sh: Copy kernel-stat.h, syscall.h for kernel/cpu to
include/arch.
---
 .gitignore |  19 
 build-aux/GNUmakefile.in   |  11 ++-
 build-aux/bootstrap.sh.in  |   4 +-
 build-aux/build.sh.in  |  11 ++-
 build-aux/install.sh.in|   3 +-
 configure  |   7 ++
 configure.sh   |   4 +
 include/gnu/x86/kernel-stat.h  |  25 ++
 include/linux/arm/kernel-stat.h|  79 +
 include/linux/arm/syscall.h|  19 
 include/linux/m2/kernel-stat.h |  47 ++
 include/linux/x86/kernel-stat.h|  79 +
 include/linux/x86/syscall.h|  20 -
 include/linux/x86_64/kernel-stat.h |  51 +++
 include/m2/types.h | 138 +
 include/sys/stat.h |  51 +--
 kaem.run   |   3 +
 lib/linux/_getcwd.c|   4 +-
 lib/linux/_open3.c |   2 +-
 lib/linux/_read.c  |   4 +-
 lib/linux/access.c |   4 +-
 lib/linux/brk.c|   4 +-
 lib/linux/chdir.c  |   4 +-
 lib/linux/chmod.c  |   4 +-
 lib/linux/clock_gettime.c  |   4 +-
 lib/linux/close.c  |   4 +-
 lib/linux/dup.c|   4 +-
 lib/linux/dup2.c   |   4 +-
 lib/linux/execve.c |   4 +-
 lib/linux/fcntl.c  |   4 +-
 lib/linux/fork.c   |   4 +-
 lib/linux/fstat.c  |   4 +-
 lib/linux/fsync.c  |   4 +-
 lib/linux/getdents.c   |   4 +-
 lib/linux/getegid.c|   4 +-
 lib/linux/geteuid.c|   4 +-
 lib/linux/getgid.c |   4 +-
 lib/linux/getpid.c |   4 +-
 lib/linux/getppid.c|   4 +-
 lib/linux/getrusage.c  |   4 +-
 lib/linux/gettimeofday.c   |   4 +-
 lib/linux/getuid.c |   4 +-
 lib/linux/ioctl.c  |   2 +-
 lib/linux/ioctl3.c |   2 +-
 lib/linux/kill.c   |   4 +-
 lib/linux/link.c   |   4 +-
 lib/linux/lseek.c  |   2 +-
 lib/linux/lstat.c  |   4 +-
 lib/linux/mkdir.c  |   4 +-
 lib/linux/mknod.c  |   4 +-
 lib/linux/nanosleep.c  |   4 +-
 lib/linux/pipe.c   |   4 +-
 lib/linux/read.c   |   2 +-
 lib/linux/readlink.c   |   4 +-
 lib/linux/rename.

bug#55013: Guix-emacs doesn't work

2022-04-21 Thread Jan Nieuwenhuizen
Giovanni Biscuolo writes:

Hi!

> I was able to solve.

Great!

> I repeat, I'm using emacs-guix on a foreing distro, I don't know if on
> Guix System this workaround is not needed.

I'm on Guix System and emacs-guix's command line completion hasn't
worked for me for about a year.  Starting an emacs shell and typing
"guix TAB", I got

Starting Guix REPL ... [5 times]
guix-geiser-eval: Error in evaluating guile expression: 
ice-9/boot-9.scm:1685:16: In procedure raise-exception:

/home/janneke/.config/guix/current/share/guile/site/3.0/guix/scripts/deploy.scm:169:7:
 Unknown # object: "#~"

Entering a new prompt.  Type `,bt' for a backtrace or `,q' to continue.
scheme@(emacs-guix) [1]> 

> The most similar upstream bug is this one:
> https://gitlab.com/emacs-guix/emacs-guix/-/issues/23
>
> In that thread Adam Porter points to this comment that explains how to
> start Guix REPL instead of Guile REPL, from emacs-guix:
> https://gitlab.com/emacs-guix/emacs-guix/-/issues/19#note_559028370
>
> (with-eval-after-load 'guix-repl
> (setq guix-guile-program  '("guix" "repl")
>   guix-config-scheme-compiled-directory  nil
>   guix-repl-use-latest  nil
>   guix-repl-use-server  nil))
>
> Evaluating the above code /before/ starting any emacs-guix command (thus
> before starting Guile REPL) all is working well now!

This sort-of works for me, i.e., typing "guix TAB" in an emacs shell
buffer no longer gives this error...but there also are no completions.

My ~/.emacs/init_bash.sh is empty and I seem to remember having
something there?

Greetings,
Janneke

-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com





bug#43166: The issues.guix.gnu.org is hard to read in emacs-w3m.

2021-12-12 Thread Jan Nieuwenhuizen
Ricardo Wurmus writes:

> This is now fixed in mumi.  I tested the change in eww and in icecat.

Lovely, thank you!

Greetings,
Janneke

-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com





bug#50945: Guix home: No such file or directory: "/run/user/1003/on-first-login-executed"

2021-10-01 Thread Jan Nieuwenhuizen
Hi,

When using su or sudo to enter an account managed by guix home, I get
this error

--8<---cut here---start->8---
Backtrace:
   2 (primitive-load "/home/guix/.guix-home/on-first-login")
In ice-9/ports.scm:
   461:11  1 (call-with-output-file "/run/user/1003/on-first-login-…" …)
In unknown file:
   0 (open-file "/run/user/1003/on-first-login-executed" "w" …)

ERROR: In procedure open-file:
In procedure open-file: No such file or directory: 
"/run/user/1003/on-first-login-executed"
--8<---cut here---end--->8---

Upon a console login or ssh login, /var/run/1003 is created and all is fine.

See below for the scenario, home-minimal.scm is attached.

Greetings,
Janneke


$ ssh guix@localhost -p 
guix@localhost's password: 
Last login: Tue Jun 23 11:45:08 2020 from 2001:980:1b4f:1:216:d3ff:fe29:7cdb
guix@dundal ~$ guix home reconfigure home-minimal.scm
/gnu/store/fgxpmf1iwjp9f8dfyaf7wxqa8105lq3w-home
Cleaning up symlinks from previous home-environment.

Skipping /home/guix/.config/fontconfig (not an empty directory)... done
Skipping /home/guix/.config (not an empty directory)... done
Cleanup finished.

New symlinks to home-environment will be created soon.
All conflicting files will go to 
/home/guix/1633101995-guix-home-legacy-configs-backup.

Skipping   /home/guix/.config (directory already exists)... done
Creating   /home/guix/.config/fontconfig... done
Symlinking /home/guix/.config/fontconfig/fonts.conf -> 
/gnu/store/phj2z2iiqdhryfy7mqral0b9qz3hlva6-fonts.conf... done
Symlinking /home/guix/.config/test.conf -> 
/gnu/store/bdixb09v30bvhpgi2f6ndiq25wzb9l74-tmp-file.txt... done
Symlinking /home/guix/.bash_profile -> 
/gnu/store/j3vhlswj46psxicapnq8c9p1jrwd55rk-bash_profile... done
Symlinking /home/guix/.profile -> 
/gnu/store/fxbppk3pqzdi3zzy0xl5vg1ir6c5jzq5-shell-profile... done
Symlinking /home/guix/.bashrc -> 
/gnu/store/513j2xkszmcmv7fiawh59mr0i1fmin55-bashrc... done
 done
Finished updating symlinks.

Comparing /gnu/store/fgxpmf1iwjp9f8dfyaf7wxqa8105lq3w-home/profile/share/fonts 
and
  
/gnu/store/fgxpmf1iwjp9f8dfyaf7wxqa8105lq3w-home/profile/share/fonts... done 
(same)
Evaling on-change gexps.

On-change gexps evaluation finished.

guix@dundal ~$ guix home list-generations
]8;;file://dundal/var/guix/profiles/per-user/guix/guix-home-1-link\Generation 1 
Oct 01 2021 12:19:16]8;;\   (current)
  file name: /var/guix/profiles/per-user/guix/guix-home-1-link
  canonical file name: /gnu/store/fgxpmf1iwjp9f8dfyaf7wxqa8105lq3w-home
  channels:
guix:
  repository URL: https://git.savannah.gnu.org/git/guix.git
  branch: master
  commit: 
]8;;https://git.savannah.gnu.org/cgit/guix.git/commit/?id=56b10709efc4eb35df66f52a20ce3cb7fab4fee6\56b10709efc4eb35df66f52a20ce3cb7fab4fee6]8;;\
  configuration file: 
]8;;file://dundal/gnu/store/kjha5z8mck0pa9jrgx2266rq1lvlb3ji-configuration.scm\/gnu/store/kjha5z8mck0pa9jrgx2266rq1lvlb3ji-configuration.scm]8;;\
guix@dundal ~$ logout
Connection to localhost closed.
17:26:49 janneke@dundal:~
$ sudo -i -u guix
Password: 
Backtrace:
   2 (primitive-load "/home/guix/.guix-home/on-first-login")
In ice-9/ports.scm:
   461:11  1 (call-with-output-file "/run/user/1003/on-first-login-…" …)
In unknown file:
   0 (open-file "/run/user/1003/on-first-login-executed" "w" …)

ERROR: In procedure open-file:
In procedure open-file: No such file or directory: 
"/run/user/1003/on-first-login-executed"
guix@dundal ~$ ls -ltrF /run/user
total 0
drwx--  7 gdm gdm 160 Oct  1 12:16 971/
drwx-- 13 janneke janneke 260 Oct  1 13:07 1000/
guix@dundal ~$ logout
17:29:34 janneke@dundal:~
$ su - guix
Password: 
Backtrace:
   2 (primitive-load "/home/guix/.guix-home/on-first-login")
In ice-9/ports.scm:
   461:11  1 (call-with-output-file "/run/user/1003/on-first-login-…" …)
In unknown file:
   0 (open-file "/run/user/1003/on-first-login-executed" "w" …)

ERROR: In procedure open-file:
In procedure open-file: No such file or directory: 
"/run/user/1003/on-first-login-executed"
17:37:33 janneke@dundal:~
$ ssh guix@localhost -p 
guix@localhost's password: 
Last login: Fri Oct  1 17:23:35 2021 from 127.0.0.1
guix@dundal ~$ 



home-minimal.scm
Description: Binary data

-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com


bug#49515: [core-updates] mescc-tools tests fail

2021-07-26 Thread Jan Nieuwenhuizen
Ludovic Courtès writes:

Hi Ludo!

> Jan Nieuwenhuizen  skribis:
>
>>> Should we upgrade instead?  If we do, what’s the potential for breakage?
>>> Should ‘mes-rb5’ be kept on an older version?
>>
>> We could try that, I really can't tell if upgrading to 1.1.0 creates
>> a different mes binary.
>
> I took this route and everything went well, and we can now build
> ‘bootstrap-tarballs’ on x86_64-linux.  I ended up doing additional
> changes:
>
>   e2690a8eb2 gnu: mes-rb5: Remove.
>   da32015db0 gnu: mes-minimal-stripped: Explicitly disallow references.
>   5510e1c483 gnu: mes: Remove 0.19.
>   81096caf7d gnu: mes: Switch to Guile 3.0.
>   114a9f1f80 gnu: mescc-tools: Update to 1.2.0.
>   0b9da8b5a2 gnu: m2-planet: Update to 1.8.0.
>   8b627a7701 gnu: mes-minimal: Remove unused variable.

> Removing ‘mes-rb5’ was a bit disheartening but I guess it’d have to be
> updated to the current tool versions.

Yeah, a bit sad but OK I guess.

> I removed Mes 0.19 because it failed to build with Guile 3.0 and didn’t
> appear to be needed any longer.
>
> Let me know if you think I did anything wrong!

LGTM!

Greetings,
Janneke

-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com





bug#49515: [core-updates] mescc-tools tests fail

2021-07-18 Thread Jan Nieuwenhuizen
Ludovic Courtès writes:

Hello,

> Ludovic Courtès  skribis:
>
>> On commit 9b4c3c675c05870e5983c21ce4ff944e0b0bc2fa of ‘core-updates’,
>> mescc-tools fails tests, with generated binaries segfaulting:
>>
>> $ ./pre-inst-env guix build mescc-tools
>>
>> […]
>>
>> + . ./sha256.sh
>> ++ set -ex
>> ++ ./bin/get_machine
>> + ./bin/M1 -f test/test3/defs -f test/test3/lisp.s --BigEndian 
>> --architecture knight-native -o test/test3/hold
>> + '[' amd64 = amd64 ']'
>> + ./test/results/test1-binary
>> + ./bin/hex2 -f elf_headers/elf32.hex2 -f test/test2/hold --LittleEndian 
>> --architecture x86 --BaseAddress 0x8048000 -o test/results/test2-binary 
>> --exec_enable
>> test/test1/hello.sh: line 37:   125 Segmentation fault  
>> ./test/results/test1-binary < test/test1/hex0.hex0 > test/test1/proof1
>
> [...]

How weird!  I wonder what changed...

>> builder for 
>> `/gnu/store/lir8pmc63k1bcj4ml9gsx1769aw9ndj2-mescc-tools-0.7.0.drv' failed 
>> with exit code 1
>
> I found that this upstream commit, which made it in version 1.1.0, fixes
> the segfault:
>
>   commit e633669dfdf16f503a7d740b9058e343536533b4
>   Author: nimaje 
>   Date:   Thu Oct 15 19:12:18 2020 -0400
>
>   Fix ELF headers to be more well behaved

[..]

> Should we upgrade instead?  If we do, what’s the potential for breakage?
> Should ‘mes-rb5’ be kept on an older version?

We could try that, I really can't tell if upgrading to 1.1.0 creates
a different mes binary.

Greetings,
Janneke

-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com





bug#48223: EXWM knows nothing about Guix profiles

2021-05-08 Thread Jan Nieuwenhuizen
> Leo Prikler  writes:

Hello again,

>> I think the launcher that we install in the install-xsession does not
>> do sufficient work to set up the environment variables of the session
>> appropriately.  In particular, I think it should source /etc/profile
>> prior to running Emacs.
>>
>> WDYT?
>
> I think this is a very good idea.

To follow-up on this: at first glance sourcing /etc/profile seemed to
fix my problem.  However, I am calling some scripts from Emacs that need
my ~/.bash_profile to be sourced too.

So this got me wondering, something has definately changed here.
Before, this used to work OOTB.  Any ideas what may have changed?

BTW, I only tested with slim

--8<---cut here---start->8---
(service slim-service-type
  (slim-configuration
   (auto-login? #t)
   (allow-empty-passwords? #t)
   (default-user "janneke")
   ;;(auto-login-session (file-append emacs-exwm "/bin/exwm"))
   (auto-login-session "/home/janneke/bin/exwm")
   (xorg-configuration
(xorg-configuration
 (keyboard-layout keyboard-layout)
 (server-arguments '("-listen" "tcp"
--8<---cut here---end--->8---

and now use the attached exwm, which works OK for me.

Greetings,
Janneke



exwm
Description: Binary data

-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com


bug#47055: guix upgrade throws a backtrace

2021-03-10 Thread Jan Wielkiewicz
Hello, running guix pull and then guix upgrade gave me this backtrace.
The version is: guix (GNU Guix) 6e70211b20537b018e639b0114d3ccddd4924acb

Backtrace:
In guix/ui.scm:
  2164:12 19 (run-guix-command _ . _)
In guix/scripts/substitute.scm:
633:2 18 (guix-substitute . _)
In unknown file:
  17 (with-continuation-barrier #)
In ice-9/boot-9.scm:
  1736:10 16 (with-exception-handler _ _ #:unwind? _ # _)
In unknown file:
  15 (apply-smob/0 #)
In ice-9/boot-9.scm:
  1736:10 14 (with-exception-handler _ _ #:unwind? _ # _)
  1736:10 13 (with-exception-handler _ _ #:unwind? _ # _)
  1731:15 12 (with-exception-handler # …)
In guix/scripts/substitute.scm:
   682:17 11 (_)
391:7 10 (process-substitution _ "/gnu/store/9iyfc2g1585ps9danh…" …)
In ice-9/boot-9.scm:
  1736:10  9 (with-exception-handler _ _ #:unwind? _ # _)
In guix/scripts/substitute.scm:
400:9  8 (_)
In ice-9/boot-9.scm:
  1731:15  7 (with-exception-handler # …)
  1669:16  6 (raise-exception _ #:continuable? _)
  1667:16  5 (raise-exception _ #:continuable? _)
  1669:16  4 (raise-exception _ #:continuable? _)
  1764:13  3 (_ #< components: (#<> #<…>)
  1669:16  2 (raise-exception _ #:continuable? _)
  1667:16  1 (raise-exception _ #:continuable? _)
V)ï¾ÉD­substitution of
/gnu/store/9iyfc2g1585ps9danh95p0mw56pw8ik5-bison-3.5.3 failed _
#:continuable? _)ð­^zܪÅszò guix system: error: corrupt input
while restoring archive from #


Jan Wielkiewicz





bug#45962: ‘binutils-mesboot0’ includes non-zero timestamps in ar archives

2021-03-09 Thread Jan Nieuwenhuizen
Ludovic Courtès writes:

Hey Ludo!

> Jan Nieuwenhuizen  skribis:
>
> I can think of two possibilities, then: (1) apply the patch in a phase
> rather than via the ‘patches’ field, and (2) arrange so that
> ‘patch-and-repack’ does not compress the patched code or compresses it
> with the bootstrap gzip.

Oh, that would be nice: we could remove all these clumsy manual patching
stages.  Also, we may be able to remove XZ from the bootstrap chain, if
no XZ-repackaging happens and only build a final version.

> My understanding is that #2 may be doable now thanks to Maxim’s recent
> changes.  I’ll take a look!

Great!
Greetings,
Janneke

-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com





bug#45962: ‘binutils-mesboot0’ includes non-zero timestamps in ar archives

2021-03-03 Thread Jan Nieuwenhuizen
Ludovic Courtès writes:

Hello!

> Ludovic Courtès  skribis:
>
>> On #bootstrappable, mid-kid reported that ‘binutils-mesboot0’ in
>> commencement.scm lacks ‘--enable-deterministic-archives’.  So I checked
>> if this had an effect by running:

> [...]
>
>> Apparently Binutils 2.14 didn’t have ‘--enable-deterministic-archives’
>> so we’ll have to patch it.
>
> Sikonas on #bootstrappable provided a patch for that (thanks!) so I went
> ahead and gave it a try on ‘core-updates’ (Guix patch attached).

Great!

> The binutils source gets patched and repacked, but then decompressing it
> fails:

[..]

> Maxime, does that ring a bell?  Could it be that this bootstrap ‘xz’ is
> less capable, or could it be a Gash-Utils bug?

Currently, we avoid using non-bootstrapped binaries in the bootstrap,
that includes 'xz'; earlier in the bootstrap that includes also 'patch'.

See also gcc-core-mesboot0: it applies the patch in a manual phase.  So
I'm not sure if we want to start depending on 'xz' an this stage?

Greetings,
Janneke

-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com





bug#45618: development childhurd fails to build: glib@2.62.6: build system `meson'

2021-01-14 Thread Jan Nieuwenhuizen
Jan Nieuwenhuizen writes:

Hello,

> On current master
>
> 395489cdc959c3f3c026bf545c3ed95efc9919f0
> gnu: spice-vdagent: Update to 0.20.0.
>
> building
>
> ./pre-inst-env guix system disk-image --target=i586-pc-gnu 
> gnu/system/examples/devel-hurd.tmpl
>
> fail with
>
> guix system: error: gnu/packages/glib.scm:181:2: glib@2.62.6: build system 
> `meson' does not support cross builds

My bad, turns out to be the new guile-avahi dependency that cannot be
cross-built.

For the archives, find an updated devel-hurd.tmpl attached that removes
guile-avahi.

Greetings,
Janneke



devel-hurd.tmpl
Description: Binary data

-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com


bug#45867: hurd-vm: custom disk-size ignored

2021-01-14 Thread Jan Nieuwenhuizen
Jan Nieuwenhuizen writes:

> On current master, setting a bigger disk-size for a childhurd
>
>   (service hurd-vm-service-type
>(hurd-vm-configuration
> (disk-size (* 12 (expt 2 30))) ;12GiB
>
>
> is being ignored.  I am suspecting

[..]

> disk-size goes unused.  So we probably need something like
>
> diff --git a/gnu/services/virtualization.scm b/gnu/services/virtualization.scm
> index f435630faf..3ede822183 100644
> --- a/gnu/services/virtualization.scm
> +++ b/gnu/services/virtualization.scm
> @@ -917,7 +917,9 @@ is added to the OS specified in CONFIG."
>   (disk-size (hurd-vm-configuration-disk-size config))
>   (type  (lookup-image-type-by-name 'hurd-qcow2))
>   (os->image (image-type-constructor type)))
> -(system-image (os->image os
> +(system-image
> + (image (inherit (os->image os))
> +(size disk-size)
>  
>  (define (hurd-vm-port config base)
>"Return the forwarded vm port for this childhurd config."

I can connfirm this works, pushed to master as 
5b785b2a62b885a65aeece1399f7e3a732dd1cea.

> Greetings,
> Janneke

-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com





bug#45867: hurd-vm: custom disk-size ignored

2021-01-14 Thread Jan Nieuwenhuizen
On current master, setting a bigger disk-size for a childhurd

--8<---cut here---start->8---
  (service hurd-vm-service-type
   (hurd-vm-configuration
(disk-size (* 12 (expt 2 30))) ;12GiB
--8<---cut here---end--->8---

is being ignored.  I am suspecting

> commit 859b362f81598830d7ff276b96a8724aee3c4db7
> Author: Ludovic Courtès 
> AuthorDate: Mon Dec 7 12:38:25 2020 +0100
>
> services: hurd-vm: Avoid circular dependency with (gnu system images 
> hurd).
> 
> * gnu/services/virtualization.scm (hurd-vm-disk-image): Use
> 'lookup-image-type-by-name' instead of referring to 'hurd-disk-image'
> from (gnu system images hurd).
> ---
>  gnu/services/virtualization.scm | 15 ++-
>  1 file changed, 6 insertions(+), 9 deletions(-)
>
> diff --git a/gnu/services/virtualization.scm b/gnu/services/virtualization.scm
> index eaf0bbd..f435630 100644
> --- a/gnu/services/virtualization.scm
> +++ b/gnu/services/virtualization.scm

[..]

> @@ -913,14 +912,12 @@ that will be listening to receive secret keys on port 
> 1004, TCP."
>  (define (hurd-vm-disk-image config)
>"Return a disk-image for the Hurd according to CONFIG.  The secret-service
>  is added to the OS specified in CONFIG."
> -  (let ((os (secret-service-operating-system (hurd-vm-configuration-os 
> config)))
> -(disk-size (hurd-vm-configuration-disk-size config)))
> -(system-image
> - (image
> -  (inherit hurd-disk-image)
> -  (format 'compressed-qcow2)
> -  (size disk-size)
> -  (operating-system os)

This system-image included (size disk-size), and here

> +  (let* ((os(secret-service-operating-system
> + (hurd-vm-configuration-os config)))
> + (disk-size (hurd-vm-configuration-disk-size config))
> + (type  (lookup-image-type-by-name 'hurd-qcow2))
> + (os->image (image-type-constructor type)))
> +(system-image (os->image os

disk-size goes unused.  So we probably need something like

diff --git a/gnu/services/virtualization.scm b/gnu/services/virtualization.scm
index f435630faf..3ede822183 100644
--- a/gnu/services/virtualization.scm
+++ b/gnu/services/virtualization.scm
@@ -917,7 +917,9 @@ is added to the OS specified in CONFIG."
  (disk-size (hurd-vm-configuration-disk-size config))
  (type  (lookup-image-type-by-name 'hurd-qcow2))
  (os->image (image-type-constructor type)))
-(system-image (os->image os
+(system-image
+ (image (inherit (os->image os))
+(size disk-size)
 
 (define (hurd-vm-port config base)
   "Return the forwarded vm port for this childhurd config."

Greetings,
Janneke

-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com





bug#45618: development childhurd fails to build: glib@2.62.6: build system `meson'

2021-01-03 Thread Jan Nieuwenhuizen
Hi,

We have been using the attached devel-hurd.tmpl (see attched) to add a
childhurd service that has a development environment.

On current master

395489cdc959c3f3c026bf545c3ed95efc9919f0
gnu: spice-vdagent: Update to 0.20.0.

building

./pre-inst-env guix system disk-image --target=i586-pc-gnu 
gnu/system/examples/devel-hurd.tmpl

fail with

--8<---cut here---start->8---
guix system: error: gnu/packages/glib.scm:181:2: glib@2.62.6: build system 
`meson' does not support cross builds
--8<---cut here---end--->8---

I guess we are missing a (some?) tests for the Hurd.

Anyway, I started a bisecting round last night and it found

--8<---cut here---start->8---
1b0cda6b44 gnu: qemu: Extend I/O test time-outs.
--8<---cut here---end--->8---

which was an honest debugging leftover, fixed promptly in

--8<---cut here---start->8---
b070e3f810 gnu: qemu: Remove left-over debugging statement.
--8<---cut here---end--->8---

Luckily, this fixed commit also builds the childhurd again...so I'm
starting a new bisect.

This is not funny; it means I either cannot reconfigure, or I'm losing
my childhurd...grmbl.  Sorry for not noticing this earlier!

Greetings,
Janneke



devel-hurd.tmpl
Description: Binary data

-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com


bug#45165: binutils-mesboot0 fails at configure, cannot find lex

2020-12-10 Thread Jan Nieuwenhuizen
Carl Dong writes:

Hello!

> Some more information from my debugging:
>
> 1. This error is reproducible even when I specify --cores=1, which is very 
> strange
> 2. I have attached the full log to this email

Diffing this with the build log from

--8<---cut here---start->8---
guix build -e '(@@ (gnu packages commencement) binutils-mesboot0)' --log-file
wget 
https://ci.guix.gnu.org/log/jfa9b78rdniyw7qilsmw3bh02x8x68ly-binutils-mesboot0-2.14
 -O jfa9b78rdniyw7qilsmw3bh02x8x68ly-binutils-mesboot0-2.14.gz
gunzip jfa9b78rdniyw7qilsmw3bh02x8x68ly-binutils-mesboot0-2.14.gz
diff -u jfa9b78rdniyw7qilsmw3bh02x8x68ly-binutils-mesboot0-2.14  
2020-10-10-binutils-mesboot0.log
[..]

@@ -5538,16 +5537,16 @@
 checking for i386-unknown-linux-windres... no
 checking for windres... windres
 checking whether to enable maintainer-specific portions of Makefiles... no
-updating cache ./config.cache
+not updating unwritable cache ./config.cache
 creating ./config.status
 creating Makefile
[..]
@@ -5558,7 +5557,7 @@
 checking whether the C compiler (tcc -D __GLIBC_MINOR__=6 -g ) works... yes
 checking whether the C compiler (tcc -D __GLIBC_MINOR__=6 -g ) is a 
cross-compiler... no
 checking whether we are using GNU C... no
-checking for ranlib... (cached) true
+checking for ranlib... true
 checking for POSIXized ISC... no
 checking for ANSI C header files... yes
 checking for working const... yes
--8<---cut here---end--->8---

config values do not get cached (why is config.cache
unwritable?)...which seems to lead to a misdectected presence of lex:

--8<---cut here---start->8---
-@ build-succeeded 
/gnu/store/bz6xjpzlwf57m4bg3w5ihlq638sscx54-binutils-mesboot0-2.14.drv -
-checking for flex... (cached) 
/tmp/guix-build-binutils-mesboot0-2.14.drv-0/binutils-2.14/missing flex
-checking for flex... (cached) 
/tmp/guix-build-binutils-mesboot0-2.14.drv-0/binutils-2.14/missing flex
-checking for yywrap in -ll... (cached) no
-checking lex output file root... (cached) lex.yy
[..]
+checking for flex... no
+checking for lex... no
+./configure: line 4417: flex: command not found
+checking for flex... lex
+checking for yywrap in -ll... no
+checking lex output file root... ./configure: line 4505: lex: command not found
+configure: error: cannot find output from lex; giving up
+make: *** [configure-ld] Error 1
--8<---cut here---end--->8---

What is your build environment/version of guix you're using?  It looks
like some unreproducible bit is leaking in somewhere??

Greetings,
Janneke

-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com





bug#44261: running a daemon with userns in relocateble pack breaks

2020-11-01 Thread Jan Nieuwenhuizen
Ludovic Courtès writes:

Hello,

> Jan Nieuwenhuizen  skribis:
>
>> Ludovic Courtès writes:
>
> [...]
>
>>> If you confirm that it works for you and looks reasonable, we can apply
>>> it.
>>
>> Yes, this works.  The test and also my reproducer now work fine.
>
> Thanks for checking, I pushed the fix as
> bfe82fe2f6e9f34c0774fe2114cdc7e937ba8bd2.

\o/

Thank you
Janneke.

-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com





bug#44261: running a daemon with userns in relocateble pack breaks

2020-10-30 Thread Jan Nieuwenhuizen
Ludovic Courtès writes:

Hi!

> As discussed on IRC, my initial advice about MS_PRIVATE was misguided.
> The real issue is the “rm_rf (new_root);” call, which removes the root
> directory and thus leaves child processes (the daemon) with nothing.

Yes, I'm not entirely sure what I thought to see yesterday; anyway the
rm_rf (new_root) is indeed the thing that makes the daemon crash.

> The attached patch adds a test loosely based on yours and a fix for
> that.  The fix (for the “userns” engine) is to make NEW_ROOT a tmpfs,
> such that upon completion, all we need to do is to unmount it and remove
> it; it lives on as the root file system of child processes.
>
> In the “fakechroot” case, we have to leave NEW_ROOT behind, which is not
> great but acceptable (it’s user-owned, #o700, and it’s under /tmp).  The
> test only checks the “userns” engine.

Yes, I think this is acceptable.

> If you confirm that it works for you and looks reasonable, we can apply
> it.

Yes, this works.  The test and also my reproducer now work fine.

Thanks a lot!
Janneke

-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com





bug#25782: guile: one test fails on Debian/HURD

2020-10-28 Thread Jan Nieuwenhuizen
zimoun writes:

Hello zimoun,

> On Sat, 18 Feb 2017 at 07:24, Jan Nieuwenhuizen  wrote:
>> Running
>>
>> ./pre-inst-env guix package -i hello
>>
>> on Debian/HURD one test fails when building Guile
>>
>> Running 00-repl-server.test
>> FAIL: 00-repl-server.test: repl-server: simple expression - arguments:

[..]

> What is the status of this bug [1]?  It is done now, right?

Yes, I would say so.  In the guile package we currently have:

;; Hangs at: "Running 00-repl-server.test"
(rename-file "test-suite/tests/00-repl-server.test" 
"00-repl-server.test")

So the guile package build now succeeds, but the "real work" that this
patch hints at still needs to be done some time.

Anyway, closing; thanks!

Greetings,
Janneke

-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com





bug#44261: running a daemon with userns in relocateble pack breaks

2020-10-27 Thread Jan Nieuwenhuizen
Jan Nieuwenhuizen writes:

Hi!

I tried the hint from Ludovic to use MS_PRIVATE in the attached patch
and that works for me; not sure if we want a test and even less sure how
to write that...

Janneke

>From fd3104608c3fa6a2375b6c7df0862e5479976b39 Mon Sep 17 00:00:00 2001
From: "Jan (janneke) Nieuwenhuizen" 
Date: Tue, 27 Oct 2020 20:55:11 +0100
Subject: [PATCH] pack: Support running of daemons in user namespace-based
 relocation.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset=UTF-8

Add relocation via ld.so and fakechroot.
Fixes <https://bugs.gnu.org/44261>.

* gnu/packages/aux-files/run-in-namespace.c (bind_mount): Add 'MS_PRIVATE' to
avoid unmounting the bind mount when parent process exits.

Co-authored-by: Ludovic Courtès 
---
 gnu/packages/aux-files/run-in-namespace.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/aux-files/run-in-namespace.c b/gnu/packages/aux-files/run-in-namespace.c
index 52a16a5362..67cea4fcd5 100644
--- a/gnu/packages/aux-files/run-in-namespace.c
+++ b/gnu/packages/aux-files/run-in-namespace.c
@@ -1,5 +1,6 @@
 /* GNU Guix --- Functional package management for GNU
Copyright (C) 2018, 2019, 2020 Ludovic Courtès 
+   Copyright (C) 2020 Jan (janneke) Nieuwenhuizen 
 
This file is part of GNU Guix.
 
@@ -138,7 +139,7 @@ bind_mount (const char *source, const struct dirent *entry,
 close (open (target, O_WRONLY | O_CREAT));
 
   return mount (source, target, "none",
-		MS_BIND | MS_REC | MS_RDONLY, NULL);
+		MS_BIND | MS_PRIVATE | MS_REC | MS_RDONLY, NULL);
 }
 
 #if HAVE_EXEC_WITH_LOADER
-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com


-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com


bug#44261: running a daemon with userns in relocateble pack breaks

2020-10-27 Thread Jan Nieuwenhuizen
Hi!

As mentioned on IRC, running a daemon from a guix relocatable pack on a
foreign distro using the user namespace feature is troublesome: it looks
as if the daemon "loses" (its view of) the file-system once the parent
process that creates the daemon exits.

I'm attatching a package description for a test package "vork".  It
builds a program "test" that forks the program "daemon".

The daemon program reads a character from /dev/urandom, prints it,
and sleeps for a second; 10 times.

The "test" parent program exits after 5 seconds.  When the parent
program exits, the daemon crashes.

To reproduce, put "vork.scm" in a fresh directory and do something like:

--8<---cut here---start->8---
fakeroot tar xf $(GUIX_PACKAGE_PATH=. guix pack --relocatable\
  --symlink=/gnu/bin=bin guile shepherd vork --no-offload)
guix gc -D $(guix build -f vork.scm)
touch /tmp/daemon.log
tail -f /tmp/daemon.log &
GUILE_LOAD_COMPILED_PATH=$PWD/$(ls -1d gnu/store/*profile)/lib/guile/3.0/ccache\
:$PWD/$(ls -1d gnu/store/*profile)/lib/guile/3.0/site-ccache gnu/bin/test
--8<---cut here---end--->8---

this gives something like

--8<---cut here---start->8---
.daemon-start
daemon: 10 ?
.daemon: 9 ?
.daemon: 8 T
.daemon: 7 ^O
.daemon: 6 O

exit
20:42:38 janneke@dundal:~/src/guix/master/vork [env]
$ 20:42:38 janneke@dundal:~/src/guix/master/vork [env]
$ Backtrace:
Exception thrown while printing backtrace:
In procedure public-lookup: Module named (system repl debug) does not exist
--8<---cut here---end--->8---

Greetings,
Janneke



vork.scm
Description: Binary data

-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com


bug#39819: [PATCH 1/2] services: guix: Make /etc/guix/acl really declarative by default.

2020-10-25 Thread Jan Nieuwenhuizen
Ludovic Courtès writes:

Hello,

> I went ahead and pushed this as c6ef627c97e5e6a94688baf20892ae3429f86897
> with the changes below, accounting for Vagrant’s comment and for the
> fact that childhurds rely on the non-declarative behavior (which hadn’t
> occurred to me before), as well as fixing other typos.
>
>
> +   ;; By default, the secret service introduces a pre-initialized
> +   ;; /etc/guix/acl file in the childhurd.  Thus, clear
> +   ;; 'authorize-key?' so that it's not overridden at activation
> +   ;; time.
> +   (modify-services %base-services/hurd
> + (guix-service-type config =>
> +(guix-configuration
> + (inherit config)
> + (authorize-key? #f

Ah, good catch!

Janneke

-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com





bug#44000: Guile-Git cross-compiled to i586-pc-gnu gets bytestructures wrong

2020-10-15 Thread Jan Nieuwenhuizen
Ludovic Courtès writes:

Hi,

> Ludovic Courtès  skribis:
>
>> The problem is that the ‘cond-expand’ used to define ‘arch32bit?’ is a
>> expansion-time thing when (cross-)building Bytestructures itself, so
>> it’s incorrect from cross-building from 64-bit to 32-bit.
>>
>> I believe that changing it to:
>>
>>   (define arch32bit? (memq data-model '(ilp32 lp32)))
>>
>> would fix it because then the test would happen at run time.
>
> I confirm that the attached patch for Bytestructures solves the problem
> (running ‘guix pull’ in my childhurd :-)).

Wow, beautiful!

> Let’s see whether it needs to be adapted for inclusion upstream.

Yes, sure.

Greetings,
Janneke

-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com





bug#39819: Declarative /etc/guix/acl?

2020-10-12 Thread Jan Nieuwenhuizen
Ludovic Courtès writes:

Hello,

> Jan Nieuwenhuizen  skribis:
>
>> Ludovic Courtès writes:
>
>> However, if you have your own substitute server, you now can run guix
>> archive --authorize < ..., e.g. at bootstrap/install time.  For such
>> cases, IWBN to have a --authorized-key argument to guix build / guix
>> system.
>
> There’s already an ‘authorized-keys’ field in ‘guix-configuration’:
>
>   
> https://guix.gnu.org/manual/devel/en/html_node/Base-Services.html#index-guix_002dconfiguration
>
> So you would just list keys there.  Is that what you have in mind?
>
> The option is already there, it’s just non-authoritative.

I was thinking about the initial installer scenario; when guix-daemon is
already running and you didn't build the guix system yourself.  But
yeah, I guess this is an exceptional or corner case and you can always
build your own installer and add the key there.

Janneke

-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com





bug#39819: Declarative /etc/guix/acl?

2020-10-11 Thread Jan Nieuwenhuizen
Ludovic Courtès writes:

Hello!

> For some reason, /etc/guix/acl is not declarative on Guix System: we let
> users modify it and assume it’s stateful, which can surprise users as in
> <https://issues.guix.gnu.org/39819>.
>
> Should we make it declarative, just like most of /etc?  I think so.

Yes, I think so too.  However, if you have your own substitute server,
you now can run guix archive --authorize < ..., e.g. at
bootstrap/install time.  For such cases, IWBN to have a --authorized-key
argument to guix build / guix system.

Greetings,
Janneke

-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com





bug#43668: Daemon tries to build GNU/Hurd derivations on GNU/Linux

2020-09-29 Thread Jan Nieuwenhuizen
Ludovic Courtès writes:

Hi!

> Jan Nieuwenhuizen  skribis:
>
>>> Ludovic Courtès  skribis:
>>>
>> Displaying notes found in: .note.ABI-tag
>>   OwnerData size Description
>>   GNU  0x0010NT_GNU_ABI_TAG (ABI version tag)
>> OS: Hurd, ABI: 0.0.0
>
> Oh, well done, I browsed ‘file’ but didn’t find it.

:-)

>>> So I think we can’t count on an ‘execve’ error and thus have to treat
>>> this case (same architecture but different OS kernel) specially, as
>>> shown below.
>>>
>>> Thoughts?
>>
>> If that really doesn't work...then yeah (yuck ;-)
>
> Yeah, I think we’ll have to do this hack (we’re not going to parse ELF
> files and all to determine whether to call ‘execve’.)

Ah, we're C++; I was thinking Guile and "we surely have" an ELF library.
That's allright then.  Let's have this workaround.

> (Besides, it would be interesting to understand how the libc/Hurd
> startup code ends up segfaulting on GNU/Linux.)

Hmm...are you saying something like "it could run until it wants to RCP
Mach or Hurd?"  Might it "just load" shared libraries...

Greetings,
Janneke

-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com





bug#43668: Daemon tries to build GNU/Hurd derivations on GNU/Linux

2020-09-28 Thread Jan Nieuwenhuizen
Ludovic Courtès writes:

Hi!

> Ludovic Courtès  skribis:
>
>> It’s no wonder that the GNU/Hurd executable fails to run on GNU/Linux.
>> The reason the daemon tries to run it anyway is because of the hack
>> introduced in 7bf2a70a4ffd976d50638d3b9f2ec409763157df, in support of
>> transparent emulation via binfmt_misc.
>
> The thing is that x86 GNU/Hurd and GNU/Linux ELF binaries are
> indistinguishable AFAICS since they both use ELFOSABI_NONE:
>
> scheme@(guile-user)> ,use(guix elf)
> scheme@(guile-user)> ,use(rnrs io ports)
> scheme@(guile-user)> (define e (parse-elf (call-with-input-file 
> "/gnu/store/vq7zyb4hmlrafflmrcjbqccxp4dsx0s3-bash" get-bytevector-all)))
> scheme@(guile-user)> (elf-abi e)
> $6 = 0
> scheme@(guile-user)> ELFOSABI_GNU
> $7 = 3
> scheme@(guile-user)> (define e2 (parse-elf (call-with-input-file "/bin/sh" 
> get-bytevector-all)))
> scheme@(guile-user)> (elf-abi e2)
> $8 = 0
>
> (The ‘file’ command does manage to recognize GNU/Hurd binaries, but I
> don’t know how it does it.)

Looking at the file sources, it uses do_os_note, look:

--8<---cut here---start->8---
$ readelf -a $(guix build --target=i586-pc-gnu hello)bin/hello

Displaying notes found in: .note.ABI-tag
  OwnerData sizeDescription
  GNU  0x0010   NT_GNU_ABI_TAG (ABI version tag)
OS: Hurd, ABI: 0.0.0
--8<---cut here---end--->8---

> So I think we can’t count on an ‘execve’ error and thus have to treat
> this case (same architecture but different OS kernel) specially, as
> shown below.
>
> Thoughts?

If that really doesn't work...then yeah (yuck ;-)
Greetigs,
Janneke

-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com





bug#43533: guix-daemon fails to start in Childhurd

2020-09-21 Thread Jan Nieuwenhuizen
Mathieu Othacehe writes:

Hello Mathieu,

>> 8ce6f4dc2879919c12bc76a2f4b01200af97e019
>> installer: Run the installation inside a container.
>>
>> ...but I don't find the commit message quite clear about its intention
>> to *always* run guix-daemon in a container; it could be read as
>> sugessting to do so only during installation?
>
> Thanks for the detailed bug report. Yes it's not very clear, I'll try to
> improve the comments. The idea is that when you run:
>
> herd start guix-daemon PID
>
> then, the guix-daemon joins the given PID namespaces, which is practical
> to solve an installation issue.
>
> If guix-daemon is started normally, outside of the installation process,
> then it joins the caller namespaces, which should be a no-op. Of course,
> it breaks everything if the operating system does not support
> namespaces.
>
> Fixed with 6453915cf7729203ef9552c13cb4528c6f4ed122.

Yay, I can confirm that it works!

> Sorry for the breakage,

Thanks for the quick fix and explanation, I didn't catch that no-op
trick!  It's all about context/knowledge I guess; If you know how /ns/
works, I guess that the patch/explanation was clear.

Greetings,
Janneke

-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com





bug#43533: guix-daemon fails to start in Childhurd

2020-09-20 Thread Jan Nieuwenhuizen
Hi!

On current master (6feb7a2107000f9ded547543dcda9d64402c6081), the
shepherd in a Childhurd fails to start the guix-daemon.  It does start
when invoked manually, using the same arguments *)

The culprit seems to be the usage of fork+exec-command/container:
After applying this patch

--8<---cut here---start->8---
diff --git a/gnu/services/base.scm b/gnu/services/base.scm
index d560ad5a13..98a8d2abca 100644
--- a/gnu/services/base.scm
+++ b/gnu/services/base.scm
@@ -1570,7 +1570,7 @@ proxy of 'guix-daemon'...~%")
 ;; the 'set-http-proxy' action.
 (or (getenv "http_proxy") #$http-proxy))
 
-  (fork+exec-command/container
+  (fork+exec-command
(cons* #$(file-append guix "/bin/guix-daemon")
   "--build-users-group" #$build-group
   "--max-silent-time"
--8<---cut here---end--->8---

a Hurd VM built with

--8<---cut here---start->8---
./pre-inst-env guix system disk-image --target=i586-pc-gnu 
gnu/system/examples/bare-hurd.tmpl
--8<---cut here---end--->8---

has the shepherd starting the guix-daemon fine.

I found that the /container bit was added in

8ce6f4dc2879919c12bc76a2f4b01200af97e019
installer: Run the installation inside a container.

...but I don't find the commit message quite clear about its intention
to *always* run guix-daemon in a container; it could be read as
sugessting to do so only during installation?

How to proceed reverting this container feature for the Hurd?

Greetings,
Janneke

*) For the Hurd that currently is something like:
   
GUIX_LOCPATH=/gnu/store/z7a6sbvqzb5zapwpznmjkq2rsxil6i67-glibc-utf8-locales-2.31/lib/locale\
   LC_ALL=en_US.utf8\
   guix-daemon --build-users-group guixbuild --max-silent-time 0 --timeout 0
  --log-compression bzip2 --substitute-urls https://ci.guix.gnu.org
  --disable-chroot --disable-deduplication

-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com





bug#43005: make dist fails: "store file names embedded in the distribution"

2020-09-16 Thread Jan Nieuwenhuizen
Vagrant Cascadian writes:

Hi!

> On 2020-09-16, Ludovic Courtès wrote:
>> Hello!
>>
>> Jan Nieuwenhuizen  skribis:
>>> This is the closing parenthesis of a string-append that has only this
>>> one big string; what about removing that string-append altogether?
>>
>> Agreed.
>>
>> Vagrant, could you push it to core-updates with this change?
>
> Not in a good position to push anything for a few days; if someone else
> could that would be great!

Sure.  Pushed with minor change (removing encompassing string-append) to
core-updates as 7467f9857dc530861735ebffe2c9376c8dfb80b7

Thanks!
Janneke

-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com





bug#43005: make dist fails: "store file names embedded in the distribution"

2020-09-16 Thread Jan Nieuwenhuizen
Ludovic Courtès writes:

Hello,

> Jan Nieuwenhuizen  skribis:
>
>> Oops; your patch is fine (see nit-pick) for core-updates; but as you
>> noticed, on master we need to add an indirection to avoid rebuilds.
>> What about something like

>> diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
>> index aa30e3fa18..48f9a47c6b 100644
>> --- a/gnu/packages/commencement.scm
>> +++ b/gnu/packages/commencement.scm

[..]

> Well done!  Could you push to ‘master’ (with a “Fixes” line in the
> commit log)?

Pushed to master as b85863f7ce99d05205e57358b36ff50656cca08b.

Meanwile we have a duplicate bug: <https://bugs.gnu.org/43435>
(it finally rang a bell on IRC...).

Janneke

-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com





bug#43435: bootstrap (bash-mesboot0) and ’make release’ error

2020-09-16 Thread Jan Nieuwenhuizen
zimoun writes:

Hello zimoun!

> Reading the release document [1] and going step by step, so I start from
> a fresh worktree and branch and I tweak a bit (maybe I am doing wrong)
> otherwise it fails:

[..]

> guix-1.0.1.22205-a8360-dirty/gnu/packages/commencement.scm:// 
> /gnu/store/cq0cmv35s9dhilx14zaghlc08gpc0hwr-tcc-boot0-0.9.26-6.c004e9a/lib/libc.a:
>  error: 'sigprocmask' defined twice
> error: store file names embedded in the distribution
> make[4]: *** [Makefile:6335: assert-no-store-file-names] Error 1

So, this ’assert-no-store-file-names’ check in Makefile.am greps for

-E "$(storedir)/[a-z0-9]{32}-" $(distdir) ;

which is really meant for source code; to catch the use of hardcoded
store file names.  Unfortunately, however ...

[..]

> On IRC [2], it rings a bell. :-)  The error should come from
> ’bash-mesboot0’ in (gnu packages commencement) at the ’modify-phases’
> [3]:
>
>  (add-after 'configure 'configure-fixups
>(lambda _
>  (substitute* "config.h"
>(("#define GETCWD_BROKEN 1") "#undef GETCWD_BROKEN"))
>  (let ((config.h (open-file "config.h" "a")))
>(display (string-append "
> // tcc: error: undefined symbol 'enable_hostname_completion'
> #define enable_hostname_completion(on_or_off) 0
>
> // 
> /gnu/store/cq0cmv35s9dhilx14zaghlc08gpc0hwr-tcc-boot0-0.9.26-6.c004e9a/lib/libc.a:
>  error: 'sigprocmask' defined twice

a commented store file name was added inside a code snippet.  Changing
this comment to something like

// /gnu/store/...-tcc-boot0-0.9.26-6.c004e9a/lib/libc.a: error: 
'sigprocmask' defined twice

would pass the check, but this triggers a rebuld world.  So I am
proposing the attached patch that breaks the comment to pass the check,
and using unquoted string-append to  avoid a world rebuild.

Greetings,
Janneke

>From 7256bae0eebbec22c42a482ccfdf12fd8b874188 Mon Sep 17 00:00:00 2001
From: "Jan (janneke) Nieuwenhuizen" 
Date: Wed, 16 Sep 2020 06:57:51 +0200
Subject: [PATCH] gnu: commencement: bash-mesboot0: Break store file-name in
 comment.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset=UTF-8

This fixes running ‘make release’.

* gnu/packages/commencement.scm (bash-mesboot0)[arguments]: Break store file
name in commend and add unquoted string-append to silence store file name
check.  The store file name check is meant for code, this file name was
unfortunately used is a comment.
---
 gnu/packages/commencement.scm | 9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index 565799c611..8a0864f26a 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -788,14 +788,17 @@ $MES -e '(mescc)' module/mescc.scm -- \"$@\"
  (substitute* "config.h"
(("#define GETCWD_BROKEN 1") "#undef GETCWD_BROKEN"))
  (let ((config.h (open-file "config.h" "a")))
-   (display (string-append "
+   (display (string-append
+ ;; XXX TODO: remove nested ,(string-append ...) and
+ ;; store file name on next rebuild cycle
+ ,(string-append "
 // tcc: error: undefined symbol 'enable_hostname_completion'
 #define enable_hostname_completion(on_or_off) 0
 
-// /gnu/store/cq0cmv35s9dhilx14zaghlc08gpc0hwr-tcc-boot0-0.9.26-6.c004e9a/lib/libc.a: error: 'sigprocmask' defined twice
+// /gnu/store/" "cq0cmv35s9dhilx14zaghlc08gpc0hwr-tcc-boot0-0.9.26-6.c004e9a/lib/libc.a: error: 'sigprocmask' defined twice
 #define HAVE_POSIX_SIGNALS 1
 #define endpwent(x) 0
-")
+"))
 config.h)
(close config.h))
  #t))
-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com


-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com


bug#43166: The issues.guix.gnu.org is hard to read in emacs-w3m.

2020-09-15 Thread Jan Nieuwenhuizen
Ricardo Wurmus writes:

> The attached patch seems to fix the worst problems.

Ohh...thank you!!!  This makes issues at least readable in EWW.

It's a bit annoying to change issues URLs into bugs.gnu.org urls and
this also made me reluctant to share issues URLs -- altough I greatly
appreciate all the work you have been doing here: in heavyweight modern
mouse-shoving-browsers --that I personally try to avoid-- it really
looks beautiful.

> What do you think?

It seems that EWW ignores ’monospace’...

-.message span.line {
+.message div.line {
 white-space: pre-wrap;
 font-family: monospace;
 display: block;
 }

... here, or otherwise "eats" spaces; so diffs/patches are still a bit
annoying to read.  Ideas?

Greetings,
Janneke

-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com





bug#43384: guix pull: backtrace "no route to host"

2020-09-13 Thread Jan Wielkiewicz
Hello, 
I tried running "guix pull" but it gave me a backtrace.

guix substitute: error: connect: No route to host
@ substituter-failed
/gnu/store/c4mzhay8jrg5r43wkn4f9004afvly0ad-po4a-0.57 256 fetching path
`/gnu/store/c4mzhay8jrg5r43wkn4f9004afvly0ad-po4a-0.57' failed with
exit code 1 @ substituter-started
/gnu/store/s6ha2sssblw06sjpw4zawzx98zwbj5m7-graphviz-2.42.3 substitute
killing process 6694 Backtrace: 11 (primitive-load
"/gnu/store/lardz9zqi5ypgrdrj6dyfgj9p3bca2ab-compute-guix-derivation")
In ice-9/eval.scm: 155:9 10 (_ _) 159:9  9 (_
#(#(#(#(#(#(#(#(#(#(#(#(#(# ?) ?)
?) ?) ?) ?) ?) ?) ?) ?) ?) ?) ?)) In ./guix/store.scm: 2042:24  8
(run-with-store # _
#:guile-for-build _ #:system _ #:target _) 1876:8  7 (_ _) In
./guix/gexp.scm: 244:18  6 (_ _)
   1064:2  5 (_ _)
924:2  4 (_ _)
785:4  3 (_ _)
In ./guix/store.scm:
  1924:12  2 (_ #)
   1357:5  1 (map/accumulate-builds # _ _) 1368:15  0 (_ # 7fe2f10265f0> _ _)

./guix/store.scm:1368:15: ERROR:
  1. :
  message: "some substitutes for the outputs of derivation
`/gnu/store/bxw2dzjmdrq7qmv0w1mpzqrkfqs9p7q2-po4a-0.57.drv' failed
(usually happens due to networking issues); try `--fallback' to build
derivation from source " status: 1 guix pull: error: You found a bug:
the program
'/gnu/store/lardz9zqi5ypgrdrj6dyfgj9p3bca2ab-compute-guix-derivation'
failed to compute the derivation for Guix (version:
"71992a532dd0bb88b39dda285482b332a24dae66"; system: "x86_64-linux";
host version: "1192ae940434808560b3170107e4ce44855816c3"; pull-version:
1). Please report it by email to .


Jan Wielkiewicz






bug#43081: diffutils always referrers to the native coreutils

2020-08-31 Thread Jan Nieuwenhuizen
Ludovic Courtès writes:

> Hi,
>
> Mathieu Othacehe  skribis:
>
>>> Do you know which acl is fixing (commencement.scm vs. acl.scm)?
>>
>> Yes it's the acl that is rooted in the bootstrap toolchain. Here's the
>> full build log attached. I'm also cc-ing janneke which has some
>> experience in that matter :).
>
> Yes, now that you mention it, I remember janneke and I looking at a
> similar LD_PRELOAD issue in Marrakesh last December.  :-)
>
>> [24] $ setfacl -m u:bin:rx /test -- failed
>> ERROR: ld.so: object 
>> '/tmp/guix-build-acl-2.2.53.drv-0/acl-2.2.53/.libs/libtestlookup.so' from 
>> LD_PRELOAD cannot be preloaded: ignored. != ~
>
> Does that ring a bell, janneke?

Oh my...I do remember we looked into this or something very similar.

Is it doable to run the test suite using the canonical PR again( maybe
setenv "PR_PROGRAM" just before the test phase or some substituting)?

Janneke

-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com





bug#43005: make dist fails: "store file names embedded in the distribution"

2020-08-24 Thread Jan Nieuwenhuizen
Vagrant Cascadian writes:

Hello!

> When I tried to run make dist, it fails:
>
> guix-1.0.1.21330-a8c8f-dirty/gnu/packages/commencement.scm:
>   // 
> /gnu/store/cq0cmv35s9dhilx14zaghlc08gpc0hwr-tcc-boot0-0.9.26-6.c004e9a/lib/libc.a:
>  error: 'sigprocmask' defined t
>   error: store file names embedded in the distribution
>
> The attached patch triggers pretty extensive rebuilds, but should fix
> the problem.

Oops; your patch is fine (see nit-pick) for core-updates; but as you
noticed, on master we need to add an indirection to avoid rebuilds.
What about something like

--8<---cut here---start->8---
diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index aa30e3fa18..48f9a47c6b 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -788,14 +788,16 @@ $MES -e '(mescc)' module/mescc.scm -- \"$@\"
  (substitute* "config.h"
(("#define GETCWD_BROKEN 1") "#undef GETCWD_BROKEN"))
  (let ((config.h (open-file "config.h" "a")))
-   (display (string-append "
+   ;; TODO: remove ,(string-append hack in next rebuild cycle
+   ;; together with store file name
+   (display (string-append ,(string-append "
 // tcc: error: undefined symbol 'enable_hostname_completion'
 #define enable_hostname_completion(on_or_off) 0
 
-// 
/gnu/store/cq0cmv35s9dhilx14zaghlc08gpc0hwr-tcc-boot0-0.9.26-6.c004e9a/lib/libc.a:
 error: 'sigprocmask' defined twice
+// /gnu/store/" 
"cq0cmv35s9dhilx14zaghlc08gpc0hwr-tcc-boot0-0.9.26-6.c004e9a/lib/libc.a: error: 
'sigprocmask' defined twice
 #define HAVE_POSIX_SIGNALS 1
 #define endpwent(x) 0
-")
+"))
 config.h)
(close config.h))
  #t))
--8<---cut here---end--->8---

Thanks for catching this!

Greetings,
Janneke

> From 6e77f342c0deca73fa608365bbceb14aaf675b21 Mon Sep 17 00:00:00 2001
> From: Vagrant Cascadian 
> Date: Sun, 23 Aug 2020 14:10:57 -0700
> Subject: [PATCH] gnu: commencement: bash-mesboot0: Remove store file name.

[..]

> diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
> index aa30e3fa18..617a12016f 100644
> --- a/gnu/packages/commencement.scm
> +++ b/gnu/packages/commencement.scm
> @@ -792,7 +792,7 @@ $MES -e '(mescc)' module/mescc.scm -- \"$@\"
>  // tcc: error: undefined symbol 'enable_hostname_completion'
>  #define enable_hostname_completion(on_or_off) 0
>  
> -// 
> /gnu/store/cq0cmv35s9dhilx14zaghlc08gpc0hwr-tcc-boot0-0.9.26-6.c004e9a/lib/libc.a:
>  error: 'sigprocmask' defined twice
> +// /gnu/store/…-tcc-boot0-0.9.26-6.c004e9a/lib/libc.a: error: 'sigprocmask' 
> defined twice
>  #define HAVE_POSIX_SIGNALS 1
>  #define endpwent(x) 0
>  ")
^

This is the closing parenthesis of a string-append that has only this
one big string; what about removing that string-append altogether?

-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com





bug#27149: perl for arm-linux-gnueabihf

2020-08-11 Thread Jan Nieuwenhuizen
Ludovic Courtès writes:

>>> *guix build --target=arm-linux-gnueabihf* *perl* fails with the following
>>> output: https://pastebin.com/QF0xKAmR

This has been fixed by #40698.

Thanks,
Janneke

-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com





bug#28243: Guix cross-compilation doesn't work

2020-08-11 Thread Jan Nieuwenhuizen
Manolis Ragkousis writes:

This has been fixed since 6741f543e6f09069961edd741cd210b7f49aadcc
that adds bootstrap tarballs for the Hurd.

Thanks,
Janneke

-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com





bug#42601: Guix install bug: error: Unbound variable: ~S

2020-08-09 Thread Jan Wielkiewicz
Hello,

I believe there's still something wrong here.
The bug (the new one, described below) occurs after adding 
#:use-module (gnu packages avr) to the firmware.scm file.
Attached the diff file of my package below.

I'm packaging qmk-firmware and here's what happens running guix build:

error: binutils: unbound variable
hint: Did you forget a `use-modules' form?

error: googletest: unbound variable
hint: Did you forget a `use-modules' form?

error: bzip2: unbound variable
hint: Did you forget a `use-modules' form?

error: gcc-4.9: unbound variable
hint: Did you forget a `use-modules' form?

error: perl-module-build: unbound variable
hint: Did you forget a `use-modules' form?

error: python2-numpy: unbound variable
hint: Did you forget a `use-modules' form?

error: gzip: unbound variable
hint: Did you forget a `use-modules' form?

error: xcb-proto: unbound variable
hint: Did you forget a `use-modules' form?

error: gnu-make: unbound variable
hint: Did you forget a `use-modules' form?

error: unzip: unbound variable
hint: Did you forget a `use-modules' form?

error: curl: unbound variable
hint: Did you forget a `use-modules' form?

error: binutils: unbound variable
hint: Did you forget a `use-modules' form?

error: pjproject: unbound variable
hint: Did you forget a `use-modules' form?

error: xorg-server: unbound variable
hint: Did you forget a `use-modules' form?

error: libdvdnav: unbound variable
hint: Did you forget a `use-modules' form?

error: perl: unbound variable
hint: Did you forget a `use-modules' form?

error: coreutils: unbound variable
hint: Did you forget a `use-modules' form?

error: libetpan: unbound variable
hint: Did you forget a `use-modules' form?

Throw to key `unbound-variable' with args `("resolve-interface" "no
binding `~A' in module ~A" (python (gnu packages python)) #f)'.
Backtrace: In ice-9/boot-9.scm:
  1736:10 19 (with-exception-handler _ _ #:unwind? _ # _)
In guix/store.scm:
   631:22 18 (thunk)
   1299:8 17 (call-with-build-handler # …)
In guix/scripts/build.scm:
817:2 16 (_)
In srfi/srfi-1.scm:
   673:15 15 (append-map _ _ . _)
   586:17 14 (map1 ((argument . "qmk-firmware") (build-mode . 0) # …))
In guix/scripts/build.scm:
   837:30 13 (_ _)
In gnu/packages.scm:
477:2 12 (%find-package "qmk-firmware" "qmk-firmware" #f)
362:6 11 (find-best-packages-by-name _ _)
   292:55 10 (_ "qmk-firmware" _)
In unknown file:
   9 (force #)
In gnu/packages.scm:
   239:33  8 (fold-packages # …)
In guix/discovery.scm:
   153:11  7 (all-modules _ #:warn _)
In srfi/srfi-1.scm:
   460:18  6 (fold # …)
In guix/discovery.scm:
   143:19  5 (_ _ ())
In srfi/srfi-1.scm:
   691:23  4 (filter-map # . #)
In guix/discovery.scm:
   118:22  3 (_ . _)
In guix/ui.scm:
329:2  2 (report-unbound-variable-error _ #:frame _)
In ice-9/boot-9.scm:
  1669:16  1 (raise-exception _ #:continuable? _)
  1669:16  0 (raise-exception _ #:continuable? _)

ice-9/boot-9.scm:1669:16: In procedure raise-exception:
Throw to key `match-error' with args `("match" "no matching pattern"
(unbound-variable "resolve-interface" "no binding `~A' in module ~A"
(python (gnu packages python)) #f))'.



Jan Wielkiewicz
From 39b3791efd06c4895c844548937d421f8359b1e0 Mon Sep 17 00:00:00 2001
From: Jan Wielkiewicz 
Date: Sun, 9 Aug 2020 23:43:08 +0200
Subject: [PATCH] gnu: Add qmk-firmware.

* gnu/packages/firmware.scm (qmk-firmware): New variable.
---
 gnu/packages/firmware.scm | 37 +
 1 file changed, 37 insertions(+)

diff --git a/gnu/packages/firmware.scm b/gnu/packages/firmware.scm
index 15a6725c67..a0c65752d4 100644
--- a/gnu/packages/firmware.scm
+++ b/gnu/packages/firmware.scm
@@ -7,6 +7,7 @@
 ;;; Copyright © 2018 Vagrant Cascadian 
 ;;; Copyright © 2019 Mathieu Othacehe 
 ;;; Copyright © 2020 Marius Bakke 
+;;; Copyright © 2020 Jan Wielkiewicz 
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -33,6 +34,8 @@
   #:use-module (gnu packages)
   #:use-module (gnu packages admin)
   #:use-module (gnu packages assembly)
+  #:use-module (gnu packages autotools)
+  #:use-module (gnu packages avr)
   #:use-module (gnu packages base)
   #:use-module (gnu packages bison)
   #:use-module (gnu packages cmake)
@@ -41,6 +44,7 @@
   #:use-module (gnu packages gcc)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages perl)
+  #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python))
 
 (define-public ath9k-htc-firmware
@@ -621,3 +625,36 @@ switching support).\n")
  #t)
 (native-inputs `(("cross-gcc" ,(cross-gcc "arm-none-eabi" #:xgcc gcc-7))
  ("cross-binutils" ,(cross-binutils "arm-none-eabi"))
+
+(define-public qmk-firmware
+  (package
+(name "qmk-firmware")
+(version "0.9.50")
+(source
+ (origin
+   (method git-fetch)

bug#42601: Guix install bug: error: Unbound variable: ~S

2020-08-05 Thread Jan Wielkiewicz
Dnia 2020-08-05, o godz. 22:33:14
Ludovic Courtès  napisał(a):

> My bad, I believe this is fixed by
> 05f3d34094b23dc9612ff6641a0257bc4f7dcd12.
> 
> Thanks for reporting the issue!
> 
> Is this bug closed, though?
> 
> Ludo’.

I can close it if needed.





bug#42601: Guix install bug: error: Unbound variable: ~S

2020-07-29 Thread Jan Wielkiewicz
Dnia 2020-07-29, o godz. 22:17:01
Ricardo Wurmus  napisał(a):

> 
> “avr-toolchain” is a procedure, not a package.  Use
> “avr-toolchain-4.9” or “avr-toolchain-5”.
> 

Success!

What about the strange message though?
"incorrect package definition" would be better.





bug#42601: Guix install bug: error: Unbound variable: ~S

2020-07-29 Thread Jan Wielkiewicz
Dnia 2020-07-29, o godz. 19:57:35
Ricardo Wurmus  napisał(a):

> 
> What is the actual diff?  I see that (gnu packages hardware) does not
> import (gnu packages avr), so it’s expected that “avr-toolchain”
> cannot be found.
> 

Okay, I tested it and it fails on "avr-toolchain", even though I have
#:use-module (gnu packages avr).





bug#42601: Guix install bug: error: Unbound variable: ~S

2020-07-29 Thread Jan Wielkiewicz
Dnia 2020-07-29, o godz. 19:57:35
Ricardo Wurmus  napisał(a):

> What is the actual diff?  I see that (gnu packages hardware) does not
> import (gnu packages avr), so it’s expected that “avr-toolchain”
> cannot be found.
> 

Just added it and I get the same result. Anyway, the error message is
useless. I'll try removing some inputs and check what causes this.





bug#42601: Guix install bug: error: Unbound variable: ~S

2020-07-29 Thread Jan Wielkiewicz
Dnia 2020-07-29, o godz. 13:00:59
Leo Famulari  napisał(a):

> On Wed, Jul 29, 2020 at 06:16:47PM +0200, Jan Wielkiewicz wrote:
> > It seems it's not about the name, but the package - I changed the
> > name to "qmk" and it still doesn't work. Not that this is an excuse
> > for writing such a strange message.
> 
> I think some interface changed elsewhere in the codebase and these
> errors are confusing. Try `make clean-go && make` before using the
> ./pre-inst-env script again.

Same thing, didn't work





bug#42601: Guix install bug: error: Unbound variable: ~S

2020-07-29 Thread Jan Wielkiewicz
It seems it's not about the name, but the package - I changed the name
to "qmk" and it still doesn't work. Not that this is an excuse for
writing such a strange message.

Make output:

[100%] GUILEC   gnu/packages/hardware.go
gnu/packages/hardware.scm:486:4: warning: possibly unbound variable
`arm-none-eabi-toolchain' gnu/packages/hardware.scm:486:4: warning:
possibly unbound variable `avr-toolchain'
gnu/packages/hardware.scm:486:4: warning: possibly unbound variable
`dfu-programmer' gnu/packages/hardware.scm:486:4: warning: possibly
unbound variable `dfu-util'

My wip package:

(define-public qmk
  (package
   (name "qmk")
   (version "0.0.35")
   (source
(origin
 (method url-fetch)
 (uri (pypi-uri "qmk" version))
 (sha256
  (base32
   "1dd3q38r5bs9ih8jiwsb7q2655wyka2a8wlwv7yln9narlqwl177"
   (build-system python-build-system)
   (propagated-inputs
`(("arm-none-eabi-toolchain" ,arm-none-eabi-toolchain)
  ("avr-toolchain" ,avr-toolchain)
  ("dfu-programmer" ,dfu-programmer)
  ("dfu-util" ,dfu-util)
  ("python3" ,python)
  ("python-appdirs" ,python-appdirs)
  ("python-argcomplete" ,python-argcomplete)
  ("python-colorama" ,python-colorama)
  ("python-flake8" ,python-flake8)
  ("python-hjson" ,python-hjson)
  ("python-nose2" ,python-nose2)
  ("python-yapf" ,python-yapf)))
   (arguments
`(#:tests? #f)) ; no tests
   (home-page "https://github.com/qmk/qmk_cli;)
   (synopsis
"Work with QMK Firmware")
   (description
"A program to help users work with QMK Firmware.")
   (license license:expat)))

Jan Wielkiewicz





bug#42601: Guix install bug: error: Unbound variable: ~S

2020-07-29 Thread Jan Wielkiewicz
Hello,

I made a package named "qmk-cli" and it seems Guix doesn't like it.
Running "./pre-inst-env guix install "qmk-cli"" results in this:
guix install: error: Unbound variable: ~S


Jan Wielkiewicz





bug#42561: arm-none-eabi-toolchain fails to build

2020-07-27 Thread Jan Wielkiewicz
I think I fixed it, but someone needs to check it.
I looked at this issue as inspiration: https://issues.guix.gnu.org/41210
Now the package compiles, but it didn't fail yet, so it might be the
fix!
That's what I did:

index e3a9017ba5..c7b8fcc0ce 100644
--- a/gnu/packages/embedded.scm
+++ b/gnu/packages/embedded.scm
@@ -251,7 +251,7 @@ usable on embedded products.")
(origin-patches (package-source gcc-7))
(search-patches
"gcc-7-cross-environment-variables.patch") (native-inputs
-   `(("gcc@5" ,gcc-5)
+   `(("gcc@7" ,gcc-7)
  ("flex" ,flex)
  ("isl" ,isl-0.18)
  ,@(alist-delete "isl" (package-native-inputs xgcc



Jan Wielkiewicz





bug#41982: [PATCH v2] grub-core: Build fixes for i386

2020-07-13 Thread Jan Nieuwenhuizen
Ludovic Courtès writes:

Hi!

> Jan Nieuwenhuizen  skribis:
>
>> Jan Nieuwenhuizen writes:
>>
>> lib/i386/relocator64.S:97: Error: bad register name `%rsp'
>>
>> The attached v2 fixes that.
>
> On the Guix side I guess you can go ahead and apply it.
>
> Well done!

Thanks!  Ah, I already done in 54e70a70f2cb6336b02ed3ac4256f6b44da5c769
after discussing with Mathieu on IRC.  I wanted to keep a line to
upstream, being cautious for continuing to carry a diff here.

Janneke

-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com





bug#42327: Offload build to Childhurd selects linux-libre-headers

2020-07-11 Thread Jan Nieuwenhuizen
Hi!

The offload build works, yay!...all the way up to

--8<---cut here---start->8---
$ ./pre-inst-env guix build --system=i586-gnu \
   -e '(@@ (gnu packages commencement) glibc-final-with-bootstrap-bash)'
/gnu/store/cah6lzl8cxdhfink3a1ij0m1p5vk66kw-glibc-intermediate-2.31-debug
/gnu/store/i7l6dnq6br3jg5qzhfssrp11mg499d2b-glibc-intermediate-2.31
/gnu/store/lr2ymww5imjl3hxrzyc7dmsadw7dxbdh-glibc-intermediate-2.31-static
--8<---cut here---end--->8---

With static-bash-for-glibc, however, it goes off track

--8<---cut here---start->8---
$ ./pre-inst-env guix build --system=i586-gnu \
   -e '(@@ (gnu packages commencement) static-bash-for-glibc)'
The following derivations will be built:
   /gnu/store/gv40jpz4g0hbia28wa6d50z9x6ncgdlh-bash-static-5.0.16.drv
   /gnu/store/apj2ihazv6x3anhvfvmmqrkyak05p9yc-gcc-cross-boot0-wrapped-7.5.0.drv
   /gnu/store/yfpy5b3xqkarxchyhi339fw2ldwczj1d-linux-libre-headers-5.4.20.drv
--8<---cut here---end--->8---

...oops!  Note that a native build on the Childhurd works all the way up
to "hello".

The "glibc-final-with-bootstrap-bash" has a propagated-inputs that looks
like this

--8<---cut here---start->8---
(define* (kernel-headers-boot0 #:optional (system (%current-system)))
  (match system
("i586-gnu" hurd-core-headers-boot0)
(_ linux-libre-headers-boot0)))

(define glibc-final-with-bootstrap-bash
   [..]
   (propagated-inputs `(("kernel-headers" ,(kernel-headers-boot0
   [..])
--8<---cut here---end--->8---

In KERNEL-HEADERS-BOOT0, SYSTEM is "x86_64-linux".  Passing SYSTEM from
a LET-SYSTEM clause (see attached patch) seems to fix this...but i'm
afraid that triggers a world rebuild.  Our offload Childhurds can only
run master, right?  Is there any way around this?  Thoughts?

Greetings,
--a-mildly-disappointed--
Janneke

>From 28bdd162e5430517df3957b8454c49d037d684ba Mon Sep 17 00:00:00 2001
From: "Jan (janneke) Nieuwenhuizen" 
Date: Sat, 11 Jul 2020 22:44:39 +0200
Subject: [PATCH] commencement: glibc-final-with-bootstrap-bash: Fix
 kernel-headers.
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset=UTF-8

* gnu/packages/commencement.scm (glibc-final-with-bootstrap-bash)
[propagated-inputs]: Use let-system to pass correct system
kernel-headers-boot0.
---
 gnu/packages/commencement.scm | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/gnu/packages/commencement.scm b/gnu/packages/commencement.scm
index d0393ebe25..518ffd0bd8 100644
--- a/gnu/packages/commencement.scm
+++ b/gnu/packages/commencement.scm
@@ -49,6 +49,7 @@
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages rsync)
   #:use-module (gnu packages xml)
+  #:use-module (guix gexp)
   #:use-module (guix packages)
   #:use-module (guix download)
   #:use-module (guix build-system gnu)
@@ -3298,7 +3299,8 @@ memoized as a function of '%current-system'."
  "export CPATH\n"
  all "\n")))
#t)))
-(propagated-inputs `(("kernel-headers" ,(kernel-headers-boot0
+(propagated-inputs `(("kernel-headers" ,(let-system (system target)
+      (kernel-headers-boot0 system)
 (native-inputs
  `(("bison" ,bison-boot0)
("texinfo" ,texinfo-boot0)
-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com


-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com


bug#42151: [PATCH v3 2/2] image: Do not set journal_model=WAL for the Hurd.

2020-07-11 Thread Jan Nieuwenhuizen
Ludovic Courtès writes:

> "Jan (janneke) Nieuwenhuizen"  skribis:
>
>> This fixes <https://bugs.gnu.org/42151>.
>>
>> * gnu/system/images/hurd.scm (hurd-initialize-root-partition): Use 
>> #:wal-mode #f
>> in call to ...
[...]
>> + (list #:make-device-nodes make-hurd-device-nodes
>> +   #:wal-mode? #f)
>
> IWBN to have an XXX comment here stating why we disable WAL mode on
> GNU/Hurd, possibly referencing this issue.  That way, we can eventually
> revisit the issue and hopefully get rid of this workaround.

Sure, done!

> Apart from that the patch LGTM, thanks!

Yay!  Pushed series to master as 4b9eecd322e566783369795ebea63a479b51f486.

Let the offloadings commence!

Janneke

-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com





bug#42151: [PATCH v3 2/2] image: Do not set journal_model=WAL for the Hurd.

2020-07-10 Thread Jan (janneke) Nieuwenhuizen
This fixes <https://bugs.gnu.org/42151>.

* gnu/system/images/hurd.scm (hurd-initialize-root-partition): Use #:wal-mode #f
in call to ...
* gnu/build/image.scm (initialize-root-partition): ... this, add #:wal-mode?
parameter, pass it to ...
(register-closure): ... this, add #:wal-mode? parameter, pass it to ...
* guix/store/database.scm (with-database): ... this, add #:wal-mode?
parameter, pass it to ...
(call-with-database): ... this, add #:wal-mode? parameter; when
set to #f, do not set journal_model=WAL.
---
 gnu/build/image.scm| 26 --
 gnu/system/images/hurd.scm |  4 ++--
 guix/store/database.scm| 29 -
 3 files changed, 38 insertions(+), 21 deletions(-)

diff --git a/gnu/build/image.scm b/gnu/build/image.scm
index e7b0418182..d8efa73f16 100644
--- a/gnu/build/image.scm
+++ b/gnu/build/image.scm
@@ -131,20 +131,23 @@ given CONFIG file."
 (define* (register-closure prefix closure
#:key
(deduplicate? #t) (reset-timestamps? #t)
-   (schema (sql-schema)))
+   (schema (sql-schema))
+   (wal-mode? #t))
   "Register CLOSURE in PREFIX, where PREFIX is the directory name of the
 target store and CLOSURE is the name of a file containing a reference graph as
 produced by #:references-graphs..  As a side effect, if RESET-TIMESTAMPS? is
 true, reset timestamps on store files and, if DEDUPLICATE? is true,
-deduplicates files common to CLOSURE and the rest of PREFIX."
+deduplicates files common to CLOSURE and the rest of PREFIX.  Pass WAL-MODE?
+to call-with-database."
   (let ((items (call-with-input-file closure read-reference-graph)))
 (parameterize ((sql-schema schema))
   (with-database (store-database-file #:prefix prefix) db
-(register-items db items
-#:prefix prefix
-#:deduplicate? deduplicate?
-#:reset-timestamps? reset-timestamps?
-#:registration-time %epoch)
+   #:wal-mode? wal-mode?
+   (register-items db items
+   #:prefix prefix
+   #:deduplicate? deduplicate?
+   #:reset-timestamps? reset-timestamps?
+   #:registration-time %epoch)
 
 (define* (initialize-efi-partition root
#:key
@@ -164,14 +167,16 @@ deduplicates files common to CLOSURE and the rest of 
PREFIX."
 (register-closures? #t)
 system-directory
 make-device-nodes
+(wal-mode? #t)
 #:allow-other-keys)
   "Initialize the given ROOT directory. Use BOOTCFG and BOOTCFG-LOCATION to
 install the bootloader configuration.
 
 If REGISTER-CLOSURES? is true, register REFERENCES-GRAPHS in the store.  If
 DEDUPLICATE? is true, then also deduplicate files common to CLOSURES and the
-rest of the store when registering the closures. SYSTEM-DIRECTORY is the name
-of the directory of the 'system' derivation."
+rest of the store when registering the closures.  SYSTEM-DIRECTORY is the name
+of the directory of the 'system' derivation.  Pass WAL-MODE? to
+register-closure."
   (populate-root-file-system system-directory root)
   (populate-store references-graphs root)
 
@@ -184,7 +189,8 @@ of the directory of the 'system' derivation."
 (register-closure root
   closure
   #:reset-timestamps? #t
-  #:deduplicate? deduplicate?))
+  #:deduplicate? deduplicate?
+  #:wal-mode? wal-mode?))
   references-graphs))
 
   (when bootloader-installer
diff --git a/gnu/system/images/hurd.scm b/gnu/system/images/hurd.scm
index 31942e7386..4e1db37104 100644
--- a/gnu/system/images/hurd.scm
+++ b/gnu/system/images/hurd.scm
@@ -61,8 +61,8 @@
   #~(lambda* (#:rest args)
   (apply initialize-root-partition
  (append args
- (list #:make-device-nodes
-   make-hurd-device-nodes)
+ (list #:make-device-nodes make-hurd-device-nodes
+   #:wal-mode? #f)
 
 (define hurd-disk-image
   (image
diff --git a/guix/store/database.scm b/guix/store/database.scm
index a38e4d7e52..50b66ce282 100644
--- a/guix/store/database.scm
+++ b/guix/store/database.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2017, 2019 Caleb Ristvedt 
 ;;; Copyright © 2018, 2020 Ludovic Courtès 
+;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen 
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -20,6 +21,7 @@
 (define-module (guix

bug#42151: [PATCH v3 1/2] gnu: sqlite: Add locking-mode fix for the Hurd.

2020-07-10 Thread Jan (janneke) Nieuwenhuizen
* gnu/packages/patches/sqlite-hurd.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/sqlite.scm (sqlite)[native-inputs]: Add it when building
for the Hurd.
[arguments]: Apply it when building for the Hurd.
---
 gnu/local.mk   |  1 +
 gnu/packages/patches/sqlite-hurd.patch | 58 ++
 gnu/packages/sqlite.scm| 19 +
 3 files changed, 78 insertions(+)
 create mode 100644 gnu/packages/patches/sqlite-hurd.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 5c3b391960..42c9d0f379 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1370,6 +1370,7 @@ dist_patch_DATA = 
\
   %D%/packages/patches/sdl-pango-header-guard.patch\
   %D%/packages/patches/sdl-pango-matrix_declarations.patch \
   %D%/packages/patches/sdl-pango-sans-serif.patch  \
+  %D%/packages/patches/sqlite-hurd.patch   \
   %D%/packages/patches/patchutils-test-perms.patch \
   %D%/packages/patches/patch-hurd-path-max.patch   \
   %D%/packages/patches/perl-autosplit-default-time.patch   \
diff --git a/gnu/packages/patches/sqlite-hurd.patch 
b/gnu/packages/patches/sqlite-hurd.patch
new file mode 100644
index 00..d80a2c5be8
--- /dev/null
+++ b/gnu/packages/patches/sqlite-hurd.patch
@@ -0,0 +1,58 @@
+Adapted from Debian: 
https://sources.debian.org/patches/sqlite3/3.32.3-1/20-hurd-locking-style.patch
+Upstream status: Not upstreamed.
+
+This patch is needed to get offloading to work.
+
+Sqlite can use simple file locking mode, but that does not work for the Hurd;
+a second sqlite process fails with a "locking protocol" error.
+
+See also: https://bugs.debian.org/529734.
+
+diff -purN sqlite-autoconf-3310100/sqlite3.c sqlite-autoconf-3310100-/sqlite3.c
+--- sqlite-autoconf-3310100/sqlite3.c  2020-01-27 21:25:19.0 +0100
 sqlite-autoconf-3310100-/sqlite3.c 2020-07-01 11:50:13.768333806 +0200
+@@ -33189,7 +33189,7 @@ SQLITE_PRIVATE const char *sqlite3Opcode
+ # include 
+ #endif
+ 
+-#if SQLITE_ENABLE_LOCKING_STYLE
++#if SQLITE_ENABLE_LOCKING_STYLE || defined(__GNU__)
+ /* # include  */
+ # include 
+ # include 
+@@ -35676,7 +35676,7 @@ static int dotlockClose(sqlite3_file *id
+ **
+ ** Omit this section if SQLITE_ENABLE_LOCKING_STYLE is turned off
+ */
+-#if SQLITE_ENABLE_LOCKING_STYLE
++#if SQLITE_ENABLE_LOCKING_STYLE || defined(__GNU__)
+ 
+ /*
+ ** Retry flock() calls that fail with EINTR
+@@ -38586,7 +38586,7 @@ IOMETHODS(
+   0 /* xShmMap method */
+ )
+ 
+-#if SQLITE_ENABLE_LOCKING_STYLE
++#if SQLITE_ENABLE_LOCKING_STYLE || defined(__GNU__)
+ IOMETHODS(
+   flockIoFinder,/* Finder function name */
+   flockIoMethods,   /* sqlite3_io_methods object name */
+@@ -41142,6 +41142,8 @@ SQLITE_API int sqlite3_os_init(void){
+ UNIXVFS("unix",  autolockIoFinder ),
+ #elif OS_VXWORKS
+ UNIXVFS("unix",  vxworksIoFinder ),
++#elif defined(__GNU__)
++UNIXVFS("unix",  flockIoFinder ),
+ #else
+ UNIXVFS("unix",  posixIoFinder ),
+ #endif
+@@ -41151,7 +41153,7 @@ SQLITE_API int sqlite3_os_init(void){
+ #if OS_VXWORKS
+ UNIXVFS("unix-namedsem", semIoFinder ),
+ #endif
+-#if SQLITE_ENABLE_LOCKING_STYLE || OS_VXWORKS
++#if SQLITE_ENABLE_LOCKING_STYLE || OS_VXWORKS || defined(__GNU__)
+ UNIXVFS("unix-posix",posixIoFinder ),
+ #endif
+ #if SQLITE_ENABLE_LOCKING_STYLE
diff --git a/gnu/packages/sqlite.scm b/gnu/packages/sqlite.scm
index 8468131ddf..eeb77749d8 100644
--- a/gnu/packages/sqlite.scm
+++ b/gnu/packages/sqlite.scm
@@ -11,6 +11,7 @@
 ;;; Copyright © 2017 Jelle Licht 
 ;;; Copyright © 2018 Tobias Geerinckx-Rice 
 ;;; Copyright © 2018 Alex Vong 
+;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen 
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -29,6 +30,7 @@
 
 (define-module (gnu packages sqlite)
   #:use-module (gnu packages)
+  #:use-module (gnu packages hurd)
   #:use-module (gnu packages readline)
   #:use-module ((guix licenses) #:prefix license:)
   #:use-module (guix packages)
@@ -65,6 +67,11 @@
   "1bj936svd8i5g25xd1bj52hj4zca01fgl3sqkj86z9q5pkz4wa32"
(build-system gnu-build-system)
(inputs `(("readline" ,readline)))
+   (native-inputs (if (hurd-target?)
+  ;; TODO move into origin on the next rebuild cycle.
+  `(("hurd-locking-mode.patch"
+ ,@(search-patches "sqlite-hurd.patch")))
+  '()))
(outputs '("out" "static"))
(arguments
 `(#:configure-flags
@@ -79,6 +86,18 @@
;; Column metadata is required by GNU Jami and Qt, 
et.al.
"-DSQLITE_ENABLE_COLUMN_METADATA"))
   #:phases (modify-phases %standard-phases
+ 

bug#42151: [PATCH 2/3] gnu: guile-sqlite3: Use sqlite/hurd for locking on the Hurd.

2020-07-10 Thread Jan Nieuwenhuizen
Ludovic Courtès writes:

> "Jan (janneke) Nieuwenhuizen"  skribis:
>
>> This fixes
>>
>> guix offload: error: exception occurred on remote host 'localhost': 
>> (%exception #> synchronous mode: locking protocol" status: 1>>)
>>
>> * gnu/packages/guile.scm (guile-sqlite3)[inputs]: Use sqlite/hurd instead of
>> sqlite.
>> ---
>>  gnu/packages/guile.scm | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm
>> index a32bd33293..c651e2427a 100644
>> --- a/gnu/packages/guile.scm
>> +++ b/gnu/packages/guile.scm
>> @@ -665,7 +665,7 @@ Guile's foreign function interface.")
>> ("pkg-config" ,pkg-config)))
>>  (inputs
>>   `(("guile" ,guile-3.0)
>> -   ("sqlite" ,sqlite)))
>> +   ("sqlite" ,sqlite/hurd)))
>
> This should be guarded by ‘if (hurd-target?)’, right?

Yeah...but all changed now...look out for v3.  Thanks!

Janneke

-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com





bug#42151: [PATCH 1/3] gnu: Add sqlite/hurd with locking fix.

2020-07-10 Thread Jan Nieuwenhuizen
Ludovic Courtès writes:

> "Jan (janneke) Nieuwenhuizen"  skribis:
>
>> * gnu/packages/patches/sqlite3-hurd.patch: New file.
>> * gnu/local.mk (dist_patch_DATA): Add it.
>> * gnu/packages/sqlite.scm (sqlite/hurd): New variable.
>
> […]
>
>> +++ b/gnu/packages/patches/sqlite3-hurd.patch
>> @@ -0,0 +1,51 @@
>> +Adapted from Debian: 
>> https://sources.debian.org/patches/sqlite3/3.31.1-5/20-hurd-locking-style.patch
>> +Upstream status: Not offered upstream.
>
> The URL is 404, could you fix it?

That's weird...Changing it (in completely rewritten patch) to


https://sources.debian.org/patches/sqlite3/3.32.3-1/20-hurd-locking-style.patch/

> It would also be great if you could
> add a sentence or two explaining what this works around, so that our
> future selves know how to deal with this patch.  :-)

Ah, sure!

> Otherwise LGTM, you can push with changes along these lines!

As it's so much changed, I'll send it by one more time :-)

Janneke

-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com





bug#42151: [PATCH 3/3] gnu: guix: Use sqlite/hurd for locking on the Hurd.

2020-07-10 Thread Jan Nieuwenhuizen
Ludovic Courtès writes:

> "Jan (janneke) Nieuwenhuizen"  skribis:

>> * gnu/packages/package-management.scm (guix)[inputs]: Use sqlite/hurd.
>
> Same here.
>
> Which makes me thing: how about applying the sqlite/hurd patch in a
> build phase of sqlite that would be Hurd-specific?  That way, we’d still
> have a single sqlite package.

Ah, yes that sounds better.  We don't need sqlite/hurd "sqlite-for-hurd"
and all that.  I'll give that a go! 

Janneke

-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com





bug#42151: [PATCH v2 2/4] gnu: guile-sqlite3: Use sqlite/hurd for locking on the Hurd.

2020-07-10 Thread Jan (janneke) Nieuwenhuizen
This fixes

guix offload: error: exception occurred on remote host 'localhost': 
(%exception #>)

* gnu/packages/guile.scm (guile-sqlite3)[inputs]: Use sqlite/hurd instead of
sqlite.
---
 gnu/packages/guile.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm
index a32bd33293..c651e2427a 100644
--- a/gnu/packages/guile.scm
+++ b/gnu/packages/guile.scm
@@ -665,7 +665,7 @@ Guile's foreign function interface.")
("pkg-config" ,pkg-config)))
 (inputs
  `(("guile" ,guile-3.0)
-   ("sqlite" ,sqlite)))
+   ("sqlite" ,sqlite/hurd)))
 (synopsis "Access SQLite databases from Guile")
 (description
  "This package provides Guile bindings to the SQLite database system.")
-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com






bug#42151: [PATCH v2 1/4] gnu: Add sqlite/hurd with locking fix.

2020-07-10 Thread Jan (janneke) Nieuwenhuizen
* gnu/packages/patches/sqlite3-hurd.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/sqlite.scm (sqlite/hurd): Use it in new variable.
---
 gnu/local.mk|  1 +
 gnu/packages/patches/sqlite3-hurd.patch | 51 +
 gnu/packages/sqlite.scm |  9 +
 3 files changed, 61 insertions(+)
 create mode 100644 gnu/packages/patches/sqlite3-hurd.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 5c3b391960..e452004945 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1370,6 +1370,7 @@ dist_patch_DATA = 
\
   %D%/packages/patches/sdl-pango-header-guard.patch\
   %D%/packages/patches/sdl-pango-matrix_declarations.patch \
   %D%/packages/patches/sdl-pango-sans-serif.patch  \
+  %D%/packages/patches/sqlite3-hurd.patch  \
   %D%/packages/patches/patchutils-test-perms.patch \
   %D%/packages/patches/patch-hurd-path-max.patch   \
   %D%/packages/patches/perl-autosplit-default-time.patch   \
diff --git a/gnu/packages/patches/sqlite3-hurd.patch 
b/gnu/packages/patches/sqlite3-hurd.patch
new file mode 100644
index 00..de87a30cb1
--- /dev/null
+++ b/gnu/packages/patches/sqlite3-hurd.patch
@@ -0,0 +1,51 @@
+Adapted from Debian: 
https://sources.debian.org/patches/sqlite3/3.31.1-5/20-hurd-locking-style.patch
+Upstream status: Not offered upstream.
+
+diff -purN sqlite-autoconf-3310100/sqlite3.c sqlite-autoconf-3310100-/sqlite3.c
+--- sqlite-autoconf-3310100/sqlite3.c  2020-01-27 21:25:19.0 +0100
 sqlite-autoconf-3310100-/sqlite3.c 2020-07-01 11:50:13.768333806 +0200
+@@ -33189,7 +33189,7 @@ SQLITE_PRIVATE const char *sqlite3Opcode
+ # include 
+ #endif
+ 
+-#if SQLITE_ENABLE_LOCKING_STYLE
++#if SQLITE_ENABLE_LOCKING_STYLE || defined(__GNU__)
+ /* # include  */
+ # include 
+ # include 
+@@ -35676,7 +35676,7 @@ static int dotlockClose(sqlite3_file *id
+ **
+ ** Omit this section if SQLITE_ENABLE_LOCKING_STYLE is turned off
+ */
+-#if SQLITE_ENABLE_LOCKING_STYLE
++#if SQLITE_ENABLE_LOCKING_STYLE || defined(__GNU__)
+ 
+ /*
+ ** Retry flock() calls that fail with EINTR
+@@ -38586,7 +38586,7 @@ IOMETHODS(
+   0 /* xShmMap method */
+ )
+ 
+-#if SQLITE_ENABLE_LOCKING_STYLE
++#if SQLITE_ENABLE_LOCKING_STYLE || defined(__GNU__)
+ IOMETHODS(
+   flockIoFinder,/* Finder function name */
+   flockIoMethods,   /* sqlite3_io_methods object name */
+@@ -41142,6 +41142,8 @@ SQLITE_API int sqlite3_os_init(void){
+ UNIXVFS("unix",  autolockIoFinder ),
+ #elif OS_VXWORKS
+ UNIXVFS("unix",  vxworksIoFinder ),
++#elif defined(__GNU__)
++UNIXVFS("unix",  flockIoFinder ),
+ #else
+ UNIXVFS("unix",  posixIoFinder ),
+ #endif
+@@ -41151,7 +41153,7 @@ SQLITE_API int sqlite3_os_init(void){
+ #if OS_VXWORKS
+ UNIXVFS("unix-namedsem", semIoFinder ),
+ #endif
+-#if SQLITE_ENABLE_LOCKING_STYLE || OS_VXWORKS
++#if SQLITE_ENABLE_LOCKING_STYLE || OS_VXWORKS || defined(__GNU__)
+ UNIXVFS("unix-posix",posixIoFinder ),
+ #endif
+ #if SQLITE_ENABLE_LOCKING_STYLE
diff --git a/gnu/packages/sqlite.scm b/gnu/packages/sqlite.scm
index 8468131ddf..d5c44b0d0f 100644
--- a/gnu/packages/sqlite.scm
+++ b/gnu/packages/sqlite.scm
@@ -11,6 +11,7 @@
 ;;; Copyright © 2017 Jelle Licht 
 ;;; Copyright © 2018 Tobias Geerinckx-Rice 
 ;;; Copyright © 2018 Alex Vong 
+;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen 
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -107,3 +108,11 @@ is in the public domain.")
 ;; commit fad5b1a6d8d9c36bea5785ae4fbc1beb37e644d7.
 (define-public sqlite-with-column-metadata
   (deprecated-package "sqlite-with-column-metadata" sqlite))
+
+(define-public sqlite/hurd
+  ;; TODO move into sqlite on the next rebuild cycle.
+  (package
+(inherit sqlite)
+(name "sqlite-for-hurd")
+(source (origin (inherit (package-source sqlite))
+(patches (search-patches "sqlite3-hurd.patch"))
-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com






bug#42151: [PATCH v2 4/4] image: Do not set journal_model=WAL for the Hurd.

2020-07-10 Thread Jan (janneke) Nieuwenhuizen
This fixes <https://bugs.gnu.org/42151>.

* gnu/system/images/hurd.scm (hurd-initialize-root-partition): Use #:wal-mode #f
in call to ...
* gnu/build/image.scm (initialize-root-partition): ... this, add #:wal-mode?
parameter, pass it to ...
(register-closure): ... this, add #:wal-mode? parameter, pass it to ...
* guix/store/database.scm (with-database): ... this, add #:wal-mode?
parameter, pass it to ...
(call-with-database): ... this, add #:wal-mode? parameter; when
set to #f, do not set journal_model=WAL.
---
 gnu/build/image.scm| 26 --
 gnu/system/images/hurd.scm |  4 ++--
 guix/store/database.scm| 29 -
 3 files changed, 38 insertions(+), 21 deletions(-)

diff --git a/gnu/build/image.scm b/gnu/build/image.scm
index e7b0418182..d8efa73f16 100644
--- a/gnu/build/image.scm
+++ b/gnu/build/image.scm
@@ -131,20 +131,23 @@ given CONFIG file."
 (define* (register-closure prefix closure
#:key
(deduplicate? #t) (reset-timestamps? #t)
-   (schema (sql-schema)))
+   (schema (sql-schema))
+   (wal-mode? #t))
   "Register CLOSURE in PREFIX, where PREFIX is the directory name of the
 target store and CLOSURE is the name of a file containing a reference graph as
 produced by #:references-graphs..  As a side effect, if RESET-TIMESTAMPS? is
 true, reset timestamps on store files and, if DEDUPLICATE? is true,
-deduplicates files common to CLOSURE and the rest of PREFIX."
+deduplicates files common to CLOSURE and the rest of PREFIX.  Pass WAL-MODE?
+to call-with-database."
   (let ((items (call-with-input-file closure read-reference-graph)))
 (parameterize ((sql-schema schema))
   (with-database (store-database-file #:prefix prefix) db
-(register-items db items
-#:prefix prefix
-#:deduplicate? deduplicate?
-#:reset-timestamps? reset-timestamps?
-#:registration-time %epoch)
+   #:wal-mode? wal-mode?
+   (register-items db items
+   #:prefix prefix
+   #:deduplicate? deduplicate?
+   #:reset-timestamps? reset-timestamps?
+   #:registration-time %epoch)
 
 (define* (initialize-efi-partition root
#:key
@@ -164,14 +167,16 @@ deduplicates files common to CLOSURE and the rest of 
PREFIX."
 (register-closures? #t)
 system-directory
 make-device-nodes
+(wal-mode? #t)
 #:allow-other-keys)
   "Initialize the given ROOT directory. Use BOOTCFG and BOOTCFG-LOCATION to
 install the bootloader configuration.
 
 If REGISTER-CLOSURES? is true, register REFERENCES-GRAPHS in the store.  If
 DEDUPLICATE? is true, then also deduplicate files common to CLOSURES and the
-rest of the store when registering the closures. SYSTEM-DIRECTORY is the name
-of the directory of the 'system' derivation."
+rest of the store when registering the closures.  SYSTEM-DIRECTORY is the name
+of the directory of the 'system' derivation.  Pass WAL-MODE? to
+register-closure."
   (populate-root-file-system system-directory root)
   (populate-store references-graphs root)
 
@@ -184,7 +189,8 @@ of the directory of the 'system' derivation."
 (register-closure root
   closure
   #:reset-timestamps? #t
-  #:deduplicate? deduplicate?))
+  #:deduplicate? deduplicate?
+  #:wal-mode? wal-mode?))
   references-graphs))
 
   (when bootloader-installer
diff --git a/gnu/system/images/hurd.scm b/gnu/system/images/hurd.scm
index 31942e7386..4e1db37104 100644
--- a/gnu/system/images/hurd.scm
+++ b/gnu/system/images/hurd.scm
@@ -61,8 +61,8 @@
   #~(lambda* (#:rest args)
   (apply initialize-root-partition
  (append args
- (list #:make-device-nodes
-   make-hurd-device-nodes)
+ (list #:make-device-nodes make-hurd-device-nodes
+   #:wal-mode? #f)
 
 (define hurd-disk-image
   (image
diff --git a/guix/store/database.scm b/guix/store/database.scm
index a38e4d7e52..50b66ce282 100644
--- a/guix/store/database.scm
+++ b/guix/store/database.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2017, 2019 Caleb Ristvedt 
 ;;; Copyright © 2018, 2020 Ludovic Courtès 
+;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen 
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -20,6 +21,7 @@
 (define-module (guix

bug#42151: [PATCH v2 3/4] gnu: guix: Use sqlite/hurd for locking on the Hurd.

2020-07-10 Thread Jan (janneke) Nieuwenhuizen
* gnu/packages/package-management.scm (guix)[inputs]: Use sqlite/hurd.
---
 gnu/packages/package-management.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnu/packages/package-management.scm 
b/gnu/packages/package-management.scm
index 9986976cc6..64c6931011 100644
--- a/gnu/packages/package-management.scm
+++ b/gnu/packages/package-management.scm
@@ -343,7 +343,7 @@ $(prefix)/etc/init.d\n")))
  ("zlib" ,zlib)  ;for 'guix publish'
  ("lzlib" ,lzlib);for 'guix publish' and 'guix substitute'
 
- ("sqlite" ,sqlite)
+ ("sqlite" ,sqlite/hurd)
  ("libgcrypt" ,libgcrypt)
 
  ("guile" ,guile-3.0-latest)
-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com






bug#42151: [PATCH 4/3] database: Do not use journal_model=WAL for the Hurd.

2020-07-10 Thread Jan Nieuwenhuizen
Ludovic Courtès writes:

Hi!

> Jan Nieuwenhuizen  skribis:
>
>>>From dc6f96fc7de50602fb28d7ad7b8cbff09e55f538 Mon Sep 17 00:00:00 2001
>> From: "Jan (janneke) Nieuwenhuizen" 
>> Date: Fri, 3 Jul 2020 23:45:20 +0200
>> Subject: [PATCH 4/3] database: Do not use journal_model=WAL for the Hurd.
>> Content-Transfer-Encoding: 8bit
>> Content-Type: text/plain; charset=UTF-8
>>
>> This fixes <https://bugs.gnu.org/42151>.
[...]
>> diff --git a/guix/store/database.scm b/guix/store/database.scm
>> index a38e4d7e52..da46b0abce 100644
>> --- a/guix/store/database.scm
>> +++ b/guix/store/database.scm
[...]
>> +;; Using WAL breaks for the Hurd <https://bugs.gnu.org/42151>.
>> +(unless (let-system (system target)
>> +  (equal? target "i586-pc-gnu"))
>> +  ;; Turn DB in "write-ahead log" mode, which should avoid SQLITE_LOCKED
>> +  ;; errors when we have several readers: 
>> <https://www.sqlite.org/wal.html>.
>> +  (sqlite-exec db "PRAGMA journal_mode=WAL;"))
>
> I think this has the same effect as:
>
>   (unless #t
> (sqlite-exec db "PRAGMA journal_mode=WAL;"))
>
> because this code is not in a gexp, so ‘let-system’ evaluates to an
> object (not #f), and that’s it, it’s never lowered and the ‘equal?’ call
> is never made.

Oops.  Great catch, thanks!

> You want to disable WAL mode not just when running this code natively on
> GNU/Hurd, but also when building a database that will eventually be used
> on GNU/Hurd, right?

Exactly.

> In that case, I think you’ll have to add, say, a #:wal-mode? parameter
> to ‘call-with-database’ (defaulting to #true), and change the caller to
> set it appropriately.  The caller, directly or indirectly, is in a gexp,
> where you can use the ‘let-system’ expression above.
>
> Does that make sense?

Yes, very much so. [...] After some typing, it turns out that the whole
let-system is gone, we can set use a hard-coded #:wal-mode? #t in
hurd-initialize-root-partition.

> Thanks, and apologies for the delay!

Sure, I'm happy I didn't "just push" ;-)

I'm sending a v2 patch set in a minute.

Greetings,
Janneke

-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com





bug#41982: [PATCH v2] grub-core: Build fixes for i386

2020-07-08 Thread Jan Nieuwenhuizen
Jan Nieuwenhuizen writes:

Hello!

> When cross-compiling Grub-2.04 from i386-linux-gnu to i586-pc-hurd on
> GNU Guix, I got this error

Today, we found* that my patch introduced a regression: a native, EFI
build on i686-linux-gnu failed with

lib/i386/relocator64.S:97: Error: bad register name `%rsp'

The attached v2 fixes that.

Greetings,
Janneke

*) http://logs.guix.gnu.org/guix/2020-07-08.log#104852

>From 17b242e7b80108f1467037e15b605595e4823b2e Mon Sep 17 00:00:00 2001
From: "Jan (janneke) Nieuwenhuizen" 
Date: Sun, 21 Jun 2020 15:10:40 +0200
Subject: [PATCH v2] grub-core: Build fixes for i386
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset=UTF-8

* grub-core/lib/i386/relocator64.S: Avoid x86_64 instructions on i386.
---
 grub-core/lib/i386/relocator64.S | 33 +++-
 1 file changed, 32 insertions(+), 1 deletion(-)

diff --git a/grub-core/lib/i386/relocator64.S b/grub-core/lib/i386/relocator64.S
index 148f38adb..ea39908c1 100644
--- a/grub-core/lib/i386/relocator64.S
+++ b/grub-core/lib/i386/relocator64.S
@@ -63,7 +63,9 @@ VARIABLE(grub_relocator64_cr3)
 	movq	%rax, %cr3
 #endif
 
+#ifdef __x86_64__
 	.code64
+#endif
 
 	/* mov imm64, %rax */
 	.byte 	0x48
@@ -71,7 +73,14 @@ VARIABLE(grub_relocator64_cr3)
 VARIABLE(grub_relocator64_rsp)
 	.quad	0
 
+#ifndef __x86_64__
+	/* movq	%rax, %rsp */
+	.byte 	0x48
+	.byte	0x89
+	.byte	0xc4
+#else
 	movq	%rax, %rsp
+#endif
 
 #ifdef GRUB_MACHINE_EFI
 	jmp	LOCAL(skip_efi_stack_align)
@@ -85,7 +94,14 @@ VARIABLE(grub_relocator64_rsp)
 	 */
 VARIABLE(grub_relocator64_efi_start)
 	/* Align the stack as UEFI spec requires. */
+#ifndef __x86_64__
+	.byte 0x48
+.byte 0x83
+.byte 0xe4
+.byte 0xf0
+#else
 	andq	$~15, %rsp
+#endif
 
 LOCAL(skip_efi_stack_align):
 #endif
@@ -95,8 +111,15 @@ LOCAL(skip_efi_stack_align):
 VARIABLE(grub_relocator64_rsi)
 	.quad	0
 
+#ifndef	__x86_64__
+	/* movq	%rax, %rsi */
+	.byte 	0x48
+	.byte	0x89
+	.byte 	0xc6
+#else
 	movq	%rax, %rsi
-	
+#endif
+
 	/* mov imm64, %rax */
 	.byte 	0x48
 	.byte	0xb8
@@ -128,6 +151,14 @@ VARIABLE(grub_relocator64_rdx)
 #ifdef __APPLE__
 	.byte 0xff, 0x25
 	.quad 0
+#elif !defined (__x86_64__)
+	/* jmp *LOCAL(jump_addr) (%rip) */
+	.byte 0xff
+.byte 0x25
+	.byte 0
+	.byte 0
+	.byte 0
+	.byte 0
 #else
 	jmp *LOCAL(jump_addr) (%rip)
 #endif
-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com


-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com


bug#42151: [PATCH 4/3] database: Do not use journal_model=WAL for the Hurd.

2020-07-06 Thread Jan Nieuwenhuizen
Jan Nieuwenhuizen writes:

> Jan Nieuwenhuizen writes:
>
> Adding one additional patch to this series, hence 4/3 (see attached)
> fixes the sqlite problem.

For clarity -- patches 1-4 really do fix offloading to the Hurd and this...

> After the build succeeds, the download fails but lets first get this
> patch series done...

...is not true; you gat that when you (I) forgot to add keys in
/etc/guix/

As seen on IRC, possibly Ricardo will an update for the QEMU
command-line (at least for berlin), adding "--cpu base".

Janneke

-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com





bug#42151: [PATCH 4/3] database: Do not use journal_model=WAL for the Hurd.

2020-07-04 Thread Jan Nieuwenhuizen
Jan Nieuwenhuizen writes:

Adding one additional patch to this series, hence 4/3 (see attached)
fixes the sqlite problem.

With this over-complete series we can now do offload builds to a
childhurd:

--8<---cut here---start->8---
$ guix build -e '(@@ (gnu packages commencement) rsync-boot0)'
sending 74 store items (365 MiB) to 'localhost'...
exporting path 
`/gnu/store/1kf05mhh31wl89r3mlx52x5sxrjivi7i-module-import-compiled-guile-builder'
exporting path `/gnu/store/7jxamp3g8wdr6vwrisqfmrncxh8nbfb4-mirrors'
[...]
exporting path `/gnu/store/x8wnf0h0ipibgzadlbmll8bcnhvv1yaq-diffutils-boot0-3.7'
offloading '/gnu/store/3xmmbjfqrl4p4sn8vljfdikypb0vi5am-rsync-3.1.3.drv' to 
'localhost'...
offloading build of /gnu/store/3xmmbjfqrl4p4sn8vljfdikypb0vi5am-rsync-3.1.3.drv 
to 'localhost'
[...]
@ build-succeeded /gnu/store/3xmmbjfqrl4p4sn8vljfdikypb0vi5am-rsync-3.1.3.drv -
retrieving 1 store item from 'localhost'...
importing file or directory 
'/gnu/store/haf6mlm8xa6s2q918s05pijl6ql17mnq-rsync-3.1.3'...
guix offload: error: corrupt input while restoring archive from #
guix build: error: build of 
`/gnu/store/3xmmbjfqrl4p4sn8vljfdikypb0vi5am-rsync-3.1.3.drv' failed
[1]10:04:55 janneke@dundal:~/src/guix/master [env]
--8<---cut here---end--->8---

After the build succeeds, the download fails but lets first get this
patch series done...

Janneke

>From dc6f96fc7de50602fb28d7ad7b8cbff09e55f538 Mon Sep 17 00:00:00 2001
From: "Jan (janneke) Nieuwenhuizen" 
Date: Fri, 3 Jul 2020 23:45:20 +0200
Subject: [PATCH 4/3] database: Do not use journal_model=WAL for the Hurd.
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset=UTF-8

This fixes <https://bugs.gnu.org/42151>.

* guix/store/database.scm (call-with-database): When building for the Hurd,
do not set journal_model=WAL.
---
 guix/store/database.scm | 12 +---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/guix/store/database.scm b/guix/store/database.scm
index a38e4d7e52..da46b0abce 100644
--- a/guix/store/database.scm
+++ b/guix/store/database.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2017, 2019 Caleb Ristvedt 
 ;;; Copyright © 2018, 2020 Ludovic Courtès 
+;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen 
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -20,6 +21,7 @@
 (define-module (guix store database)
   #:use-module (sqlite3)
   #:use-module (guix config)
+  #:use-module (guix gexp)
   #:use-module (guix serialization)
   #:use-module (guix store deduplication)
   #:use-module (guix base16)
@@ -27,6 +29,7 @@
   #:use-module (guix build syscalls)
   #:use-module ((guix build utils)
 #:select (mkdir-p executable-file?))
+  #:use-module (guix utils)
   #:use-module (guix build store-copy)
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-11)
@@ -105,9 +108,12 @@ create it and initialize it as a new database."
  (mkdir-p (dirname file))
  #t)))
 (db   (sqlite-open file)))
-;; Turn DB in "write-ahead log" mode, which should avoid SQLITE_LOCKED
-;; errors when we have several readers: <https://www.sqlite.org/wal.html>.
-(sqlite-exec db "PRAGMA journal_mode=WAL;")
+;; Using WAL breaks for the Hurd <https://bugs.gnu.org/42151>.
+(unless (let-system (system target)
+  (equal? target "i586-pc-gnu"))
+  ;; Turn DB in "write-ahead log" mode, which should avoid SQLITE_LOCKED
+  ;; errors when we have several readers: <https://www.sqlite.org/wal.html>.
+  (sqlite-exec db "PRAGMA journal_mode=WAL;"))
 
 ;; Install a busy handler such that, when the database is locked, sqlite
 ;; retries until 30 seconds have passed, at which point it gives up and
-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com


-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com


bug#42151: [PATCH 0/3] offload to Childhurd fails: setting synchronous mode: locking protocol

2020-07-03 Thread Jan Nieuwenhuizen
Ludovic Courtès writes:

Hi!

>> It seems there is a compatibility bug/problem/thing with the db.sqlite
>> that we produce on GNU/Linux.  While an unpatched sqlite3 on the Hurd
>> can read it, and work with it, the unpatched sqlite has locking
>> problems.  I found a workaround, though: dumping and loading  the
>> database file.

[..]

>> So...about the compatibility problem.  I tried to diff the db.sqlite-orig
>> db.sqlite-init binary files: they look completely different.  Not sure
>> how to handle this workaround, maybe we can insert a two system* calls
>> somewhere when building the disk image?
>
> Weird, weird!
>
> Could you compare ‘db.dump’ created on GNU/Hurd with ‘db.dump’ created
> from the same ‘sqlite3 -init’ command on GNU/Linux?

Yeah, they are identical.  The initial dump can only be created atm on
GNU/Linux; the dump can be loaded (obviously) anywhere like so

>> $ sqlite3 -init db.dump db.sqlite-init .quit

and the resulting initial db.sqlite is the same.  Guess we can do that
by hand for now...

> (Perhaps loading the dump reorders entries or something.)

Yes, "or something" certainly! :)  I have no clue...

If/when we decide to pinpoint this bug, what could be a first step?  Who
is creating the database right now, is that the C++ daemon or
guile-sqlite3.  IWBN to have that code create/save a smaller version and
see when reading fails.

> I think the binary format of the database is supposed to be
> architecture-independent and filling it is supposed to be deterministic.

Yes, that works.

> Congrats for getting this far anyway!

Yeah... \o/

Janneke

-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com





bug#42151: [PATCH 0/3] offload to Childhurd fails: setting synchronous mode: locking protocol

2020-07-03 Thread Jan Nieuwenhuizen
Ludovic Courtès writes:

Hi!

> "Jan (janneke) Nieuwenhuizen"  skribis:
>
>> $ guix offload test
>> guix offload: testing 1 build machines defined in '/etc/guix/machines.scm'...
>> guix offload: Guix is usable on 'childhurd' (test returned 
>> "/gnu/store/883yjkl46dxw9mzykykmbs0yzwyxm17z-test")
>> guix offload: 'childhurd' is running GNU Guile 3.0.4
>> guix offload: error: exception occurred on remote host 'localhost':
>> (%exception #> "setting synchronous mode: locking protocol" status: 1>>)

> Does it help if you set ‘settings.fsyncMetadata = false’ in the daemon?
> As a stop-gap, we could add a command-line option if that helps.

Tried that, thanks.  No, it does not help.  (But that's good news, see below!)

> The “synchronous = normal” mode translates to ‘fsync’ calls, right?  If
> you rpctrace sqlite3, do you see ‘file_sync’ calls failing?

Tried that before, rpctrace hangs before I see something useful.

> Does sqlite pass its tests on GNU/Hurd?

That's the (or at least a) right question: YES!

> My 2¢!

Thanks -- it seems that buys us a pretty cheap fix after all, $-wise ;)

It turns out that Debian's patch (and thus this patch series) is
probably OK: It fixes the locking problem on the Hurd, while exposing
another bug, apparently: "unable to open database file".

It seems there is a compatibility bug/problem/thing with the db.sqlite
that we produce on GNU/Linux.  While an unpatched sqlite3 on the Hurd
can read it, and work with it, the unpatched sqlite has locking
problems.  I found a workaround, though: dumping and loading  the
database file.

Look...

--8<---cut here---start->8---
$ scp childhurd2:/var/guix/db/db.sqlite db.sqlite-orig
db.sqlite   
100%  144KB   5.8MB/s   00:00
11:30:37 janneke@dundal:~/tmp [env]
$ sqlite3 db.sqlite-orig .dump > db.dump
11:30:45 janneke@dundal:~/tmp [env]
$ sqlite3 -init db.dump db.sqlite-init .quit
-- Loading resources from db.dump
11:30:49 janneke@dundal:~/tmp [env]
$ cmp db.sqlite-orig db.sqlite-init 
db.sqlite-orig db.sqlite-init differ: byte 19, line 1
[1]11:31:11 janneke@dundal:~/tmp [env]
$ scp db.sqlite-init childhurd2:/var/guix/db/db.sqlite
db.sqlite-init  
100%  144KB   7.3MB/s   00:00
11:31:21 janneke@dundal:~/tmp [env]
$ guix offload test
guix offload: testing 1 build machines defined in '/etc/guix/machines.scm'...
guix offload: Guix is usable on 'localhost' (test returned 
"/gnu/store/883yjkl46dxw9mzykykmbs0yzwyxm17z-test")
guix offload: 'localhost' is running GNU Guile 3.0.4
sending 1 store item (0 MiB) to 'localhost'...
exporting path `/gnu/store/y6b7bjqsazmm6jsyj5y80dqqajysw64p-export-test'
guix offload: 'localhost' successfully imported 
'/gnu/store/y6b7bjqsazmm6jsyj5y80dqqajysw64p-export-test'
retrieving 1 store item from 'localhost'...
guix offload: successfully imported 
'/gnu/store/gxz6hzyc1cy3m1w9l7f2dk6rcspvymxf-import-test' from 'localhost'
11:31:29 janneke@dundal:~/tmp [env]
--8<---cut here---end--->8---

So...about the compatibility problem.  I tried to diff the db.sqlite-orig
db.sqlite-init binary files: they look completely different.  Not sure
how to handle this workaround, maybe we can insert a two system* calls
somewhere when building the disk image?

Greetings,
Janneke

-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com





bug#42151: [PATCH 0/3] offload to Childhurd fails: setting synchronous mode: locking protocol

2020-07-01 Thread Jan Nieuwenhuizen
Jan (janneke) Nieuwenhuizen writes:

> Maybe we're missing some file_lock patch that Debian has?  Where to look,
> glibc, hurd, ...?  Ideas?

So...I found a way to reproduce the feature/bug: run "pragma synchronous = 
normal;"
in two instances.

I created a db.sqlite using

sh -x tests/guix-pack-localstatedir.sh 

(after removing the cleanup trap).

Then, doing

--8<---cut here---start->8---
$ sqlite3 db.sqlite 
SQLite version 3.31.1 2020-01-27 19:55:54
Enter ".help" for usage hints.
sqlite> SELECT * FROM ValidPaths;
1|/gnu/store/pqciscj9304544h3yaqb5m70fggsr293-manual-database|sha256:ccd93bed3a0018f892abc5db92bf182c3e2e986f41a8ded168915b4d9e85fa18|1||2664
2|/gnu/store/mzfkrxd4w8vqrmyrx169wj8wyw7r8i37-bash|sha256:6f887d45fa0f7e59e55c6d7ba86a3d8c35369c7afbb3a5829b8ed226bfef4a66|1||1351880
3|/gnu/store/lgi9x15a0w35mcpd7g1kb9274r6wy4pv-guile-bootstrap-2.0|sha256:dc3e6b577e995c093849454fe4b9c30e87ece6462c54369ff249121f178c5476|1||12718808
4|/gnu/store/6z4h8g6s73zmcn0h6sm63p9d47ih4b63-info-dir|sha256:fd154332e6d35c95f12e41d6168a93945b4737fcbaf734bcaf04ca771a106544|1||432
5|/gnu/store/mj7szx64bdh080rlhzhrvcg6viyba73s-profile|sha256:e32ae4d07fc2298a72e6942f21ba85c0300a84bbaf5794a8c5f0393a8dc9f253|1||2960
sqlite> pragma synchronous = normal;
sqlite>   C-c C-z^Z
[2]+  Stopped sqlite3 db.sqlite
[148]18:55:06 janneke@dundal:~/src/guix/master [env]
$ sqlite3 db.sqlite 
SQLite version 3.31.1 2020-01-27 19:55:54
Enter ".help" for usage hints.
sqlite> pragma synchronous = normal;
sqlite> 
--8<---cut here---end--->8---

works nice on GNU/Linux and on current master Childhurd gives

--8<---cut here---start->8---
$ ssh childhurd
Last login: Wed Jul  1 12:08:17 2020 from 10.0.2.2


  This is the GNU Hurd.  Welcome.

root@childhurd ~# sqlite3 db.sqlite 
SQLite version 3.31.1 2020-01-27 19:55:54
Enter ".help" for usage hints.
sqlite> SELECT * FROM ValidPaths;
1|/gnu/store/pqciscj9304544h3yaqb5m70fggsr293-manual-database|sha256:ccd93bed3a0018f892abc5db92bf182c3e2e986f41a8ded168915b4d9e85fa18|1||2664
2|/gnu/store/mzfkrxd4w8vqrmyrx169wj8wyw7r8i37-bash|sha256:6f887d45fa0f7e59e55c6d7ba86a3d8c35369c7afbb3a5829b8ed226bfef4a66|1||1351880
3|/gnu/store/lgi9x15a0w35mcpd7g1kb9274r6wy4pv-guile-bootstrap-2.0|sha256:dc3e6b577e995c093849454fe4b9c30e87ece6462c54369ff249121f178c5476|1||12718808
4|/gnu/store/6z4h8g6s73zmcn0h6sm63p9d47ih4b63-info-dir|sha256:fd154332e6d35c95f12e41d6168a93945b4737fcbaf734bcaf04ca771a106544|1||432
5|/gnu/store/mj7szx64bdh080rlhzhrvcg6viyba73s-profile|sha256:e32ae4d07fc2298a72e6942f21ba85c0300a84bbaf5794a8c5f0393a8dc9f253|1||2960
sqlite> pragma synchronous = normal;
sqlite>   C-c C-z^Z
[1]+  Stopped sqlite3 db.sqlite
root@childhurd ~# sqlite3 db.sqlite 
SQLite version 3.31.1 2020-01-27 19:55:54
Enter ".help" for usage hints.
sqlite> pragma synchronous = normal;
Error: locking protocol
sqlite> 
--8<---cut here---end--->8---

On Debian/Hurd (which I hoped had a patched, fixed sqlite3), it doesn't
work at all

--8<---cut here---start->8---
$ ssh hurd
GNU debian 0.9 GNU-Mach 1.8+git20191117-486/Hurd-0.9 i686-AT386


  This is the GNU Hurd.  Welcome.

The Hurd is not Linux.  Make sure to read
http://www.debian.org/ports/hurd/hurd-install
to check out the few things you _need_ to know.
Also check out the FAQ
http://www.gnu.org/software/hurd/faq.html
or its latest version on
http://darnassus.sceen.net/~hurd-web/faq/

To read a short intro on some nice features of the Hurd, just have a look at
the translator_primer file, for example via 'nano translator_primer'
Last login: Wed Jul  1 12:58:44 2020 from 10.0.2.2
janneke@debian:~$ sqlite3 db.sqlite
SQLite version 3.32.3 2020-06-18 14:00:33
Enter ".help" for usage hints.
sqlite> SELECT * FROM ValidPaths;
Error: unable to open database file
sqlite> 
--8<---cut here---end--->8---

So, still a similar question...is the patch simply broken/bitrotted, or
did some file locking change on the Hurd?

Janneke

-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com





bug#42151: [PATCH 1/3] gnu: Add sqlite/hurd with locking fix.

2020-07-01 Thread Jan (janneke) Nieuwenhuizen
* gnu/packages/patches/sqlite3-hurd.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/sqlite.scm (sqlite/hurd): New variable.
---
 gnu/local.mk|  1 +
 gnu/packages/patches/sqlite3-hurd.patch | 51 +
 gnu/packages/sqlite.scm |  9 +
 3 files changed, 61 insertions(+)
 create mode 100644 gnu/packages/patches/sqlite3-hurd.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 5e9dba5ab7..d5451bf2d5 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1358,6 +1358,7 @@ dist_patch_DATA = 
\
   %D%/packages/patches/sdl-pango-header-guard.patch\
   %D%/packages/patches/sdl-pango-matrix_declarations.patch \
   %D%/packages/patches/sdl-pango-sans-serif.patch  \
+  %D%/packages/patches/sqlite3-hurd.patch  \
   %D%/packages/patches/patchutils-test-perms.patch \
   %D%/packages/patches/patch-hurd-path-max.patch   \
   %D%/packages/patches/perl-autosplit-default-time.patch   \
diff --git a/gnu/packages/patches/sqlite3-hurd.patch 
b/gnu/packages/patches/sqlite3-hurd.patch
new file mode 100644
index 00..de87a30cb1
--- /dev/null
+++ b/gnu/packages/patches/sqlite3-hurd.patch
@@ -0,0 +1,51 @@
+Adapted from Debian: 
https://sources.debian.org/patches/sqlite3/3.31.1-5/20-hurd-locking-style.patch
+Upstream status: Not offered upstream.
+
+diff -purN sqlite-autoconf-3310100/sqlite3.c sqlite-autoconf-3310100-/sqlite3.c
+--- sqlite-autoconf-3310100/sqlite3.c  2020-01-27 21:25:19.0 +0100
 sqlite-autoconf-3310100-/sqlite3.c 2020-07-01 11:50:13.768333806 +0200
+@@ -33189,7 +33189,7 @@ SQLITE_PRIVATE const char *sqlite3Opcode
+ # include 
+ #endif
+ 
+-#if SQLITE_ENABLE_LOCKING_STYLE
++#if SQLITE_ENABLE_LOCKING_STYLE || defined(__GNU__)
+ /* # include  */
+ # include 
+ # include 
+@@ -35676,7 +35676,7 @@ static int dotlockClose(sqlite3_file *id
+ **
+ ** Omit this section if SQLITE_ENABLE_LOCKING_STYLE is turned off
+ */
+-#if SQLITE_ENABLE_LOCKING_STYLE
++#if SQLITE_ENABLE_LOCKING_STYLE || defined(__GNU__)
+ 
+ /*
+ ** Retry flock() calls that fail with EINTR
+@@ -38586,7 +38586,7 @@ IOMETHODS(
+   0 /* xShmMap method */
+ )
+ 
+-#if SQLITE_ENABLE_LOCKING_STYLE
++#if SQLITE_ENABLE_LOCKING_STYLE || defined(__GNU__)
+ IOMETHODS(
+   flockIoFinder,/* Finder function name */
+   flockIoMethods,   /* sqlite3_io_methods object name */
+@@ -41142,6 +41142,8 @@ SQLITE_API int sqlite3_os_init(void){
+ UNIXVFS("unix",  autolockIoFinder ),
+ #elif OS_VXWORKS
+ UNIXVFS("unix",  vxworksIoFinder ),
++#elif defined(__GNU__)
++UNIXVFS("unix",  flockIoFinder ),
+ #else
+ UNIXVFS("unix",  posixIoFinder ),
+ #endif
+@@ -41151,7 +41153,7 @@ SQLITE_API int sqlite3_os_init(void){
+ #if OS_VXWORKS
+ UNIXVFS("unix-namedsem", semIoFinder ),
+ #endif
+-#if SQLITE_ENABLE_LOCKING_STYLE || OS_VXWORKS
++#if SQLITE_ENABLE_LOCKING_STYLE || OS_VXWORKS || defined(__GNU__)
+ UNIXVFS("unix-posix",posixIoFinder ),
+ #endif
+ #if SQLITE_ENABLE_LOCKING_STYLE
diff --git a/gnu/packages/sqlite.scm b/gnu/packages/sqlite.scm
index 8468131ddf..d5c44b0d0f 100644
--- a/gnu/packages/sqlite.scm
+++ b/gnu/packages/sqlite.scm
@@ -11,6 +11,7 @@
 ;;; Copyright © 2017 Jelle Licht 
 ;;; Copyright © 2018 Tobias Geerinckx-Rice 
 ;;; Copyright © 2018 Alex Vong 
+;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen 
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -107,3 +108,11 @@ is in the public domain.")
 ;; commit fad5b1a6d8d9c36bea5785ae4fbc1beb37e644d7.
 (define-public sqlite-with-column-metadata
   (deprecated-package "sqlite-with-column-metadata" sqlite))
+
+(define-public sqlite/hurd
+  ;; TODO move into sqlite on the next rebuild cycle.
+  (package
+(inherit sqlite)
+(name "sqlite-for-hurd")
+(source (origin (inherit (package-source sqlite))
+(patches (search-patches "sqlite3-hurd.patch"))
-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com






bug#42151: [PATCH 2/3] gnu: guile-sqlite3: Use sqlite/hurd for locking on the Hurd.

2020-07-01 Thread Jan (janneke) Nieuwenhuizen
This fixes

guix offload: error: exception occurred on remote host 'localhost': 
(%exception #>)

* gnu/packages/guile.scm (guile-sqlite3)[inputs]: Use sqlite/hurd instead of
sqlite.
---
 gnu/packages/guile.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm
index a32bd33293..c651e2427a 100644
--- a/gnu/packages/guile.scm
+++ b/gnu/packages/guile.scm
@@ -665,7 +665,7 @@ Guile's foreign function interface.")
("pkg-config" ,pkg-config)))
 (inputs
  `(("guile" ,guile-3.0)
-   ("sqlite" ,sqlite)))
+   ("sqlite" ,sqlite/hurd)))
 (synopsis "Access SQLite databases from Guile")
 (description
  "This package provides Guile bindings to the SQLite database system.")
-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com






bug#42151: [PATCH 3/3] gnu: guix: Use sqlite/hurd for locking on the Hurd.

2020-07-01 Thread Jan (janneke) Nieuwenhuizen
* gnu/packages/package-management.scm (guix)[inputs]: Use sqlite/hurd.
---
 gnu/packages/package-management.scm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gnu/packages/package-management.scm 
b/gnu/packages/package-management.scm
index 068d46566c..52c5a1e60d 100644
--- a/gnu/packages/package-management.scm
+++ b/gnu/packages/package-management.scm
@@ -343,7 +343,7 @@ $(prefix)/etc/init.d\n")))
  ("zlib" ,zlib)  ;for 'guix publish'
  ("lzlib" ,lzlib);for 'guix publish' and 'guix substitute'
 
- ("sqlite" ,sqlite)
+ ("sqlite" ,sqlite/hurd)
  ("libgcrypt" ,libgcrypt)
 
  ("guile" ,guile-3.0-latest)
-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com






bug#42151: [PATCH 0/3] offload to Childhurd fails: setting synchronous mode: locking protocol

2020-07-01 Thread Jan (janneke) Nieuwenhuizen
Hello Guix!

I configured my system with a childhurd service and added

--8<---cut here---start->8---
 (build-machine
  (name "childhurd")
  (system "i586-gnu")
  (host-key "ssh-ed25519 ... root@childhurd")
  (user "root")
  (private-key "/home/janneke/.ssh/id_rsa_childhurd"))
--8<---cut here---end--->8---

to /etc/guix/machines.  Sadly, running guix offload test gives

--8<---cut here---start->8---
$ guix offload test
guix offload: testing 1 build machines defined in '/etc/guix/machines.scm'...
guix offload: Guix is usable on 'childhurd' (test returned 
"/gnu/store/883yjkl46dxw9mzykykmbs0yzwyxm17z-test")
guix offload: 'childhurd' is running GNU Guile 3.0.4
guix offload: error: exception occurred on remote host 'localhost': (%exception 
#>)
--8<---cut here---end--->8---

So, I looked into the Debian/Hurd sqlite3 package for inspiration and found
debian/patches/20-hurd-locking-style.patch...well, that should fix it, right?

Sadly, this patch seems to break sqlite3 altogether.

--8<---cut here---start->8---
$ guix offload test
guix offload: testing 1 build machines defined in '/etc/guix/machines.scm'...
Backtrace:
In ice-9/boot-9.scm:
  1736:10 11 (with-exception-handler _ _ #:unwind? _ #:unwind-for-type _)
In unknown file:
  10 (apply-smob/0 #)
In ice-9/boot-9.scm:
718:2  9 (call-with-prompt _ _ #)
In ice-9/eval.scm:
619:8  8 (_ #(#(#)))
In guix/ui.scm:
  1949:12  7 (run-guix-command _ . _)
663:2  6 (call-with-error-handling _)
In ice-9/boot-9.scm:
  1736:10  5 (with-exception-handler _ _ #:unwind? _ #:unwind-for-type _)
  1731:15  4 (with-exception-handler # _ #:unwind? _ # …)
In guix/scripts/offload.scm:
647:6  3 (check-machine-availability _ _)
In srfi/srfi-1.scm:
   650:11  2 (for-each # 
(#< pid: pipe socket: #) …)
In guix/scripts/offload.scm:
582:2  1 (assert-node-has-guix #< pid: pipe socket: 
# …)
In ice-9/boot-9.scm:
  1669:16  0 (raise-exception _ #:continuable? _)

ice-9/boot-9.scm:1669:16: In procedure raise-exception:
ERROR:
  1. :
  arguments: (%exception #>)
  inferior: #< pid: pipe socket: # close: # version: (0 1 1) packages: 
#> table: 
#>>
  stack: ((#f ("ice-9/boot-9.scm" 1763 13)) (raise-exception 
("ice-9/boot-9.scm" 1666 16)) (raise-exception ("ice-9/boot-9.scm" 1668 16)) 
(#f ("guix/store.scm" 582 42)) (with-exception-handler ("ice-9/boot-9.scm" 1735 
10)) (open-connection ("guix/store.scm" 545 2)) (call-with-store 
("guix/store.scm" 626 15)) (#f (#f #f #f)) (#f ("guix/repl.scm" 92 21)) 
(with-exception-handler ("ice-9/boot-9.scm" 1735 10)) (with-exception-handler 
("ice-9/boot-9.scm" 1730 15)) (#f ("guix/repl.scm" 119 7)))
--8<---cut here---end--->8---

Maybe we're missing some file_lock patch that Debian has?  Where to look,
glibc, hurd, ...?  Ideas?

Greetings,
Janneke

Jan (janneke) Nieuwenhuizen (3):
  gnu: Add sqlite/hurd with locking fix.
  gnu: guile-sqlite3: Use sqlite/hurd for locking on the Hurd.
  gnu: guix: Use sqlite/hurd for locking on the Hurd.

 gnu/local.mk|  1 +
 gnu/packages/guile.scm  |  2 +-
 gnu/packages/package-management.scm |  2 +-
 gnu/packages/patches/sqlite3-hurd.patch | 51 +
 gnu/packages/sqlite.scm |  9 +
 5 files changed, 63 insertions(+), 2 deletions(-)
 create mode 100644 gnu/packages/patches/sqlite3-hurd.patch

-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com





bug#42077: updated guix package build fails: tests/git-authenticate.log Error 1

2020-06-29 Thread Jan Nieuwenhuizen
Ludovic Courtès writes:

Hello,

>> Test suite failed, dumping logs.
>> command "make" "check" failed with status 2
>
> Oops, fixed in 0a8dd8aae5fad365c2f429d48e4085a3b3388332.

Thank you.  Oh, I suppose that was easy once you spotted it; that was
what I hoped anyway.  I tried following the backtrace and looking for
search-patch instances for a bit...but it wasn't obvious.

Greetings,
Janneke

-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com





bug#42047: [PATCH v2] guix: gc: Support for the Hurd.

2020-06-27 Thread Jan Nieuwenhuizen
Jan Nieuwenhuizen writes:

Hello,

>> Nitpick: I see 3 mostly unrelated patches: (1) fix duplicate called to
>> ‘scope’, (2) mount /proc, and (3) handle EIO.  I think it’s clearer to
>> view them separately.

> Yes, I agree.  I will split into 3 patches.

I have split and pushed the trivial hurd-boot patches as
65d95e5d852e47343b9acc1717918c9db7364c01

>>>(append-map rhs-file-names
>>> -  (split-on-nul
>>> -   (call-with-input-file environ
>>> - get-string-all
>>> +  (catch 'system-error
>>> +(lambda _
>>> +  (split-on-nul
>>> +   (call-with-input-file environ
>>> + get-string-all)))
>>> +(lambda args
>>> +  (if (= EIO (system-error-errno args))
>>> +  '()
>>> +  (apply throw args))
>>
>> This may be papering over a real problem.  Before doing that, I think
>> “we” :-) should investigate why procfs returns EIO in some cases and
>> look into fixing it.
>
> Sure, let "us" look into that! :)

I have (with some kind fixup help from Marius) created a gdb-minimal
package that cross-builds and works on the Hurd.  I tried to gain
insight by attaching to guix-daemon or just running guix-daemon in gdb,
but it does not seem to run under gdb; but that could be my
inexperience.  I'm only getting mig/ipc or thread messages...

So...attached is a pretty blunt hack that does "fix" guix gc.  Where the
above "tried" to paper over the problem, "catch #t" is the only thing I
could get to actually work.

I'm really puzzled here.  This

--8<---cut here---start->8---
  (append-map rhs-file-names
  (split-on-nul
   (catch #t ;;'system-error
 (lambda _
   (call-with-input-file environ
 get-string-all))
 (lambda args
   (format (current-error-port) "KETS: args=~s\n" args)
   (format (current-error-port) "sys: ~s\n" (system-error-errno 
args))
   ""
--8<---cut here---end--->8---

gives

--8<---cut here---start->8---
KETS: args=(r6rs:exception #)
sys: #f
Backtrace:
  19 (apply-smob/1 #)
In ice-9/boot-9.scm:
705:2 18 (call-with-prompt _ _ #)
In ice-9/eval.scm:
619:8 17 (_ #(#(#)))
In guix/ui.scm:
  1948:12 16 (run-guix-command _ . _)
In ice-9/boot-9.scm:
829:9 15 (catch _ _ # _)
829:9 14 (catch _ _ # _)
In guix/scripts/gc.scm:
   280:14 13 (_)
In guix/store/roots.scm:
   290:39 12 (busy-store-items)
madvise failed: Function not implemented
In srfi/srfi-1.scm:
   679:15 11 (append-map _ _ . _)
   592:29 10 (map1 _)
   592:29  9 (map1 _)
   592:29  8 (map1 _)
   592:29  7 (map1 _)
   592:29  6 (map1 ("5" "6" "7" "9" "10" "12" "19" "23" "24" "25" "26" "27" 
"42" "93" "95" "109" "197" "503" …))
   592:29  5 (map1 ("6" "7" "9" "10" "12" "19" "23" "24" "25" "26" "27" "42" 
"93" "95" "109" "197" "503" "5…" …))
   592:29  4 (map1 ("7" "9" "10" "12" "19" "23" "24" "25" "26" "27" "42" "93" 
"95" "109" "197" "503" "516" # …))
   592:17  3 (map1 ("9" "10" "12" "19" "23" "24" "25" "26" "27" "42" "93" "95" 
"109" "197" "503" "516" "538" …))
In ice-9/boot-9.scm:
829:9  2 (catch system-error # # …)
In guix/store/roots.scm:
   259:30  1 (_)
   204:15  0 (proc-environ-roots _)

guix/store/roots.scm:204:15: In procedure proc-environ-roots:
ERROR: R6RS exception:
  1. /o-read
  2. /o-port: #
--8<---cut here---end--->8---

which shows 'system-error as well as conditions.  But using "catch
'system-error' or even

--8<---cut here---start->8---
 (append-map rhs-file-names
 (split-on-nul
  (guard (c (else ;;(i/o-read-error? c)
 (format #t "KETS\n")
 (format (current-error-

bug#42077: updated guix package build fails: tests/git-authenticate.log Error 1

2020-06-27 Thread Jan Nieuwenhuizen
Hi,

On current master (35691bf5dc69e4d482b31fab63e3bd73ffece755, and "some
time" earlier), updating guix (see attached patch) and running

--8<---cut here---start->8---
./pre-inst-env guix build guix --keep-failed --verbosity=1
--8<---cut here---end--->8---

fails like so

--8<---cut here---start->8---
PASS: tests/gexp.scm
SKIP: tests/git.scm
make[4]: *** [Makefile:5274: tests/git-authenticate.log] Error 1
make[4]: Leaving directory '/tmp/guix-build-guix-1.1.0-13.35691bf.drv-0/source'
make[3]: *** [Makefile:5256: check-TESTS] Error 2
make[3]: Leaving directory '/tmp/guix-build-guix-1.1.0-13.35691bf.drv-0/source'
make[2]: *** [Makefile:5505: check-am] Error 2
make[2]: Leaving directory '/tmp/guix-build-guix-1.1.0-13.35691bf.drv-0/source'
make[1]: *** [Makefile:5033: check-recursive] Error 1
make[1]: Leaving directory '/tmp/guix-build-guix-1.1.0-13.35691bf.drv-0/source'
make: *** [Makefile:5507: check] Error 2

Test suite failed, dumping logs.
command "make" "check" failed with status 2
--8<---cut here---end--->8---

Contents of 
/tmp/guix-build-guix-1.1.0-13.35691bf.drv-0/source/tests/git-authenticate.log:

--8<---cut here---start->8---
Backtrace:
   2 (primitive-load-path "tests/git-authenticate.scm")
In ice-9/eval.scm:
259:9  1 (_ #f)
In unknown file:
   0 (search-path ("/tmp/guix-build-guix-1.1.0-13.35691b…" …) …)

ERROR: In procedure search-path:
Wrong type (expecting string): #f
test-name: unsigned commits
location: 
/tmp/guix-build-guix-1.1.0-13.35691bf.drv-0/source/tests/git-authenticate.scm:43
source:
+ (test-assert
+   "unsigned commits"
+   (with-temporary-git-repository
+ directory
+ '((add "a.txt" "A")
+   (commit "first commit")
+   (add "b.txt" "B")
+   (commit "second commit"))
+ (with-repository
+   directory
+   repository
+   (let ((commit1 (find-commit repository "first"))
+ (commit2 (find-commit repository "second")))
+ (guard (c ((unsigned-commit-error? c)
+(oid=? (git-authentication-error-commit c)
+   (commit-id commit1
+(authenticate-commits
+  repository
+  (list commit1 commit2)
+  #:keyring-reference
+  "master")
+'failed)
result: SKIP
--8<---cut here---end--->8---

Greetings,
Janneke

>From bc29c78ac33d9f4e037bbe2a8104873a5644df57 Mon Sep 17 00:00:00 2001
From: "Jan (janneke) Nieuwenhuizen" 
Date: Thu, 7 May 2020 18:25:26 +0200
Subject: [PATCH] gnu: guix: Update to 1.1.0-13.35691bf5dc6.

* gnu/packages/package-management.scm (guix): Update to 1.1.0-13.35691bf5dc6
---
 gnu/packages/package-management.scm | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gnu/packages/package-management.scm b/gnu/packages/package-management.scm
index bfecf110ca..bf5e59fb4b 100644
--- a/gnu/packages/package-management.scm
+++ b/gnu/packages/package-management.scm
@@ -118,8 +118,8 @@
   ;; Note: the 'update-guix-package.scm' script expects this definition to
   ;; start precisely like this.
   (let ((version "1.1.0")
-(commit "c00564192a9924ab2218c243342963aba89d67d1")
-(revision 12))
+(commit "35691bf5dc69e4d482b31fab63e3bd73ffece755")
+(revision 13))
 (package
   (name "guix")
 
@@ -135,7 +135,7 @@
   (commit commit)))
 (sha256
  (base32
-  "008ywpdkc5f2jh25x6rr9glzvq4a6qih7v73w5dbxscpddx5c5g2"))
+  "0hh31lbbbmjkwlxvp4fzrdz0r8p9233h2zlf71r4gccsjqh16pra"))
     (file-name (string-append "guix-" version "-checkout"
   (build-system gnu-build-system)
   (arguments
-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com


-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com


bug#42047: [PATCH 3/3] guix: gc: Support for the Hurd.

2020-06-26 Thread Jan Nieuwenhuizen
Ludovic Courtès writes:

Hello,

A new day!

> "Jan (janneke) Nieuwenhuizen"  skribis:
>
>> * guix/store/roots.scm (proc-environ-roots): Handle EIO, for the Hurd.
>> * gnu/build/hurd-boot.scm (set-hurd-device-translators): Mount /proc.  Add
>> symlink to /etc/mtab.  Remove duplicate calls to 'scope'.
>
> Nitpick: I see 3 mostly unrelated patches: (1) fix duplicate called to
> ‘scope’, (2) mount /proc, and (3) handle EIO.  I think it’s clearer to
> view them separately.

Yes, I agree.  I will split into 3 patches.

(Initially my plan was to post a DRAFT/RFC for (3) that would either fix
"guix gc", or show us the next error.  Then I needed the other two and
found there was yet another problem...)

>> -  (mkdir* (scope "dev/vcs/1"))
>> -  (mkdir* (scope "dev/vcs/2"))
>> -  (mkdir* (scope "dev/vcs/2"))
>
> Was it creating like /some/root/some/root/dev/vcs/1?

No... "just" //dev/vcs/1.  However, in my bare-iron experiments I
stumbled upon several "Not a directory", so...just being careful here.

>>(append-map rhs-file-names
>> -  (split-on-nul
>> -   (call-with-input-file environ
>> - get-string-all
>> +  (catch 'system-error
>> +(lambda _
>> +  (split-on-nul
>> +   (call-with-input-file environ
>> + get-string-all)))
>> +(lambda args
>> +  (if (= EIO (system-error-errno args))
>> +  '()
>> +  (apply throw args))
>
> This may be papering over a real problem.  Before doing that, I think
> “we” :-) should investigate why procfs returns EIO in some cases and
> look into fixing it.

Sure, let "us" look into that! :)

> Then maybe we can still have the ‘catch’ above, but this time as a
> temporary measure and with a reference to the upstream issue/commit.
>
> WDYT?

Sure, thanks.

So...I think that I found the problem: Using guile-3.0.[34].  This patch

--8<---cut here---start->8---
diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm
index a32bd33293..b191a7b93b 100644
--- a/gnu/packages/guile.scm
+++ b/gnu/packages/guile.scm
@@ -312,14 +312,14 @@ without requiring the source code to be rewritten.")
   ;; TODO: Make this 'guile-3.0' on the next rebuild cycle.
   (package
 (inherit guile-3.0)
-(version "3.0.4")
+(version "3.0.2")
 (source (origin
   (inherit (package-source guile-3.0))
   (uri (string-append "mirror://gnu/guile/guile-"
   version ".tar.xz"))
   (sha256
(base32
-"0c8dkyvs6xbxp7rgnhkyakajzhakay7qn9kahj1mj49x5vf4fybb"))
+"12lziar4j27j9whqp2n18427q45y9ghq7gdd8lqhmj1k0lr7vi2k"))
 
 (define-public guile-next
   (deprecated-package "guile-next" guile-3.0))
--8<---cut here---end--->8---

fixes guix build...(terrible!)  What shall "we" do with this, maybe
"someone" wants to have a look?  Guess this should find its way into a
Guile bug report?

[later...]

I checked-out guile master on Debian/Hurd and ran the Guile test suite,
which (apart from known failures) passed.  Leaving that for now.

So, then it "must" be our cross-compiled guile-3.0.4 for the Hurd; best
to check that, right?  Look:

--8<---cut here---start->8---
root@guixydevel ~/guile# ./check-guile -i /run/current-system/profile/bin/guile
Testing /run/current-system/profile/bin/guile ...
with 
GUILE_LOAD_PATH=/root/guile/test-suite:/run/current-system/profile/share/guile/site/3.0
WARNING: Use of `load' in declarative module (test-suite guile-test).  Add 
#:declarative? #f to your define-module invocation.
Running 00-initial-env.test
Running 00-repl-server.test
Running 00-socket.test
UNRESOLVED: 00-socket.test: AF_INET6/SOCK_STREAM: bind
UNRESOLVED: 00-socket.test: AF_INET6/SOCK_STREAM: bind/sockaddr
UNRESOLVED: 00-socket.test: AF_INET6/SOCK_STREAM: listen
UNRESOLVED: 00-socket.test: AF_INET6/SOCK_STREAM: connect
UNRESOLVED: 00-socket.test: AF_INET6/SOCK_STREAM: connect/sockaddr
UNRESOLVED: 00-socket.test: AF_INET6/SOCK_STREAM: accept
[...]
Running asyncs.test
ERROR: asyncs.test: preemption via sigprof - arguments: ((system-error 
"setitimer" "~A" ("Function not implemented") (1073741902)))
[...]
Running bytevectors.test
FAIL: bytevectors.test: 2.8 Operations on IEEE-754 Representations: 
bytevector-ieee-single-native-{ref,set!} (compile -O2)
FAIL: bytevectors.test: 2.8 Operations on IEEE-754 Representation

bug#42047: [PATCH 1/3] image: hurd: Create hurd-compatible ext2 file-system.

2020-06-25 Thread Jan Nieuwenhuizen
Ludovic Courtès writes:

Hey Ludo',

> "Jan (janneke) Nieuwenhuizen"  skribis:
>
>> This is a follow-up to commit b904b59ce592c89dfb4675a8c06757afed6738a0.
>>
>> * gnu/system/images/hurd.scm (hurd-disk-image): Add file-system-options to
>> create an ext2 file-system that is compatible with the Hurd.
>
> [...]
>
>> This is a follow-up to commit b904b59ce592c89dfb4675a8c06757afed6738a0.
>>
>> * gnu/system/image.scm (hurd-initialize-root-partition): Move to ...
>> * gnu/system/images/hurd.scm (hurd-initialize-root-partition): ... here.
>> (hurd-disk-image): Use it.
>
> You can definitely push these two patches.
>
> Breakage occurred as a result of the introduction of (gnu system images
> hurd)?
>
> If you know which commit introduced the regression, I think it’s useful
> to mention it in the commit message.

Yes, breakage occured in the mentioned commit above
(b904b59ce592c89dfb4675a8c06757afed6738a0)

Pushed the two fixups to master as 2463a78d17673581978debff6c6c9fce7966980a.

Now to look into "guix build", i'd like to fix that first before
considering "guix gc".

Thanks.
Janneke

-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com





bug#42047: [PATCH 3/3] guix: gc: Support for the Hurd.

2020-06-25 Thread Jan (janneke) Nieuwenhuizen
* guix/store/roots.scm (proc-environ-roots): Handle EIO, for the Hurd.
* gnu/build/hurd-boot.scm (set-hurd-device-translators): Mount /proc.  Add
symlink to /etc/mtab.  Remove duplicate calls to 'scope'.
---
 gnu/build/hurd-boot.scm | 21 ++---
 guix/store/roots.scm| 13 ++---
 2 files changed, 24 insertions(+), 10 deletions(-)

diff --git a/gnu/build/hurd-boot.scm b/gnu/build/hurd-boot.scm
index aea2ac3307..2db99cdcce 100644
--- a/gnu/build/hurd-boot.scm
+++ b/gnu/build/hurd-boot.scm
@@ -191,7 +191,8 @@ set."
   "10.0.2.15" ;the default QEMU guest IP
   "--netmask" "255.255.255.0"
   "--gateway" "10.0.2.2"
-  "--ipv6" "/servers/socket/16"
+  "--ipv6" "/servers/socket/16"))
+  ("proc"("/hurd/procfs" "--stat-mode=444"
 
   (define devices
 '(("dev/full"("/hurd/null" "--full")#o666)
@@ -232,17 +233,23 @@ set."
 #o666)))
 
   (for-each scope-set-translator servers)
-  (mkdir* (scope "dev/vcs/1"))
-  (mkdir* (scope "dev/vcs/2"))
-  (mkdir* (scope "dev/vcs/2"))
-  (rename-file (scope "/dev/console") (scope "/dev/console-"))
+  (mkdir* "dev/vcs/1")
+  (mkdir* "dev/vcs/2")
+  (mkdir* "dev/vcs/2")
+  (rename-file (scope "/dev/console") (scope "dev/console-"))
   (for-each scope-set-translator devices)
 
   (false-if-EEXIST (symlink "/dev/random" (scope "dev/urandom")))
-  (mkdir* (scope "dev/fd"))
+  (mkdir* "dev/fd")
   (false-if-EEXIST (symlink "/dev/fd/0" (scope "dev/stdin")))
   (false-if-EEXIST (symlink "/dev/fd/1" (scope "dev/stdout")))
-  (false-if-EEXIST (symlink "/dev/fd/2" (scope "dev/stderr"
+  (false-if-EEXIST (symlink "/dev/fd/2" (scope "dev/stderr")))
+
+  ;; Make sure /etc/mtab is a symlink to /proc/mounts.
+  (false-if-exception
+   (delete-file (scope "etc/mtab")))
+  (mkdir* (scope "etc"))
+  (symlink "/proc/mounts" (scope "etc/mtab")))
 
 
 (define* (boot-hurd-system #:key (on-error 'debug))
diff --git a/guix/store/roots.scm b/guix/store/roots.scm
index 58653507f8..9b4a05b149 100644
--- a/guix/store/roots.scm
+++ b/guix/store/roots.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2012, 2013, 2014, 2017, 2019 Ludovic Courtès 
+;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen 
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -197,9 +198,15 @@ or the empty list."
 (string-append dir "/environ"))
 
   (append-map rhs-file-names
-  (split-on-nul
-   (call-with-input-file environ
- get-string-all))))
+  (catch 'system-error
+(lambda _
+  (split-on-nul
+   (call-with-input-file environ
+ get-string-all)))
+(lambda args
+  (if (= EIO (system-error-errno args))
+  '()
+  (apply throw args))
 
 (define (referenced-files)
   "Return the list of referenced store items."
-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com






bug#42047: [PATCH 1/3] image: hurd: Create hurd-compatible ext2 file-system.

2020-06-25 Thread Jan (janneke) Nieuwenhuizen
This is a follow-up to commit b904b59ce592c89dfb4675a8c06757afed6738a0.

* gnu/system/images/hurd.scm (hurd-disk-image): Add file-system-options to
create an ext2 file-system that is compatible with the Hurd.
---
 gnu/system/images/hurd.scm | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gnu/system/images/hurd.scm b/gnu/system/images/hurd.scm
index 4417f03cc8..e5e120d49c 100644
--- a/gnu/system/images/hurd.scm
+++ b/gnu/system/images/hurd.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2020 Mathieu Othacehe 
+;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen 
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -66,6 +67,7 @@
(offset root-offset)
(label root-label)
(file-system "ext2")
+   (file-system-options '("-o" "hurd" "-O" "ext_attr"))
(flags '(boot))
(initializer (gexp initialize-root-partition)))
 
-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com






bug#42047: [PATCH 2/3] image: hurd: Initialize root partition for the Hurd.

2020-06-25 Thread Jan (janneke) Nieuwenhuizen
This is a follow-up to commit b904b59ce592c89dfb4675a8c06757afed6738a0.

* gnu/system/image.scm (hurd-initialize-root-partition): Move to ...
* gnu/system/images/hurd.scm (hurd-initialize-root-partition): ... here.
(hurd-disk-image): Use it.
---
 gnu/system/image.scm   | 7 ---
 gnu/system/images/hurd.scm | 9 -
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/gnu/system/image.scm b/gnu/system/image.scm
index bb73aea65a..a4cc2d1ef9 100644
--- a/gnu/system/image.scm
+++ b/gnu/system/image.scm
@@ -96,13 +96,6 @@
(flags '(boot))
(initializer (gexp initialize-root-partition
 
-(define hurd-initialize-root-partition
-  #~(lambda* (#:rest args)
-  (apply initialize-root-partition
- (append args
- (list #:make-device-nodes
-   make-hurd-device-nodes)
-
 (define efi-disk-image
   (image
(format 'disk-image)
diff --git a/gnu/system/images/hurd.scm b/gnu/system/images/hurd.scm
index e5e120d49c..31942e7386 100644
--- a/gnu/system/images/hurd.scm
+++ b/gnu/system/images/hurd.scm
@@ -57,6 +57,13 @@
   (password-authentication? #t)))
%base-services/hurd
 
+(define hurd-initialize-root-partition
+  #~(lambda* (#:rest args)
+  (apply initialize-root-partition
+ (append args
+ (list #:make-device-nodes
+   make-hurd-device-nodes)
+
 (define hurd-disk-image
   (image
(format 'disk-image)
@@ -69,7 +76,7 @@
(file-system "ext2")
(file-system-options '("-o" "hurd" "-O" "ext_attr"))
(flags '(boot))
-   (initializer (gexp initialize-root-partition)))
+   (initializer hurd-initialize-root-partition))
 
 (define hurd-barebones-disk-image
   (image
-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com






bug#42047: [PATCH 0/3] Running guix gc on the Hurd.

2020-06-25 Thread Jan (janneke) Nieuwenhuizen
From: Jan Nieuwenhuizen 

Hi!

As discussed on IRC, we would like to get "guix gc" to work on the Hurd.  It's
kind of essential to get the build nodes running a Childhurd.  We discussed
several workarounds, but an acceptable one is non-trivial; so better look into
a proper fix first.

We found that /proc is missing, so I have added that.  And then we found that
/proc/1/environ (and others) may return EIO; so I've added a catch/workaround
for that.

However, when trying to test this I found that the hurd disk image on master
is pretty broken:

   * it creates an ext2, but not of hurd flavor (fixed in 0001)
   * it fails to call make-hurd-device-nodes (fixed in 0002)

With these two fixes, it boots again.  These are really minor fixes/typo-like
oversights and I was considering to "just push" them... but then I found that
the "guix build" command is also broken:

--8<---cut here---start->8---
root@guixygnu ~# guix build -e '(@@ (gnu packages commencement) gnu-make-boot0)'
Backtrace:
In ice-9/boot-9.scm:
  1736:10  4 (with-exception-handler _ _ #:unwind? _ # _)
In unknown file:
   3 (apply-smob/0 #)
In ice-9/boot-9.scm:
718:2  2 (call-with-prompt _ _ #)
In ice-9/eval.scm:
619:8  1 (_ #(#(#)))
In guix/ui.scm:
  1948:12  0 (run-guix-command _ . _)

guix/ui.scm:1948:12: In procedure run-guix-command:
In procedure struct-vtable: Wrong type argument in position 1 (expecting 
struct): #f
--8<---cut here---end--->8---

How sad!

I'm a bit stuck on this, probably because I'm feeling somewhat discouraged.
Any ideas what could have broken this, how to look into it, fix this?

Greetings,
Janneke

Jan (janneke) Nieuwenhuizen (3):
  image: hurd: Create hurd-compatible ext2 file-system.
  image: hurd: Initialize root partition for the Hurd.
  guix: gc: Support for the Hurd.

 gnu/build/hurd-boot.scm| 21 ++---
 gnu/system/image.scm   |  7 ---
 gnu/system/images/hurd.scm | 11 ++-
 guix/store/roots.scm   | 12 +---
 4 files changed, 33 insertions(+), 18 deletions(-)

-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com






bug#41982: [PATCH 0/1] gnu: grub: Cross-build fix for system i686-linux.

2020-06-25 Thread Jan Nieuwenhuizen
Ludovic Courtès writes:

Hello,

>> Pushed to master as cd6b0910dc471afb76677109625af0a42ce3056a
>
> Cool, thanks!

Well, preparing a new patch I found the commit above didn't make it to
master yet, I'm puzzled.  I'm pretty sure that I send this mail after
(I believe that) the push was successful.

A new attempt: pushed to master as d613991a8ebe5d4b3a7706f8f0dd52f16fc1c50a

And closing (forgot that too).

Greetings,
Janneke

-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com





bug#41982: [PATCH] grub-core: Build fixes for i386

2020-06-23 Thread Jan Nieuwenhuizen
Hi!

When cross-compiling Grub-2.04 from i386-linux-gnu to i586-pc-hurd on
GNU Guix, I got this error

--8<---cut here---start->8---
i586-pc-gnu-gcc -DHAVE_CONFIG_H -I. -I..  -Wall -W  -DGRUB_MACHINE_PCBIOS=1 
-DGRUB_MACHINE=I386_PC -m32 -nostdinc -isystem 
/gnu/store/5s0ldm31100d9ix15d1lmbsvi0aa77pq-gcc-cross-i586-pc-gnu-7.5.0-lib/lib/gcc/i586-pc-gnu/7.5.0/include
 -I../include -I../include -DGRUB_FILE=\"lib/cmos_datetime.c\" -I. -I. -I.. 
-I.. -I../include -I../include -I../grub-core/lib/libgcrypt-grub/src/
-D_FILE_OFFSET_BITS=64 -Os -Wall -W -Wshadow -Wpointer-arith -Wundef 
-Wchar-subscripts -Wcomment -Wdeprecated-declarations -Wdisabled-optimization 
-Wdiv-by-zero -Wfloat-equal -Wformat-extra-args -Wformat-security -Wformat-y2k 
-Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Wmain 
-Wmissing-braces -Wmissing-format-attribute -Wmultichar -Wparentheses 
-Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wswitch -Wtrigraphs 
-Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter 
-Wunused-value  -Wunused-variable -Wwrite-strings -Wnested-externs 
-Wstrict-prototypes -g -Wredundant-decls -Wmissing-prototypes 
-Wmissing-declarations  -Wextra -Wattributes -Wendif-labels -Winit-self 
-Wint-to-pointer-cast -Winvalid-pch -Wmissing-field-initializers -Wnonnull 
-Woverflow -Wvla -Wpointer-to-int-cast -Wstrict-aliasing -Wvariadic-macros 
-Wvolatile-register-var -Wpointer-sign -Wmissing-include-dirs 
-Wmissing-prototypes -Wmissing-declarations -Wformat=2 -march=i386 -m32 -mrtd 
-mregparm=3 -falign-jumps=1 -falign-loops=1 -falign-functions=1 
-freg-struct-return -mno-mmx -mno-sse -mno-sse2 -mno-sse3 -mno-3dnow 
-msoft-float -fno-dwarf2-cfi-asm -mno-stack-arg-probe 
-fno-asynchronous-unwind-tables -fno-unwind-tables -fno-stack-protector 
-Wtrampolines -Werror   -ffreestanding   -MT 
lib/datetime_module-cmos_datetime.o -MD -MP -MF 
lib/.deps-core/datetime_module-cmos_datetime.Tpo -c -o 
lib/datetime_module-cmos_datetime.o `test -f 'lib/cmos_datetime.c' || echo 
'./'`lib/cmos_datetime.c
lib/i386/relocator64.S: Assembler messages:
lib/i386/relocator64.S:66: Error: unknown pseudo-op: `.code64'
lib/i386/relocator64.S:74: Error: bad register name `%rax'
lib/i386/relocator64.S:98: Error: bad register name `%rax'
lib/i386/relocator64.S:132: Error: bad register name `%rip)'
make[3]: *** [Makefile:32165: lib/i386/relocator_module-relocator64.o] Error 1
make[3]: *** Waiting for unfinished jobs
mv -f lib/i386/.deps-core/relocator_module-relocator_common_c.Tpo 
lib/i386/.deps-core/relocator_module-relocator_common_c.Po
mv -f lib/i386/.deps-core/relocator_module-relocator.Tpo 
lib/i386/.deps-core/relocator_module-relocator.Po
mv -f kern/.deps-core/elf_module-elf.Tpo kern/.deps-core/elf_module-elf.Po
mv -f lib/.deps-core/datetime_module-cmos_datetime.Tpo 
lib/.deps-core/datetime_module-cmos_datetime.Po
mv -f fs/.deps-core/xfs_module-xfs.Tpo fs/.deps-core/xfs_module-xfs.Po
mv -f lib/.deps-core/crypto_module-crypto.Tpo 
lib/.deps-core/crypto_module-crypto.Po
mv -f lib/.deps-core/relocator_module-relocator.Tpo 
lib/.deps-core/relocator_module-relocator.Po
make[3]: Leaving directory 
'/tmp/guix-build-grub-minimal-2.04.drv-0/grub-2.04/grub-core'
make[2]: *** [Makefile:26403: all] Error 2
make[2]: Leaving directory 
'/tmp/guix-build-grub-minimal-2.04.drv-0/grub-2.04/grub-core'
make[1]: *** [Makefile:11304: all-recursive] Error 1
make[1]: Leaving directory '/tmp/guix-build-grub-minimal-2.04.drv-0/grub-2.04'
make: *** [Makefile:3343: all] Error 2
command "make" "-j" "8" failed with status 2
--8<---cut here---end--->8---

In Guix we are now using the patch attached, which seems to fix this for
us.  We are not entirely sure if this is the proper fix though, see
<https://bugs.gnu.org/41982>.

Paraphrasing the questions raised there: why does this seem to compile
on i386?  Is that because the non-cross 32-bit ‘as’ supports ‘.code64’?
Is the Guix's cross-assembler ‘i586-pc-gnu-as’ configured wrong and
should it support this?

(FWIW, this is not specific for the Hurd, cross compiling from
i686-linux-gnu to i686-linux-gnu show the same error.  The use case for
that may be a bit thin to warrant a bug report.)

Ideas welcome!

Greetings,
Janneke

>From 270667540146f8ef9ea7a44258a71b3837a7af4a Mon Sep 17 00:00:00 2001
From: "Jan (janneke) Nieuwenhuizen" 
Date: Sun, 21 Jun 2020 15:10:40 +0200
Subject: [PATCH] grub-core: Build fixes for i386

* grub-core/lib/i386/relocator64.S: Avoid x86_64 instructions on i386.
---
 grub-core/lib/i386/relocator64.S | 26 +-
 1 file changed, 25 insertions(+), 1 deletion(-)

diff --git a/grub-core/lib/i386/relocator64.S b/grub-core/lib/i386/relocator64.S
index 148f38adb..45fed9444 100644
--- a/grub-core/lib/i386/relocator64.S
+++ b/grub-core/lib/i386/relocator64.S
@@ -63,7 +63,9 @@ VARIABLE(grub_relocator6

bug#41982: [PATCH 0/1] gnu: grub: Cross-build fix for system i686-linux.

2020-06-23 Thread Jan Nieuwenhuizen
Ludovic Courtès writes:

Hello,

> Jan Nieuwenhuizen  skribis:
>
>> Attempting to reconfigure a i686-linux guix system to a Hurd system, I
>> found that the Grub(-minimal) cross build fails like this
>>
>> i586-pc-gnu-gcc -DHAVE_CONFIG_H -I. -I..  -Wall -W
>> -DGRUB_MACHINE_PCBIOS=1 -DGRUB_MACHINE=I386_PC -m32 -nostdinc
>> -isystem
>> /gnu/store/5s0ldm31100d9ix15d1lmbsvi0aa77pq-gcc-cross-i586-pc-gnu-7.5.0-lib/lib/gcc/i586-pc-gnu/7.5.0/include
>> -I../include -I../include -DGRUB_FILE=\"lib/cmos_datetime.c\"

[..]
>> lib/.deps-core/datetime_module-cmos_datetime.Tpo -c -o
>> lib/datetime_module-cmos_datetime.o `test -f 'lib/cmos_datetime.c'
>> || echo './'`lib/cmos_datetime.c
>> lib/i386/relocator64.S: Assembler messages:
>> lib/i386/relocator64.S:66: Error: unknown pseudo-op: `.code64'
>> lib/i386/relocator64.S:74: Error: bad register name `%rax'
>> lib/i386/relocator64.S:98: Error: bad register name `%rax'
>> lib/i386/relocator64.S:132: Error: bad register name `%rip)'
>
> Interesting.  Why doesn’t it happen when doing:
>
>   guix build grub-minimal -s i686-linux
>
> ?  That’s because ‘as’ supports ‘.code64’ there?

Ah, that could be a switch!  I imagined ".code64" was not supported,
"just like" using 64-bit registers.

>> I am not sure if and how to report this upstream.  Ideas for a bug
>> description?  Apparently, non-cross builds "just" work (how?!).
>
> The issue seems to be that ‘.code64’ is not supported by cross
> assemblers to 32-bit Intel, right?

That could be part of the problem, I don't know.  I tested ‘.code64’ on
a 32-bit machine and get

--8<---cut here---start->8---
gcc -c foo-64.S
foo-64.S: Assembler messages:
foo-64.S:23: Error: unknown pseudo-op: `.code64'
foo-64.S:24: Error: bad register name `%rax'
foo-64.S:48: Error: unknown pseudo-op: `.code64'
foo-64.S:49: Error: bad register name `%rip)'
--8<---cut here---end--->8---

so, I'm not sure what's the idea here.

> Is this a defect of cross-as in general, or a misconfiguration in our
> Guix package?  Or is this normal behavior that should be fixed in GRUB?

Good question.  I will send the patch upstream (to Grub), maybe they can
share some light on this?

> Anyway, the patch LGTM!

Pushed to master as cd6b0910dc471afb76677109625af0a42ce3056a

Thanks!
Janneke

-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com





bug#41982: [PATCH 1/1] gnu: grub: Cross-build fix for system i686-linux.

2020-06-21 Thread Jan (janneke) Nieuwenhuizen
* gnu/packages/patches/grub-cross-system-i686.patch: New file.
* gnu/local.mk (dist_patch_DATA): Add it.
* gnu/packages/bootloaders.scm (grub): Use it.
---
 gnu/local.mk  |  1 +
 gnu/packages/bootloaders.scm  |  3 +-
 .../patches/grub-cross-system-i686.patch  | 79 +++
 3 files changed, 82 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/grub-cross-system-i686.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 347d4bbb17..1a061f43f8 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1044,6 +1044,7 @@ dist_patch_DATA = 
\
   %D%/packages/patches/grocsvs-dont-use-admiral.patch  \
   %D%/packages/patches/gromacs-tinyxml2.patch  \
   %D%/packages/patches/groovy-add-exceptionutilsgenerator.patch\
+  %D%/packages/patches/grub-cross-system-i686.patch\
   %D%/packages/patches/grub-efi-fat-serial-number.patch\
   %D%/packages/patches/grub-setup-root.patch   \
   %D%/packages/patches/grub-verifiers-Blocklist-fallout-cleanup.patch \
diff --git a/gnu/packages/bootloaders.scm b/gnu/packages/bootloaders.scm
index ea80cf020e..efbe488bc3 100644
--- a/gnu/packages/bootloaders.scm
+++ b/gnu/packages/bootloaders.scm
@@ -97,7 +97,8 @@
  (patches (search-patches
"grub-efi-fat-serial-number.patch"
"grub-setup-root.patch"
-   "grub-verifiers-Blocklist-fallout-cleanup.patch"
+   "grub-verifiers-Blocklist-fallout-cleanup.patch"
+   "grub-cross-system-i686.patch"
 (build-system gnu-build-system)
 (arguments
  `(#:configure-flags
diff --git a/gnu/packages/patches/grub-cross-system-i686.patch 
b/gnu/packages/patches/grub-cross-system-i686.patch
new file mode 100644
index 00..a376cae1db
--- /dev/null
+++ b/gnu/packages/patches/grub-cross-system-i686.patch
@@ -0,0 +1,79 @@
+Not upstreamed.
+Fixes cross-build for the Hurd, from i686-linux,
+see <https://bugs.gnu.org/41982>.
+
+From 270667540146f8ef9ea7a44258a71b3837a7af4a Mon Sep 17 00:00:00 2001
+From: "Jan (janneke) Nieuwenhuizen" 
+Date: Sun, 21 Jun 2020 15:10:40 +0200
+Subject: [PATCH] grub-core: Build fixes for i386
+
+* grub-core/lib/i386/relocator64.S: Avoid x86_64 instructions on i386.
+---
+ grub-core/lib/i386/relocator64.S | 26 +-
+ 1 file changed, 25 insertions(+), 1 deletion(-)
+
+diff --git a/grub-core/lib/i386/relocator64.S 
b/grub-core/lib/i386/relocator64.S
+index 148f38adb..45fed9444 100644
+--- a/grub-core/lib/i386/relocator64.S
 b/grub-core/lib/i386/relocator64.S
+@@ -63,7 +63,9 @@ VARIABLE(grub_relocator64_cr3)
+   movq%rax, %cr3
+ #endif
+ 
++#ifdef __x86_64__
+   .code64
++#endif
+ 
+   /* mov imm64, %rax */
+   .byte   0x48
+@@ -71,7 +73,14 @@ VARIABLE(grub_relocator64_cr3)
+ VARIABLE(grub_relocator64_rsp)
+   .quad   0
+ 
++#ifndef __x86_64__
++  /* movq %rax, %rsp */
++  .byte   0x48
++  .byte   0x89
++  .byte   0xc4
++#else
+   movq%rax, %rsp
++#endif
+ 
+ #ifdef GRUB_MACHINE_EFI
+   jmp LOCAL(skip_efi_stack_align)
+@@ -95,8 +104,15 @@ LOCAL(skip_efi_stack_align):
+ VARIABLE(grub_relocator64_rsi)
+   .quad   0
+ 
++#ifndef   __x86_64__
++  /* movq %rax, %rsi */
++  .byte   0x48
++  .byte   0x89
++  .byte   0xc6
++#else
+   movq%rax, %rsi
+-  
++#endif
++
+   /* mov imm64, %rax */
+   .byte   0x48
+   .byte   0xb8
+@@ -128,6 +144,14 @@ VARIABLE(grub_relocator64_rdx)
+ #ifdef __APPLE__
+   .byte 0xff, 0x25
+   .quad 0
++#elif !defined (__x86_64__)
++  /* jmp *LOCAL(jump_addr) (%rip) */
++  .byte 0xff
++.byte 0x25
++  .byte 0
++  .byte 0
++  .byte 0
++  .byte 0
+ #else
+   jmp *LOCAL(jump_addr) (%rip)
+ #endif
+-- 
+Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
+Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com
+
-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com






bug#41982: [PATCH 0/1] gnu: grub: Cross-build fix for system i686-linux.

2020-06-21 Thread Jan Nieuwenhuizen
Hi!

Attempting to reconfigure a i686-linux guix system to a Hurd system, I
found that the Grub(-minimal) cross build fails like this

--8<---cut here---start->8---
i586-pc-gnu-gcc -DHAVE_CONFIG_H -I. -I..  -Wall -W  -DGRUB_MACHINE_PCBIOS=1 
-DGRUB_MACHINE=I386_PC -m32 -nostdinc -isystem 
/gnu/store/5s0ldm31100d9ix15d1lmbsvi0aa77pq-gcc-cross-i586-pc-gnu-7.5.0-lib/lib/gcc/i586-pc-gnu/7.5.0/include
 -I../include -I../include -DGRUB_FILE=\"lib/cmos_datetime.c\" -I. -I. -I.. 
-I.. -I../include -I../include -I../grub-core/lib/libgcrypt-grub/src/
-D_FILE_OFFSET_BITS=64 -Os -Wall -W -Wshadow -Wpointer-arith -Wundef 
-Wchar-subscripts -Wcomment -Wdeprecated-declarations -Wdisabled-optimization 
-Wdiv-by-zero -Wfloat-equal -Wformat-extra-args -Wformat-security -Wformat-y2k 
-Wimplicit -Wimplicit-function-declaration -Wimplicit-int -Wmain 
-Wmissing-braces -Wmissing-format-attribute -Wmultichar -Wparentheses 
-Wreturn-type -Wsequence-point -Wshadow -Wsign-compare -Wswitch -Wtrigraphs 
-Wunknown-pragmas -Wunused -Wunused-function -Wunused-label -Wunused-parameter 
-Wunused-value  -Wunused-variable -Wwrite-strings -Wnested-externs 
-Wstrict-prototypes -g -Wredundant-decls -Wmissing-prototypes 
-Wmissing-declarations  -Wextra -Wattributes -Wendif-labels -Winit-self 
-Wint-to-pointer-cast -Winvalid-pch -Wmissing-field-initializers -Wnonnull 
-Woverflow -Wvla -Wpointer-to-int-cast -Wstrict-aliasing -Wvariadic-macros 
-Wvolatile-register-var -Wpointer-sign -Wmissing-include-dirs 
-Wmissing-prototypes -Wmissing-declarations -Wformat=2 -march=i386 -m32 -mrtd 
-mregparm=3 -falign-jumps=1 -falign-loops=1 -falign-functions=1 
-freg-struct-return -mno-mmx -mno-sse -mno-sse2 -mno-sse3 -mno-3dnow 
-msoft-float -fno-dwarf2-cfi-asm -mno-stack-arg-probe 
-fno-asynchronous-unwind-tables -fno-unwind-tables -fno-stack-protector 
-Wtrampolines -Werror   -ffreestanding   -MT 
lib/datetime_module-cmos_datetime.o -MD -MP -MF 
lib/.deps-core/datetime_module-cmos_datetime.Tpo -c -o 
lib/datetime_module-cmos_datetime.o `test -f 'lib/cmos_datetime.c' || echo 
'./'`lib/cmos_datetime.c
lib/i386/relocator64.S: Assembler messages:
lib/i386/relocator64.S:66: Error: unknown pseudo-op: `.code64'
lib/i386/relocator64.S:74: Error: bad register name `%rax'
lib/i386/relocator64.S:98: Error: bad register name `%rax'
lib/i386/relocator64.S:132: Error: bad register name `%rip)'
make[3]: *** [Makefile:32165: lib/i386/relocator_module-relocator64.o] Error 1
make[3]: *** Waiting for unfinished jobs
mv -f lib/i386/.deps-core/relocator_module-relocator_common_c.Tpo 
lib/i386/.deps-core/relocator_module-relocator_common_c.Po
mv -f lib/i386/.deps-core/relocator_module-relocator.Tpo 
lib/i386/.deps-core/relocator_module-relocator.Po
mv -f kern/.deps-core/elf_module-elf.Tpo kern/.deps-core/elf_module-elf.Po
mv -f lib/.deps-core/datetime_module-cmos_datetime.Tpo 
lib/.deps-core/datetime_module-cmos_datetime.Po
mv -f fs/.deps-core/xfs_module-xfs.Tpo fs/.deps-core/xfs_module-xfs.Po
mv -f lib/.deps-core/crypto_module-crypto.Tpo 
lib/.deps-core/crypto_module-crypto.Po
mv -f lib/.deps-core/relocator_module-relocator.Tpo 
lib/.deps-core/relocator_module-relocator.Po
make[3]: Leaving directory 
'/tmp/guix-build-grub-minimal-2.04.drv-0/grub-2.04/grub-core'
make[2]: *** [Makefile:26403: all] Error 2
make[2]: Leaving directory 
'/tmp/guix-build-grub-minimal-2.04.drv-0/grub-2.04/grub-core'
make[1]: *** [Makefile:11304: all-recursive] Error 1
make[1]: Leaving directory '/tmp/guix-build-grub-minimal-2.04.drv-0/grub-2.04'
make: *** [Makefile:3343: all] Error 2
command "make" "-j" "8" failed with status 2
--8<---cut here---end--->8---

It is non-Hurd specific, it can be reproduced by running

--8<---cut here---start->8---
./pre-inst-env guix build --system=i686-linux --target=i686-linux-gnu 
grub-minimal
--8<---cut here---end--->8---

I am not sure if and how to report this upstream.  Ideas for a bug
description?  Apparently, non-cross builds "just" work (how?!).

Greetings,
Janneke

Jan (janneke) Nieuwenhuizen (1):
  gnu: grub: Cross-build fix for system-i686.

 gnu/local.mk  |  1 +
 gnu/packages/bootloaders.scm  |  3 +-
 .../patches/grub-cross-system-i686.patch  | 73 +++
 3 files changed, 76 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/grub-cross-system-i686.patch

-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com





bug#41908: guix time-machine fails; XXXX is not related to introductory commit of channel 'guix'

2020-06-17 Thread Jan Nieuwenhuizen
Hi,

After pulling this morning, guix time-machine fails, look:

--8<---cut here---start->8---
$ guix pull --commit=559491ea5b36b89b2a2f9d48dacf6a2d7e219910
Updating channel 'guix' from Git repository at 
'https://git.savannah.gnu.org/git/guix.git'...
Building from this channel:
  guix  https://git.savannah.gnu.org/git/guix.git   559491e
[...]
hint: Run `guix pull --news' to read all the news.

11:23:19 janneke@dundal:~/src/guix/master
$ guix time-machine --commit=36640207c9543e48cd6daa92930f023f80065a5d -- 
environment hello
Updating channel 'guix' from Git repository at 
'https://git.savannah.gnu.org/git/guix.git'...
guix time-machine: error: '36640207c9543e48cd6daa92930f023f80065a5d' is not 
related to introductory commit of channel 'guix'

[1]11:23:25 janneke@dundal:~/src/guix/master
git log --pretty=oneline | grep 36640207c9543e48cd6daa92930f023f80065a5d
36640207c9543e48cd6daa92930f023f80065a5d quirks: Build 
'compute-guix-derivation' modules with 2.2 when needed.
--8<---cut here---end--->8---

Am I missing something?

Greetings,
Janneke

-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com





bug#41855: [PATCH 1/2] hurd-boot: Create individual translators instead of running MAKEDEV.

2020-06-14 Thread Jan (janneke) Nieuwenhuizen
uot;/hurd/random"   "--seed-file" "/var/lib/random-seed")
+#o644)
+  ("dev/zero"("/hurd/storeio"  "--store-type=zero") #o666)
+
+  ("dev/console" ("/hurd/term" "/dev/console" "device" "console"))
+
+  ("dev/klog"("/hurd/streamio" "kmsg"))
+  ("dev/mem" ("/hurd/storeio"  "--no-cache" "mem")  #o660)
+  ("dev/shm" ("/hurd/tmpfs""--mode=1777" "50%") #o644)
+  ("dev/time"("/hurd/storeio"  "--no-cache" "time") #o644)
+
+  ("dev/vcs" ("/hurd/console"))
+  ("dev/tty" ("/hurd/magic""tty")   #o666)
+
+  ("dev/tty1"("/hurd/term" "/dev/tty1" "hurdio" 
"/dev/vcs/1/console")
+#o666)
+  ("dev/tty2"("/hurd/term" "/dev/tty2" "hurdio" 
"/dev/vcs/2/console")
+#o666)
+  ("dev/tty3"("/hurd/term" "/dev/tty3" "hurdio" 
"/dev/vcs/3/console")
+#o666)
+
+  ("dev/ptyp0"   ("/hurd/term" "/dev/ptyp0" "pty-master" "/dev/ttyp0")
+#o666)
+  ("dev/ptyp1"   ("/hurd/term" "/dev/ptyp1" "pty-master" "/dev/ttyp1")
+#o666)
+  ("dev/ptyp2"   ("/hurd/term" "/dev/ptyp2" "pty-master" "/dev/ttyp2")
+#o666)
+
+  ("dev/ttyp0"   ("/hurd/term" "/dev/ttyp0" "pty-slave" "/dev/ptyp0")
+#o666)
+  ("dev/ttyp1"   ("/hurd/term" "/dev/ttyp1" "pty-slave" "/dev/ptyp1")
+#o666)
+  ("dev/ttyp2"   ("/hurd/term" "/dev/ttyp2" "pty-slave" "/dev/ptyp2")
+#o666)))
+
+  (for-each scope-setup-translator servers)
+  (false-if-exception (mkdir-p (scope "dev/vcs/1")))
+  (false-if-exception (mkdir-p (scope "dev/vcs/2")))
+  (false-if-exception (mkdir-p (scope "dev/vcs/3")))
+  (false-if-exception (rename-file "/dev/console" "/dev/console-"))
+  (for-each scope-setup-translator devices)
+
+  (false-if-exception (symlink "/dev/random" "/dev/urandom"))
+  (false-if-exception (mkdir-p "/dev/fd"))
+  (false-if-exception (symlink "/dev/fd/0"   "/dev/stdin"))
+  (false-if-exception (symlink "/dev/fd/1"   "/dev/stdout"))
+  (false-if-exception (symlink "/dev/fd/2"   "/dev/stderr")))
+
 
 (define* (boot-hurd-system #:key (on-error 'debug))
   "This procedure is meant to be called from an early RC script.
@@ -126,20 +237,9 @@ starting the Shepherd.
 XXX TODO: see linux-boot.scm:boot-system.
 XXX TODO: add proper file-system checking, mounting
 XXX TODO: move bits to (new?) (hurd?) (activation?) services
-XXX TODO: use settrans/setxattr instead of MAKEDEV
+XXX TODO: use Linux xattr/setxattr to remove (settrans in) /libexec/RUNSYSTEM
 
 "
-  (define translators
-'(("/servers/crash-dump-core" ("/hurd/crash" "--dump-core"))
-  ("/servers/crash-kill" ("/hurd/crash" "--kill"))
-  ("/servers/crash-suspend" ("/hurd/crash" "--suspend"))
-  ("/servers/password" ("/hurd/password"))
-  ("/servers/socket/1" ("/hurd/pflocal"))
-  ("/servers/socket/2" ("/hurd/pfinet" "--interface" "eth0"
-"--address" "10.0.2.15" ;the default QEMU guest IP
-"--netmask" "255.255.255.0"
-"--gateway" "10.0.2.2"
-"--ipv6" "/servers/socket/16"
 
   (display "Welcome, this is GNU's early boot Guile.\n")
   (display "Use '--repl' for an initrd REPL.\n\n")
@@ -147,35 +247,13 @@ XX

bug#41855: [PATCH 2/2] hurd-boot: Use 'setxattr' instead of invoking settrans.

2020-06-14 Thread Jan (janneke) Nieuwenhuizen
Note: Using `getxattr' on the Hurd instead of running showtrans does not
work (yet?).

* gnu/build/hurd-boot.scm (setup-translator): Use 'setxattr' instead of
invoking settrans.
* gnu/system.scm (hurd-multiboot-modules): Add --x-xattr-translator-records to
enable xattr-embebbing of translators.
---
 gnu/build/hurd-boot.scm | 2 +-
 gnu/system.scm  | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/gnu/build/hurd-boot.scm b/gnu/build/hurd-boot.scm
index 398cee1395..8150aff972 100644
--- a/gnu/build/hurd-boot.scm
+++ b/gnu/build/hurd-boot.scm
@@ -140,7 +140,7 @@ set."
 (chmod port mode)
 (catch 'system-error
   (lambda _
-(apply invoke "settrans" "--create" file-name command))
+(setxattr file-name "gnu.translator" (string-join command "\0" 
'suffix)))
   (lambda (key . args)
 (let ((errno (system-error-errno (cons key args
   (format (current-error-port) "~a: ~a\n"
diff --git a/gnu/system.scm b/gnu/system.scm
index d51691fe76..25cc63a9df 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -1191,6 +1191,7 @@ a list of , to populate the \"old entries\" 
menu."
 "--device-master-port='${device-port}'"
 "--exec-server-task='${exec-task}'"
 "--store-type=typed"
+"--x-xattr-translator-records"
 "'${root}'" "'$(task-create)'" "'$(task-resume)'"))
  (target (%current-target-system))
  (libc (if target
-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com






bug#41855: [PATCH 0/2] hurd-boot: Cleanups: Remove MAKEDEV, then use setxattr (on the Hurd).

2020-06-14 Thread Jan (janneke) Nieuwenhuizen
From: Jan Nieuwenhuizen 

Hi!

Several variants of these patches were present on wip-hurd-vm before.

Currently, we are running MAKEDEV from activation, and thus need hurd, bash,
coreutils and sed in PATH.

The first patch replaces that with scheme code, which seems a no-brainer to
me.  Then we only need hurd in PATH for settrans and gettrans.

The second patch then switches to using setxattr instead of settrans; alas we
still need gettrans as getxattr behaves "funny" on translated nodes.  I
suppose that would be a question for the bug-hurd?

Greetings,
Janneke

Jan (janneke) Nieuwenhuizen (2):
  hurd-boot: Create individual translators instead of running MAKEDEV.
  hurd-boot: Use 'setxattr' instead of invoking settrans.

 gnu/build/hurd-boot.scm | 172 +---
 gnu/system.scm  |   1 +
 2 files changed, 126 insertions(+), 47 deletions(-)

-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com






bug#41835: guile-sqlite3 update to 0.1.1 breaks hurd disk-image

2020-06-13 Thread Jan Nieuwenhuizen
Hi!

On current master, this

--8<---cut here---start->8---
./pre-inst-env guix system disk-image --no-grafts --target=i586-pc-gnu 
gnu/system/examples/bare-hurd.tmpl
--8<---cut here---end--->8---

fails with

--8<---cut here---start->8---
...
@ build-started 
/gnu/store/xljx2nn0lrn32xhaw3yi0dqirjniyijf-partition-image-root.drv - 
x86_64-linux 
/var/log/guix/drvs/xl//jx2nn0lrn32xhaw3yi0dqirjniyijf-partition-image-root.drv.bz2
 31335
[Kcopying 171 store items
[...]
[Kregistering 171 items
Backtrace:
   5 (primitive-load "/gnu/store/w8gql3n1rivg5cs6c5pcn15nvvx…")
In ./gnu/build/image.scm:
181:4  4 (initialize-root-partition "/gnu/store/y2sijm2kp75rrbh…" …)
In ice-9/boot-9.scm:
   260:13  3 (for-each # …)
In ./guix/store/database.scm:
443:4  2 (register-items _ #:prefix _ #:state-directory _ # _ # _ …)
95:20  1 (call-with-database _ _)
In ice-9/boot-9.scm:
  1731:15  0 (with-exception-handler # …)

ice-9/boot-9.scm:1731:15: In procedure with-exception-handler:
statement already finalized #< pointer: # live?: 
#f reset?: #t cached?: #f>
--8<---cut here---end--->8---

After reverting this commit

--8<---cut here---start->8---
29e4d3ea064f039d60b5f41a1077bc9d4bab322a gnu: guile-sqlite3: Update to 0.1.1.
--8<---cut here---end------->8---

the error goes away.

Greetings,
Janneke

-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com





bug#41541: [PATCH 3/8] system: Add 'multiboot-modules' field to .

2020-06-06 Thread Jan Nieuwenhuizen
Mathieu Othacehe writes:

Hello!

>> + (mach (if (%current-target-system)
>> +   ;; A cross-built GNUmach does not work
>> +   (with-parameters ((%current-system "i686-linux")
>> + (%current-target-system #f))
>> + mach)
>
> Maybe it would make more sense to check if we are on a Hurd system,
> rather than just checking for %current-target-system to be set, don't
> know.

Ah yes.  When this IF runs we already checked that we are building a
hurd system; this adds two lines leading up to the above snippet

  (if (operating-system-hurd os)
  (let* ((mach (operating-system-kernel os))
 (mach (if (%current-target-system)

...but that means that this last IF is maybe unnecessarily implicit and
only really makes sense by adding/remembering that context.  Changed it
to

 (mach (if (and=> (%current-target-system) hurd-triplet?)

I guess that's friendlier?

>> + (libc (if target
>> +   (with-parameters ((%current-target-system #f))
>> + (cross-libc target))
>> +   glibc))
>
> In the future, it would be nice to make this think transparent. Anyway,
> for now this is the best we can do I think.

Yes, I've added a comment

 ;; TODO: cross-libc has extra patches for the Hurd;
 ;; remove in next rebuild cycle
 (cross-libc target))

I have now 8 squash! commits; I'll be resetting wip-hurd-vm just once
more before merging, after checking in with Ludovic and re-running some
tests.

Really looking forward to seeing a Guix Hurd VM hookup-up in bayfront
and really start building a Hurd system, mabye we'll see some more
people join in.  I think that should be (almost?) possible after
merging, right?

Greetings, Janneke

-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com





bug#41541: [PATCH 8/8] system: Add `hurd-activation'.

2020-06-06 Thread Jan Nieuwenhuizen
Mathieu Othacehe writes:

Hello Mathieu,

>>  (define (activation-script gexps)
>>"Return the system's activation script, which evaluates GEXPS."
>> +  (program-file "activate.scm" (if (hurd-target?)
>> +   (hurd-activation-script gexps)
>> +   (gnu/linux-activation-script gexps
>
> "hurd-target?" is using %current-target-system. It would be safer to use
> let-system here I guess.

Okay, changed to

  (let-system (system target)
(program-file "activate.scm" (if (hurd-triplet? (or target system))
 (hurd-activation-script gexps)
 (gnu/linux-activation-script gexps)

> I think Ludo will have some more comments, but let me say again that you
> are doing a great job here, many thanks!

Thank you! -- luckily I get some help ;)
Janneke

-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com





bug#41541: [PATCH 4/8] bootloader: grub: Add support for multiboot.

2020-06-06 Thread Jan Nieuwenhuizen
Mathieu Othacehe writes:

>> +  (($  label device mount-point #f () #f kernel arguments 
>> modules)
>> +   (let* ((target (%current-target-system)))
>
> This doesn't seem to be used anymore.

Oops, but yeah: great!  Sorry -- this went through so many iterations,
thanks for catching it.

> Plus using %current-target-system
> here could not give the expected result. I think that the only two
> "safe" ways are to use (current-target-system) from a monadic context,
> or to use "let-system".

> We should maybe write something about that in the documentation.

Maybe...I think also that I should become more aware about monadic
context and its implications.

>> + #~(format port "
>> +menuentry ~s {
>> +  multiboot ~a root=device:hd0s1~a~a
>> +}~%"
>
> If we add support for EFI one day, then it could be "hd0s2". In
> "install-grub-disk-image", I manage to get to root-index from the
> caller. I think it will be harder to do the same thing here. It's ok for
> me if we leave it this way.

Of course -- and this only works as long as we are only building virtual
machine images.  Changed to this

   (let ((root-index 1)) ; XXX EFI will need root-index 2

Thanks, Janneke

-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com





bug#41541: [PATCH 1/8] system: Add 'hurd' field to .

2020-06-06 Thread Jan Nieuwenhuizen
Mathieu Othacehe writes:

> Hey Jan,
>
>> +Using GNU@tie{}mach in combination with a @code{hurd} is experimental
>> +and only available when building a vm-image.}.
>
> Maybe replace "vm-image" by "virtual machine disk image"?

Okay.

>> +
>> +@cindex hurd
>> +@item @code{hurd} (default: @code{#f})
>> +The hurd to be started by the kernel.  This is required to build an
>> +experimental vm-image for the Hurd and requires using @code{kernel}
>
> Ditto.

Done.

Thanks, Janneke

-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com





bug#41541: merge wip-hurd-vm

2020-06-05 Thread Jan Nieuwenhuizen
Ludovic Courtès writes:

> Jan Nieuwenhuizen  skribis:
>
>> So, after digesting your message here I took the next step: grep for
>> _HURD_STARTUP and change it there, like so
>>
>> diff --git a/gnu/packages/hurd.scm b/gnu/packages/hurd.scm
>> index 421783eb80..8c73ea8430 100644
>> --- a/gnu/packages/hurd.scm
>> +++ b/gnu/packages/hurd.scm
>> @@ -428,9 +428,10 @@ exec ${system}/rc \"$@\"
>>"startup/startup.c")
>>   (("/hurd/")
>>(string-append out "/hurd/")))
>> -   (substitute* "hurd/paths.h"
>> - (("_HURD_STARTUP\t")
>> -  (string-append "_HURD_STARTUP\t\"" out "\" ")))
>> +   (substitute* '("libdiskfs/boot-start.c"
>> +  "libdiskfs/opts-std-startup.c")
>> + (("_HURD_STARTUP")
>> +  (string-append "\"" out "/hurd/startup\"")))
>
> Perfect!  Perhaps we can add a comment explaining that this is needed
> for the first boot, when the /hurd symlink doesn’t exist yet.

That's a good idea.  I've added a squash commit with

   ;; Upon first boot the /hurd symlink does not exist; it is
   ;; created during activation: Hard-code the .../hurd store file
   ;; name.

>> This also works, and so I figure we're fine now.  I'm resetting
>> wip-hurd-vm and, like Mathieu suggested will prepare to send send a
>> patch series here for the unreviewed subset of patches.
>
> Thank you!

In other news, I've been playing with at "devel-hurd.tmpl" system and
just succeeded to build gnu-make-boot0!  I still need sort of a hack to
include %bootstrap-gcc etc, but this gives me good hopes that we'll be
able create a functional VM to build substitutes after merging!

Greetings,
Janneke

-- 
Jan Nieuwenhuizen  | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com





bug#41541: [PATCH 1/8] system: Add 'hurd' field to .

2020-06-04 Thread Jan (janneke) Nieuwenhuizen
* gnu/system.scm ()[hurd]: New field.
* doc/guix.texi (operating-system Reference): Document 'hurd'.
---
 doc/guix.texi  | 13 ++---
 gnu/system.scm |  3 +++
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/doc/guix.texi b/doc/guix.texi
index 056bf011f6..4776eacacd 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -11484,9 +11484,16 @@ configuration (@pxref{Using the Configuration System}).
 
 @table @asis
 @item @code{kernel} (default: @code{linux-libre})
-The package object of the operating system kernel to use@footnote{Currently
-only the Linux-libre kernel is supported.  In the future, it will be
-possible to use the GNU@tie{}Hurd.}.
+The package object of the operating system kernel to
+use@footnote{Currently only the Linux-libre kernel is fully supported.
+Using GNU@tie{}mach in combination with a @code{hurd} is experimental
+and only available when building a vm-image.}.
+
+@cindex hurd
+@item @code{hurd} (default: @code{#f})
+The hurd to be started by the kernel.  This is required to build an
+experimental vm-image for the Hurd and requires using @code{kernel}
+GNU@tie{}mach as well as other specific operating system overrides.
 
 @item @code{kernel-loadable-modules} (default: '())
 A list of objects (usually packages) to collect loadable kernel modules
diff --git a/gnu/system.scm b/gnu/system.scm
index 213452a6f9..43dd2ec598 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -83,6 +83,7 @@
 operating-system-packages
 operating-system-host-name
 operating-system-hosts-file
+operating-system-hurd
 operating-system-kernel
 operating-system-kernel-file
 operating-system-kernel-arguments
@@ -187,6 +188,8 @@
 (default '())); list of packages
   (kernel-arguments operating-system-user-kernel-arguments
 (default %default-kernel-arguments)) ; list of 
gexps/strings
+  (hurd operating-system-hurd
+(default #f)) ; package
   (bootloader operating-system-bootloader); 
   (label operating-system-label   ; string
  (thunked)
-- 
2.26.2






bug#41541: [PATCH 3/8] system: Add 'multiboot-modules' field to .

2020-06-04 Thread Jan (janneke) Nieuwenhuizen
* gnu/system.scm ()[multiboot-modules]: New field.
(read-boot-parameters): Initialize it.
(operating-system-multiboot-modules, hurd-multiboot-modules): New procedure.
(operating-system-boot-parameters): Cater for multiboot the Hurd and
initialize it; avoid initrd in that case.
(operating-system-kernel-file): Cater for for Gnumach (the Hurd) besides Linux.
(boot-parameters->menu-entry): Use it to support a multiboot .
---
 gnu/system.scm | 92 +++---
 1 file changed, 73 insertions(+), 19 deletions(-)

diff --git a/gnu/system.scm b/gnu/system.scm
index 43dd2ec598..a96a6e6f2c 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -39,9 +39,11 @@
   #:use-module (guix utils)
   #:use-module (gnu packages base)
   #:use-module (gnu packages bash)
+  #:use-module (gnu packages cross-base)
   #:use-module (gnu packages guile)
   #:use-module (gnu packages guile-xyz)
   #:use-module (gnu packages admin)
+  #:use-module (gnu packages hurd)
   #:use-module (gnu packages linux)
   #:use-module (gnu packages pciutils)
   #:use-module (gnu packages package-management)
@@ -142,6 +144,7 @@
 boot-parameters-kernel
 boot-parameters-kernel-arguments
 boot-parameters-initrd
+boot-parameters-multiboot-modules
 read-boot-parameters
 read-boot-parameters-file
 boot-parameters->menu-entry
@@ -283,7 +286,8 @@ directly by the user."
   (store-mount-point boot-parameters-store-mount-point)
   (kernel   boot-parameters-kernel)
   (kernel-arguments boot-parameters-kernel-arguments)
-  (initrd   boot-parameters-initrd))
+  (initrd   boot-parameters-initrd)
+  (multiboot-modules boot-parameters-multiboot-modules))
 
 (define (ensure-not-/dev device)
   "If DEVICE starts with a slash, return #f.  This is meant to filter out
@@ -314,7 +318,7 @@ file system labels."
   (match (read port)
 (('boot-parameters ('version 0)
('label label) ('root-device root)
-   ('kernel linux)
+   ('kernel kernel)
rest ...)
  (boot-parameters
   (label label)
@@ -330,12 +334,12 @@ file system labels."
  ((_ entries) (map sexp->menu-entry entries))
  (#f  '(
 
-  ;; In the past, we would store the directory name of the kernel instead
-  ;; of the absolute file name of its image.  Detect that and correct it.
-  (kernel (if (string=? linux (direct-store-path linux))
-  (string-append linux "/"
+  ;; In the past, we would store the directory name of linux instead of
+  ;; the absolute file name of its image.  Detect that and correct it.
+  (kernel (if (string=? kernel (direct-store-path kernel))
+  (string-append kernel "/"
  (system-linux-image-file-name))
-  linux))
+  kernel))
 
   (kernel-arguments
(match (assq 'kernel-arguments rest)
@@ -349,6 +353,8 @@ file system labels."
  (('initrd (? string? file))
   file)))
 
+  (multiboot-modules (or (assq 'multiboot-modules rest) '()))
+
   (store-device
;; Linux device names like "/dev/sda1" are not suitable GRUB device
;; identifiers, so we just filter them out.
@@ -386,14 +392,25 @@ The object has its kernel-arguments extended in order to 
make it bootable."
(boot-parameters-kernel-arguments params))
 
 (define (boot-parameters->menu-entry conf)
-  (menu-entry
-   (label (boot-parameters-label conf))
-   (device (boot-parameters-store-device conf))
-   (device-mount-point (boot-parameters-store-mount-point conf))
-   (linux (boot-parameters-kernel conf))
-   (linux-arguments (boot-parameters-kernel-arguments conf))
-   (initrd (boot-parameters-initrd conf
-
+  (let* ((kernel (boot-parameters-kernel conf))
+ (multiboot-modules (boot-parameters-multiboot-modules conf))
+ (multiboot? (pair? multiboot-modules)))
+(menu-entry
+ (label (boot-parameters-label conf))
+ (device (boot-parameters-store-device conf))
+ (device-mount-point (boot-parameters-store-mount-point conf))
+ (linux (and (not multiboot?) kernel))
+ (linux-arguments (if (not multiboot?) '
+  (boot-parameters-kernel-arguments conf)
+  '()))
+ (initrd (boot-parameters-initrd conf))
+ (multiboot-kernel (and multiboot? kernel))
+ (multiboot-arguments (if multiboot?
+  (boot-parameters-kernel-arguments conf)
+  '()))
+ (multiboot-modules (if multiboot?
+(boot-parameters-multiboot-modules conf)
+'())
 
 
 ;;;
@@ -485,8 +502,17 @@ from the initrd."
 (define (operating-system-kernel-file os)
   "Return an object representing the absolute file name of the kernel 

bug#41541: [PATCH 7/8] services: hurd: Add `hurd-etc-service'.

2020-06-04 Thread Jan (janneke) Nieuwenhuizen
* gnu/services/hurd.scm: New file.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
* doc/guix.texi (Hurd Services): Document it.
---
 doc/guix.texi | 13 +
 gnu/local.mk  |  1 +
 gnu/services/hurd.scm | 61 +++
 3 files changed, 75 insertions(+)
 create mode 100644 gnu/services/hurd.scm

diff --git a/doc/guix.texi b/doc/guix.texi
index 4776eacacd..97bf067074 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -319,7 +319,9 @@ Services
 * Version Control Services::Providing remote access to Git repositories.
 * Game Services::   Game servers.
 * PAM Mount Service::   Service to mount volumes when logging in.
+* Guix Services::   Services relating specifically to Guix.
 * Linux Services::  Services tied to the Linux kernel.
+* Hurd Services::   Services specific to a Hurd System.
 * Miscellaneous Services::  Other services.
 
 Defining Services
@@ -12594,6 +12596,7 @@ declaration.
 * PAM Mount Service::   Service to mount volumes when logging in.
 * Guix Services::   Services relating specifically to Guix.
 * Linux Services::  Services tied to the Linux kernel.
+* Hurd Services::   Services specific for a Hurd System.
 * Miscellaneous Services::  Other services.
 @end menu
 
@@ -26032,6 +26035,16 @@ parameters, can be done as follow:
 @end lisp
 @end deffn
 
+@node Hurd Services
+@subsection Hurd Services
+
+@deffn {Scheme Procedure} hurd-etc-service @var{os}
+This service implements a minimal @code{etc-service}, adding some
+specifics for the Hurd.
+
+It is part of the @code{hurd-default-essential-services}.
+@end deffn
+
 @node Miscellaneous Services
 @subsection Miscellaneous Services
 
diff --git a/gnu/local.mk b/gnu/local.mk
index 8abca8659e..d1d086abe0 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -582,6 +582,7 @@ GNU_SYSTEM_MODULES =\
   %D%/services/games.scm   \
   %D%/services/getmail.scm \
   %D%/services/guix.scm\
+  %D%/services/hurd.scm\
   %D%/services/kerberos.scm\
   %D%/services/linux.scm   \
   %D%/services/lirc.scm\
diff --git a/gnu/services/hurd.scm b/gnu/services/hurd.scm
new file mode 100644
index 00..6e57b22810
--- /dev/null
+++ b/gnu/services/hurd.scm
@@ -0,0 +1,61 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen 
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu services hurd)
+  #:use-module (gnu packages admin)
+  #:use-module (gnu services)
+  #:use-module (gnu system)
+  #:use-module (guix gexp)
+  #:use-module (guix records)
+  #:export (hurd-etc-service))
+
+;;; Commentary:
+;;;
+;;; This module implements services for the Hurd.
+;;;
+;;; Code:
+
+
+;;;
+;;; The ETC service for the Hurd.
+;;;
+
+(define (hurd-etc-service os)
+  "Return a  that builds containing the static part of the /etc
+directory."
+  (let ((profile (mixed-text-file "profile"  "\
+# Generated by hurd-etc-services
+export PS1='\\u@\\h\\$ '
+
+GUIX_PROFILE=\"/run/current-system/profile\"
+. \"$GUIX_PROFILE/etc/profile\"
+
+GUIX_PROFILE=\"$HOME/.guix-profile\"
+if [ -f \"$GUIX_PROFILE/etc/profile\" ]; then
+  . \"$GUIX_PROFILE/etc/profile\"
+fi\n"))
+(hurd (operating-system-hurd os)))
+(etc-service
+ `(("services" ,(file-append net-base "/etc/services"))
+   ("protocols" ,(file-append net-base "/etc/protocols"))
+   ("profile" ,profile)
+   ("hostname" ,(plain-file "hostname" (operating-system-host-name os)))
+   ("login" ,(file-append hurd "/etc/login"))
+   ("motd" ,(file-append hurd "/etc/motd"))
+
+;;; hurd.scm ends here
-- 
2.26.2






bug#41541: [PATCH 5/8] system: Use 'hurd' package in label.

2020-06-04 Thread Jan (janneke) Nieuwenhuizen
* gnu/system.scm (kernel->boot-label): Add keyword parameter 'hurd'.  If set,
use it for label.
(operating-system-default-label): Call with it with operating-system-hurd.
---
 gnu/system.scm | 11 ---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/gnu/system.scm b/gnu/system.scm
index a96a6e6f2c..b814181c69 100644
--- a/gnu/system.scm
+++ b/gnu/system.scm
@@ -1098,9 +1098,13 @@ listed in OS.  The C library expects to find it under
   (locale-directory definitions
 #:libcs (operating-system-locale-libcs os)))
 
-(define (kernel->boot-label kernel)
+(define* (kernel->boot-label kernel #:key hurd)
   "Return a label for the bootloader menu entry that boots KERNEL."
-  (cond ((package? kernel)
+  (cond ((package? hurd)
+ (string-append "GNU with the "
+(string-titlecase (package-name hurd)) " "
+(package-version hurd)))
+((package? kernel)
  (string-append "GNU with "
 (string-titlecase (package-name kernel)) " "
 (package-version kernel)))
@@ -1113,7 +1117,8 @@ listed in OS.  The C library expects to find it under
 (define (operating-system-default-label os)
   "Return the default label for OS, as it will appear in the bootloader menu
 entry."
-  (kernel->boot-label (operating-system-kernel os)))
+  (kernel->boot-label (operating-system-kernel os)
+  #:hurd (operating-system-hurd os)))
 
 (define (store-file-system file-systems)
   "Return the file system object among FILE-SYSTEMS that contains the store."
-- 
2.26.2






bug#41541: [PATCH 2/8] bootloader: Extend `' for multiboot.

2020-06-04 Thread Jan (janneke) Nieuwenhuizen
* gnu/bootloader.scm ()[multiboot-kernel,multiboot-arguments,
multiboot-modules]: New fields.
[linux,initrd]: Add default value '#f'.
(menu-entry->sexp, sexp->menu-entry): Support multiboot entry.
---
 gnu/bootloader.scm | 46 +-
 1 file changed, 41 insertions(+), 5 deletions(-)

diff --git a/gnu/bootloader.scm b/gnu/bootloader.scm
index 668caa7fc3..2eebb8e9d9 100644
--- a/gnu/bootloader.scm
+++ b/gnu/bootloader.scm
@@ -3,6 +3,7 @@
 ;;; Copyright © 2017, 2020 Mathieu Othacehe 
 ;;; Copyright © 2017 Leo Famulari 
 ;;; Copyright © 2019 Ludovic Courtès 
+;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen 
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -33,6 +34,9 @@
 menu-entry-linux-arguments
 menu-entry-initrd
 menu-entry-device-mount-point
+menu-entry-multiboot-kernel
+menu-entry-multiboot-arguments
+menu-entry-multiboot-modules
 
 menu-entry->sexp
 sexp->menu-entry
@@ -77,22 +81,41 @@
(default #f))
   (device-mount-point menu-entry-device-mount-point
(default #f))
-  (linux   menu-entry-linux)
+  (linux   menu-entry-linux
+   (default #f))
   (linux-arguments menu-entry-linux-arguments
(default '()))  ; list of string-valued gexps
-  (initrd  menu-entry-initrd)) ; file name of the initrd as a gexp
+  (initrd  menu-entry-initrd   ; file name of the initrd as a gexp
+   (default #f))
+  (multiboot-kernel menu-entry-multiboot-kernel
+(default #f))
+  (multiboot-arguments menu-entry-multiboot-arguments
+   (default '()))  ; list of string-valued gexps
+  (multiboot-modules menu-entry-multiboot-modules
+ (default '(   ; list of multiboot commands, where
+   ; a command is a list of 
 
 (define (menu-entry->sexp entry)
   "Return ENTRY serialized as an sexp."
   (match entry
-(($  label device mount-point linux linux-arguments initrd)
+(($  label device mount-point linux linux-arguments initrd #f
+ ())
  `(menu-entry (version 0)
   (label ,label)
   (device ,device)
   (device-mount-point ,mount-point)
   (linux ,linux)
   (linux-arguments ,linux-arguments)
-  (initrd ,initrd)
+  (initrd ,initrd)))
+(($  label device mount-point #f () #f
+ multiboot-kernel multiboot-arguments multiboot-modules)
+ `(menu-entry (version 0)
+  (label ,label)
+  (device ,device)
+  (device-mount-point ,mount-point)
+  (multiboot-kernel ,multiboot-kernel)
+  (multiboot-arguments ,multiboot-arguments)
+  (multiboot-modules ,multiboot-modules)
 
 (define (sexp->menu-entry sexp)
   "Turn SEXP, an sexp as returned by 'menu-entry->sexp', into a 
@@ -109,7 +132,20 @@ record."
   (device-mount-point mount-point)
   (linux linux)
   (linux-arguments linux-arguments)
-  (initrd initrd)
+  (initrd initrd)))
+(('menu-entry ('version 0)
+  ('label label) ('device device)
+  ('device-mount-point mount-point)
+  ('multiboot-kernel multiboot-kernel)
+  ('multiboot-arguments multiboot-arguments)
+  ('multiboot-modules multiboot-modules) _ ...)
+ (menu-entry
+  (label label)
+  (device device)
+  (device-mount-point mount-point)
+  (multiboot-kernel multiboot-kernel)
+  (multiboot-arguments multiboot-arguments)
+  (multiboot-modules multiboot-modules)
 
 
 ;;;
-- 
2.26.2






bug#41541: [PATCH 6/8] system: examples: Add bare-hurd.tmpl.

2020-06-04 Thread Jan (janneke) Nieuwenhuizen
With this, we can now build a VM like so

./pre-inst-env guix system vm-image --target=i586-pc-gnu --no-grafts \
gnu/system/examples/bare-hurd.tmpl

it boots, but needs some more setup/services to be really useful.

See also: <https://bugs.gnu.org/40839>; wip-disk-image.

* gnu/system/hurd.scm (%hurd-default-operating-system): New exported variable.
* gnu/system/examples/bare-hurd.tmpl: New file.
* Makefile.am (EXAMPLES): Add it.
---
 Makefile.am|  3 +-
 gnu/services.scm   |  5 ++-
 gnu/system/examples/bare-hurd.tmpl | 24 ++
 gnu/system/hurd.scm| 50 --
 4 files changed, 78 insertions(+), 4 deletions(-)
 create mode 100644 gnu/system/examples/bare-hurd.tmpl

diff --git a/Makefile.am b/Makefile.am
index 5b64386b53..d8c519b4af 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -7,7 +7,7 @@
 # Copyright © 2017 Mathieu Othacehe 
 # Copyright © 2017 Leo Famulari 
 # Copyright © 2017 Ricardo Wurmus 
-# Copyright © 2017 Jan Nieuwenhuizen 
+# Copyright © 2017, 2020 Jan (janneke) Nieuwenhuizen 
 # Copyright © 2017 Arun Isaac 
 # Copyright © 2018 Nikita 
 # Copyright © 2018 Julien Lepiller 
@@ -346,6 +346,7 @@ AUX_FILES = \
 EXAMPLES = \
   gnu/system/examples/asus-c201.tmpl   \
   gnu/system/examples/bare-bones.tmpl  \
+  gnu/system/examples/bare-hurd.tmpl   \
   gnu/system/examples/beaglebone-black.tmpl\
   gnu/system/examples/desktop.tmpl \
   gnu/system/examples/lightweight-desktop.tmpl \
diff --git a/gnu/services.scm b/gnu/services.scm
index 2e4648bf78..614956fbab 100644
--- a/gnu/services.scm
+++ b/gnu/services.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020 Ludovic Courtès 

 ;;; Copyright © 2016 Chris Marusich 
+;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen 
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -29,10 +30,12 @@
   #:use-module (guix describe)
   #:use-module (guix sets)
   #:use-module (guix ui)
-  #:use-module ((guix utils) #:select (source-properties->location))
+  #:use-module ((guix utils) #:select (source-properties->location
+   %current-target-system))
   #:use-module (guix modules)
   #:use-module (gnu packages base)
   #:use-module (gnu packages bash)
+  #:use-module (gnu packages hurd)
   #:use-module (srfi srfi-1)
   #:use-module (srfi srfi-9)
   #:use-module (srfi srfi-9 gnu)
diff --git a/gnu/system/examples/bare-hurd.tmpl 
b/gnu/system/examples/bare-hurd.tmpl
new file mode 100644
index 00..d100bd6dd8
--- /dev/null
+++ b/gnu/system/examples/bare-hurd.tmpl
@@ -0,0 +1,24 @@
+;; -*-scheme-*-
+
+;; This is an operating system configuration template
+;; for a "bare bones" setup, with no X11 display server.
+
+(use-modules (gnu) (gnu system hurd) (guix utils))
+
+(define %hurd-os
+  (operating-system
+(inherit %hurd-default-operating-system)
+(bootloader (bootloader-configuration
+ (bootloader grub-minimal-bootloader)
+ (target "/dev/sdX")))
+(file-systems (cons (file-system
+  (device (file-system-label "my-root"))
+  (mount-point "/")
+  (type "ext2"))
+%base-file-systems))
+(host-name "guixygnu")
+(timezone "GNUrope")
+(packages %base-packages/hurd)
+(services %base-services/hurd)))
+
+%hurd-os
diff --git a/gnu/system/hurd.scm b/gnu/system/hurd.scm
index 3ccf47aa21..472eca82b9 100644
--- a/gnu/system/hurd.scm
+++ b/gnu/system/hurd.scm
@@ -21,6 +21,7 @@
   #:use-module (guix gexp)
   #:use-module (guix profiles)
   #:use-module (guix utils)
+  #:use-module (gnu bootloader)
   #:use-module (gnu bootloader grub)
   #:use-module (gnu packages admin)
   #:use-module (gnu packages base)
@@ -31,8 +32,17 @@
   #:use-module (gnu packages guile-xyz)
   #:use-module (gnu packages hurd)
   #:use-module (gnu packages less)
+  #:use-module (gnu services)
+  #:use-module (gnu services base)
+  #:use-module (gnu services hurd)
+  #:use-module (gnu services shepherd)
+  #:use-module (gnu system)
+  #:use-module (gnu system shadow)
   #:use-module (gnu system vm)
-  #:export (cross-hurd-image))
+  #:export (cross-hurd-image
+%base-packages/hurd
+%base-services/hurd
+%hurd-default-operating-system))
 
 ;;; Commentary:
 ;;;
@@ -44,7 +54,43 @@
 (define %base-packages/hurd
   (list hurd bash coreutils file findutils grep sed
 guile-3.0 guile-colorized guile-readline
-net-base inetutils less which))
+net-base inetutils less shepherd which))
+
+(define %base-services/hurd
+  '())
+
+(define %hurd-default-operating-system
+  (operating-system
+(kernel gnumach)

  1   2   3   >