Resending because the first one didn't go through (?)

Hi all,

Here is a fun one:

Run: guix time-machine --channels=/tmp/last-good.scm --  system image -t
qcow2 -e '(use-modules (beaver system)) (minimal-ovh)'

And you'll get
/gnu/store/naijarz2br4m7sdhw5dzyrx1wl2ynf69-image.qcow2

So far, so good.

Now run  guix time-machine --channels=/tmp/first-bad.scm --  system image -t
qcow2 -e '(use-modules (beaver system)) (minimal-ovh)'

and you'll get "In procedure struct-vtable: Wrong type argument in
position 1 (expecting struct): #<syntax-transformer
dhcp-client-service-type>"

(full backtrace below).


The diff between the last working commit and the first breaking one is:

git diff 
0d213d29f324afbba19fd3b1f255099a45a3f22..a9f0a0635df10bfbf4af72be789968ae26e6b1d3
diff --git a/gnu/services/networking.scm b/gnu/services/networking.scm
index 4bda1029867..52e37d20ab9 100644
--- a/gnu/services/networking.scm
+++ b/gnu/services/networking.scm
@@ -455,14 +455,17 @@ (define dhcp-client-shepherd-service
       (dhcp-client-configuration
        (package package))))))

-(define dhcp-client-service-type
+(define-deprecated dhcp-client-service-type
+  dhcpcd-service-type
   (service-type (name 'dhcp-client)
                 (extensions
                  (list (service-extension shepherd-root-service-type
                                           dhcp-client-shepherd-service)))
                 (default-value (dhcp-client-configuration))
                 (description "Run @command{dhcp}, a Dynamic Host Configuration
-Protocol (DHCP) client, on all the non-loopback network interfaces.")))
+Protocol (DHCP) client, on all the non-loopback network interfaces.
+
+This services is deprecated as ISC's DHCP client reached its end-of-life.")))

 (define-record-type* <dhcpd-configuration>
   dhcpd-configuration make-dhcpd-configuration



What's even more fun is that if I pull the definition of minimal-ovh out
of my channel, copy it in a single file, call if minimal-ovh2, and run
time guix time-machine --channels=/tmp/first-bad.scm --  system image -t
qcow2 mwe.scm

Then it works !!!

I have no clue why the exact same code, once in a channel, and once out,
would trigger a bug when define-deprecated is added to the mix...


I won't try to fix it further, bisecting this took me the whole
afternoon at 10min to 20min per guix time-machine call. It's way outside
of my guix-fu. If somebody has a hunch, though, you've got everything
you need to start hacking ;) Good luck !





last-good.scm:
#+begin_src scheme
(list (channel
        (name 'beaverlabs)
        (url "https://gitlab.com/edouardklein/guix";)
        (branch "beaverlabs")
        (commit
          "55943119945d7a9ef8e2466b546617c2432a28c4"))
      (channel
        (name 'guix)
        (url "https://codeberg.org/guix/guix-mirror";)
        (branch "master")
        (commit
          "0d213d29f324afbba19fd3b1f255099a45a3f22b")
        (introduction
          (make-channel-introduction
            "9edb3f66fd807b096b48283debdcddccfea34bad"
            (openpgp-fingerprint
              "BBB0 2DDF 2CEA F6A8 0D1D  E643 A2A0 6DF2 A33A 54FA")))))
#+end_src

first-bad.scm
#+begin_src scheme
(list (channel
        (name 'beaverlabs)
        (url "https://gitlab.com/edouardklein/guix";)
        (branch "beaverlabs")
        (commit
          "55943119945d7a9ef8e2466b546617c2432a28c4"))
      (channel
        (name 'guix)
        (url "https://codeberg.org/guix/guix-mirror";)
        (branch "master")
        (commit
          "a9f0a0635df10bfbf4af72be789968ae26e6b1d3")
        (introduction
          (make-channel-introduction
            "9edb3f66fd807b096b48283debdcddccfea34bad"
            (openpgp-fingerprint
              "BBB0 2DDF 2CEA F6A8 0D1D  E643 A2A0 6DF2 A33A 54FA")))))

#+end_src

mwe.scm
#+begin_src scheme
(define-module (mwe2))
(use-modules
 (beaver system)
 (beaver packages plan9)
 (beaver functional-services)
 (guix gexp)
 (gnu system)
 (gnu system file-systems)
 (gnu packages package-management)
 (gnu services)
 (gnu services base)
 (gnu services guix)
 (gnu services linux)
 (gnu packages rust-apps)
 (gnu packages pretty-print)
 (gnu packages python-xyz)
 (gnu packages curl)
 (ice-9 match)
 (gnu system keyboard)
 (gnu bootloader)
 (gnu bootloader grub)
 (gnu services networking)
  (beaver utils)
  (guix gexp)
  (guix modules)
  (guix channels)
  (guix records)
  (guix ci)
  (gnu)
  (gnu system)
  (gnu services)
  (gnu services web)
  (gnu services base)
  (gnu services certbot)
  (gnu services shepherd)
  (gnu services ssh)
  (gnu services networking)
  (gnu services telephony)
  (gnu services sysctl)
  (gnu bootloader)
  (gnu bootloader grub)
  (gnu system file-systems)
  (gnu system shadow)
  (gnu system setuid)
  (gnu packages tls)
  (gnu packages bash)
  (gnu packages package-management)
  (gnu packages lsof)
  (gnu packages linux)
  (gnu packages admin)
  (gnu packages version-control)
  (srfi srfi-1)
  (srfi srfi-9)
  (srfi srfi-9 gnu)
  (srfi srfi-26)
  (srfi srfi-34)
  (ice-9 match)
  (gcrypt hash)
  (rnrs bytevectors)
  (beaver functional-services)
  (beaver packages plan9)
  (beaver packages unix)
 (gnu packages games)
 (gnu packages ruby))

(define minimal-ovh2
  ;; This function of one argument returns an operating system that does
  ;; nothing, but contains all the necessary boilerplate to be run on an OVH
  ;; VPS and have other services added to it.
  ;;
  ;;Its only argument SSH-PUBLIC-KEY can be a string (of the form,
  ;;e.g. ssh-rsa AAAAB3...fPShQ== toto) or a file-like object.
  ;;
  ;; Note that when called with no argument, no ssh server will be started by
  ;; the returned operating-system and you need to add one by chaining the
  ;; call to MINIMAL-OVH with e.g. OPENSSH-ROOT-KEY or SSH-USER, if you want
  ;; to be able to connect to your VPS.
  (match-lambda*
    (((? string? ssh-public-key))
     (->
      (minimal-ovh)  ;; Recursive call with no args
      (openssh-root-key (plain-file "root.pub" ssh-public-key))))
    ((ssh-public-key)  ;; Assume file-like object
     (->
      (minimal-ovh)  ;; Recursive call with no args
      (openssh-root-key ssh-public-key)))
    (() ;; No args, return the base OS with no ssh server
     (->
      (operating-system
        (locale "en_US.utf8")
        (timezone "UTC")
        (keyboard-layout (keyboard-layout "fr"))
        (host-name "minimal-ovh")
        (bootloader
         (bootloader-configuration
          (bootloader grub-bootloader)
          (targets '("/dev/sda"))
          (keyboard-layout keyboard-layout)))
        (initrd-modules
         (append '("virtio_scsi") %base-initrd-modules))
        (file-systems
         (cons (file-system
                 (mount-point "/")
                 (device
                  (if (access? "/dev/sda2" F_OK)
                      ;; As of 2022-08-28 OVH vps don't have a bios boot 
partition anymore
                      ;; but support is needed for VPSs created before this date
                     "/dev/sda2" "/dev/sda1"))
                 (type "ext4"))
               %base-file-systems)))
      (add-service dhcp-client)))))
(minimal-ovh2)
#+end_src


Full backtrace

guix system: warning: 'dhcp-client-service-type' is deprecated, use 
'dhcpcd-service-type' instead
guix system: warning: Consider running 'guix pull' followed by
'guix system reconfigure' to get up-to-date packages and security updates.

Backtrace:
In ice-9/boot-9.scm:
  1752:10 19 (with-exception-handler _ _ #:unwind? _ # _)
In guix/store.scm:
   690:37 18 (thunk)
   1331:8 17 (call-with-build-handler #<procedure 7f73c2ace690 at g…> …)
  2212:25 16 (run-with-store #<store-connection 256.100 7f73c3443e10> …)
In guix/scripts/system.scm:
    861:2 15 (_ _)
In guix/store.scm:
  2040:13 14 (_ #<store-connection 256.100 7f73c3443e10>)
In guix/gexp.scm:
   301:51 13 (_)
   747:11 12 (_ _ "x86_64-linux" #f)
In unknown file:
          11 (with-fluids* (#<fluid 7f73d62f7080>) (#f) #<procedure …>)
In guix/gexp.scm:
   756:17 10 (_)
In gnu/system/image.scm:
  1010:15  9 (_)
    941:7  8 (operating-system-for-image _)
In gnu/system.scm:
  1427:38  7 (operating-system-uuid #<<operating-system> kernel: #<…> …)
   894:11  6 (operating-system-services #<<operating-system> kernel:…>)
   806:23  5 (operating-system-default-essential-services #<<operati…>)
   781:34  4 (operating-system-directory-base-entries #<<operating-s…>)
  1382:15  3 (operating-system-initrd-file #<<operating-system> kern…>)
In /home/edouard/src/guix/mwe2.scm:
    62:34  2 (initrd-modules #<<operating-system> kernel: #<package …>)
In ice-9/boot-9.scm:
  1685:16  1 (raise-exception _ #:continuable? _)
  1685:16  0 (raise-exception _ #:continuable? _)

ice-9/boot-9.scm:1685:16: In procedure raise-exception:
error: %base-initrd-modules: unbound variable



Reply via email to