unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Simon Tournier <zimon.toutoune@gmail.com>
To: "Maxim Cournoyer" <maxim.cournoyer@gmail.com>,
	"Ludovic Courtès" <ludovic.courtes@inria.fr>
Cc: "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 19:35:59 +0200	[thread overview]
Message-ID: <86ilda1vr4.fsf@gmail.com> (raw)
In-Reply-To: <871qjy51zo.fsf@gmail.com>

Hi,

On Tue, 02 May 2023 at 08:52, Maxim Cournoyer <maxim.cournoyer@gmail.com> wrote:

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

Somehow improve “guix lint -c archival”. ;-)


> 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.

My point was to show that ’snippet’ could produce the exact same output
but exposing the ’origin’ usable by third-party (sources.json or else).
Maybe the snippet can be simplified. :-)

Another solution would to list ’sorbet-monorepo’ as an input and then
apply a generic build phase dealing with mono repo.  Hum, I think the
’snippet’ approach is better. :_

Note ’racket-packages-origin’ from (gnu packages racket) looks similar:

--8<---------------cut here---------------start------------->8---
  (computed-file
   (string-append "racket-pkg-" name "-sources")
   (with-imported-modules `((guix build utils))
     #~(begin
         (use-modules (guix build utils))
         (mkdir-p (string-append #$output "/share/racket/pkgs"))
         (chdir (string-append #$output "/share/racket/pkgs"))
         #$@(map (match-lambda
                   ((? string? name)
                    #~(copy-recursively #$(file-append origin (string-append "/" name))
                                        #$name))
                   ((name ".")
                    #~(copy-recursively #$origin #$name))
                   ((name path)
                    #~(copy-recursively #$(file-append origin (string-append "/" path))
                                        #$name)))
                 specs)))))
--8<---------------cut here---------------end--------------->8---

and that somehow uses the ’inputs’ approach.  Well, contrary to what I
said earlier in this thread, not all the sources for building Racket are
captured by sources.json:

--8<---------------cut here---------------start------------->8---

$ wget https://guix.gnu.org/sources.json
$ guix shell jq
$ cat sources.json | jq | grep sorbet

$ cat sources.json | jq | grep 'github.com/racket'
      "git_url": "https://github.com/racket/racket",
--8<---------------cut here---------------end--------------->8---

As you see, it requires,

    https://github.com/racket/2d

as input and that’s not listed.  I will give a look later if no one
beats me. :-)


Somehow, my initial point when mentioning ’computed-origin-method’ is
that maybe there is a need.  Maybe it’s an opportunity to rehash this
“method”.  Or another that provides 1. the structure we need for
extracting and 2. the flexibility we need for special use cases.

Cheers,
simon


  reply	other threads:[~2023-05-02 18:03 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
2023-05-02 17:35                     ` Simon Tournier [this message]
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=86ilda1vr4.fsf@gmail.com \
    --to=zimon.toutoune@gmail.com \
    --cc=bjoern.hoefling@bjoernhoefling.de \
    --cc=guix-devel@gnu.org \
    --cc=lars@6xq.net \
    --cc=ludovic.courtes@inria.fr \
    --cc=maxim.cournoyer@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).