(guix scripts environment) fails to build with Guile 2.2

DoneSubmitted by cage.
Details
3 participants
  • cage
  • Ludovic Courtès
  • Maxime Devos
Owner
unassigned
Severity
normal
C
[debian] compilation from git fails
(address . bug-guix@gnu.org)
YDtONnEKLCe7pBEE@kurosawa.casa.net
Hi!

i tried to compile guix from git but the compilation fails with a syntax error, details below:

- OS Debian testing (bullseye)
- guix commit hash 8ef1f24f16354e08f23dfabf11396527b0417638 (master)
- $ guile --version
guile (GNU Guile) 2.2.7

The error is:

$ make

[...]

guix/scripts/environment.scm:752:12: error: (define manifest (if profile (profile-manifest profile) manifest-from-opts)): definition in expression context, where definitions are not allowed,
make[2]: *** [Makefile:6246: make-go] Error 1


A kind user suggested to comment the form in
guix/scripts/environment.scm starting at line 178:

------------
(when (and profile
(> (length (manifest-entries manifest-from-opts)) 0))
(leave (G_ "'--profile' cannot be used with package options~%")))
-----------

After commenting the form above, the compilation works flawless.

Hope this help!
Bye!
C.
C
(address . 46826@debbugs.gnu.org)
YDtcuDMQptDnLcWI@kurosawa.casa.net
Errata:

Toggle quote (2 lines)
> guix/scripts/environment.scm starting at line 178:

line 748 actually.

Bye!
C.
M
M
Maxime Devos wrote on 1 Mar 2021 12:42
35e9878676026fc49a7216083acebfae50f8bc23.camel@telenet.be
On Sun, 2021-02-28 at 09:03 +0100, cage wrote:

Toggle quote (12 lines)
> [...]
> A kind user suggested to comment the form in
> guix/scripts/environment.scm starting at line 178:
>
> ------------
> (when (and profile
> (> (length (manifest-entries manifest-from-opts)) 0))
> (leave (G_ "'--profile' cannot be used with package options~%")))
> -----------
>
> After commenting the form above, the compilation works flawless.

The guile2.2-bytestructures dependency of guile2.2-guix is broken currently
(see https://issues.guix.gnu.org/46844),which makes my proposal somewhat annoying
to test ...

Perhaps replace (when COND STUFF) with (define _ (when COND STUFF))? That should
be ok for both guile2.2 and guile3.0. It's not very aesthetical, but if the
alternative is putting everything below (when COND STUFF) in a let form
(leading to more indentation), perhaps that's ok.

cage, could you verify whether this patch works for you?

Greetings,
Maxime.
--
Maxime Devos <maximedevos@telenet.be>
PGP Key: C1F3 3EE2 0C52 8FDB 7DD7 011F 49E3 EE22 1917 25EE
Freenode handle: mdevos
From 659e191c1e9d64a9cf7734db6e9bb99e47877344 Mon Sep 17 00:00:00 2001
From: Maxime Devos <maximedevos@telenet.be>
Date: Mon, 1 Mar 2021 10:57:17 +0100
Subject: [PATCH] scripts: environment: Replace expression with definition.

This fixes the following build error when building guix with
GNU Guile 2.2.7 on Debian (bullseye) (reindented):

guix/scripts/environment.scm:752:12: error:
(define manifest (if profile (profile-manifest profile) manifest-from-opts)):
definition in expression context, where definitions are not allowed,


* guix/scripts/environment.scm (guix-environment): Fix a syntax error
on Guile 2.2.7.
---
guix/scripts/environment.scm | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)

Toggle diff (20 lines)
diff --git a/guix/scripts/environment.scm b/guix/scripts/environment.scm
index a39347743e..a28018e627 100644
--- a/guix/scripts/environment.scm
+++ b/guix/scripts/environment.scm
@@ -745,9 +745,10 @@ message if any test fails."
           (with-status-verbosity (assoc-ref opts 'verbosity)
             (define manifest-from-opts
               (options/resolve-packages store opts))
-            (when (and profile
-                       (> (length (manifest-entries manifest-from-opts)) 0))
-              (leave (G_ "'--profile' cannot be used with package options~%")))
+            (define _
+              (when (and profile
+                         (> (length (manifest-entries manifest-from-opts)) 0))
+                (leave (G_ "'--profile' cannot be used with package options~%"))))
 
             (define manifest
               (if profile
-- 
2.30.0
-----BEGIN PGP SIGNATURE-----

iI0EABYIADUWIQTB8z7iDFKP233XAR9J4+4iGRcl7gUCYDzTERccbWF4aW1lZGV2
b3NAdGVsZW5ldC5iZQAKCRBJ4+4iGRcl7mjFAP0Vp/2DOshsGYCZGvPYOnDrYzDG
cS434zcYCAhq5qwv+QD9FiBs+726zTor0Q+rmCCCRbjC0r+OunizQrQyMnb49wM=
=9QCw
-----END PGP SIGNATURE-----


C
(name . Maxime Devos)(address . maximedevos@telenet.be)
YDzoOEf6qpsDgmYo@kurosawa.casa.net
On Mon, Mar 01, 2021 at 12:42:08PM +0100, Maxime Devos wrote:

Hi!

Toggle quote (8 lines)
>
> Perhaps replace (when COND STUFF) with (define _ (when COND STUFF))? That should
> be ok for both guile2.2 and guile3.0. It's not very aesthetical, but if the
> alternative is putting everything below (when COND STUFF) in a let form
> (leading to more indentation), perhaps that's ok.
>
> cage, could you verify whether this patch works for you?

I wrapped that form in a (define _ ...) and I was able to compile guix
without errors.

Bye!
C.
L
L
Ludovic Courtès wrote on 1 Mar 2021 21:40
(name . cage)(address . cage-dev@twistfold.it)
87y2f6ppz2.fsf@gnu.org
Hi!

I pushed a slightly different fix as
9ce78f27a02b3a5fcaea2f0633404b940795989a.

Thanks,
Ludo’.
Closed
L
L
Ludovic Courtès wrote on 1 Mar 2021 21:40
control message for bug #46826
(address . control@debbugs.gnu.org)
87wnuqppyk.fsf@gnu.org
retitle 46826 (guix scripts environment) fails to build with Guile 2.2
quit
C
Re: bug#46826: [debian] compilation from git fails
(name . Ludovic Courtès)(address . ludo@gnu.org)
YD6UX42vi2v0wMZi@kurosawa.casa.net
On Mon, Mar 01, 2021 at 09:40:33PM +0100, Ludovic Court�s wrote:
Toggle quote (2 lines)
> Hi!

Hi!

Toggle quote (4 lines)
>
> I pushed a slightly different fix as
> 9ce78f27a02b3a5fcaea2f0633404b940795989a.

FWIW the compilation works just fine! :)

Toggle quote (2 lines)
> Thanks,

You're welcome!
C.
Closed
?
Your comment

This issue is archived.

To comment on this conversation send email to 46826@debbugs.gnu.org