GNU bug report logs - #70245
[PATCH 0/2] Finalize renaming of `sqlite-register' (fix `guix system init')

Previous Next

Package: guix-patches;

Reported by: Wojtek Kosior <koszko <at> koszko.org>

Date: Sat, 6 Apr 2024 20:36:01 UTC

Severity: normal

Tags: patch

Done: Christopher Baines <mail <at> cbaines.net>

To reply to this bug, email your comments to 70245 AT debbugs.gnu.org.
There is no need to reopen the bug first.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to guix <at> cbaines.net, dev <at> jpoiret.xyz, ludo <at> gnu.org, othacehe <at> gnu.org, rekado <at> elephly.net, zimon.toutoune <at> gmail.com, me <at> tobias.gr, guix-patches <at> gnu.org:
bug#70245; Package guix-patches. (Sat, 06 Apr 2024 20:36:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Wojtek Kosior <koszko <at> koszko.org>:
New bug report received and forwarded. Copy sent to guix <at> cbaines.net, dev <at> jpoiret.xyz, ludo <at> gnu.org, othacehe <at> gnu.org, rekado <at> elephly.net, zimon.toutoune <at> gmail.com, me <at> tobias.gr, guix-patches <at> gnu.org. (Sat, 06 Apr 2024 20:36:02 GMT) Full text and rfc822 format available.

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

From: Wojtek Kosior <koszko <at> koszko.org>
To: guix-patches <at> gnu.org
Cc: Wojtek Kosior <koszko <at> koszko.org>
Subject: [PATCH 0/2] Finalize renaming of `sqlite-register' (fix `guix system
 init')
Date: Sat,  6 Apr 2024 22:30:05 +0200
Recently, guix/store/database.scm had function `sqlite-register' renamed but the
old name kept being used elsewhere, causing breakage.

Wojtek Kosior (2):
  scripts: system: Rename `sqlite-register'.
  store: database: Use correct function name in assertion.

 guix/scripts/system.scm | 19 ++++++++++---------
 guix/store/database.scm |  5 +++--
 2 files changed, 13 insertions(+), 11 deletions(-)


base-commit: 7988ca6a480a7648971c06edc0dfb8da6fd0777b
-- 
2.41.0





Information forwarded to guix <at> cbaines.net, dev <at> jpoiret.xyz, ludo <at> gnu.org, othacehe <at> gnu.org, rekado <at> elephly.net, zimon.toutoune <at> gmail.com, me <at> tobias.gr, guix-patches <at> gnu.org:
bug#70245; Package guix-patches. (Sat, 06 Apr 2024 20:38:01 GMT) Full text and rfc822 format available.

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

From: Wojtek Kosior <koszko <at> koszko.org>
To: 70245 <at> debbugs.gnu.org
Cc: Wojtek Kosior <koszko <at> koszko.org>
Subject: [PATCH 1/2] scripts: system: Rename `sqlite-register'.
Date: Sat,  6 Apr 2024 22:37:07 +0200
* guix/scripts/system.scm (define-module): #:autoload `register-valid-path'
  instead of `sqlite-register'.
  (copy-item): Call it with the new name.

Change-Id: I24f71f822a5f400a47adee43f61184a4fbcb9741
---
 guix/scripts/system.scm | 19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
index bf3d2f9044..67020a2aab 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -35,7 +35,7 @@ (define-module (guix scripts system)
   #:use-module (guix store)
   #:autoload   (guix base16) (bytevector->base16-string)
   #:autoload   (guix store database)
-               (sqlite-register store-database-file call-with-database)
+               (register-valid-path store-database-file call-with-database)
   #:autoload   (guix build store-copy) (copy-store-item)
   #:use-module (guix describe)
   #:use-module (guix gexp)
@@ -158,14 +158,15 @@ (define* (copy-item item info target db
     (copy-store-item item target
                      #:deduplicate? #t)
 
-    (sqlite-register db
-                     #:path item
-                     #:references (path-info-references info)
-                     #:deriver (path-info-deriver info)
-                     #:hash (string-append
-                             "sha256:"
-                             (bytevector->base16-string (path-info-hash info)))
-                     #:nar-size (path-info-nar-size info))))
+    (register-valid-path db
+                         #:path item
+                         #:references (path-info-references info)
+                         #:deriver (path-info-deriver info)
+                         #:hash (string-append
+                                 "sha256:"
+                                 (bytevector->base16-string
+                                  (path-info-hash info)))
+                         #:nar-size (path-info-nar-size info))))
 
 (define* (copy-closure item target
                        #:key (log-port (current-error-port)))
-- 
2.41.0





Information forwarded to guix <at> cbaines.net, dev <at> jpoiret.xyz, ludo <at> gnu.org, othacehe <at> gnu.org, rekado <at> elephly.net, zimon.toutoune <at> gmail.com, me <at> tobias.gr, guix-patches <at> gnu.org:
bug#70245; Package guix-patches. (Sat, 06 Apr 2024 20:38:02 GMT) Full text and rfc822 format available.

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

From: Wojtek Kosior <koszko <at> koszko.org>
To: 70245 <at> debbugs.gnu.org
Cc: Wojtek Kosior <koszko <at> koszko.org>
Subject: [PATCH 2/2] store: database: Use correct function name in assertion.
Date: Sat,  6 Apr 2024 22:37:08 +0200
* guix/store/database.scm (register-valid-path): Replace "sqlite-register"
  with "register-valid-path" as argument to `assert-integer'.

Change-Id: Id93687e90d0a806d715006ca0b2498a1d10cfba6
---
 guix/store/database.scm | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/guix/store/database.scm b/guix/store/database.scm
index 58d3871e85..a847f9d2f0 100644
--- a/guix/store/database.scm
+++ b/guix/store/database.scm
@@ -247,8 +247,9 @@ (define* (register-valid-path db #:key path (references '())
     (time-second time))
 
   ;; Make sure NAR-SIZE is valid.
-  (assert-integer "sqlite-register" positive? #:nar-size nar-size)
-  (assert-integer "sqlite-register" (cut >= <> 0) #:time registration-time)
+  (assert-integer "register-valid-path" positive? #:nar-size nar-size)
+  (assert-integer "register-valid-path" (cut >= <> 0)
+                  #:time registration-time)
 
   (define id
     (let ((existing-id (valid-path-id db path)))
-- 
2.41.0





Information forwarded to guix-patches <at> gnu.org:
bug#70245; Package guix-patches. (Sun, 07 Apr 2024 21:14:02 GMT) Full text and rfc822 format available.

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

From: Tomas Volf <~@wolfsden.cz>
To: 70245 <at> debbugs.gnu.org
Subject: RE: [PATCH 0/2] Finalize renaming of `sqlite-register' (fix `guix
 system init')
Date: Sun, 7 Apr 2024 23:13:40 +0200
[Message part 1 (text/plain, inline)]
Hello,

just confirming that this is indeed a problem, I hit this yesterday[0].

Tomas

0: https://github.com/vpsfreecz/vpsadminos/pull/66#issuecomment-2041177372

--
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.
[signature.asc (application/pgp-signature, inline)]

Reply sent to Christopher Baines <mail <at> cbaines.net>:
You have taken responsibility. (Mon, 08 Apr 2024 14:55:03 GMT) Full text and rfc822 format available.

Notification sent to Wojtek Kosior <koszko <at> koszko.org>:
bug acknowledged by developer. (Mon, 08 Apr 2024 14:55:03 GMT) Full text and rfc822 format available.

Message #19 received at 70245-done <at> debbugs.gnu.org (full text, mbox):

From: Christopher Baines <mail <at> cbaines.net>
To: Wojtek Kosior <koszko <at> koszko.org>
Cc: 70245-done <at> debbugs.gnu.org
Subject: Re: [bug#70245] [PATCH 0/2] Finalize renaming of `sqlite-register'
 (fix `guix system init')
Date: Mon, 08 Apr 2024 15:54:22 +0100
[Message part 1 (text/plain, inline)]
Wojtek Kosior <koszko <at> koszko.org> writes:

> Recently, guix/store/database.scm had function `sqlite-register' renamed but the
> old name kept being used elsewhere, causing breakage.
>
> Wojtek Kosior (2):
>   scripts: system: Rename `sqlite-register'.
>   store: database: Use correct function name in assertion.
>
>  guix/scripts/system.scm | 19 ++++++++++---------
>  guix/store/database.scm |  5 +++--
>  2 files changed, 13 insertions(+), 11 deletions(-)

I forgot to update the issue, but I pushed these patches to master as
c3dfb14f9be7479057036d3fe7744828d2c1a31a.

Chris
[signature.asc (application/pgp-signature, inline)]

This bug report was last modified 25 days ago.

Previous Next


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