unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
To: Simon Tournier <zimon.toutoune@gmail.com>
Cc: "Ludovic Courtès" <ludovic.courtes@inria.fr>,
	"Björn Höfling" <bjoern.hoefling@bjoernhoefling.de>,
	guix-devel@gnu.org, "Lars-Dominik Braun" <lars@6xq.net>
Subject: Re: Adding content-addressed URLs to https://guix.gnu.org/sources.json
Date: Tue, 25 Apr 2023 09:52:50 -0400	[thread overview]
Message-ID: <87354oqdal.fsf@gmail.com> (raw)
In-Reply-To: <86pm7sb7vf.fsf@gmail.com> (Simon Tournier's message of "Tue, 25 Apr 2023 11:59:00 +0200")

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


  parent reply	other threads:[~2023-04-25 13:53 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <ZAmrhccMfljep8+i@noor.fritz.box>
     [not found] ` <20230312220021.22bfff4f@tangletp>
     [not found]   ` <878rfwgbng.fsf@gnu.org>
2023-04-03 21:42     ` SWH: extend sources.json and Mercurial (or not Git and not tarball) Simon Tournier
2023-04-24 16:41       ` Adding content-addressed URLs to https://guix.gnu.org/sources.json Ludovic Courtès
2023-04-25  9:59         ` Simon Tournier
2023-04-25 12:40           ` Ludovic Courtès
2023-04-25 12:59           ` Ludovic Courtès
2023-04-25 13:52           ` Maxim Cournoyer [this message]
2023-04-28 13:39             ` Simon Tournier
2023-05-01  0:39               ` Maxim Cournoyer
2023-05-02  7:39                 ` Ludovic Courtès
2023-05-02 12:52                   ` Maxim Cournoyer
2023-05-02 17:35                     ` Simon Tournier
2023-05-04  7:13                     ` Ludovic Courtès
2023-05-07 21:25                       ` Ludovic Courtès
2023-05-08  1:06                         ` Maxim Cournoyer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87354oqdal.fsf@gmail.com \
    --to=maxim.cournoyer@gmail.com \
    --cc=bjoern.hoefling@bjoernhoefling.de \
    --cc=guix-devel@gnu.org \
    --cc=lars@6xq.net \
    --cc=ludovic.courtes@inria.fr \
    --cc=zimon.toutoune@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).