Subject: bug#26805: [PATCH] gs-fonts: add missing podule imports

From: Sergei Trofimovich <[email-masked]>
Date: Sun, 14 May 2017 17:31:28 +0100

On Thu, 11 May 2017 22:49:05 +0200
[email-masked] (Ludovic Courtès) wrote:

> Hi!
> 
> Sergei Trofimovich <[email-masked]> skribis:
> 
> > On Wed, 10 May 2017 13:53:41 +0200
> > [email-masked] (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