GNU bug report logs - #38628
Character literals unsupported in source 'snippets'

Previous Next

Package: guix;

Reported by: Marius Bakke <mbakke <at> fastmail.com>

Date: Sun, 15 Dec 2019 20:28:01 UTC

Severity: normal

Done: Marius Bakke <mbakke <at> fastmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Marius Bakke <mbakke <at> fastmail.com>
Subject: bug#38628: closed (Re: bug#38628: [PATCH] gexp: Allow character
 literals in GEXP->SEXP.)
Date: Wed, 18 Dec 2019 22:07:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#38628: Character literals unsupported in source 'snippets'

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 38628 <at> debbugs.gnu.org.

-- 
38628: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=38628
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Marius Bakke <mbakke <at> fastmail.com>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: 38628-done <at> debbugs.gnu.org
Subject: Re: bug#38628: [PATCH] gexp: Allow character literals in GEXP->SEXP.
Date: Wed, 18 Dec 2019 23:06:21 +0100
[Message part 3 (text/plain, inline)]
Marius Bakke <mbakke <at> fastmail.com> writes:

> Ludovic Courtès <ludo <at> gnu.org> writes:
>
>> Also it would be nice to add a tiny test close to the one that
>> 24ab804ce11fe12ff49cd144a3d9c4bfcf55b41c added.
>
> Good idea.  I came up with this:
>
> diff --git a/tests/gexp.scm b/tests/gexp.scm
> index 84c16422c2..8b1596f66d 100644
> --- a/tests/gexp.scm
> +++ b/tests/gexp.scm
> @@ -886,6 +886,12 @@
>      (run-with-store %store
>        (lower-gexp #~(foo #$+)))))
>  
> +(test-equal "lower-gexp, character literal"
> +  '(#\+)
> +  (lowered-gexp-sexp
> +   (run-with-store %store
> +     (lower-gexp #~(#\+)))))
> +
>  (test-assertm "gexp->derivation #:references-graphs"
>    (mlet* %store-monad
>        ((one (text-file "one" (random-text)))
>
> WDYT?

I ended up pushing this in ab7010af1f1077c056529769a53a380147c3933f,
even though I suspect there is an easier test that could reveal this
problem without involving the store, somewhere.  Improvements welcome.
[signature.asc (application/pgp-signature, inline)]
[Message part 5 (message/rfc822, inline)]
From: Marius Bakke <mbakke <at> fastmail.com>
To: bug-guix <at> gnu.org
Subject: Character literals unsupported in source 'snippets'
Date: Sun, 15 Dec 2019 21:27:08 +0100
[Message part 6 (text/plain, inline)]
Guix,

If you try to use a character literal in a source 'snippet', Guix will
complain about an "unsupported input".  I.e. adding the following to the
'hello' package definition:

              (snippet '(begin #\!))

Results in:

guix build: error: /home/marius/guix/gnu/packages/base.scm:73:2: package `hello <at> 2.10' has an invalid input: #\!

This is a fairly recent regression.  I tracked it down to the following commit:

commit 24ab804ce11fe12ff49cd144a3d9c4bfcf55b41c
Author: Ludovic Courtès <ludo <at> gnu.org>
Date:   Mon Sep 23 22:17:39 2019 +0200

    gexp: Catch and report non-self-quoting gexp inputs.
    
    Previously we would, for example, generate build scripts in the store;
    when trying to run them, we'd get a 'read' error due to the presence
    of #<foo> syntax in there.
    
    * guix/gexp.scm (gexp->sexp)[self-quoting?]: New procedure.
    [reference->sexp]: Check whether the argument in a <gexp-input> box is
    self-quoting.  Raise a '&gexp-input-error' condition if it's not.
    * tests/gexp.scm ("lower-gexp, non-self-quoting input"): New test.
[signature.asc (application/pgp-signature, inline)]

This bug report was last modified 5 years and 209 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.