[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Adding content-addressed URLs to

From: Simon Tournier
Subject: Re: Adding content-addressed URLs to
Date: Tue, 25 Apr 2023 11:59:00 +0200


On Mon, 24 Apr 2023 at 18:41, Ludovic Courtès <> wrote:

> How does that sound?

The patch LGTM.


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/'


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: ""; 
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

 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

  CommitDate: Tue Mar 28 22:22:24 2023 -0400
  Author:     Maxim Cournoyer <>

  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."
       (string-append "ruby-sorbet-" gem "-" sorbet-version "-checkout")
       (with-imported-modules (source-module-closure '((guix build utils)))
             (use-modules (guix build utils))
             (copy-recursively (string-append #$sorbet-monorepo
                                              "/gems/sorbet-" #$gem)

    (define-public ruby-sorbet-runtime
        (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) 
$3 = (#<origin #<<git-reference> url: ""; 
commit: "v8.7" recursive?: #f> #<content-hash 
--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?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]