GNU bug report logs - #77093
[PATCH rust-team 00/18] New Rust packaging workflow based on lockfile importer.

Previous Next

Package: guix-patches;

Reported by: Hilton Chain <hako <at> ultrarare.space>

Date: Tue, 18 Mar 2025 07:18:02 UTC

Severity: normal

Tags: patch

Full log


Message #98 received at 77093 <at> debbugs.gnu.org (full text, mbox):

From: Efraim Flashner <efraim <at> flashner.co.il>
To: Hilton Chain <hako <at> ultrarare.space>
Cc: Josselin Poiret <dev <at> jpoiret.xyz>, 77093 <at> debbugs.gnu.org,
 Simon Tournier <zimon.toutoune <at> gmail.com>, Mathieu Othacehe <othacehe <at> gnu.org>,
 Ludovic Courtès <ludo <at> gnu.org>,
 Tobias Geerinckx-Rice <me <at> tobias.gr>, Christopher Baines <guix <at> cbaines.net>
Subject: Re: [bug#77093] [PATCH rust-team 11/18] scripts: import: Support
 expressions defined by 'define.
Date: Tue, 18 Mar 2025 15:16:18 +0200
[Message part 1 (text/plain, inline)]
On Tue, Mar 18, 2025 at 08:29:49PM +0800, Hilton Chain wrote:
> On Tue, 18 Mar 2025 19:49:39 +0800,
> Efraim Flashner wrote:
> >
> > [1  <text/plain; utf-8 (quoted-printable)>]
> > On Tue, Mar 18, 2025 at 03:24:24PM +0800, Hilton Chain wrote:
> > > * guix/utils.scm (find-definition-location): New procedure.
> > > (find-definition-insertion-location): Define with it.
> > > * guix/scripts/import.scm (import-as-definitions, guix-import): Support
> > > expressions defined by 'define.
> > >
> > > Change-Id: I03118e1a3372028b4f0530964aba871b4a1a4d25
> > > ---
> > >  guix/scripts/import.scm | 20 +++++++++++++++-----
> > >  guix/utils.scm          | 27 +++++++++++++++++++--------
> > >  2 files changed, 34 insertions(+), 13 deletions(-)
> > >
> > > diff --git a/guix/scripts/import.scm b/guix/scripts/import.scm
> > > index 58a84d0db7..aaa3d26673 100644
> > > --- a/guix/scripts/import.scm
> > > +++ b/guix/scripts/import.scm
> > > @@ -30,6 +30,7 @@ (define-module (guix scripts import)
> > >    #:use-module (guix read-print)
> > >    #:use-module (guix utils)
> > >    #:use-module (srfi srfi-1)
> > > +  #:use-module (srfi srfi-26)
> > >    #:use-module (ice-9 format)
> > >    #:use-module (ice-9 match)
> > >    #:export (%standard-import-options
> > > @@ -83,7 +84,8 @@ (define (import-as-definitions importer args proc)
> > >          ((and expr (or ('package _ ...)
> > >                         ('let _ ...)))
> > >           (proc (package->definition expr)))
> > > -        ((and expr ('define-public _ ...))
> > > +        ((and expr (or ('define-public _ ...)
> > > +                       ('define _ ...)))
> > >           (proc expr))
> > >          ((expressions ...)
> > >           (for-each (lambda (expr)
> > > @@ -91,7 +93,8 @@ (define (import-as-definitions importer args proc)
> > >                         ((and expr (or ('package _ ...)
> > >                                        ('let _ ...)))
> > >                          (proc (package->definition expr)))
> > > -                       ((and expr ('define-public _ ...))
> > > +                       ((and expr (or ('define-public _ ...)
> > > +                                      ('define _ ...)))
> > >                          (proc expr))))
> > >                     expressions))
> > >          (x
> > > @@ -117,13 +120,20 @@ (define-command (guix-import . args)
> > >       (show-version-and-exit "guix import"))
> > >      ((or ("-i" file importer args ...)
> > >           ("--insert" file importer args ...))
> > > -     (let ((find-and-insert
> > > +     (let* ((definer?
> > > +              (cut member
> > > +                   <>
> > > +                   `(,@(if (member importer '("crate"))
> > > +                           '(define)
> > > +                           '())
> > > +                     define-public)))
> >
> > This part above seems like it would break the option to use 'guix import
> > crate' with the --insert flag for "normal" packages.  I question how
> > useful it currently is in that scenario since we normally have to strip
> > the rust- prefix from those packages anyway.
> 
> Hmmm, since the crate importer now checks both ‘define’ and ‘define-public’,
> there might be ordering issue when the module to insert uses ‘define’.  But it's
> still managable I think.

Reading it over again I think I was in need of more coffee. I thought
that the importer for cargo would only search for define, not for
define-public also.

As for needing to strip the rust- prefix, there's no change from our
current setup, so we can ignore that for now.

-- 
Efraim Flashner   <efraim <at> flashner.co.il>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
[signature.asc (application/pgp-signature, inline)]

This bug report was last modified 13 days ago.

Previous Next


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