unofficial mirror of bug-guix@gnu.org 
 help / color / mirror / code / Atom feed
From: Ricardo Wurmus <rekado@elephly.net>
To: 64358@debbugs.gnu.org
Cc: ludo@gnu.org
Subject: bug#64358: “guix refresh” chokes on cran.scm
Date: Mon, 03 Jul 2023 21:29:09 +0200	[thread overview]
Message-ID: <87r0pou6h3.fsf@elephly.net> (raw)
In-Reply-To: <handler.64358.B.168807427428659.ack@debbugs.gnu.org>

> Prior to that we see warnings like this:
>
> /home/rekado/dev/gx/branches/master/gnu/packages/cran.scm:36350:2: r-readtext: updating from version 0.82 to version 0.90...
> /home/rekado/dev/gx/branches/master/gnu/packages/cran.scm:36350:2: warning: r-readtext: no `version' field in source; skipping
>
> It’s as if the position in the file has been lost and it tries to update
> the definition of r-readtext that is no longer where the current port
> position is.

It seems that this is indeed the problem.  The value for a <package>’s
“location” field is known at compile/eval time and this value will not
be correct after the first substantial edit has taken place.

I see these options:

1 - pass a value to “update-package” that corresponds to line changes so
  far and let it return an updated value, making “update-package” aware
  of file changes.  This would be rather ugly.

2 - compute the location of the target package anew if the file it is
  located in has since been edited.

3 - never rely on the line number of the package location value; just open
  the specified file and always search it for a package definition.
  Optionally take the line number into account as a starting point for a
  search in both directions.

4 - integrate changes with git, so that all edits are commits that are
  applied to the very same base commit.

The third option seems the most reasonable and lightweight to me.

-- 
Ricardo




  parent reply	other threads:[~2023-07-03 19:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-29 21:26 bug#64358: “guix refresh” chokes on cran.scm Ricardo Wurmus
     [not found] ` <handler.64358.B.168807427428659.ack@debbugs.gnu.org>
2023-07-03 19:29   ` Ricardo Wurmus [this message]
2023-07-07 13:42     ` Ludovic Courtès
2023-07-07 20:13       ` Ricardo Wurmus
2023-07-10 18:41 ` bug#64358: [PATCH] refresh: Sort update specs by package location Ricardo Wurmus
2023-07-10 21:49   ` Ludovic Courtès
2023-07-10 22:17     ` Ricardo Wurmus
2023-07-14 13:19       ` Ludovic Courtès
2023-07-12 12:35 ` bug#64358: “guix refresh” chokes on cran.scm Ricardo Wurmus

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r0pou6h3.fsf@elephly.net \
    --to=rekado@elephly.net \
    --cc=64358@debbugs.gnu.org \
    --cc=ludo@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).