[bug#39309] .[PATCH] WIP gnu: add stack.
diff mbox series

Message ID CAKf5CqW=QiGqM5GUAsFW7N7XAnSMug9iV-M+ECM3n2+OvagsLg@mail.gmail.com
State New
Headers show
Series
  • [bug#39309] .[PATCH] WIP gnu: add stack.
Related show

Checks

Context Check Description
cbaines/comparison success View comparision
cbaines/git branch success View Git branch
cbaines/applying patch fail View Laminar job

Commit Message

John Soo Jan. 27, 2020, 2:56 p.m. UTC
Hi Guix,

I looked at the wishlist on libreplanet and saw stack was on the list.
Also after the recent thread on haskell and clojure development I
realized stack would help out there.

I tried to package it which seems straightforward. I got the
dependencies built and linted but stack itself is failing with the
following:

gcc: error trying to exec
'/gnu/store/...-gcc-7.4.0/libexec/gcc/x86_64-unknown-linux-gnu/7.4.0/collect2':
execv: Argument list too long

This looks a lot like the nix issue here:
https://github.com/NixOS/nixpkgs/issues/41340

I thought I would share my work and maybe someone could help.

Thanks,

John

Comments

John Soo Jan. 29, 2020, 3:17 p.m. UTC | #1
Fixing the subject line.
John Soo Feb. 7, 2020, 5:32 p.m. UTC | #2
Hi Tim,

Just wanted to CC you because this issue is hard to find thanks to my
mistaken subject line.

- John
Timothy Sample Feb. 10, 2020, 6:06 a.m. UTC | #3
Hi John,

John Soo <jsoo1@asu.edu> writes:

> Just wanted to CC you because this issue is hard to find thanks to my
> mistaken subject line.

This seems to be due to <https://github.com/haskell/hsc2hs/issues/22>.

Briefly, the “hsc2hs” program bundled with GHC 8.6.5 accepts response
files, but then goes ahead and passes arguments directly to GCC.  Newer
versions of “hsc2hs” use response files for GCC, which solves the
“Argument list too long” problem.

My first suggestion would be to make a separate package for “hsc2hs”
using the version listed on Stackage (which is 0.68.6).  Then, add it as
a native input to the “stack” package and get it to shadow the version
shipped with GHC.

Failing that, we could consider patching our GHC package.  It would be
best to avoid that, though!  :)

(Also, there’s a duplicate “ghc-hspec-discover” in the patch set.  That
is, we already have an “hspec-discover” package.)


-- Tim
John Soo Feb. 13, 2020, 1:52 p.m. UTC | #4
Hi Tim,


> This seems to be due to <https://github.com/haskell/hsc2hs/issues/22>.
>
> Briefly, the “hsc2hs” program bundled with GHC 8.6.5 accepts response
> files, but then goes ahead and passes arguments directly to GCC.  Newer
> versions of “hsc2hs” use response files for GCC, which solves the
> “Argument list too long” problem.
>
> My first suggestion would be to make a separate package for “hsc2hs”
> using the version listed on Stackage (which is 0.68.6).  Then, add it as
> a native input to the “stack” package and get it to shadow the version
> shipped with GHC.

I added hsc2hs@0.68.6 as a native input to stack but I'm not sure how
to make it shadow the ghc package.
Used as a native input hsc2hs does not fix the issue.
I suppose another option would be to use the #:haskell key to use a
locally-patched version.
I am not familiar with ghc internals aside from having built from
source a few times so I can look into that option.

> Failing that, we could consider patching our GHC package.  It would be
> best to avoid that, though!  :)

Agree! I think we should try shadowing hsc2hs first. I might even
suggest bumping lts/ghc versions before we patch our version.


> (Also, there’s a duplicate “ghc-hspec-discover” in the patch set.  That
> is, we already have an “hspec-discover” package.)

Oops! Sorry!
It's definitely the importer. I know I'm not the first to have the problem.
Maybe we should open an issue to fix that?

Thanks!

John

Patch
diff mbox series

From 98334694e3c5a310e4c4a1b0a421c6bfd36572c8 Mon Sep 17 00:00:00 2001
From: John Soo <jsoo1@asu.edu>
Date: Sun, 26 Jan 2020 11:12:14 -0800
Subject: [PATCH 32/34] gnu: Add ghc-filelock.

* gnu/packages/haskell-xyz.scm (ghc-filelock): New variable.
---
 gnu/packages/haskell-xyz.scm | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/gnu/packages/haskell-xyz.scm b/gnu/packages/haskell-xyz.scm
index 499775281d..0f8efee977 100644
--- a/gnu/packages/haskell-xyz.scm
+++ b/gnu/packages/haskell-xyz.scm
@@ -4200,6 +4200,31 @@  the files in a directory, and turn them into @code{(path, bytestring)} pairs
 embedded in your Haskell code.")
     (license license:bsd-3)))
 
+(define-public ghc-filelock
+  (package
+    (name "ghc-filelock")
+    (version "0.1.1.3")
+    (source
+      (origin
+        (method url-fetch)
+        (uri (string-append
+               "https://hackage.haskell.org/package/filelock/filelock-"
+               version
+               ".tar.gz"))
+        (sha256
+          (base32
+            "04qimhz78jjndk686dblkx06l9jscq2q9gyr014a4pbfj4iljgi5"))))
+    (build-system haskell-build-system)
+    (native-inputs `(("ghc-async" ,ghc-async)))
+    (home-page
+      "http://github.com/takano-akio/filelock")
+    (synopsis
+      "Portable interface to file locking (flock / LockFileEx)")
+    (description
+      "This package provides an interface to Windows and Unix file locking
+functionalities.")
+    (license license:public-domain)))
+
 (define-public ghc-filemanip
   (package
     (name "ghc-filemanip")
-- 
2.25.0