all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: zimoun <zimon.toutoune@gmail.com>
To: Lars-Dominik Braun <lars@6xq.net>
Cc: Guix Devel <guix-devel@gnu.org>
Subject: Re: Cabal mismatch in ghc-lucid; long-term archiving Haskell?
Date: Mon, 22 Aug 2022 16:04:21 +0200	[thread overview]
Message-ID: <87ilmk5q8q.fsf@gmail.com> (raw)
In-Reply-To: <YwEQNu5mfUuIozWH@noor.fritz.box>

Hi Lars,

On sam., 20 août 2022 at 18:47, Lars-Dominik Braun <lars@6xq.net> wrote:

>> In all cases, these revised Cabal files are not archived elsewhere than
>> in Hackage, right?  The question is thus, where could we archive them?

>                                                  And while I updated the
> version number, I did not touch #:cabal-revision, which is obviously a
> mistake. Unfortunately we chose to encode this information into arguments
> and not the version and so this happens (alot), because – alas –
> `guix refresh` touches the version only, but not #:cabal-revision.

Well, it means it is not part of the ’source’ and thus not considered by
any of the archiving mechanism.  IIUC.

Using Guix 65cabb0, 719 packages are using ’haskell-build-system’ and
considering these, 108 packages have a ’cabal-revision’ argument.  See
below the snippet of “guix repl”.

Considering that the Haskell build-system is creating an ’origin’ under
the hood, from (guix build-system haskell):

--8<---------------cut here---------------start------------->8---
  (define (cabal-revision->origin cabal-revision)
    (match cabal-revision
      ((revision hash)
       (origin
         (method url-fetch)
         (uri (source-url->revision-url (origin-uri source) revision))
         (sha256 (base32 hash))
         (file-name (string-append name "-" revision ".cabal"))))
      (#f #f)))
--8<---------------cut here---------------end--------------->8---

Maybe it could be better to move the ’cabal-revision’ from the
’arguments’ field to the ’origin’ field.

Perhaps, we could have a ’cabal-revision’ procedure returning a G-exp
and put it under the ’snippet’ field.

WDYT?

Having all as ’origin’ would ease 1. to teach “guix refresh” about this
Cabal revision and 2. to only consider ’origin’ for archiving.

Note that ’computed-origin-method’ from (guix packages) could be used
too; although it seems a bad idea, IMHO.  However, maybe a package using
multiple upstream sources could be revisited.


That’s said, it is a core-updates change because it requires to modify
the Haskell build-system and, a rough estimate about the number of
impacted packages:

--8<---------------cut here---------------start------------->8---
$ guix refresh ghc -l | cut -d':' -f1
Building the following 450 packages would ensure 1468 dependent packages are rebuilt
--8<---------------cut here---------------end--------------->8---


Cheers,
simon


--8<---------------cut here---------------start------------->8---
$ guix repl
GNU Guile 3.0.8
Copyright (C) 1995-2021 Free Software Foundation, Inc.

Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
This program is free software, and you are welcome to redistribute it
under certain conditions; type `,show c' for details.

Enter `,help' for help.
scheme@(guix-user)> (use-modules (guix)
             (guix build-system haskell)
             (gnu)
             (ice-9 match))

scheme@(guix-user)> (define haskell-packages
  (fold-packages
   (lambda (package result)
     (if (eq? (package-build-system package) haskell-build-system)
         (cons package result)
         result))
   '()))

scheme@(guix-user)> (define (cabal-revision? package)
  (apply (lambda* (#:key cabal-revision #:allow-other-keys)
           (match cabal-revision
             ((revision hash) #t)
             (_ #f)))
         (package-arguments package)))

scheme@(guix-user)> (define cabal-revision-packages
  (filter cabal-revision? haskell-packages))

scheme@(guix-user)> (length haskell-packages)
$1 = 719
scheme@(guix-user)> (length cabal-revision-packages)
$2 = 108
--8<---------------cut here---------------end--------------->8---


  reply	other threads:[~2022-08-22 17:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-20 10:02 Cabal mismatch in ghc-lucid; long-term archiving Haskell? zimoun
2022-08-20 16:47 ` Lars-Dominik Braun
2022-08-22 14:04   ` zimoun [this message]
2022-08-23 13:34     ` Lars-Dominik Braun

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

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

  git send-email \
    --in-reply-to=87ilmk5q8q.fsf@gmail.com \
    --to=zimon.toutoune@gmail.com \
    --cc=guix-devel@gnu.org \
    --cc=lars@6xq.net \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.