unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Attila Lendvai <attila@lendvai.name>
To: 55464@debbugs.gnu.org
Subject: bug#55464: (current-filename) is #f when guix pull'ing
Date: Mon, 16 May 2022 21:04:10 +0000	[thread overview]
Message-ID: <625DOHHScuzJjNNfdQOqaLqGWVTmXC-S9PcF2xU3nzsFYG4XYTSEt0NGXDSXnBqVHqYqr6AsEbTysg7y_fxoqeBkbEtCqMZrx9muo3DlvS0=@lendvai.name> (raw)

the actual context where i'm encountering this is a package definition where i want to load some hashes from a file relative the to the .scm file:

(define-public foo
  (let ((hashes
    (with-input-from-file
        (string-append (dirname (current-filename))
                       "/foo.hashes")
      read)))
    (package ...)))

this works fine in a `./pre-inst-env build foo`, but i think there's something special in how `guix pull` compiles the scm files, and (c-f) expands to #f. guix pull works, but afterwards:

$ guix system --on-error=backtrace reconfigure --allow-downgrades /etc/guix/config.scm
guix system: error: failed to load '/etc/guix/config.scm':
guix-crypto/packages/ethereum.scm:47:36: In procedure scm_to_utf8_stringn: Wrong type argument in position 1 (expecting string): #f

In ice-9/boot-9.scm:
   222:29 19 (map1 (((gnu)) ((gnu system)) ((gnu system #)) ((# …)) …))
   222:29 18 (map1 (((gnu system)) ((gnu system file-systems)) (#) …))
   222:29 17 (map1 (((gnu system file-systems)) ((oop goops)) ((…)) …))
   222:29 16 (map1 (((oop goops)) ((shepherd service)) ((nongnu …)) …))
   222:29 15 (map1 (((shepherd service)) ((nongnu packages linux)) …))
   222:29 14 (map1 (((nongnu packages linux)) ((guix-crypto # #)) # …))
   222:17 13 (map1 (((guix-crypto packages ethereum)) ((# # #)) (#) …))
  3936:31 12 (_ ((guix-crypto packages ethereum)))
  3327:17 11 (resolve-interface (guix-crypto packages ethereum) # _ # …)
In ice-9/threads.scm:
    390:8 10 (_ _)
In ice-9/boot-9.scm:
  3253:13  9 (_)
In ice-9/threads.scm:
    390:8  8 (_ _)
In ice-9/boot-9.scm:
  3544:20  7 (_)
   2836:4  6 (save-module-excursion #<procedure 7f056144d810 at ice-…>)
  3564:26  5 (_)
In unknown file:
           4 (primitive-load-path "guix-crypto/packages/ethereum" #<…>)
In guix-crypto/packages/ethereum.scm:
    47:36  3 (_)
In unknown file:
           2 (dirname #f)
In ice-9/boot-9.scm:
  1685:16  1 (raise-exception _ #:continuable? _)
  1780:13  0 (_ #<&compound-exception components: (#<&assertion-fail…>)

i would be happy to avoid using (c-f), but i failed to find a way in Guile's module reflection API.

--
• attila lendvai
• PGP: 963F 5D5F 45C7 DFCD 0A39
--
“People who have never gone to school have never developed negative attitudes toward exploring their world.”
	— Grace Llewellyn





             reply	other threads:[~2022-05-16 22:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-16 21:04 Attila Lendvai [this message]
2022-05-17  0:09 ` bug#55464: alternative way Attila Lendvai
2022-05-18  9:14 ` bug#55464: (current-filename) is #f when guix pull'ing Ludovic Courtès
2022-05-19 13:32   ` Attila Lendvai
2022-05-21 16:39     ` 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='625DOHHScuzJjNNfdQOqaLqGWVTmXC-S9PcF2xU3nzsFYG4XYTSEt0NGXDSXnBqVHqYqr6AsEbTysg7y_fxoqeBkbEtCqMZrx9muo3DlvS0=@lendvai.name' \
    --to=attila@lendvai.name \
    --cc=55464@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).