From: Maxim Cournoyer <maxim.cournoyer@gmail.com>
To: "Ludovic Courtès" <ludovic.courtes@inria.fr>
Cc: "Simon Tournier" <zimon.toutoune@gmail.com>,
"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, 02 May 2023 08:52:59 -0400 [thread overview]
Message-ID: <871qjy51zo.fsf@gmail.com> (raw)
In-Reply-To: <87v8hb9o74.fsf@inria.fr> ("Ludovic Courtès"'s message of "Tue, 02 May 2023 09:39:43 +0200")
Hi Ludo,
Ludovic Courtès <ludovic.courtes@inria.fr> writes:
> Hello,
>
> Maxim Cournoyer <maxim.cournoyer@gmail.com> skribis:
>
>> Simon Tournier <zimon.toutoune@gmail.com> writes:
>
> [...]
>
>>> I agree that any file-like object is nice. Somehow, the issue is to
>>> “unpack“ the information of this object. For instance,
>>>
>>> scheme@(guix-user)> (define ruby-sorbet-runtime (@@ (gnu packages ruby) ruby-sorbet-runtime))
>>> scheme@(guix-user)> (package-source ruby-sorbet-runtime)
>>> $1 = #<<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> ()
>>> 7fd7ad6b81e0>:out> "/gems/sorbet-" #<gexp-input "runtime":out>)
>>> #<gexp-output out>)) gnu/packages/ruby.scm:14071:5 7fd7ae734480>
>>> guile: #f options: (#:local-build? #t)>
>>>
>>>
>>> and as far as I understand, this case cannot be handled by some generic
>>> code. The extraction of the “real” origin needs manual and specific
>>> extraction because of this ’computed-file’.
>>>
>>> For sure, ’source’ can use any file-like object because some use-cases
>>> require that. However, I would be tempted to use an ’origin’ as a
>>> preferred choice – i.e., when it’s possible and try to make it
>>> possible. ;-) Because, somehow, it “normalizes“ the source information
>>> and eases its extraction.
>
> Oh, got it.
>
>> I'm not sure I follow, perhaps because I lack context about how
>> Disarchiver use the source field of a package. Would you mind
>> explaining a bit what the problem is or pointing me to a place it was
>> already explained?
>
> The problem with the idiom used for ‘ruby-sorbet-runtime’ is that the
> origin is hidden inside a gexp.
>
> Thus, the machinery that produces <https://guix.gnu.org/sources.json>
> (the file that SWH fetches periodically to ingest the source code
> packages refer to) will not add it. To put it differently, we have no
> guarantee that the commit above will be archived and that we’ll
> eventually be able to rebuild ‘ruby-sorbet-runtime’.
>
> So I guess as a matter of policy, we should try and find other ways to
> express this so we don’t lose track of origins.
Thanks for explaining, it makes sense. One way to tip package writers
in the right direction would be to add a warning when such a situation
occurs upon running 'guix lint'.
> In this particular case, we could do what Simon proposed or, even
> simpler, just add a phase that calls ‘chdir’ (the advantage being that
> we don’t have to create copies of subsets of ‘sorbet-monorepo’).
I seem to recall there was more to it than simply having a
self-contained source correctly named, such as avoiding extra phases
doing chdir and having to delete extraneous .gems that'd get picked up
erroneously and build the wrong thing/fail the build.
Simon's solution is a bit more complicated/verbose than the gexp version
currently in used taste, but it works while preserving the origin and
avoids extra steps in each package that will be using sorbet-monorepo,
so I think I'd go with it.
--
Thanks,
Maxim
next prev parent reply other threads:[~2023-05-02 12: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
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 [this message]
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=871qjy51zo.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).