unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
To: Simon Tournier <zimon.toutoune@gmail.com>
Cc: 65352@debbugs.gnu.org, "Ludovic Courtès" <ludo@gnu.org>
Subject: [bug#65352] time-machine, unavailable network or Savannah down
Date: Wed, 06 Sep 2023 13:41:57 -0400	[thread overview]
Message-ID: <871qfb5hcq.fsf@gmail.com> (raw)
In-Reply-To: <86ledjoaly.fsf@gmail.com> (Simon Tournier's message of "Wed, 06 Sep 2023 12:32:41 +0200")

Hi Simon, Ludovic,

Simon Tournier <zimon.toutoune@gmail.com> writes:

> Hi Maxim,
>
> Let start another branch in that thread of #65352. :-)

Alright :-).

> Let start the discussion on good basis, let start with an example:
>
> $ guix describe
> Generation 26   Jul 12 2023 09:13:39    (current)
>   guix 4a027d2
>     repository URL: https://git.savannah.gnu.org/git/guix.git
>     branch: master
>     commit: 4a027d2b0ee68e39f21f6802a8cd1751d3065330
>
> $ guix time-machine --commit=4a027d2 -- describe
> Updating channel 'guix' from Git repository at 'https://git.savannah.gnu.org/git/guix.git'...
> substitute: updating substitutes from 'https://ci.guix.gnu.org'... 100.0%
> substitute: updating substitutes from 'https://bordeaux.guix.gnu.org'... 100.0%
> building /gnu/store/sg8ca36rlbh4il6jy8dk2gr33lxm4z8q-compute-guix-derivation.drv...
> Computing Guix derivation for 'x86_64-linux'... |
> substitute: updating substitutes from 'https://ci.guix.gnu.org'... 100.0%
> substitute: updating substitutes from 'https://bordeaux.guix.gnu.org'... 100.0%
> The following derivations will be built:
> [...]
> building profile with 1 package...
>   guix 4a027d2
>     repository URL: https://git.savannah.gnu.org/git/guix.git
>     commit: 4a027d2b0ee68e39f21f6802a8cd1751d3065330
>
>
> So far, so good.  Here all is cached and so on.  Now, let make
> git.savannah.gnu.org unreachable by tweaking some stuff.  Then,
>
> $ guix time-machine --commit=4a027d2 -- describe
> guix time-machine: error: Git error: failed to resolve address for git.savannah.gnu.org: Name or service not known
>
>
> Do we agree it is bug?  Do we agree that the behaviour is not POLA?

Thanks for the example, it helps :-).  I agree it's an undesirable
behavior to reach to the network after having (supposedly) cached the
very same ref.

[...]

> On Tue, 05 Sep 2023 at 22:00, Maxim Cournoyer <maxim.cournoyer@gmail.com> wrote:
>
>> I don't know if we want to consider tags are immutable or not; the
>> safest is to consider them an *not* immutable, which is what we had been
>> doing.  I agree it doesn't cover all the potential git refspecs; we can
>> get there if we want (although I suppose it's uncommon for someone to
>> try 'guix time-machine --commit=v1.3.0-47405-ge0767a24d0' or similar).
>
> [...]
>
>> I'm not sure if short commit IDs should be treated as immutable, since
>> in theory they can collide; the safest would be to check if there are
>> collisions and report an error if there is; and this requires fetching
>> new objects first.
>
> Well, the behaviour that I want is that it just works whatever the
> status of Savannah when I have a local Git ref that matches what I
> provide to ’guix time-machine’ (or guix pull or else).
>
> I think you are inferring a rule from two corner-cases.  And from my
> point of view, there are only hypothetical. :-)

Also, from the current state of things (the code) :-).  But I agree that
there seems to be space for improvements here.

> 1. About tag.  The ones from upstream are defacto immutable.  It is
> uncommon that people set local tag under ~/.cache/guix/checkouts.  And,
> the failure when Savannah is unreachable appears to me more annoying
> than hypothetical mutable tags.  Therefore, I propose what I already
> proposed. :-) It will make it works for most of the cases.

More annoying but also, much more likely!

> Even, what would happen if a tag is changed?  The user does not get the
> same inferior for two invocations.  The question is: what triggers the
> update of the cached checkout?
>
> What is the consequence for not updating when the user-specified Git ref
> is a mutable one (tag or else)?  Here, I am proposing to delay the
> update until the next “guix pull” or “guix time-machine -q”, well until
> the user invokes a command with a Git ref that does not belong to the
> local cached checkout.
>
> I do not see why this delay is a problem.  And it avoids an update.
>
>
> 2. About short commit IDs.  The same reasoning applies. :-)
>
> About the collision, it is the same.  It only delays the collision
> report.

Sounds reasonable; it'll reduce some load from Savannah ;-).

>
> All in all, I think that reference-available? needs to check if the Git
> ref belongs to the local cached checkout and that’s all.  If it is, use
> it, else update the local cached checkout.
>
> At time t, the user-specificity Git ref can match some local Git ref but
> not the upstream state.  And so?
>
> Somehow, I am considering the local cached checkout as the primary
> reference for looking up Git ref.
>
> Do you see a potential issue that I am missing?

So all the refs such as commit(ish) or tags would be referenced locally,
and branches such as 'master' would still trigger an update.

LGTM, but I'd be curious to hear what Ludovic thinks, since their
original code treated tags as mutable (which they technically are, but I
agree to the value of treating them as immutable, and it appears low
risk to me).

-- 
Thanks,
Maxim




  parent reply	other threads:[~2023-09-06 17:43 UTC|newest]

Thread overview: 67+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1689823648.git.maxim.cournoyer@gmail.com>
2023-07-20 16:34 ` [bug#64746] [PATCH 2/2] scripts: time-machine: Error when attempting to visit too old commits Maxim Cournoyer
2023-07-22  2:00   ` Maxim Cournoyer
2023-08-08 15:58     ` Ludovic Courtès
2023-08-10 14:47       ` Maxim Cournoyer
2023-08-10 16:56         ` Ludovic Courtès
2023-08-11  7:19           ` Josselin Poiret via Guix-patches via
2023-08-12 20:32             ` Ludovic Courtès
2023-08-15 18:57       ` Maxim Cournoyer
2023-08-15 16:14   ` Ludovic Courtès
2023-08-16 14:46     ` Simon Tournier
2023-08-16 18:41       ` Maxim Cournoyer
2023-08-17 14:06         ` [bug#65352] Fix time-machine and network Simon Tournier
2023-08-17 14:09           ` [bug#65352] [PATCH 1/2] guix: git: Fix the procedure reference-available? Simon Tournier
2023-08-17 14:09             ` [bug#65352] [PATCH 2/2] scripts: pull: Remove unused reference pair Simon Tournier
2023-08-17 15:41               ` [bug#65352] Fix time-machine and network Maxim Cournoyer
2023-08-17 16:08                 ` Simon Tournier
2023-08-23  2:56                   ` Maxim Cournoyer
2023-08-23  8:32                     ` Simon Tournier
2023-08-23 20:25                       ` Maxim Cournoyer
2023-08-21 14:00                 ` Ludovic Courtès
2023-08-21 15:58                   ` Maxim Cournoyer
2023-08-22 16:27                     ` Ludovic Courtès
2023-08-23  2:14                       ` Maxim Cournoyer
2023-08-21 13:57             ` Ludovic Courtès
2023-09-04  8:49             ` Ludovic Courtès
2023-09-04 11:34               ` Simon Tournier
2023-09-05 20:33                 ` Maxim Cournoyer
2023-09-05 20:48                   ` Simon Tournier
2023-09-04  9:32             ` Ludovic Courtès
2023-09-04 17:37               ` Simon Tournier
2023-09-06  0:22                 ` Maxim Cournoyer
2023-09-05 20:39               ` Maxim Cournoyer
2023-09-05 20:56                 ` Simon Tournier
2023-09-06  2:39                   ` Maxim Cournoyer
2023-09-05 13:24             ` bug#65352: " Maxim Cournoyer
2023-09-05 13:43               ` [bug#65352] " Simon Tournier
2023-09-06  0:04                 ` bug#65352: " Maxim Cournoyer
2023-09-06  0:58                   ` [bug#65352] " Simon Tournier
2023-09-06  2:00                     ` Maxim Cournoyer
2023-09-07 11:15                       ` Simon Tournier
2023-09-06 10:32           ` [bug#65352] time-machine, unavailable network or Savannah down Simon Tournier
2023-09-06 14:17             ` [bug#65352] [PATCH v2] DRAFT git: Avoid touching the network unless needed in 'reference-available?' Simon Tournier
2023-09-13 20:16               ` [bug#65352] Fix time-machine and network Ludovic Courtès
2023-09-13  0:32                 ` Simon Tournier
2023-09-14  8:50                   ` Ludovic Courtès
2023-09-14  9:04                   ` Ludovic Courtès
2023-09-14  9:42                     ` Simon Tournier
2023-09-22 13:54                       ` bug#65352: " Simon Tournier
2023-09-25  9:32                     ` [bug#65352] " Ludovic Courtès
2023-09-25  9:57                       ` Simon Tournier
2023-09-25 11:21                         ` Simon Tournier
2023-09-25 15:01                         ` Ludovic Courtès
2023-09-25 15:58                           ` Simon Tournier
2023-09-06 17:41             ` Maxim Cournoyer [this message]
2023-09-06 23:21               ` [bug#65352] time-machine, unavailable network or Savannah down Simon Tournier
2023-08-15 19:44   ` [bug#64746] [PATCH v2 1/3] git: Clarify commit relation reference in doc Maxim Cournoyer
2023-08-15 19:44     ` [bug#64746] [PATCH v2 2/3] pull: Tag commit argument with 'tag-or-commit Maxim Cournoyer
2023-08-16 15:02       ` Simon Tournier
2023-08-16 18:47         ` Maxim Cournoyer
2023-08-17 14:45           ` Simon Tournier
2023-08-17 18:16             ` Maxim Cournoyer
2023-08-17 18:47               ` Simon Tournier
2023-08-23  2:54                 ` [bug#64746] [PATCH 2/2] scripts: time-machine: Error when attempting to visit too old commits Maxim Cournoyer
2023-08-23  8:27                   ` Simon Tournier
2023-08-15 19:44     ` [bug#64746] [PATCH v2 3/3] " Maxim Cournoyer
2023-08-16 15:39       ` Simon Tournier
2023-08-17  1:41         ` bug#64746: " Maxim Cournoyer

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=871qfb5hcq.fsf@gmail.com \
    --to=maxim.cournoyer@gmail.com \
    --cc=65352@debbugs.gnu.org \
    --cc=ludo@gnu.org \
    --cc=zimon.toutoune@gmail.com \
    /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).