Hi Lars, On sam., 20 août 2022 at 18:47, Lars-Dominik Braun <l...@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---