unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: "Vitaliy Shatrov" <guix.vits@disroot.org>
To: 43736@debbugs.gnu.org
Subject: bug#43736: The local-file()'s error message is misleading.
Date: Thu, 01 Oct 2020 04:56:08 +0000	[thread overview]
Message-ID: <3abd04a2adce73691b7ff963099d47ce@disroot.org> (raw)

[-- Attachment #1: Type: text/plain, Size: 882 bytes --]

Hello there.
I ran in bash shell:



pwd
--> /home/vits

conf=~/guix/configuration/configuration.scm

ls $conf   # file exists
--> ~/guix/configuration/configuration.scm

guix system build $conf
--> guix system: error: failed to load
'/home/vits/guix/configuration/configuration.scm': No such file or directory



The commands above will result in a successfull build if i
`cd guix/configuration` before doing `guix system build`
(both with rel. and abs. names).

Attached is WORKING config.scm.  Error was caused by local-file()
used with _relative_ paths.  Those were commented out, and this
config.scm works from any directory.

#guix:
> ... error message is very misleading.

Better of course if the offending file will be print out:
"failed to load (...) /home/vits/auto-login:  no such file or directory"

---
Thanks for attention, Vitaliy.

[-- Attachment #2: config.scm --]
[-- Type: application/octet-stream, Size: 6978 bytes --]

;; These both are decorative.
(eval-when (expand)             ; evaluated _before_ use-modules()
  (define default-uses (module-uses (current-module))))

(define additional-uses         ; evaluated _after_ use-modules()
  (let ((loaded-by-default? (lambda (x) (if (find (lambda (y) (eq? x y))
                                                  default-uses) #t #f))))
  (remove loaded-by-default? (module-uses (current-module)))))


(use-modules (gnu)       ; auto-load many useful things
             (gnu bootloader u-boot)        ; auto-load (gnu bootloader)
             (srfi srfi-1))
(use-service-modules admin
                     desktop
                     networking)
(use-package-modules linux
                     certs)


;; (define (custom-local-file str)              ; shorthand, preserves permissions
;;   (let* ((file (local-file str #:recursive? #t))
;;       (dir (dirname (local-file-absolute-file-name file))))
;;     (display (string-append "loading local file '" str "' from " dir "...\n"))
;;     file))

(define (pretty-print-modules message l)     ; decorative procedure
  (display message)
  (for-each (lambda (module)
              (display "   ")
              (display (module-name module))
              (newline))
            l))

(define custom-base-services
  ;; customized %base-services of 81ea278e05986f9ccee078bd00d4d7fc309dd19c.
  (let ((ttys (map (lambda (n) (string-append "tty" (number->string n)))
                   (iota 3 1)))
;;      (auto-login (custom-local-file "auto-login"))
;;      (syslog.conf (custom-local-file "syslog.conf")))
        (auto-login (plain-file "auto-login" "dummy"))
        (syslog.conf (plain-file "syslog.conf" "dummy")))
    (append
     (list
      ;; (?) Provide the login prompts on VT.
      (service login-service-type)

      ;; > Should start before any 'term-' service.
      ;; Set VT to UTF-8 mode.
      ;; (?) UTF-8 is default with the new Linux.  Remove?
      (service virtual-terminal-service-type)

      ;; The big enough VT fonts.
      (service console-font-service-type
               (map (lambda (tty) (cons tty "LatGrkCyr-12x22"))
                    ttys)))

     ;; Agetty.  Auto-login Users without a password.
     (map (lambda (tty)
            (service agetty-service-type
                     (agetty-configuration (login-program auto-login)
                                           ;; -L:  no carrier detect
                                           ;; -o:  pass arguments to `login`.
                                           (extra-options '("-L" "-o" "\\u"))
                                           (term "linux")
                                           (tty tty))))
          ttys)

     (list
      ;; `dhclient` from %base-packages can be used if this do not work.
      ;; Some services misbehave without a fast static configuraiton.
      (service static-networking-service-type
               (list (static-networking (interface "lo")
                                        (ip "127.0.0.1")
                                        (requirement '())
                                        (provision '(loopback)))

                     (static-networking (interface "eth0")
                                        (ip "192.168.0.127")
                                        (gateway "192.168.0.1"))))

      ;; Currently i assume a tmpfs /var/log.
      (syslog-service (syslog-configuration (config-file syslog.conf)))

      ;; > Save some entropy ... when rebooting.
      (service urandom-seed-service-type)

      ;; Tell Guix how to geek.
      (service guix-service-type
               (guix-configuration (extra-options '("--gc-keep-derivations=yes"
                                                    "--gc-keep-outputs=yes"))))

      ;; (!) Very important for Guix.
      (service nscd-service-type
               (nscd-configuration    ; changed fields: 'persistent?' -> #f
                (caches
                 (list (nscd-cache (database 'hosts)
                                   ;; Aggressively cache the host name cache
                                   ;; to improve privacy and resilience.
                                   (positive-time-to-live (* 3600 12))
                                   (negative-time-to-live 20)
                                   (persistent? #f))
                       (nscd-cache (database 'services)
                                   ;; Services are unlikely to change,
                                   ;; so we can be even more aggressive.
                                   (positive-time-to-live (* 3600 24))
                                   (negative-time-to-live 3600)
                                   (check-files? #t)   ;check /etc/services changes
                                   (persistent? #f))))))

      ;; (?) > The LVM2 rules are needed as soon as LVM2 or the device-mapper is
      ;; > used, so enable them by default.  The FUSE and ALSA rules are
      ;; > less critical, but handy.
      (service udev-service-type
               (udev-configuration
                (rules (list lvm2 fuse alsa-utils crda))))))))




(display "\n    B U I L D I N G    A    G N U    S Y S T E M\n\n")

(pretty-print-modules "\nThese modules were loaded by defualt:\n"
                      default-uses)

(pretty-print-modules "\nThe additional modules was loaded:\n"
                      additional-uses)

(newline)


(operating-system
 (host-name "simon")
 (timezone  "Asia/Krasnoyarsk")

 (kernel linux-libre-arm64-generic)

 (initrd-modules '())

 (bootloader (bootloader-configuration
              (bootloader u-boot-rockpro64-rk3399-bootloader)
              (target     "/dev/mmcblk2")))

 (file-systems
  (cons*
   (file-system (device (file-system-label "simonRoot"))
                (mount-point "/")
                (type "ext4")
                (flags '(no-atime)))
   (file-system (device (file-system-label "simonHome"))
                (mount-point "/home")
                (type "ext4")
                (flags '(no-atime)))
   (file-system (device "tmpfs")
                (mount-point "/var/log")
                (type "tmpfs")
                (flags '(no-atime no-exec no-suid no-dev))
                (options "size=64M,mode=755")
                (check? #f))
   %base-file-systems))

 (users
  (cons
   (user-account (name    "vits")
                 (comment "Vitaliy Shatrov")
                 (uid     1000)
                 (group "users")
                 (supplementary-groups '("audio" "netdev" "video" "wheel")))
   %base-user-accounts))

 (packages (cons*
            ;; HTTPS
            nss-certs
            ;; tty monitor resolution
            fbset
            ;; IDK
            %base-packages))

 (services
  (append custom-base-services
          (list (service elogind-service-type)
                (service openntpd-service-type
                         (openntpd-configuration
                          (allow-large-adjustment? #t)))))))

             reply	other threads:[~2020-10-01  6:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-01  4:56 Vitaliy Shatrov [this message]
2020-10-02  6:14 ` bug#43736: The local-file()'s error message is misleading Ludovic Courtès
2020-10-02  6:54 ` bug#43736: I think f43ffee... broke guix pull Brendan Tildesley
2020-10-03  9:25   ` Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3abd04a2adce73691b7ff963099d47ce@disroot.org \
    --to=guix.vits@disroot.org \
    --cc=43736@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).