(guix scripts environment) fails to build with Guile 2.2

  • Done
  • quality assurance status badge
Details
3 participants
  • cage
  • Ludovic Courtès
  • Maxime Devos
Owner
unassigned
Submitted by
cage
Severity
normal

Debbugs page

cage wrote 4 years ago
[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.
cage wrote 4 years ago
(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.
Maxime Devos wrote 4 years ago
(name . cage)(address . cage-dev@twistfold.it)(address . 46826@debbugs.gnu.org)
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-----


cage wrote 4 years ago
(name . Maxime Devos)(address . maximedevos@telenet.be)(address . 46826@debbugs.gnu.org)(name . cage)(address . cage-dev@twistfold.it)
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.
Ludovic Courtès wrote 4 years ago
(name . cage)(address . cage-dev@twistfold.it)(address . 46826-done@debbugs.gnu.org)(name . Maxime Devos)(address . maximedevos@telenet.be)
87y2f6ppz2.fsf@gnu.org
Hi!

I pushed a slightly different fix as
9ce78f27a02b3a5fcaea2f0633404b940795989a.

Thanks,
Ludo’.
Closed
Ludovic Courtès wrote 4 years ago
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
cage wrote 4 years ago
Re: bug#46826: [debian] compilation from git fails
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 46826-done@debbugs.gnu.org)(name . Maxime Devos)(address . maximedevos@telenet.be)(name . cage)(address . cage-dev@twistfold.it)
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 an email to 46826@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 46826
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help