guix-devel
[Top][All Lists]
Advanced

[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: Maxim Cournoyer
Subject: Re: Adding content-addressed URLs to https://guix.gnu.org/sources.json
Date: Tue, 25 Apr 2023 09:52:50 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux)

Hi Simon,

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

[...]

> $ 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)>
>
>
>
> 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’.

Per the source, IIRC, 'computed-origin-method' is also considered a hack
or workaround around the fact that a snippet can't affect the name of a
source.  But it's a well established one.  That was indeed the rationale
here (to have meaningful top level directory names matching the source),
which is worth it in my opinion.

-- 
Thanks,
Maxim



reply via email to

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