unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
* bug#66419: Incorrect handling of -L flag on guix system commands
@ 2023-10-09 10:16 Sergio Pastor Pérez
  2023-10-12 14:28 ` Ludovic Courtès
  0 siblings, 1 reply; 2+ messages in thread
From: Sergio Pastor Pérez @ 2023-10-09 10:16 UTC (permalink / raw)
  To: 66419

Good morning.

I've noticed that in system configurations split into different modules,
when using the -L flag, the `guix system build` command incorrectly
issues some errors. The error is ignored and the system is built
successfully.

For example, given a base system and 2 systems that inherit from it, the
error appears when building any of them:
--8<---------------cut here---------------start------------->8---
λ ls
base-system.scm  bordercollie.scm  sheepbook.scm
--8<---------------cut here---------------end--------------->8---

base-system.scm:
--8<---------------cut here---------------start------------->8---
(define-module (base-system)
  #:use-module (gnu))
...
(define-public %base-system
  (operating-system
   ...))
--8<---------------cut here---------------end--------------->8---

bordercollie.scm:
--8<---------------cut here---------------start------------->8---
(define-module (bordercollie)
  #:use-module (base-system)
  ...)
(operating-system
  (inherit %base-system)
  ...)
--8<---------------cut here---------------end--------------->8---

sheepbook.scm:
--8<---------------cut here---------------start------------->8---
(define-module (sheepbook)
  #:use-module (base-system)
  ...)
(operating-system
  (inherit %base-system)
  ...)
--8<---------------cut here---------------end--------------->8---

--8<---------------cut here---------------start------------->8---
λ guix system build -L . bordercollie.scm 
error: %useful-gnome-extensions: unbound variable
hint: Did you forget `(use-modules (base-system))'?

/gnu/store/gf21yc9ii1cfd3ki9hnn8ac5d65923ir-system
--8<---------------cut here---------------end--------------->8---

As you can see this command has built successfully. Note that in this
particular case the error says that the unbound variable is
`%useful-gnome-extensions'. It will complain always about the first
think it encounters.

On the other hand relying on the `GUILE_LOAD_PATH', instead of using the
'-L' flag, removes the error:
--8<---------------cut here---------------start------------->8---
λ GUILE_LOAD_PATH=$(pwd):$GUILE_LOAD_PATH guix system build bordercollie.scm
/gnu/store/gf21yc9ii1cfd3ki9hnn8ac5d65923ir-system
--8<---------------cut here---------------end--------------->8---

I've noticed that for the error to appear, there has to be 2 systems
inheriting from the `base-system` module. If I remove `bordercollie.scm`
or `sheepbook.scm`, the other will build without issuing the error.

Regards,
Sergio.




^ permalink raw reply	[flat|nested] 2+ messages in thread

* bug#66419: Incorrect handling of -L flag on guix system commands
  2023-10-09 10:16 bug#66419: Incorrect handling of -L flag on guix system commands Sergio Pastor Pérez
@ 2023-10-12 14:28 ` Ludovic Courtès
  0 siblings, 0 replies; 2+ messages in thread
From: Ludovic Courtès @ 2023-10-12 14:28 UTC (permalink / raw)
  To: Sergio Pastor Pérez; +Cc: 66419

Hi,

Sergio Pastor Pérez <sergio.pastorperez@outlook.es> skribis:

> λ guix system build -L . bordercollie.scm 
> error: %useful-gnome-extensions: unbound variable
> hint: Did you forget `(use-modules (base-system))'?
>
> /gnu/store/gf21yc9ii1cfd3ki9hnn8ac5d65923ir-system

‘-L’ does more than setting ‘GUILE_LOAD_PATH’; it’s equivalent to ‘-L’
in other ‘guix’ commands, meaning that it changes ‘%package-search-path’
(like the ‘GUIX_PACKAGE_PATH’ environment variable).

In doing so, it causes package lookup by name to traverse all the .scm
files in $PWD in this case.  In other words, ‘guix system -L.’ ends up
loading ./*.scm.  This is probably the source of confusion.

HTH,
Ludo’.




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-10-12 14:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-09 10:16 bug#66419: Incorrect handling of -L flag on guix system commands Sergio Pastor Pérez
2023-10-12 14:28 ` Ludovic Courtès

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