unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / Atom feed
* Packaging elm-compiler 0.19.1
@ 2020-12-31 12:11 Matthew Kraai
  2020-12-31 18:51 ` John Soo
  0 siblings, 1 reply; 4+ messages in thread
From: Matthew Kraai @ 2020-12-31 12:11 UTC (permalink / raw)
  To: guix-devel


[-- Attachment #1.1: Type: text/plain, Size: 786 bytes --]

Hi,

I'm trying to upgrade to elm-compiler 0.19.1.  With the attached patch, 
it fails with the following error:

Configuring elm-0.19.1...
Setup.hs: Encountered missing dependencies:
time >=1.9.1

I think that time is part of GHC.  I removed the version requirement for 
time, but then it failed with the following error:

[  8 of 130] Compiling File             ( builder/src/File.hs, dist/build/elm/elm-tmp/File.dyn_o )

builder/src/File.hs:49:13: error:
     Not in scope: ?Time.nominalDiffTimeToSeconds?
     Neither ?Data.Time.Clock? nor ?Data.Time.Clock.POSIX? exports ?nominalDiffTimeToSeconds?.
    |
49 |     (Time . Time.nominalDiffTimeToSeconds . Time.utcTimeToPOSIXSeconds)
    |             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

How can I fix this problem?

-- 
Matthew Kraai


[-- Attachment #1.2: Type: text/html, Size: 1046 bytes --]

[-- Attachment #2: patch --]
[-- Type: text/plain, Size: 8992 bytes --]

diff --git a/gnu/local.mk b/gnu/local.mk
index 2402b1e349..f74c66e3b0 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -39,6 +39,7 @@
 # Copyright © 2020 Martin Becze <mjbecze@riseup.net>
 # Copyright © 2020 Malte Frank Gerdes <mate.f.gerdes@gmail.com>
 # Copyright © 2020 Vinicius Monego <monego@posteo.net>
+# Copyright © 2020 Matthew Kraai <kraai@ftbfs.org>
 #
 # This file is part of GNU Guix.
 #
@@ -948,7 +949,6 @@ dist_patch_DATA =						\
   %D%/packages/patches/elfutils-tests-ptrace.patch		\
   %D%/packages/patches/elixir-path-length.patch			\
   %D%/packages/patches/elm-compiler-disable-reactor.patch	\
-  %D%/packages/patches/elm-compiler-fix-map-key.patch		\
   %D%/packages/patches/emacs-exec-path.patch			\
   %D%/packages/patches/emacs-exwm-fix-fullscreen-states.patch	\
   %D%/packages/patches/emacs-fix-scheme-indent-function.patch	\
diff --git a/gnu/packages/elm.scm b/gnu/packages/elm.scm
index feaa9c8d5c..f1e609b65b 100644
--- a/gnu/packages/elm.scm
+++ b/gnu/packages/elm.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2019 Robert Vollmert <rob@vllmrt.net>
+;;; Copyright © 2020 Matthew Kraai <kraai@ftbfs.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -35,7 +36,7 @@
 (define-public elm-compiler
   (package
     (name "elm-compiler")
-    (version "0.19.0")
+    (version "0.19.1")
     (source
      (origin
        (method git-fetch)
@@ -44,10 +45,9 @@
              (url "https://github.com/elm/compiler/")
              (commit version)))
        (sha256
-        (base32 "0s93z9vr0vp5w894ghc5s34nsq09sg1msf59zfiba87sid5vgjqy"))
+        (base32 "1rdg3xp3js9xadclk3cdypkscm5wahgsfmm4ldcw3xswzhw6ri8w"))
        (patches
-        (search-patches "elm-compiler-disable-reactor.patch"
-                        "elm-compiler-fix-map-key.patch"))))
+        (search-patches "elm-compiler-disable-reactor.patch"))))
     (build-system haskell-build-system)
     (arguments
      `(#:phases
@@ -71,6 +71,7 @@
        ("ghc-ansi-wl-pprint" ,ghc-ansi-wl-pprint)
        ("ghc-edit-distance" ,ghc-edit-distance)
        ("ghc-file-embed" ,ghc-file-embed)
+       ("ghc-filelock" ,ghc-filelock)
        ("ghc-http" ,ghc-http)
        ("ghc-http-client" ,ghc-http-client)
        ("ghc-http-client-tls" ,ghc-http-client-tls)
diff --git a/gnu/packages/haskell-xyz.scm b/gnu/packages/haskell-xyz.scm
index d6c50ade71..961075e7ea 100644
--- a/gnu/packages/haskell-xyz.scm
+++ b/gnu/packages/haskell-xyz.scm
@@ -28,6 +28,7 @@
 ;;; Copyright © 2020 Alexandru-Sergiu Marton <brown121407@member.fsf.org>
 ;;; Copyright © 2020 Carlo Holl <carloholl@gmail.com>
 ;;; Copyright © 2020 Christopher Lemmer Webber <cwebber@dustycloud.org>
+;;; Copyright © 2020 Matthew Kraai <kraai@ftbfs.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -4414,6 +4415,28 @@ 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.5")
+    (source
+     (origin
+       (method url-fetch)
+       (uri (string-append
+             "https://hackage.haskell.org/package/filelock/filelock-"
+             version
+             ".tar.gz"))
+       (sha256
+        (base32
+         "06a44i7a956d7xkk2na4090xj2a7b7a228pk4spmccs4x20ymssh"))))
+    (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")
diff --git a/gnu/packages/patches/elm-compiler-disable-reactor.patch b/gnu/packages/patches/elm-compiler-disable-reactor.patch
index 9871b55e8d..a91bbd94b8 100644
--- a/gnu/packages/patches/elm-compiler-disable-reactor.patch
+++ b/gnu/packages/patches/elm-compiler-disable-reactor.patch
@@ -1,16 +1,21 @@
-commit 20d80e2323b565a36751c9455e535d8f73fa32f7
-Author: Robert Vollmert <rob@vllmrt.net>
-Date:   Fri Jun 14 16:05:47 2019 +0200
+From 6edf6711f08a5c67400f0eb087c9e966aa93b05a Mon Sep 17 00:00:00 2001
+From: Robert Vollmert <rob@vllmrt.net>
+Date: Sat, 12 Dec 2020 07:24:30 -0800
+Subject: [PATCH] disable reactor
 
-    disable reactor
+---
+ elm.cabal               |  5 -----
+ terminal/src/Develop.hs | 12 +-----------
+ terminal/src/Main.hs    |  1 -
+ 3 files changed, 1 insertion(+), 17 deletions(-)
 
 diff --git a/elm.cabal b/elm.cabal
-index c75f9689..ece63c46 100644
+index bf1cfcf0..8f7b2bd5 100644
 --- a/elm.cabal
 +++ b/elm.cabal
-@@ -45,9 +45,6 @@ Executable elm
-         builder/src
-         ui/terminal/src
+@@ -48,9 +48,6 @@ Executable elm
+         terminal/impl
+         terminal/src
  
 -    other-extensions:
 -        TemplateHaskell
@@ -18,34 +23,34 @@ index c75f9689..ece63c46 100644
      Main-Is:
          Main.hs
  
-@@ -56,8 +53,6 @@ Executable elm
-         Develop
+@@ -74,8 +71,6 @@ Executable elm
+         -- from terminal/
          Develop.Generate.Help
          Develop.Generate.Index
 -        Develop.StaticFiles
 -        Develop.StaticFiles.Build
-         Diff
-         Init
-         Install
-diff --git a/ui/terminal/src/Develop.hs b/ui/terminal/src/Develop.hs
-index 4b2252e1..7ed7716e 100644
---- a/ui/terminal/src/Develop.hs
-+++ b/ui/terminal/src/Develop.hs
-@@ -23,7 +23,6 @@ import Snap.Util.FileServe
- import qualified Elm.Project as Project
- import qualified Develop.Generate.Help as Generate
+ 
+         -- from builder/
+         Build
+diff --git a/terminal/src/Develop.hs b/terminal/src/Develop.hs
+index 00339364..167de693 100644
+--- a/terminal/src/Develop.hs
++++ b/terminal/src/Develop.hs
+@@ -25,7 +25,6 @@ import qualified Build
+ import qualified Elm.Details as Details
+ import qualified Develop.Generate.Help as Help
  import qualified Develop.Generate.Index as Index
 -import qualified Develop.StaticFiles as StaticFiles
- import qualified Generate.Output as Output
- import qualified Json.Encode as Encode
- import qualified Reporting.Exit as Exit
-@@ -219,16 +218,7 @@ compileToHtmlBuilder mode file =
+ import qualified Generate.Html as Html
+ import qualified Generate
+ import qualified Reporting
+@@ -170,16 +169,7 @@ compile path =
  
  
  serveAssets :: Snap ()
 -serveAssets =
--  do  file <- getSafePath
--      case StaticFiles.lookup file of
+-  do  path <- getSafePath
+-      case StaticFiles.lookup path of
 -        Nothing ->
 -          pass
 -
@@ -57,15 +62,18 @@ index 4b2252e1..7ed7716e 100644
  
  
  -- MIME TYPES
-diff --git a/ui/terminal/src/Main.hs b/terminal/src/Main.hs
-index 7000f3ca..2c76965a 100644
---- a/ui/terminal/src/Main.hs
-+++ b/ui/terminal/src/Main.hs
-@@ -39,7 +39,6 @@ main =
-       complex intro outro
-         [ repl
-         , init
--        , reactor
-         , make
-         , install
-         , bump
+diff --git a/terminal/src/Main.hs b/terminal/src/Main.hs
+index e2d3f408..cd078422 100644
+--- a/terminal/src/Main.hs
++++ b/terminal/src/Main.hs
+@@ -34,7 +34,6 @@ main =
+   Terminal.app intro outro
+     [ repl
+     , init
+-    , reactor
+     , make
+     , install
+     , bump
+-- 
+2.29.2
+
diff --git a/gnu/packages/patches/elm-compiler-fix-map-key.patch b/gnu/packages/patches/elm-compiler-fix-map-key.patch
deleted file mode 100644
index 4f05ded530..0000000000
--- a/gnu/packages/patches/elm-compiler-fix-map-key.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-commit e3512d887df41a8162c3e361171c04beca08415b
-Author: Tom Stejskal <tom.stejskal@gmail.com>
-Date:   Mon Nov 19 20:09:43 2018 +0100
-
-    Fix Map.!: given key is not an element in the map
-
-diff --git a/compiler/src/Elm/Compiler/Type/Extract.hs b/compiler/src/Elm/Compiler/Type/Extract.hs
-index 1aafe1d4..99763392 100644
---- a/compiler/src/Elm/Compiler/Type/Extract.hs
-+++ b/compiler/src/Elm/Compiler/Type/Extract.hs
-@@ -10,6 +10,7 @@ module Elm.Compiler.Type.Extract
- 
- 
- import Data.Map ((!))
-+import qualified Data.Map as Map
- import qualified Data.Maybe as Maybe
- import qualified Data.Set as Set
- 
-@@ -134,11 +135,15 @@ extractUnion interfaces (Opt.Global home name) =
-     else
-       let
-         pname = toPublicName home name
--        unions = I._unions (interfaces ! home)
-+        maybeUnions = I._unions <$> Map.lookup home interfaces
-       in
--      case I.toUnionInternals (unions ! name) of
--        Can.Union vars ctors _ _ ->
--          T.Union pname vars <$> traverse extractCtor ctors
-+      case Map.lookup name =<< maybeUnions of
-+        Just union ->
-+          case I.toUnionInternals union of
-+            Can.Union vars ctors _ _ ->
-+              T.Union pname vars <$> traverse extractCtor ctors
-+        Nothing ->
-+          return $ T.Union pname [] []
- 
- 
- extractCtor :: Can.Ctor -> Extractor (N.Name, [T.Type])

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Packaging elm-compiler 0.19.1
  2020-12-31 12:11 Packaging elm-compiler 0.19.1 Matthew Kraai
@ 2020-12-31 18:51 ` John Soo
  2021-01-02 18:37   ` Matthew Kraai
  0 siblings, 1 reply; 4+ messages in thread
From: John Soo @ 2020-12-31 18:51 UTC (permalink / raw)
  To: Matthew Kraai; +Cc: guix-devel

[-- Attachment #1: Type: text/plain, Size: 368 bytes --]

     Hi Matthew,  

  
I’m not 100% sure how guix handles the ghc “boot” libraries but I think time is installed alongside ghc. Doing guix environment --pure --ad-hoc ghc -- ghc-pkg list gets me time-1.9.3. So I do think the version bounds should be satisfied without any other dependency. Mind sharing more of the package definition?
  

  
- John
     

[-- Attachment #2: Type: text/html, Size: 412 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Packaging elm-compiler 0.19.1
  2020-12-31 18:51 ` John Soo
@ 2021-01-02 18:37   ` Matthew Kraai
  2021-01-03  1:23     ` John Soo
  0 siblings, 1 reply; 4+ messages in thread
From: Matthew Kraai @ 2021-01-02 18:37 UTC (permalink / raw)
  To: John Soo; +Cc: guix-devel

Hi John,

On 12/31/20 10:51 AM, John Soo wrote:
> I’m not 100% sure how guix handles the ghc “boot” libraries but I 
> think time is installed alongside ghc. Doing guix environment --pure 
> --ad-hoc ghc -- ghc-pkg list gets me time-1.9.3. So I do think the 
> version bounds should be satisfied without any other dependency. Mind 
> sharing more of the package definition?

I think that elm-compiler is built with GHC 8.6.5, not GHC 8.8.3.  When 
I run `guix environment --pure --ad-hoc ghc@8.6.5 -- ghc-pkg list`, its 
output contains `time-1.8.0.2`.  I tried changing the definition of 
`ghc-8` in `haskell.scm` from `ghc-8.6` to `ghc-8.8`, but then 
`integer-logarithms` fails to build.  Maybe I have to upgrade to the 
latest LTS Haskell.

Here is the full package definition:

(define-public elm-compiler
   (package
     (name "elm-compiler")
     (version "0.19.1")
     (source
      (origin
        (method git-fetch)
        (file-name (git-file-name name version))
        (uri (git-reference
              (url "https://github.com/elm/compiler/")
              (commit version)))
        (sha256
         (base32 "1rdg3xp3js9xadclk3cdypkscm5wahgsfmm4ldcw3xswzhw6ri8w"))
        (patches
         (search-patches "elm-compiler-disable-reactor.patch"))))
     (build-system haskell-build-system)
     (arguments
      `(#:phases
        (modify-phases %standard-phases
          (add-after 'unpack 'update-constraints
            (lambda _
              (substitute* "elm.cabal"
                (("ansi-terminal >= 0\\.8 && < 0\\.9,")
                 "ansi-terminal >= 0.8 && < 0.10,")
                (("containers >= 0\\.5\\.8\\.2 && < 0\\.6,")
                 "containers >= 0.5.8.2 && < 0.7,")
                (("http-client >= 0\\.5 && < 0\\.6,")
                 "http-client >= 0.5 && < 0.7,")
                (("language-glsl >= 0\\.0\\.2 && < 0\\.3,")
                 "language-glsl >= 0.0.2 && < 0.4,")
                (("network >= 2\\.4 && < 2\\.7,")
                 "network >= 2.4 && < 2.9,"))
              #t)))))
     (inputs
      `(("ghc-ansi-terminal" ,ghc-ansi-terminal)
        ("ghc-ansi-wl-pprint" ,ghc-ansi-wl-pprint)
        ("ghc-edit-distance" ,ghc-edit-distance)
        ("ghc-file-embed" ,ghc-file-embed)
        ("ghc-filelock" ,ghc-filelock)
        ("ghc-http" ,ghc-http)
        ("ghc-http-client" ,ghc-http-client)
        ("ghc-http-client-tls" ,ghc-http-client-tls)
        ("ghc-http-types" ,ghc-http-types)
        ("ghc-language-glsl" ,ghc-language-glsl)
        ("ghc-logict" ,ghc-logict)
        ("ghc-network" ,ghc-network)
        ("ghc-raw-strings-qq" ,ghc-raw-strings-qq)
        ("ghc-scientific" ,ghc-scientific)
        ("ghc-sha" ,ghc-sha)
        ("ghc-snap-core" ,ghc-snap-core)
        ("ghc-snap-server" ,ghc-snap-server)
        ("ghc-time-compat" ,ghc-time-compat)
        ("ghc-unordered-containers"
         ,ghc-unordered-containers)
        ("ghc-utf8-string" ,ghc-utf8-string)
        ("ghc-vector" ,ghc-vector)
        ("ghc-zip-archive" ,ghc-zip-archive)))
     (home-page "https://elm-lang.org")
     (synopsis "Programming language for Web applications")
     (description
      "This package provides Elm, a statically-typed functional programming
language for the browser.  It includes commands for developers such as
@command{elm make} and @command{elm repl}.")
     (license license:bsd-3)))

-- 
Matthew Kraai



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Packaging elm-compiler 0.19.1
  2021-01-02 18:37   ` Matthew Kraai
@ 2021-01-03  1:23     ` John Soo
  0 siblings, 0 replies; 4+ messages in thread
From: John Soo @ 2021-01-03  1:23 UTC (permalink / raw)
  To: Matthew Kraai; +Cc: guix-devel

Hi Matthew,


Matthew Kraai <kraai@ftbfs.org> writes:

> I think that elm-compiler is built with GHC 8.6.5, not GHC 8.8.3. 
> When I run `guix environment --pure --ad-hoc ghc@8.6.5 -- ghc-pkg
> list`, its output contains `time-1.8.0.2`.  I tried changing the
> definition of `ghc-8` in `haskell.scm` from `ghc-8.6` to `ghc-8.8`,
> but then `integer-logarithms` fails to build.  Maybe I have to upgrade
> to the latest LTS Haskell.

The haskell-build-system respects a #:haskell argument like so:

(arguments
 `(#:haskell ,ghc-8.8 ...))

That way you don't end up bumping the default ghc for everyone while
updating one package.

I tried your definition with ghc@8.8 as above and some new packages were
not in constraints.  Can you go from there and update the
"update-constraints" phase as you go? Maybe that will be enough.


Thanks!

- John


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-01-03  1:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-31 12:11 Packaging elm-compiler 0.19.1 Matthew Kraai
2020-12-31 18:51 ` John Soo
2021-01-02 18:37   ` Matthew Kraai
2021-01-03  1:23     ` John Soo

unofficial mirror of guix-devel@gnu.org 

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://yhetil.org/guix-devel/0 guix-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 guix-devel guix-devel/ https://yhetil.org/guix-devel \
		guix-devel@gnu.org
	public-inbox-index guix-devel

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.yhetil.org/yhetil.gnu.guix.devel
	nntp://news.gmane.io/gmane.comp.gnu.guix.devel


AGPL code for this site: git clone http://ou63pmih66umazou.onion/public-inbox.git