unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#67290: (current-profile) only works when invoked as a process named "guix"
@ 2023-11-19 21:24 Ian Eure
  0 siblings, 0 replies; only message in thread
From: Ian Eure @ 2023-11-19 21:24 UTC (permalink / raw)
  To: 67290

When you invoke `guix repl', the current-profile and current-channels procedures reflect my current profile and channel configuration:

    l0p!ieure~$ guix repl
    GNU Guile 3.0.9
    Copyright (C) 1995-2023 Free Software Foundation, Inc.

    Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
    This program is free software, and you are welcome to redistribute it
    under certain conditions; type `,show c' for details.

    Enter `,help' for help.
    scheme@(guix-user)> ,m (guix describe)
    scheme@(guix describe)> (current-profile)
    $1 = "/home/ieure/.config/guix/current"
    scheme@(guix describe)> (length (current-channels))
    $2 = 3
    scheme@(guix describe)> 

If you run `guile', they do not:

    l0p!ieure~$ guile
    GNU Guile 3.0.9
    Copyright (C) 1995-2023 Free Software Foundation, Inc.

    Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
    This program is free software, and you are welcome to redistribute it
    under certain conditions; type `,show c' for details.

    Enter `,help' for help.
    scheme@(guile-user)> ,m (guix describe)
    scheme@(guix describe)> (current-profile)
    $1 = #f
    scheme@(guix describe)> (length (current-channels))
    $2 = 1
    scheme@(guix describe)> 

The issue seems to be that current-profile checks the name of the program which was invoked, and always returns #f unless the name ends with "bin/guix".  Since "guile" doesn’t, they don’t work as expected.  See: https://git.savannah.gnu.org/cgit/guix.git/tree/guix/describe.scm#n64

I discovered this when I was using emacs-guix to debug one of my package definitions, which inherits from a package in a non-default channel.  While I can load the .scm file into Geiser no matter what channels are configured, it can’t use the module containing the package definition it inherits from.  This also appears to be the root cause behind this three-year-old bug report for emacs-guix: https://gitlab.com/emacs-guix/emacs-guix/-/issues/17

I’m not sure what the rationale is for this behavior, so I don’t have a suggestion for a fix, but it’s definitely a bug.

Thanks,

  — Ian




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-11-19 21:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-19 21:24 bug#67290: (current-profile) only works when invoked as a process named "guix" Ian Eure

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).