all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#66659: (home-)on-first-login script broken when no gexps are added
@ 2023-10-21  6:14 Nils Landt
  2023-10-21  9:27 ` Carlo Zancanaro
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Nils Landt @ 2023-10-21  6:14 UTC (permalink / raw)
  To: 66659

Error message:

ice-9/psyntax.scm:2824:12: In procedure syntax-violation:
Syntax error:
/home/nl/.guix-home/on-first-login:3:1233: source expression failed to match any pattern in form (when (claim-first-run flag-file-path))

As you can see, there is no body in the "when" expression.

Code in gnu/home/services.scm:438 :

          (if (file-exists? xdg-runtime-dir)
              (when (claim-first-run flag-file-path)
                #$@gexps)

In my case, it appears that gexps is empty, resulting in the invalid syntax.

Broken by b92235ea8b06e304072bad55ae006593ea673568




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

* bug#66659: (home-)on-first-login script broken when no gexps are added
  2023-10-21  6:14 bug#66659: (home-)on-first-login script broken when no gexps are added Nils Landt
@ 2023-10-21  9:27 ` Carlo Zancanaro
  2023-10-21  9:39   ` bug#66659: [PATCH] home: services: Don't crash on-first-login when nothing to do Carlo Zancanaro
  2023-10-21 14:15   ` bug#66659: (home-)on-first-login script broken when no gexps are added Ludovic Courtès
       [not found] ` <handler.66659.D66659.169789774918233.notifdone@debbugs.gnu.org>
  2023-10-24 14:17 ` Rostislav Svoboda
  2 siblings, 2 replies; 9+ messages in thread
From: Carlo Zancanaro @ 2023-10-21  9:27 UTC (permalink / raw)
  To: Nils Landt; +Cc: 66659

On Sat, Oct 21 2023, Nils Landt wrote:
> ...
> As you can see, there is no body in the "when" expression.
>
> Code in gnu/home/services.scm:438 :
>
>           (if (file-exists? xdg-runtime-dir)
>               (when (claim-first-run flag-file-path)
>                 #$@gexps)
>
> In my case, it appears that gexps is empty, resulting in the invalid syntax.

Ah, yep, that's an issue. That issue was introduced in 6b0a32196982a0a2f4dbb59d35e55833a5545ac6.

I guess this raises a question about how to resolve this: if we have no gexps, do we still want to claim the first run?

If yes: we can add #t (or whatever) to the end of the "when" form to make sure it's never empty.

If no: we can generate an empty on-first-login script that does nothing.

The previous behaviour was to still claim the first run, so I'll send through a patch that does that.

Carlo




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

* bug#66659: [PATCH] home: services: Don't crash on-first-login when nothing to do
  2023-10-21  9:27 ` Carlo Zancanaro
@ 2023-10-21  9:39   ` Carlo Zancanaro
  2023-10-21 14:15   ` bug#66659: (home-)on-first-login script broken when no gexps are added Ludovic Courtès
  1 sibling, 0 replies; 9+ messages in thread
From: Carlo Zancanaro @ 2023-10-21  9:39 UTC (permalink / raw)
  To: 66659

* gnu/home/services.scm (compute-on-first-login-script): Ensure that WHEN is
syntactically valid in expansion.
---
 gnu/home/services.scm | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/gnu/home/services.scm b/gnu/home/services.scm
index 651c068f79..3f018e3893 100644
--- a/gnu/home/services.scm
+++ b/gnu/home/services.scm
@@ -435,7 +435,10 @@ (define (compute-on-first-login-script _ gexps)
          ;; after complete logout/reboot.
          (if (file-exists? xdg-runtime-dir)
              (when (claim-first-run flag-file-path)
-               #$@gexps)
+               #$@gexps
+               ;; An empty WHEN body is not syntactically valid, so we put an
+               ;; arbitrary form here to ensure it's not empty.
+               #t)
              ;; TRANSLATORS: 'on-first-login' is the name of a service and
              ;; shouldn't be translated
              (warning (G_ "XDG_RUNTIME_DIR doesn't exists, on-first-login script

base-commit: 80c8f5b57aa3699445fab29e0f75f5955e697509
-- 
2.41.0





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

* bug#66659: (home-)on-first-login script broken when no gexps are added
  2023-10-21  9:27 ` Carlo Zancanaro
  2023-10-21  9:39   ` bug#66659: [PATCH] home: services: Don't crash on-first-login when nothing to do Carlo Zancanaro
@ 2023-10-21 14:15   ` Ludovic Courtès
  1 sibling, 0 replies; 9+ messages in thread
From: Ludovic Courtès @ 2023-10-21 14:15 UTC (permalink / raw)
  To: Carlo Zancanaro; +Cc: 66659-done, Nils Landt

Hi Carlo & Nils,

Carlo Zancanaro <carlo@zancanaro.id.au> skribis:

> On Sat, Oct 21 2023, Nils Landt wrote:
>> ...
>> As you can see, there is no body in the "when" expression.
>>
>> Code in gnu/home/services.scm:438 :
>>
>>           (if (file-exists? xdg-runtime-dir)
>>               (when (claim-first-run flag-file-path)
>>                 #$@gexps)
>>
>> In my case, it appears that gexps is empty, resulting in the invalid syntax.
>
> Ah, yep, that's an issue. That issue was introduced in 6b0a32196982a0a2f4dbb59d35e55833a5545ac6.
>
> I guess this raises a question about how to resolve this: if we have no gexps, do we still want to claim the first run?
>
> If yes: we can add #t (or whatever) to the end of the "when" form to make sure it's never empty.
>
> If no: we can generate an empty on-first-login script that does nothing.
>
> The previous behaviour was to still claim the first run, so I'll send through a patch that does that.

I’ve just pushed something similar to what you provided, Carlo, in
commit e098ba2f499bbddfea50c85058e4077e39b85513.

We should be good now.

Thank you!

Ludo’.




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

* bug#66659: closed (Re: bug#66659: (home-)on-first-login script broken when no gexps are added)
       [not found] ` <handler.66659.D66659.169789774918233.notifdone@debbugs.gnu.org>
@ 2023-10-24 10:05   ` Nils Landt
  2023-10-24 23:19     ` bug#66659: (home-)on-first-login script broken when no gexps are added Clément Lassieur
  2023-10-27 22:22     ` Ludovic Courtès
  0 siblings, 2 replies; 9+ messages in thread
From: Nils Landt @ 2023-10-24 10:05 UTC (permalink / raw)
  To: 66659


> help-debbugs@gnu.org hat am 21.10.2023 16:16 CEST geschrieben:
> 
>  
> Your bug report
> 
> #66659: (home-)on-first-login script broken when no gexps are added
> 
> which was filed against the guix package, has been closed.
> 
> The explanation is attached below, along with your original report.
> If you require more details, please reply to 66659@debbugs.gnu.org.
> 
> -- 
> 66659: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=66659
> GNU Bug Tracking System
> Contact help-debbugs@gnu.org with problems
> Hi Carlo & Nils,
> 

> I’ve just pushed something similar to what you provided, Carlo, in
> commit e098ba2f499bbddfea50c85058e4077e39b85513.
> 
> We should be good now.

I'm afraid this did not fix the issue. It results in
(when (claim-first-run flag-file-path) (begin))

which leads to the new error message "Syntax error:
/home/nl/.guix-home/on-first-login:3:1272: sequence of zero expressions in form (begin)"




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

* bug#66659: (home-)on-first-login script broken when no gexps are added
  2023-10-21  6:14 bug#66659: (home-)on-first-login script broken when no gexps are added Nils Landt
  2023-10-21  9:27 ` Carlo Zancanaro
       [not found] ` <handler.66659.D66659.169789774918233.notifdone@debbugs.gnu.org>
@ 2023-10-24 14:17 ` Rostislav Svoboda
  2023-10-27 14:53   ` Clément Lassieur
  2 siblings, 1 reply; 9+ messages in thread
From: Rostislav Svoboda @ 2023-10-24 14:17 UTC (permalink / raw)
  To: 66659

[-- Attachment #1: Type: text/plain, Size: 773 bytes --]

> > I've just pushed something similar to what you provided, Carlo, in
> > commit e098ba2f499bbddfea50c85058e4077e39b85513.
> >
> > We should be good now.
>
> I'm afraid this did not fix the issue. It results in
> (when (claim-first-run flag-file-path) (begin))
>
> which leads to the new error message "Syntax error:
> /home/nl/.guix-home/on-first-login:3:1272: sequence of zero expressions in form (begin)"

Adding *unspecified* works for me. I.e.:

    (when (claim-first-run flag-file-path)
      ;; GEXPS can be empty, hence 'begin *unspecified*'. Having just
      ;; 'begin' without '*unspecified*' leads to
      ;; "Syntax error: ... sequence of zero expressions in form (begin)"
      (begin *unspecified* #$@gexps))

The patch is in the attachment.

Cheers Bost

[-- Attachment #2: 0001-home-services-Fix-regression-in-generated-on-first-l.patch --]
[-- Type: text/x-patch, Size: 1930 bytes --]

From 96da848ddeec11f207dabec64a5d314c28e6c46f Mon Sep 17 00:00:00 2001
Message-ID: <96da848ddeec11f207dabec64a5d314c28e6c46f.1698156887.git.Rostislav.Svoboda@gmail.com>
From: Rostislav Svoboda <Rostislav.Svoboda@gmail.com>
Date: Tue, 24 Oct 2023 16:08:10 +0200
Subject: [PATCH] =?UTF-8?q?home:=20services:=20Fix=20regression=20in=20gen?=
 =?UTF-8?q?erated=20=E2=80=98on-first-login=E2=80=99=20script.?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Fixes <https://issues.guix.gnu.org/66659>.

Fixes a regression introduced in 6b0a32196982a0a2f4dbb59d35e55833a5545ac6. The
first attempt in e098ba2f499bbddfea50c85058e4077e39b85513 to fix this issue didn't work.

* gnu/home/services.scm (compute-on-first-login-script): Add
‘begin *unspecified*’ around #$@gexps.

Change-Id: I14339ad684ffe93e692e507b57dcd221d96210ef
---
 gnu/home/services.scm | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/gnu/home/services.scm b/gnu/home/services.scm
index 282fed74c1..44f585aff5 100644
--- a/gnu/home/services.scm
+++ b/gnu/home/services.scm
@@ -435,7 +435,10 @@ (define (compute-on-first-login-script _ gexps)
          ;; after complete logout/reboot.
          (if (file-exists? xdg-runtime-dir)
              (when (claim-first-run flag-file-path)
-               (begin #$@gexps))            ;GEXPS can be empty, hence 'begin'
+               ;; GEXPS can be empty, hence 'begin *unspecified*'. Having just
+               ;; 'begin' without '*unspecified*' leads to
+               ;; "Syntax error: ... sequence of zero expressions in form (begin)"
+               (begin *unspecified* #$@gexps))
              ;; TRANSLATORS: 'on-first-login' is the name of a service and
              ;; shouldn't be translated
              (warning (G_ "XDG_RUNTIME_DIR doesn't exists, on-first-login script

base-commit: d22d2a05c389207f8cdcf824be7738b1499a987c
-- 
2.41.0


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

* bug#66659: (home-)on-first-login script broken when no gexps are added
  2023-10-24 10:05   ` bug#66659: closed (Re: bug#66659: (home-)on-first-login script broken when no gexps are added) Nils Landt
@ 2023-10-24 23:19     ` Clément Lassieur
  2023-10-27 22:22     ` Ludovic Courtès
  1 sibling, 0 replies; 9+ messages in thread
From: Clément Lassieur @ 2023-10-24 23:19 UTC (permalink / raw)
  To: Nils Landt; +Cc: Ludovic Courtès, 66659

Nils Landt <nils@landt.email> writes:

>> I’ve just pushed something similar to what you provided, Carlo, in
>> commit e098ba2f499bbddfea50c85058e4077e39b85513.
>> 
>> We should be good now.
>
> I'm afraid this did not fix the issue. It results in
> (when (claim-first-run flag-file-path) (begin))
>
> which leads to the new error message "Syntax error:
> /home/nl/.guix-home/on-first-login:3:1272: sequence of zero expressions in form (begin)"

Hi,

I just ran into the same issue.

Thanks,
Clément




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

* bug#66659: (home-)on-first-login script broken when no gexps are added
  2023-10-24 14:17 ` Rostislav Svoboda
@ 2023-10-27 14:53   ` Clément Lassieur
  0 siblings, 0 replies; 9+ messages in thread
From: Clément Lassieur @ 2023-10-27 14:53 UTC (permalink / raw)
  To: Rostislav Svoboda; +Cc: 66659-done

On Tue, Oct 24 2023, Rostislav Svoboda wrote:

>> > I've just pushed something similar to what you provided, Carlo, in
>> > commit e098ba2f499bbddfea50c85058e4077e39b85513.
>> >
>> > We should be good now.
>>
>> I'm afraid this did not fix the issue. It results in
>> (when (claim-first-run flag-file-path) (begin))
>>
>> which leads to the new error message "Syntax error:
>> /home/nl/.guix-home/on-first-login:3:1272: sequence of zero expressions in form (begin)"
>
> Adding *unspecified* works for me. I.e.:
>
>     (when (claim-first-run flag-file-path)
>       ;; GEXPS can be empty, hence 'begin *unspecified*'. Having just
>       ;; 'begin' without '*unspecified*' leads to
>       ;; "Syntax error: ... sequence of zero expressions in form (begin)"
>       (begin *unspecified* #$@gexps))
>
> The patch is in the attachment.
>
> Cheers Bost

Applied as 2de30042674197fe451c220745186e36465d06e2, thanks!
Clément




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

* bug#66659: (home-)on-first-login script broken when no gexps are added
  2023-10-24 10:05   ` bug#66659: closed (Re: bug#66659: (home-)on-first-login script broken when no gexps are added) Nils Landt
  2023-10-24 23:19     ` bug#66659: (home-)on-first-login script broken when no gexps are added Clément Lassieur
@ 2023-10-27 22:22     ` Ludovic Courtès
  1 sibling, 0 replies; 9+ messages in thread
From: Ludovic Courtès @ 2023-10-27 22:22 UTC (permalink / raw)
  To: Nils Landt, Rostislav Svoboda, Clément Lassieur; +Cc: 66659

Hi,

Nils Landt <nils@landt.email> skribis:

> I'm afraid this did not fix the issue. It results in
> (when (claim-first-run flag-file-path) (begin))
>
> which leads to the new error message "Syntax error:
> /home/nl/.guix-home/on-first-login:3:1272: sequence of zero expressions in form (begin)"

Oops, my bad.  (I did check at the REPL that (begin) was fine but forgot
that I was checking the top-level ‘begin’ form, which is not the same as
the sequencing ‘begin’ form…)

Rostislav Svoboda <rostislav.svoboda@gmail.com> skribis:

> Adding *unspecified* works for me. I.e.:
>
>     (when (claim-first-run flag-file-path)
>       ;; GEXPS can be empty, hence 'begin *unspecified*'. Having just
>       ;; 'begin' without '*unspecified*' leads to
>       ;; "Syntax error: ... sequence of zero expressions in form (begin)"
>       (begin *unspecified* #$@gexps))
>
> The patch is in the attachment.

Thanks Rostislav and everyone, and apologies for not replying earlier!

Ludo’.




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

end of thread, other threads:[~2023-10-27 22:23 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-21  6:14 bug#66659: (home-)on-first-login script broken when no gexps are added Nils Landt
2023-10-21  9:27 ` Carlo Zancanaro
2023-10-21  9:39   ` bug#66659: [PATCH] home: services: Don't crash on-first-login when nothing to do Carlo Zancanaro
2023-10-21 14:15   ` bug#66659: (home-)on-first-login script broken when no gexps are added Ludovic Courtès
     [not found] ` <handler.66659.D66659.169789774918233.notifdone@debbugs.gnu.org>
2023-10-24 10:05   ` bug#66659: closed (Re: bug#66659: (home-)on-first-login script broken when no gexps are added) Nils Landt
2023-10-24 23:19     ` bug#66659: (home-)on-first-login script broken when no gexps are added Clément Lassieur
2023-10-27 22:22     ` Ludovic Courtès
2023-10-24 14:17 ` Rostislav Svoboda
2023-10-27 14:53   ` Clément Lassieur

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.