unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
* bug#26805: [PATCH] gs-fonts: add missing podule imports
@ 2017-05-06 15:40 Sergei Trofimovich
  2017-05-07 19:06 ` bug#26805: [PATCH] gs-fonts: add missing module imports Danny Milosavljevic
  2017-05-09 10:20 ` bug#26805: [PATCH] gs-fonts: add missing podule imports Ludovic Courtès
  0 siblings, 2 replies; 11+ messages in thread
From: Sergei Trofimovich @ 2017-05-06 15:40 UTC (permalink / raw)
  To: 26805

On code-updates branch 'gs-fonts' build fails as:

ice-9/psyntax.scm:1534:32: In procedure expand-macro:
ice-9/psyntax.scm:1534:32: Syntax error:
...-gs-fonts-8.11-guile-builder:1:2300: source expression failed to match
any pattern in form (%modify-phases phases* (delete (quote configure)))
builder for `/gnu/store/...-gs-fonts-8.11.drv' failed with exit code 1

* gnu/packages/ghostscript.scm (gs-fonts): add missing modules to
  %modify-phases call: gnu-build-system, utils, srfi-1

Signed-off-by: Sergei Trofimovich <slyfox@inbox.ru>
---
 gnu/packages/ghostscript.scm | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/gnu/packages/ghostscript.scm b/gnu/packages/ghostscript.scm
index 076046e72..33b8f51b6 100644
--- a/gnu/packages/ghostscript.scm
+++ b/gnu/packages/ghostscript.scm
@@ -273,6 +273,10 @@ architecture.")
    (build-system gnu-build-system)
    (arguments
     `(#:tests? #f ; nothing to check, just files to copy
+
+      #:modules ((guix build gnu-build-system)
+                 (guix build utils)
+                 (srfi srfi-1))
       #:phases
       (modify-phases %standard-phases
         (delete 'configure)
-- 
2.12.2

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

* bug#26805: [PATCH] gs-fonts: add missing module imports
  2017-05-06 15:40 bug#26805: [PATCH] gs-fonts: add missing podule imports Sergei Trofimovich
@ 2017-05-07 19:06 ` Danny Milosavljevic
  2017-05-09 10:20 ` bug#26805: [PATCH] gs-fonts: add missing podule imports Ludovic Courtès
  1 sibling, 0 replies; 11+ messages in thread
From: Danny Milosavljevic @ 2017-05-07 19:06 UTC (permalink / raw)
  To: Sergei Trofimovich; +Cc: 26805-done

Hi Sergei,

thanks for your contribution.

I've pushed it to core-updates as 809bc3948e2441daae32dfd1beb6c1984b840315.

This causes 3198 dependent packages to rebuild, therefore I'll not push it to master (which I did for the other module import patches - because they caused a lot fewer packages to rebuild).

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

* bug#26805: [PATCH] gs-fonts: add missing podule imports
  2017-05-06 15:40 bug#26805: [PATCH] gs-fonts: add missing podule imports Sergei Trofimovich
  2017-05-07 19:06 ` bug#26805: [PATCH] gs-fonts: add missing module imports Danny Milosavljevic
@ 2017-05-09 10:20 ` Ludovic Courtès
  2017-05-09 20:36   ` Sergei Trofimovich
  1 sibling, 1 reply; 11+ messages in thread
From: Ludovic Courtès @ 2017-05-09 10:20 UTC (permalink / raw)
  To: Sergei Trofimovich; +Cc: 26805

Hello!

Sergei Trofimovich <slyfox@inbox.ru> skribis:

> On code-updates branch 'gs-fonts' build fails as:
>
> ice-9/psyntax.scm:1534:32: In procedure expand-macro:
> ice-9/psyntax.scm:1534:32: Syntax error:
> ...-gs-fonts-8.11-guile-builder:1:2300: source expression failed to match
> any pattern in form (%modify-phases phases* (delete (quote configure)))
> builder for `/gnu/store/...-gs-fonts-8.11.drv' failed with exit code 1

Any idea when this problem appeared?  That’s on core-updates, right?

> +      #:modules ((guix build gnu-build-system)
> +                 (guix build utils)
> +                 (srfi srfi-1))

The first two modules are here by default (see ‘%default-modules’ in
(guix build-system gnu)), so I wonder why adding (srfi srfi-1) would
help here.

Thoughts?

Ludo’.

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

* bug#26805: [PATCH] gs-fonts: add missing podule imports
  2017-05-09 10:20 ` bug#26805: [PATCH] gs-fonts: add missing podule imports Ludovic Courtès
@ 2017-05-09 20:36   ` Sergei Trofimovich
  2017-05-10 11:53     ` Ludovic Courtès
  0 siblings, 1 reply; 11+ messages in thread
From: Sergei Trofimovich @ 2017-05-09 20:36 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 26805

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

On Tue, 09 May 2017 12:20:46 +0200
ludo@gnu.org (Ludovic Courtès) wrote:

> Hello!
> 
> Sergei Trofimovich <slyfox@inbox.ru> skribis:
> 
> > On code-updates branch 'gs-fonts' build fails as:
> >
> > ice-9/psyntax.scm:1534:32: In procedure expand-macro:
> > ice-9/psyntax.scm:1534:32: Syntax error:
> > ...-gs-fonts-8.11-guile-builder:1:2300: source expression failed to match
> > any pattern in form (%modify-phases phases* (delete (quote configure)))
> > builder for `/gnu/store/...-gs-fonts-8.11.drv' failed with exit code 1  
> 
> Any idea when this problem appeared?  That’s on core-updates, right?

Yes, core-updates. It was caused by guile-2.0->guile-2.2 switch.

> > +      #:modules ((guix build gnu-build-system)
> > +                 (guix build utils)
> > +                 (srfi srfi-1))  
> 
> The first two modules are here by default (see ‘%default-modules’ in
> (guix build-system gnu)), so I wonder why adding (srfi srfi-1) would
> help here.
> 
> Thoughts?

In http://lists.gnu.org/archive/html/guix-devel/2017-05/msg00010.html
thread Andy explains syntax-rules changed the rules on how syntax-match
is done in guile-2.2: now things are matched by binding, not by name.

That means evaluation of -guile-builder needs to keep things in scope at
<some-strange-evaluation-time-i-have-no-understanding-about> :)

The breakage is quite widespread. Danny applied 3 patches already to fix
similar problems. I have at least 5 more packages fixed (or "fixed"?) in a
similar way and more to go.

-- 

  Sergei

[-- Attachment #2: Цифровая подпись OpenPGP --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

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

* bug#26805: [PATCH] gs-fonts: add missing podule imports
  2017-05-09 20:36   ` Sergei Trofimovich
@ 2017-05-10 11:53     ` Ludovic Courtès
  2017-05-10 20:41       ` Sergei Trofimovich
  0 siblings, 1 reply; 11+ messages in thread
From: Ludovic Courtès @ 2017-05-10 11:53 UTC (permalink / raw)
  To: Sergei Trofimovich; +Cc: 26805

Sergei Trofimovich <slyfox@inbox.ru> skribis:

> On Tue, 09 May 2017 12:20:46 +0200
> ludo@gnu.org (Ludovic Courtès) wrote:
>
>> Hello!
>> 
>> Sergei Trofimovich <slyfox@inbox.ru> skribis:
>> 
>> > On code-updates branch 'gs-fonts' build fails as:
>> >
>> > ice-9/psyntax.scm:1534:32: In procedure expand-macro:
>> > ice-9/psyntax.scm:1534:32: Syntax error:
>> > ...-gs-fonts-8.11-guile-builder:1:2300: source expression failed to match
>> > any pattern in form (%modify-phases phases* (delete (quote configure)))
>> > builder for `/gnu/store/...-gs-fonts-8.11.drv' failed with exit code 1  
>> 
>> Any idea when this problem appeared?  That’s on core-updates, right?
>
> Yes, core-updates. It was caused by guile-2.0->guile-2.2 switch.
>
>> > +      #:modules ((guix build gnu-build-system)
>> > +                 (guix build utils)
>> > +                 (srfi srfi-1))  
>> 
>> The first two modules are here by default (see ‘%default-modules’ in
>> (guix build-system gnu)), so I wonder why adding (srfi srfi-1) would
>> help here.
>> 
>> Thoughts?
>
> In http://lists.gnu.org/archive/html/guix-devel/2017-05/msg00010.html
> thread Andy explains syntax-rules changed the rules on how syntax-match
> is done in guile-2.2: now things are matched by binding, not by name.

Oooooh, right, terrible.

> That means evaluation of -guile-builder needs to keep things in scope at
> <some-strange-evaluation-time-i-have-no-understanding-about> :)
>
> The breakage is quite widespread. Danny applied 3 patches already to fix
> similar problems. I have at least 5 more packages fixed (or "fixed"?) in a
> similar way and more to go.

What about adding (srfi srfi-1) to ‘%default-modules’ in (guix
build-system gnu)?  It’s generally useful anyway.

(Alternately, we could rename SRFI-1’s ‘delete’ in (guix build utils),
so we’d still be matching a literal, but we’d have problems in places
that use both (guix build utils) and (srfi srfi-1).)

Ludo’.

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

* bug#26805: [PATCH] gs-fonts: add missing podule imports
  2017-05-10 11:53     ` Ludovic Courtès
@ 2017-05-10 20:41       ` Sergei Trofimovich
  2017-05-11 20:49         ` Ludovic Courtès
  0 siblings, 1 reply; 11+ messages in thread
From: Sergei Trofimovich @ 2017-05-10 20:41 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 26805

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

On Wed, 10 May 2017 13:53:41 +0200
ludo@gnu.org (Ludovic Courtès) wrote:

> What about adding (srfi srfi-1) to ‘%default-modules’ in (guix
> build-system gnu)?  It’s generally useful anyway.
> 
> (Alternately, we could rename SRFI-1’s ‘delete’ in (guix build utils),
> so we’d still be matching a literal, but we’d have problems in places
> that use both (guix build utils) and (srfi srfi-1).)

I'd personally say the less magic reexports - the better. It's ok to go
through all of core-updates and fix missing imports.

Would be nice the all those syntactic errors could be caught with something
lighter-weight than full 'guix build'.

I'm afraid I have no idea how symbol visibility works in guix as I'm
still struggling to find which code builds and evaluates '*-guile-builder' files.

For example what is the difference between
    (use-modules ....
and
    (arguments '(#:modules
?

Should be one preferred over another? The latter creeps in core-updates :)
    https://git.savannah.gnu.org/cgit/guix.git/log/?h=core-updates

A few recent examples:
    https://git.savannah.gnu.org/cgit/guix.git/commit/?h=core-updates&id=a8f25449114bd9035898eec3455db51c0f4d928d
    https://git.savannah.gnu.org/cgit/guix.git/commit/?h=core-updates&id=bc81e6cae40098684c14b10d0aa4c6257acbbdb6
    https://git.savannah.gnu.org/cgit/guix.git/commit/?h=core-updates&id=47babd445a9f0e6fe9356cbe362d390f09df4e3b
etc.

-- 

  Sergei

[-- Attachment #2: Цифровая подпись OpenPGP --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

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

* bug#26805: [PATCH] gs-fonts: add missing podule imports
  2017-05-10 20:41       ` Sergei Trofimovich
@ 2017-05-11 20:49         ` Ludovic Courtès
  2017-05-14 16:31           ` Sergei Trofimovich
  0 siblings, 1 reply; 11+ messages in thread
From: Ludovic Courtès @ 2017-05-11 20:49 UTC (permalink / raw)
  To: Sergei Trofimovich; +Cc: 26805

Hi!

Sergei Trofimovich <slyfox@inbox.ru> skribis:

> On Wed, 10 May 2017 13:53:41 +0200
> ludo@gnu.org (Ludovic Courtès) wrote:
>
>> What about adding (srfi srfi-1) to ‘%default-modules’ in (guix
>> build-system gnu)?  It’s generally useful anyway.
>> 
>> (Alternately, we could rename SRFI-1’s ‘delete’ in (guix build utils),
>> so we’d still be matching a literal, but we’d have problems in places
>> that use both (guix build utils) and (srfi srfi-1).)
>
> I'd personally say the less magic reexports - the better. It's ok to go
> through all of core-updates and fix missing imports.

I wouldn’t call it “magic”.  It’s just about providing a useful set of
bindings in ‘%default-modules’, to save typing essentially.

Also, for this ‘delete’ issue, I’m pretty sure we’re going to miss many
occurrences no matter what (same problem as with the ‘_’ binding from
(guix ui), which wasn’t resolved until I finally realized that renaming
it would have saved a lot of time…)

Note that there’s also the second solution above.

Thoughts?

> Would be nice the all those syntactic errors could be caught with something
> lighter-weight than full 'guix build'.

The problem is that this is “build-side code” and we can’t really tell
much about it until we’ve assembled it in on of those -guile-builder
files.

> I'm afraid I have no idea how symbol visibility works in guix as I'm
> still struggling to find which code builds and evaluates '*-guile-builder' files.
>
> For example what is the difference between
>     (use-modules ....
> and
>     (arguments '(#:modules
> ?

Hopefully the intro of the “G-Expressions” section can shed some light
on this, specifically on the build-side vs. host-side story.  Otherwise
let me know.  :-)

“(arguments '(#:modules …))” specifies modules in scope on the build
side.

HTH!

Ludo’.

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

* bug#26805: [PATCH] gs-fonts: add missing podule imports
  2017-05-11 20:49         ` Ludovic Courtès
@ 2017-05-14 16:31           ` Sergei Trofimovich
  2017-05-14 20:02             ` Ludovic Courtès
  0 siblings, 1 reply; 11+ messages in thread
From: Sergei Trofimovich @ 2017-05-14 16:31 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 26805

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

On Thu, 11 May 2017 22:49:05 +0200
ludo@gnu.org (Ludovic Courtès) wrote:

> Hi!
> 
> Sergei Trofimovich <slyfox@inbox.ru> skribis:
> 
> > On Wed, 10 May 2017 13:53:41 +0200
> > ludo@gnu.org (Ludovic Courtès) wrote:
> >  
> >> What about adding (srfi srfi-1) to ‘%default-modules’ in (guix
> >> build-system gnu)?  It’s generally useful anyway.

A bunch of python-guild-system based packages fail in a similar way.

I tried reexporting 'delete' from '(guix build utils)'. It works at
least for many packages I have tested. But maybe it's too broad.

diff --git a/guix/build/utils.scm b/guix/build/utils.scm
index e8efb0653..4bc55f219 100644
--- a/guix/build/utils.scm
+++ b/guix/build/utils.scm
@@ -25,21 +25,22 @@
   #:use-module (srfi srfi-26)
   #:use-module (srfi srfi-60)
   #:use-module (ice-9 ftw)
   #:use-module (ice-9 match)
   #:use-module (ice-9 regex)
   #:use-module (ice-9 rdelim)
   #:use-module (ice-9 format)
   #:use-module (rnrs bytevectors)
   #:use-module (rnrs io ports)
   #:re-export (alist-cons
-               alist-delete)
+               alist-delete
+               delete)
   #:export (%store-directory
             store-file-name?
             strip-store-file-name
             package-name->name+version
             parallel-job-count

             directory-exists?
             executable-file?
             symbolic-link?
             call-with-ascii-input-file

> >> (Alternately, we could rename SRFI-1’s ‘delete’ in (guix build utils),
> >> so we’d still be matching a literal, but we’d have problems in places
> >> that use both (guix build utils) and (srfi srfi-1).)  
> >
> > I'd personally say the less magic reexports - the better. It's ok to go
> > through all of core-updates and fix missing imports.  
> 
> I wouldn’t call it “magic”.  It’s just about providing a useful set of
> bindings in ‘%default-modules’, to save typing essentially.
> 
> Also, for this ‘delete’ issue, I’m pretty sure we’re going to miss many
> occurrences no matter what (same problem as with the ‘_’ binding from
> (guix ui), which wasn’t resolved until I finally realized that renaming
> it would have saved a lot of time…)

Yeah. Having tried to edit 10 more packages I have to agree it's tedious
to fix each package :)

Can you explain what is the problem of renaming ‘delete’ from srfi-1 in
(guix build utils) module? How would hypothetical breakage happen?
Is it because 'delete' from srfi-1 and renamed binding srfi-1 are not
treated as the same binding by syntax rule?

> Note that there’s also the second solution above.
> 
> Thoughts?


-- 

  Sergei

[-- Attachment #2: Цифровая подпись OpenPGP --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

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

* bug#26805: [PATCH] gs-fonts: add missing podule imports
  2017-05-14 16:31           ` Sergei Trofimovich
@ 2017-05-14 20:02             ` Ludovic Courtès
  2017-05-14 23:15               ` Sergei Trofimovich
  0 siblings, 1 reply; 11+ messages in thread
From: Ludovic Courtès @ 2017-05-14 20:02 UTC (permalink / raw)
  To: Sergei Trofimovich; +Cc: 26805

Hi,

Sergei Trofimovich <slyfox@inbox.ru> skribis:

> On Thu, 11 May 2017 22:49:05 +0200

[...]

>> >> (Alternately, we could rename SRFI-1’s ‘delete’ in (guix build utils),
>> >> so we’d still be matching a literal, but we’d have problems in places
>> >> that use both (guix build utils) and (srfi srfi-1).)  

[...]

> Can you explain what is the problem of renaming ‘delete’ from srfi-1 in
> (guix build utils) module? How would hypothetical breakage happen?
> Is it because 'delete' from srfi-1 and renamed binding srfi-1 are not
> treated as the same binding by syntax rule?

The only problem would be in packages that use both (guix build utils)
and (srfi srfi-1), *and* do (modify-phase … (delete …)).  Those packages
would have a syntax error due to ‘delete’ being shadowed by SRFI-1’s
‘delete’.

It’s easy to fix them, for example by using the #:prefix option when
importing (srfi srfi-1)… but it’s also easy to miss some of the
problems.

There’s yet another option, which is to:

  (define-modules (guix build utils)
    …
    #:use-module (srfi srfi-1)
    #:re-export (delete))

I think that one had none of the previously-discussed drawbacks.

Thoughts?  Would you like to give it a try?

Ludo’.

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

* bug#26805: [PATCH] gs-fonts: add missing podule imports
  2017-05-14 20:02             ` Ludovic Courtès
@ 2017-05-14 23:15               ` Sergei Trofimovich
  2017-05-26 13:02                 ` bug#26805: Re-exporting ‘delete’ from (guix build utils) Ludovic Courtès
  0 siblings, 1 reply; 11+ messages in thread
From: Sergei Trofimovich @ 2017-05-14 23:15 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 26805


[-- Attachment #1.1: Type: text/plain, Size: 590 bytes --]

On Sun, 14 May 2017 22:02:21 +0200
ludo@gnu.org (Ludovic Courtès) wrote:

> There’s yet another option, which is to:
> 
>   (define-modules (guix build utils)
>     …
>     #:use-module (srfi srfi-1)
>     #:re-export (delete))
> 
> I think that one had none of the previously-discussed drawbacks.
> 
> Thoughts?  Would you like to give it a try?

Attached 0001-reexport-delete-symbol-bound-at-modify-phases-syntax.patch
that hopefully does exactly the same. This fix allows bootstrapping bash-minimal
and gs-fonts with #:modules patch reverted \o/

-- 

  Sergei

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1.2: 0001-reexport-delete-symbol-bound-at-modify-phases-syntax.patch --]
[-- Type: text/x-patch, Size: 839 bytes --]

From 18d1c9cf8252891c5c98ebb18a9937b5881e4ddd Mon Sep 17 00:00:00 2001
From: Sergei Trofimovich <slyfox@inbox.ru>
Date: Sat, 13 May 2017 22:08:27 +0100
Subject: [PATCH] reexport 'delete' symbol bound at %modify-phases syntax match

* guix/build/utils.scm: reexport 'delete' binding
---
 guix/build/utils.scm | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/guix/build/utils.scm b/guix/build/utils.scm
index e8efb0653..4bc55f219 100644
--- a/guix/build/utils.scm
+++ b/guix/build/utils.scm
@@ -32,7 +32,8 @@
   #:use-module (rnrs bytevectors)
   #:use-module (rnrs io ports)
   #:re-export (alist-cons
-               alist-delete)
+               alist-delete
+               delete)
   #:export (%store-directory
             store-file-name?
             strip-store-file-name
-- 
2.13.0


[-- Attachment #2: Цифровая подпись OpenPGP --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

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

* bug#26805: Re-exporting ‘delete’ from (guix build utils)
  2017-05-14 23:15               ` Sergei Trofimovich
@ 2017-05-26 13:02                 ` Ludovic Courtès
  0 siblings, 0 replies; 11+ messages in thread
From: Ludovic Courtès @ 2017-05-26 13:02 UTC (permalink / raw)
  To: Sergei Trofimovich; +Cc: 26805-done

Hi Sergei,

Sergei Trofimovich <slyfox@inbox.ru> skribis:

> Attached 0001-reexport-delete-symbol-bound-at-modify-phases-syntax.patch
> that hopefully does exactly the same. This fix allows bootstrapping bash-minimal
> and gs-fonts with #:modules patch reverted \o/

[...]

> From 18d1c9cf8252891c5c98ebb18a9937b5881e4ddd Mon Sep 17 00:00:00 2001
> From: Sergei Trofimovich <slyfox@inbox.ru>
> Date: Sat, 13 May 2017 22:08:27 +0100
> Subject: [PATCH] reexport 'delete' symbol bound at %modify-phases syntax match
>
> * guix/build/utils.scm: reexport 'delete' binding

I added an explanatory comment and pushed as
8b14773ab6cafbd138e0c6cbfd2fc48818e2e0b5.

If there are core packages where we added #:modules ((srfi srfi-1) …),
we should probably remove it.  Packages with few dependents don’t matter
much.

Thoughts?

Thank you, and apologies for the delay!

Ludo’.

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

end of thread, other threads:[~2017-05-26 13:03 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-06 15:40 bug#26805: [PATCH] gs-fonts: add missing podule imports Sergei Trofimovich
2017-05-07 19:06 ` bug#26805: [PATCH] gs-fonts: add missing module imports Danny Milosavljevic
2017-05-09 10:20 ` bug#26805: [PATCH] gs-fonts: add missing podule imports Ludovic Courtès
2017-05-09 20:36   ` Sergei Trofimovich
2017-05-10 11:53     ` Ludovic Courtès
2017-05-10 20:41       ` Sergei Trofimovich
2017-05-11 20:49         ` Ludovic Courtès
2017-05-14 16:31           ` Sergei Trofimovich
2017-05-14 20:02             ` Ludovic Courtès
2017-05-14 23:15               ` Sergei Trofimovich
2017-05-26 13:02                 ` bug#26805: Re-exporting ‘delete’ from (guix build utils) 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).