[PATCH 0/2] Finalize renaming of `sqlite-register' (fix `guix system init')

  • Done
  • quality assurance status badge
Details
3 participants
  • Wojtek Kosior
  • Christopher Baines
  • Tomas Volf
Owner
unassigned
Submitted by
Wojtek Kosior
Severity
normal

Debbugs page

W
W
Wojtek Kosior wrote on 6 Apr 13:30 -0700
(address . guix-patches@gnu.org)(name . Wojtek Kosior)(address . koszko@koszko.org)
cover.1712435265.git.koszko@koszko.org
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
W
W
Wojtek Kosior wrote on 6 Apr 13:37 -0700
[PATCH 1/2] scripts: system: Rename `sqlite-register'.
(address . 70245@debbugs.gnu.org)(name . Wojtek Kosior)(address . koszko@koszko.org)
56efa64d914f75e8bb147b1f4b46bb1f21efc78b.1712435265.git.koszko@koszko.org
* 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(-)

Toggle diff (39 lines)
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
W
W
Wojtek Kosior wrote on 6 Apr 13:37 -0700
[PATCH 2/2] store: database: Use correct function name in assertion.
(address . 70245@debbugs.gnu.org)(name . Wojtek Kosior)(address . koszko@koszko.org)
7ccff5eb36b8ffe0713660f843165677447e1023.1712435265.git.koszko@koszko.org
* 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(-)

Toggle diff (18 lines)
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
T
T
Tomas Volf wrote on 7 Apr 14:13 -0700
RE: [PATCH 0/2] Finalize renaming of `sqlite-register' (fix `guix system init')
(address . 70245@debbugs.gnu.org)
ZhMMhG4VA04gc4yg@ws
Hello,

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

Tomas


--
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEt4NJs4wUfTYpiGikL7/ufbZ/wakFAmYTDIQACgkQL7/ufbZ/
walIKQ/+OKE0w8R4EXo9BUW9zvYC9VWA5+tDE8sUYS1KQduxw8FDYTbRnyqsM5bK
0cHI2/+LYPs6CihUgVgMp7MiBLUIVALmtmhQ7/m4xoC6FT8tC1gpTduhZ4JijOP4
GOasWGur02JNY45aNjpRJ2UUJBtg4lHGQmtiTjX1TvKwdg7v947D/KmjROyOMxMm
RyYJZawvX281nkIIAjVfIad4BSE0w9WFd2nTVTmflI0kiZtz5ag8Xxb2zS445w33
hSWCKjJu5/LhLK3vRaGVqaUPMQO2vik7Df3/WQz91BITRbM5dkt2/NMFpkqCsB43
EBWcvjs+Pe2p1O6nMDM5pBMx/G40PJ3EbibHHaWMRLyUlYppsMH5bcX/agMHJO/r
bHzNLcm+hkd2SwtoZ6FQIDpsl076DNkVJGJmiX4TtEti/1te7agVEzMJ9YnoVJI4
41zMPbuFrO3bUrzlEO2RcHcvmZJdwUVhX5qeefPR7/h+or9F8oGvKFka/aMw3PpC
XJtfMGpp3JGSohleYeOFsknljQGhNAmImEawxgiZz2Q3lGsrT+5RrGkO7bz1uxx5
yQPtJpnRgmMHqCxHydYEdA2VPa+a20iA3Y0iaM0OjK4ouMw9RKmgDTmomsQsaRQk
Yi9CxPBFmh1ci0dzljv7geVNjyneS+BAL2higyB3b7jpLBV2C9s=
=2/VM
-----END PGP SIGNATURE-----


C
C
Christopher Baines wrote on 8 Apr 07:54 -0700
Re: [bug#70245] [PATCH 0/2] Finalize renaming of `sqlite-register' (fix `guix system init')
(name . Wojtek Kosior)(address . koszko@koszko.org)(address . 70245-done@debbugs.gnu.org)
87r0ffewgx.fsf@cbaines.net
Wojtek Kosior <koszko@koszko.org> writes:

Toggle quote (11 lines)
> 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
-----BEGIN PGP SIGNATURE-----

iQKlBAEBCgCPFiEEPonu50WOcg2XVOCyXiijOwuE9XcFAmYUBR5fFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF
ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcRHG1haWxAY2Jh
aW5lcy5uZXQACgkQXiijOwuE9XeQCw//ddQVmmp3aqBmeJlPb8W5VOr087FPan9t
oJ1J1J7+AEOuG2u1EOiqiwyRsFWu0300q2zOpGIdj1eE7s4Lbf9cH2XMlwLUeoqH
ojg2oNuqSnJSFxRabhen9MS+bEBHaIaVTRpHFmigZrUuf98RVSC3ctva7gkxkPpr
1uTYig4rwQSoLem2w6QQQ/fHsyE+9JhADLBtiF8W5VCGy/ZiboG/oqCw35CZHfm+
ekSaxE1KeqE//MCrPI2O7ay5WqrBTGn2unar07vdg1XPpCaR2X/rhnZ7ixAKHFfm
/PPbBTIuGZVByT0IHIscMGkM+ncuNc/8cxlGJX+8Wwk+JyvLUkj4PJhByEo3r75+
9jBBYWqpBRv8mEO2TVabipNBZ3UApumxiJeMxQtAQ0OGqY4xm+PzvCjPwhvzGR+P
HXsfLkY32HgKDB7NRoFahQz0gn4VoSuRujqZj64LgFioaz2SNSGherPuJBQG6cur
yEhiSrecyweoYMle1fV+YLQwRAnxivUMNF9T152smq0DzB41QlJmdmg/U+lrGx2+
0QdNwRLjAJqEId8Zg395lUWV/VucOe92NDZtZYJ9Znm5SIYauKHDsl0+4ic9A59Y
vmlKBVUXjUWpduykoXO5Kxo1hrHHO5zISVoRA1pGJ4VUxndFlnxUxvlVitC7hYVQ
igFxaRVmQnE=
=SU9W
-----END PGP SIGNATURE-----

Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 70245@patchwise.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 70245
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch