Message ID | 8a396a9803fc35ee63f01e608f87ffb16863bc6d.1649171729.git.philip@munksgaard.me |
---|---|
State | New |
Headers | show |
Series | [bug#54729] build: haskell-build-system: Support packages w. multiple libraries | expand |
Hi, Thanks for your patch. I have send a v2 ready for core-updates. Ricardo or Lars, can you push this v2 to core-updates? The simple test is to use attoparsec@0.14 from bug#53655 [1]. The rebuild of this package takes less than half hour. I have checked and rebuilt all the ghc- packages; nothing broken. 1: <https://issues.guix.gnu.org/53655> Cheers, simon
Hi simon,
> Ricardo or Lars, can you push this v2 to core-updates?
I’d rather have this in a separate wip-haskell branch than let it sit
on core-updates indefinitely. Stackage also has a new release[1] using
GHC 9.0, which we could update to at the same time.
Any other Haskell changes we can batch into that branch?
Cheers,
Lars
[1] https://www.stackage.org/lts-19.2
Hi Lars
On Thu, 7 Apr 2022, at 08:08, Lars-Dominik Braun wrote:
> Any other Haskell changes we can batch into that branch?
I don't know of any finished patches, but there are some issues that would be nice to have fixed, like https://issues.guix.gnu.org/52152 (which also applies to attoparsec) and https://issues.guix.gnu.org/54752. However, I think it's more important to get this current patch merged.
Best,
Philip
Hi Lars, On Thu, 07 Apr 2022 at 08:08, Lars-Dominik Braun <lars@6xq.net> wrote: > I’d rather have this in a separate wip-haskell branch than let it sit > on core-updates indefinitely. Stackage also has a new release[1] using > GHC 9.0, which we could update to at the same time. > > Any other Haskell changes we can batch into that branch? Ok, let’s do use this wip-haskell branch: fix the build system as this v2 is doing and update LTS. Currently, the wip-haskell is at: c1522b280137df2f670f47fa1e682e610406bb39 (Thu Sep 30 09:29:51 2021 +0200), so let me know once you have rebase it to the current master. Cheers, simon
Hi again On Thu, 7 Apr 2022, at 08:49, Philip Munksgaard wrote: > Hi Lars > > On Thu, 7 Apr 2022, at 08:08, Lars-Dominik Braun wrote: >> Any other Haskell changes we can batch into that branch? > > I don't know of any finished patches, but there are some issues that > would be nice to have fixed, like https://issues.guix.gnu.org/52152 > (which also applies to attoparsec) and > https://issues.guix.gnu.org/54752. However, I think it's more important > to get this current patch merged. I've also created a new issue for invalid dependencies generated by multiple libraries in one package: https://issues.guix.gnu.org/54760
Hi again On Thu, 7 Apr 2022, at 08:08, Lars-Dominik Braun wrote: > I’d rather have this in a separate wip-haskell branch than let it sit > on core-updates indefinitely. Stackage also has a new release[1] using > GHC 9.0, which we could update to at the same time. Any news on this? Was the branch created? I can't seem to find it on https://git.savannah.gnu.org, and the changes haven't made it into master, as far as I can tell. Best, Philip
Hi Philip,
> Any news on this? Was the branch created? I can't seem to find it on https://git.savannah.gnu.org, and the changes haven't made it into master, as far as I can tell.
sorry, I’ve been busy rebasing my new python-build-system (PEP 517) on
top of master.
I created the branch wip-haskell and pushed zimoun’s v2 – I
hope that’s alright with you Philip? (I didn’t check the patches
thoroughly, just tried to build attoparsec.)
Cheers,
Lars
Hi Lars On Thu, 14 Apr 2022, at 20:21, Lars-Dominik Braun wrote: > sorry, I’ve been busy rebasing my new python-build-system (PEP 517) on > top of master. No worries, I just wanted to make sure it wasn't forgotten :-) > I created the branch wip-haskell and pushed zimoun’s v2 – I > hope that’s alright with you Philip? (I didn’t check the patches > thoroughly, just tried to build attoparsec.) Yeah that sounds perfect. Best, Philip
diff --git a/guix/build/haskell-build-system.scm b/guix/build/haskell-build-system.scm index ef6cb316ee..e827e23aba 100644 --- a/guix/build/haskell-build-system.scm +++ b/guix/build/haskell-build-system.scm @@ -217,11 +217,13 @@ (define* (register #:key name system inputs outputs #:allow-other-keys) (if (not (vhash-assoc id seen)) (let ((dep-conf (string-append src "/" id ".conf")) (dep-conf* (string-append dest "/" id ".conf"))) - (when (not (file-exists? dep-conf)) + (unless (file-exists? dep-conf*) + (when (not (file-exists? dep-conf)) (error (format #f "File ~a does not exist. This usually means the dependency ~a is missing. Was checking conf-file ~a." dep-conf id conf-file))) - (copy-file dep-conf dep-conf*) ;XXX: maybe symlink instead? - (loop (vhash-cons id #t seen) - (append lst (conf-depends dep-conf)))) + (copy-file dep-conf dep-conf*) ;XXX: maybe symlink instead? + + (loop (vhash-cons id #t seen) + (append lst (conf-depends dep-conf*))))) (loop seen tail)))))) (let* ((out (assoc-ref outputs "out")) @@ -234,13 +236,12 @@ (define* (register #:key name system inputs outputs #:allow-other-keys) "/ghc-" version "/" name ".conf.d")) (id-rx (make-regexp "^id:[ \n\t]+([^ \t\n]+)$" regexp/newline)) - (config-file (string-append out "/" name ".conf")) + (config-output (string-append out "/" name ".conf")) (params - (list (string-append "--gen-pkg-config=" config-file)))) + (list (string-append "--gen-pkg-config=" config-output)))) (run-setuphs "register" params) - ;; The conf file is created only when there is a library to register. - (when (file-exists? config-file) - (mkdir-p config-dir) + + (define (install-from-config-file config-file) (let* ((contents (call-with-input-file config-file read-string)) (config-file-name+id (match:substring (first (list-matches id-rx contents)) 1))) @@ -270,10 +271,17 @@ (define* (register #:key name system inputs outputs #:allow-other-keys) (install-transitive-deps config-file %tmp-db-dir config-dir) (rename-file config-file (string-append config-dir "/" - config-file-name+id ".conf")) - (invoke "ghc-pkg" - (string-append "--package-db=" config-dir) - "recache"))) + config-file-name+id ".conf")))) + + ;; The conf file is created only when there is a library to register. + (when (file-exists? config-output) + (mkdir-p config-dir) + (if (file-is-directory? config-output) + (for-each install-from-config-file (find-files config-output)) + (install-from-config-file config-output)) + (invoke "ghc-pkg" + (string-append "--package-db=" config-dir) + "recache")) #t)) (define* (check #:key tests? test-target #:allow-other-keys)