[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Adding content-addressed URLs to https://guix.gnu.org/sources.json
From: |
Simon Tournier |
Subject: |
Re: Adding content-addressed URLs to https://guix.gnu.org/sources.json |
Date: |
Tue, 25 Apr 2023 11:59:00 +0200 |
Hi,
On Mon, 24 Apr 2023 at 18:41, Ludovic Courtès <ludovic.courtes@inria.fr> wrote:
> How does that sound?
The patch LGTM.
Cheers,
simon
PS: On a side note, building sources.json fails since ~1 month.
--8<---------------cut here---------------start------------->8---
$ guix repl -- build-package-metadata.scm /tmp/
guix repl: package metadata will be written to '/tmp/'
Backtrace:
[...]
In procedure %origin-patches-real: Wrong type argument: #<<computed-file> name:
"ruby-sorbet-runtime-0.5.10610.20230106174520-1fa668010-checkout" gexp: #<gexp
(begin (use-modules (guix build utils)) (copy-recursively (string-append
#<gexp-input #<origin #<<git-reference> url: "https://github.com/sorbet/sorbet"
commit: "0.5.10610.20230106174520-1fa668010" recursive?: #f> #<content-hash
sha256:0f21dl06alxwn6xgdxyrkd58plmmsv04z2bcls9ld4cfzsrs5537> ()
7fa67b7f6000>:out> "/gems/sorbet-" #<gexp-input "runtime":out>) #<gexp-output
out>)) gnu/packages/ruby.scm:14078:5 7fa67b701c90> guile: #f options:
(#:local-build? #t)>
--8<---------------cut here---------------end--------------->8---
Somehow, it reveals 3 currently uncovered cases: computed-file appearing
as,
1. ’origin’ in source field (ruby-sorbet-runtime)
2. ’inputs’ (racket-minimal)
3. ’snippet’ in origin in source field (chromium)
And I think we should not try to fix these cases on
build-package-metadata.scm side but instead investigate why they are
needed in the first place.
The regression in build-package-metadata is introduced by commit
7405e0c83f8f4eee5c4c40e809a40f2e4407a38c:
CommitDate: Tue Mar 28 22:22:24 2023 -0400
Author: Maxim Cournoyer <maxim.cournoyer@gmail.com>
gnu: Add ruby-sorbet-runtime.
* gnu/packages/ruby.scm (ruby-sorbet-runtime): New variable.
(sorbet-version): New variable.
(sorbet-monorepo): New variable.
(make-sorbet-gem-source): New procedure.
(define (make-sorbet-gem-source gem)
"Return the source of GEM, a sub-directory."
(computed-file
(string-append "ruby-sorbet-" gem "-" sorbet-version "-checkout")
(with-imported-modules (source-module-closure '((guix build utils)))
#~(begin
(use-modules (guix build utils))
(copy-recursively (string-append #$sorbet-monorepo
"/gems/sorbet-" #$gem)
#$output)))))
[...]
(define-public ruby-sorbet-runtime
(package
(name "ruby-sorbet-runtime")
(version sorbet-version)
(source (make-sorbet-gem-source "runtime"))
This pattern appears to me wrong. It should use ’snippet’. And if the
point is to have a meaningful path in /gnu/store, as it is the case with
icecat or linux or emacs-company-box, the current way is
’computed-origin-method’ from (guix packages).
For ’ruby-sorbet-runtime’, the fix seems ’computed-origin-method’.
Well, some data behind ’computed-file’ appears in two other places:
./gnu/packages/racket.scm:505: (computed-file
./gnu/packages/chromium.scm:348: (computed-file
For ’chromium’, it appears to me somehow overcomplicated to extract all
the layers of patches; the work does not appears to me worth. Somehow,
I would accept that “our way“ to build Chromium would be lost.
It remains the case of ’racket-minimal’ – which is somehow a corner case
of ’package-direct-sources’,
--8<---------------cut here---------------start------------->8---
scheme@(guix-user)> ,use(gnu packages racket)
scheme@(guix-user)> racket-minimal
$1 = #<package racket-minimal@8.7 gnu/packages/racket.scm:542 7f88dea4b630>
scheme@(guix-user)> (package-direct-sources racket-minimal)
$2 = ()
--8<---------------cut here---------------end--------------->8---
However, the case is indeed covered by the chain:
+ racket-minimal lists the input racket-vm-cs
+ racket-vm-cs inherits from racket-vm-bc
+ racket-vm-bc inherits from racket-vm-cgc
+ racket-vm-cgc has the source %racket-origin
--8<---------------cut here---------------start------------->8---
scheme@(guix-user)> (package-direct-sources (@@ (gnu packages racket)
racket-vm-cgc))
$3 = (#<origin #<<git-reference> url: "https://github.com/racket/racket"
commit: "v8.7" recursive?: #f> #<content-hash
sha256:0agwa1nrv8mizkqg9nffjli00djyx1r9n6y6b6ry7k13pb6i7xnj>
("/gnu/store/g6xlx4ik4skazfdl0a9vbd5r0lmqnnd9-guix-module-union/share/guile/site/3.0/gnu/packages/patches/racket-backport-8.7-pkg-strip.patch"
"/gnu/store/g6xlx4ik4skazfdl0a9vbd5r0lmqnnd9-guix-module-union/share/guile/site/3.0/gnu/packages/patches/racket-chez-scheme-bin-sh.patch"
"/gnu/store/g6xlx4ik4skazfdl0a9vbd5r0lmqnnd9-guix-module-union/share/guile/site/3.0/gnu/packages/patches/racket-rktio-bin-sh.patch"
"/gnu/store/g6xlx4ik4skazfdl0a9vbd5r0lmqnnd9-guix-module-union/share/guile/site/3.0/gnu/packages/patches/racket-zuo-bin-sh.patch")
7f88dea48720>)
--8<---------------cut here---------------end--------------->8---
Therefore the source data of ’racket-minimal’ is correctly archived.
WDYT to modify ’ruby-sorbet-runtime’ and let ’chromium’ uncovered?
Cheers,
simon
- SWH: extend sources.json and Mercurial (or not Git and not tarball), Simon Tournier, 2023/04/04
- Adding content-addressed URLs to https://guix.gnu.org/sources.json, Ludovic Courtès, 2023/04/24
- Re: Adding content-addressed URLs to https://guix.gnu.org/sources.json,
Simon Tournier <=
- Re: Adding content-addressed URLs to https://guix.gnu.org/sources.json, Ludovic Courtès, 2023/04/25
- Re: Adding content-addressed URLs to https://guix.gnu.org/sources.json, Ludovic Courtès, 2023/04/25
- Re: Adding content-addressed URLs to https://guix.gnu.org/sources.json, Maxim Cournoyer, 2023/04/25
- Re: Adding content-addressed URLs to https://guix.gnu.org/sources.json, Simon Tournier, 2023/04/28
- Re: Adding content-addressed URLs to https://guix.gnu.org/sources.json, Maxim Cournoyer, 2023/04/30