diff --git a/default.nix b/default.nix index 666692d08..5a580176d 100644 --- a/default.nix +++ b/default.nix @@ -21,6 +21,6 @@ in # We can re-enable these once https://github.com/NixOS/nixpkgs/issues/133271 # is fixed and Nixpkgs is upgraded to a version that incorporates GHCJS - # inherit (shared_ghcjs) dhall-try; - # dhall-ghcjs = shared_ghcjs.dhall; + inherit (shared_ghcjs) dhall-try; + dhall-ghcjs = shared_ghcjs.dhall; } diff --git a/dhall-csv/dhall-csv.cabal b/dhall-csv/dhall-csv.cabal index 576d54b1d..c43b9d44d 100644 --- a/dhall-csv/dhall-csv.cabal +++ b/dhall-csv/dhall-csv.cabal @@ -1,8 +1,8 @@ +Cabal-Version: 2.4 Name: dhall-csv Version: 1.0.4 -Cabal-Version: >=1.10 Build-Type: Simple -License: BSD3 +License: BSD-3-Clause License-File: LICENSE Copyright: 2021 Marcos Lerones Author: Marcos Lerones @@ -25,6 +25,8 @@ Category: Compiler Extra-Source-Files: CHANGELOG.md README.md + tasty/data/**/*.dhall + tasty/data/**/*.csv Source-Repository head Type: git Location: https://github.com/dhall-lang/dhall-haskell/tree/master/dhall-csv diff --git a/dhall-lsp-server/dhall-lsp-server.cabal b/dhall-lsp-server/dhall-lsp-server.cabal index 79c09815a..a5626dff2 100644 --- a/dhall-lsp-server/dhall-lsp-server.cabal +++ b/dhall-lsp-server/dhall-lsp-server.cabal @@ -53,7 +53,7 @@ library , dhall >= 1.38.0 && < 1.43 , dhall-json >= 1.4 && < 1.8 , filepath >= 1.4.2 && < 1.6 - , lsp >= 2.1.0.0 && < 2.2 + , lsp >= 2.1.0.0 && < 2.4 , lens >= 4.16.1 && < 5.4 -- megaparsec follows SemVer: https://github.com/mrkkrp/megaparsec/issues/469#issuecomment-927918469 , megaparsec >= 7.0.2 && < 10 @@ -104,9 +104,9 @@ Test-Suite tests GHC-Options: -Wall Build-Depends: base , - lsp-types >= 2.0.1 && < 2.1 , + lsp-types >= 2.0.1 && < 2.2 , hspec >= 2.7 && < 2.12 , - lsp-test >= 0.15.0.0 && < 0.16 , + lsp-test >= 0.15.0.0 && < 0.17 , tasty >= 0.11.2 && < 1.6 , tasty-hspec >= 1.1 && < 1.3 , text >= 0.11 && < 2.2 diff --git a/dhall-lsp-server/src/Dhall/LSP/Handlers.hs b/dhall-lsp-server/src/Dhall/LSP/Handlers.hs index 547d88b46..a65c333bf 100644 --- a/dhall-lsp-server/src/Dhall/LSP/Handlers.hs +++ b/dhall-lsp-server/src/Dhall/LSP/Handlers.hs @@ -657,7 +657,6 @@ handleErrorWithDefault respond _default = flip catchE handler Error -> MessageType_Error Warning -> MessageType_Warning Info -> MessageType_Info - Log -> MessageType_Log liftLSP $ LSP.sendNotification SMethod_WindowShowMessage ShowMessageParams{..} respond (Right _default) diff --git a/dhall-lsp-server/src/Dhall/LSP/Server.hs b/dhall-lsp-server/src/Dhall/LSP/Server.hs index de0046a00..b10b756c1 100644 --- a/dhall-lsp-server/src/Dhall/LSP/Server.hs +++ b/dhall-lsp-server/src/Dhall/LSP/Server.hs @@ -52,11 +52,15 @@ run = withLogger $ \ioLogger -> do let defaultConfig = def - let onConfigurationChange _oldConfig json = + let configSection = "dhall-lsp-server" + + let parseConfig _oldConfig json = case fromJSON json of Aeson.Success config -> Right config Aeson.Error string -> Left (Text.pack string) + let onConfigChange _ = pure () + let doInitialize environment _request = do return (Right environment) @@ -114,7 +118,6 @@ run = withLogger $ \ioLogger -> do Error -> MessageType_Error Warning -> MessageType_Warning Info -> MessageType_Info - Log -> MessageType_Log LSP.sendNotification SMethod_WindowShowMessage ShowMessageParams{..} liftIO (fail (Text.unpack _message)) diff --git a/dhall-lsp-server/tests/Main.hs b/dhall-lsp-server/tests/Main.hs index 7edbe6971..c39cb9c64 100644 --- a/dhall-lsp-server/tests/Main.hs +++ b/dhall-lsp-server/tests/Main.hs @@ -22,8 +22,9 @@ import Test.Tasty.Hspec import Test.Hspec #endif -import qualified Data.Text as T +import qualified Data.Text as T import qualified GHC.IO.Encoding +import qualified System.Environment as Environment baseDir :: FilePath -> FilePath baseDir d = "tests/fixtures/" <> d @@ -141,7 +142,9 @@ codeCompletionSpec fixtureDir = docId <- openDoc "ImportedFunctions.dhall" "dhall" cs <- getCompletions docId (Position {_line = 0, _character = 33}) liftIO $ do - let [ firstItem, secondItem ] = cs + (firstItem, secondItem) <- case cs of + [x, y] -> pure (x, y) + _ -> fail "Unexpected number of items" _label firstItem `shouldBe` "`make user`" _label secondItem `shouldBe` "makeUser" _detail firstItem `shouldBe` Just "\8704(user : Text) \8594 { home : Text }" @@ -152,7 +155,9 @@ codeCompletionSpec fixtureDir = docId <- openDoc "Union.dhall" "dhall" cs <- getCompletions docId (Position {_line = 2, _character = 10}) liftIO $ do - let [ firstItem, secondItem ] = cs + (firstItem, secondItem) <- case cs of + [x, y] -> pure (x, y) + _ -> fail "Unexpected number of items" _label firstItem `shouldBe` "A" _label secondItem `shouldBe` "`B C`" _detail firstItem `shouldBe` Just "\8704(A : Text) \8594 < A : Text | `B C` >" @@ -205,6 +210,7 @@ diagnosticsSpec fixtureDir = do main :: IO () main = do GHC.IO.Encoding.setLocaleEncoding GHC.IO.Encoding.utf8 + Environment.setEnv "TASTY_NUM_THREADS" "1" diagnostics <- testSpec "Diagnostics" (diagnosticsSpec (baseDir "diagnostics")) linting <- testSpec "Linting" (lintingSpec (baseDir "linting")) completion <- testSpec "Completion" (codeCompletionSpec (baseDir "completion")) diff --git a/dhall/ghcjs-src/Dhall/Import/HTTP.hs b/dhall/ghcjs-src/Dhall/Import/HTTP.hs index 04eced9b6..579142626 100644 --- a/dhall/ghcjs-src/Dhall/Import/HTTP.hs +++ b/dhall/ghcjs-src/Dhall/Import/HTTP.hs @@ -10,11 +10,19 @@ import Control.Monad.IO.Class (MonadIO (..)) import Control.Monad.Trans.State.Strict (StateT) import Data.ByteString (ByteString) import Data.CaseInsensitive (CI) -import Dhall.Core (URL (..), Expr (..)) -import Dhall.Import.Types (Import, Status) +import Dhall.Import.Types (Status) import Dhall.Parser (Src) import Dhall.URL (renderURL) +import Dhall.Core + ( Import(..) + , ImportHashed(..) + , ImportMode(..) + , ImportType(..) + , URL (..) + , Expr (..) + ) + import qualified Data.Text as Text import qualified Data.Text.Encoding as Text.Encoding import qualified JavaScript.XHR @@ -40,13 +48,14 @@ fetchFromHttpUrl childURL Nothing = do fetchFromHttpUrl _ _ = fail "Dhall does not yet support custom headers when built using GHCJS" -fetchFromHTTPUrlBytes +fetchFromHttpUrlBytes :: URL -> Maybe [(CI ByteString, ByteString)] -> StateT Status IO ByteString -fetchFromHTTPUrlBytes childUrl mheader = do - text <- fetchFromHTTPUrl childUrl mheader +fetchFromHttpUrlBytes childUrl mheader = do + text <- fetchFromHttpUrl childUrl mheader return (Text.Encoding.encodeUtf8 text) originHeadersFileExpr :: IO (Expr Src Import) -originHeadersFileExpr = return Missing +originHeadersFileExpr = + return (Embed (Import (ImportHashed Nothing Missing) Code)) diff --git a/dhall/src/Dhall/Syntax/Chunks.hs-boot b/dhall/src/Dhall/Syntax/Chunks.hs-boot index fa0e1e121..59eba16ba 100644 --- a/dhall/src/Dhall/Syntax/Chunks.hs-boot +++ b/dhall/src/Dhall/Syntax/Chunks.hs-boot @@ -1,3 +1,4 @@ +{-# LANGUAGE NoPolyKinds #-} {-# LANGUAGE StandaloneKindSignatures #-} module Dhall.Syntax.Chunks where diff --git a/dhall/src/Dhall/Syntax/Types.hs-boot b/dhall/src/Dhall/Syntax/Types.hs-boot index 4e255a597..e00d400d7 100644 --- a/dhall/src/Dhall/Syntax/Types.hs-boot +++ b/dhall/src/Dhall/Syntax/Types.hs-boot @@ -1,3 +1,4 @@ +{-# LANGUAGE NoPolyKinds #-} {-# LANGUAGE StandaloneKindSignatures #-} module Dhall.Syntax.Types where diff --git a/nix/packages/co-log-core.nix b/nix/packages/co-log-core.nix deleted file mode 100644 index c84775dc9..000000000 --- a/nix/packages/co-log-core.nix +++ /dev/null @@ -1,11 +0,0 @@ -{ mkDerivation, base, doctest, Glob, lib }: -mkDerivation { - pname = "co-log-core"; - version = "0.3.2.1"; - sha256 = "7e12a8e02a02c0e2c13e8def101ee8243c6c033392cd3031b63fe5db5168ff87"; - libraryHaskellDepends = [ base ]; - testHaskellDepends = [ base doctest Glob ]; - homepage = "https://github.com/co-log/co-log-core"; - description = "Composable Contravariant Comonadic Logging Library"; - license = lib.licenses.mpl20; -} diff --git a/nix/packages/hashable.nix b/nix/packages/hashable.nix deleted file mode 100644 index 5a802e559..000000000 --- a/nix/packages/hashable.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ mkDerivation, base, bytestring, containers, deepseq, ghc-prim -, HUnit, integer-gmp, lib, QuickCheck, random, test-framework -, test-framework-hunit, test-framework-quickcheck2, text, unix -}: -mkDerivation { - pname = "hashable"; - version = "1.3.4.1"; - sha256 = "2ca5fdf03a54718d02f02c9c9ab619ccf10fa8bcf3b0ff15b27edc26019a3196"; - libraryHaskellDepends = [ - base bytestring containers deepseq ghc-prim integer-gmp text - ]; - testHaskellDepends = [ - base bytestring ghc-prim HUnit QuickCheck random test-framework - test-framework-hunit test-framework-quickcheck2 text unix - ]; - homepage = "http://github.com/haskell-unordered-containers/hashable"; - description = "A class for types that can be converted to a hash value"; - license = lib.licenses.bsd3; -} diff --git a/nix/packages/hnix.nix b/nix/packages/hnix.nix deleted file mode 100644 index 32bf3d223..000000000 --- a/nix/packages/hnix.nix +++ /dev/null @@ -1,52 +0,0 @@ -{ mkDerivation, aeson, array, base, base16-bytestring, binary -, bytestring, comonad, containers, criterion, cryptonite, data-fix -, deepseq, deriving-compat, Diff, directory, exceptions, filepath -, free, gitrev, Glob, hashable, hashing, haskeline, hedgehog -, hnix-store-core, hnix-store-remote, http-client, http-client-tls -, http-types, lens-family, lens-family-core, lens-family-th, lib -, logict, megaparsec, monad-control, monadlist, mtl -, neat-interpolation, optparse-applicative, parser-combinators -, pretty-show, prettyprinter, process, ref-tf, regex-tdfa, relude -, repline, scientific, semialign, serialise, some, split, syb -, tasty, tasty-hedgehog, tasty-hunit, tasty-th, template-haskell -, text, th-lift-instances, these, time, transformers -, transformers-base, unix-compat, unordered-containers, vector, xml -}: -mkDerivation { - pname = "hnix"; - version = "0.16.0"; - sha256 = "d0b5a93efe6bec97b4b1af6703be6cd4935240dd1616df3ab5c006a13a374b61"; - isLibrary = true; - isExecutable = true; - libraryHaskellDepends = [ - aeson array base base16-bytestring binary bytestring comonad - containers cryptonite data-fix deepseq deriving-compat directory - exceptions filepath free gitrev hashable hashing hnix-store-core - hnix-store-remote http-client http-client-tls http-types - lens-family lens-family-core lens-family-th logict megaparsec - monad-control monadlist mtl neat-interpolation optparse-applicative - parser-combinators pretty-show prettyprinter process ref-tf - regex-tdfa relude scientific semialign serialise some split syb - template-haskell text th-lift-instances these time transformers - transformers-base unix-compat unordered-containers vector xml - ]; - executableHaskellDepends = [ - aeson base comonad containers data-fix deepseq exceptions filepath - free haskeline optparse-applicative pretty-show prettyprinter - ref-tf relude repline serialise template-haskell time - ]; - testHaskellDepends = [ - base containers data-fix Diff directory exceptions filepath Glob - hedgehog megaparsec neat-interpolation optparse-applicative - pretty-show prettyprinter process relude serialise split tasty - tasty-hedgehog tasty-hunit tasty-th template-haskell time - unix-compat - ]; - benchmarkHaskellDepends = [ - base criterion data-fix exceptions filepath optparse-applicative - relude serialise template-haskell time - ]; - homepage = "https://github.com/haskell-nix/hnix#readme"; - description = "Haskell implementation of the Nix language"; - license = lib.licenses.bsd3; -} diff --git a/nix/packages/lsp-test.nix b/nix/packages/lsp-test.nix deleted file mode 100644 index b0d3e709f..000000000 --- a/nix/packages/lsp-test.nix +++ /dev/null @@ -1,27 +0,0 @@ -{ mkDerivation, aeson, aeson-pretty, ansi-terminal, async, base -, bytestring, co-log-core, conduit, conduit-parse, containers -, data-default, Diff, directory, exceptions, extra, filepath, Glob -, hspec, lens, lib, lsp, lsp-types, mtl, parser-combinators -, process, row-types, some, text, time, transformers, unix -, unliftio -}: -mkDerivation { - pname = "lsp-test"; - version = "0.15.0.1"; - sha256 = "ad5be9baa344337b87958dfeb765e3edceca47c4ada57fb1ffeccf4056c57ad8"; - libraryHaskellDepends = [ - aeson aeson-pretty ansi-terminal async base bytestring co-log-core - conduit conduit-parse containers data-default Diff directory - exceptions filepath Glob lens lsp lsp-types mtl parser-combinators - process row-types some text time transformers unix - ]; - testHaskellDepends = [ - aeson base co-log-core containers data-default directory filepath - hspec lens lsp mtl parser-combinators process text unliftio - ]; - testToolDepends = [ lsp ]; - benchmarkHaskellDepends = [ base extra lsp process ]; - homepage = "https://github.com/haskell/lsp/blob/master/lsp-test/README.md"; - description = "Functional test framework for LSP servers"; - license = lib.licenses.bsd3; -} diff --git a/nix/packages/lsp-types.nix b/nix/packages/lsp-types.nix deleted file mode 100644 index 9d59d055c..000000000 --- a/nix/packages/lsp-types.nix +++ /dev/null @@ -1,31 +0,0 @@ -{ mkDerivation, aeson, base, binary, containers, data-default -, deepseq, Diff, directory, dlist, exceptions, file-embed, filepath -, hashable, hspec, hspec-discover, lens, lib, mod, mtl, network-uri -, prettyprinter, QuickCheck, quickcheck-instances, regex, row-types -, safe, some, template-haskell, text, unordered-containers -}: -mkDerivation { - pname = "lsp-types"; - version = "2.0.1.0"; - sha256 = "57406c159d14aa30b3d8e5f48ca713186b340f668c93e940e884387fe561ffe0"; - isLibrary = true; - isExecutable = true; - libraryHaskellDepends = [ - aeson base binary containers data-default deepseq Diff dlist - exceptions file-embed filepath hashable lens mod mtl network-uri - row-types safe some template-haskell text unordered-containers - ]; - executableHaskellDepends = [ - base containers directory filepath mtl prettyprinter regex text - ]; - testHaskellDepends = [ - aeson base filepath hspec lens network-uri QuickCheck - quickcheck-instances row-types text - ]; - testToolDepends = [ hspec-discover ]; - doHaddock = false; - homepage = "https://github.com/haskell/lsp"; - description = "Haskell library for the Microsoft Language Server Protocol, data types"; - license = lib.licenses.mit; - mainProgram = "generator"; -} diff --git a/nix/packages/lsp.nix b/nix/packages/lsp.nix deleted file mode 100644 index 84fb67c12..000000000 --- a/nix/packages/lsp.nix +++ /dev/null @@ -1,28 +0,0 @@ -{ mkDerivation, aeson, async, attoparsec, base, bytestring -, co-log-core, containers, data-default, directory, exceptions -, filepath, hashable, hspec, hspec-discover, lens, lib, lsp-types -, mtl, prettyprinter, random, row-types, sorted-list, stm -, temporary, text, text-rope, transformers, unliftio-core -, unordered-containers, uuid -}: -mkDerivation { - pname = "lsp"; - version = "2.1.0.0"; - sha256 = "c8a7a2b82d074641c77894639bdd5aacae5046610ee8d6b8a74b0cf71c4af30d"; - isLibrary = true; - isExecutable = true; - libraryHaskellDepends = [ - aeson async attoparsec base bytestring co-log-core containers - data-default directory exceptions filepath hashable lens lsp-types - mtl prettyprinter random row-types sorted-list stm temporary text - text-rope transformers unliftio-core unordered-containers uuid - ]; - testHaskellDepends = [ - base containers hspec row-types sorted-list text text-rope - unordered-containers - ]; - testToolDepends = [ hspec-discover ]; - homepage = "https://github.com/haskell/lsp"; - description = "Haskell library for the Microsoft Language Server Protocol"; - license = lib.licenses.mit; -} diff --git a/nix/packages/lucid.nix b/nix/packages/lucid.nix deleted file mode 100644 index 66d49f99d..000000000 --- a/nix/packages/lucid.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ mkDerivation, base, bifunctors, blaze-builder, bytestring -, containers, criterion, deepseq, hashable, hspec, HUnit, lib -, mmorph, mtl, parsec, text, transformers, unordered-containers -}: -mkDerivation { - pname = "lucid"; - version = "2.11.0"; - sha256 = "549715bd4ca7b3034e689df6d73e459a8b4efbff0c74b8f961fc0edbf7082ed4"; - libraryHaskellDepends = [ - base blaze-builder bytestring containers hashable mmorph mtl text - transformers unordered-containers - ]; - testHaskellDepends = [ - base bifunctors hspec HUnit mtl parsec text - ]; - benchmarkHaskellDepends = [ - base blaze-builder bytestring criterion deepseq text transformers - ]; - homepage = "https://github.com/chrisdone/lucid"; - description = "Clear to write, read and edit DSL for HTML"; - license = lib.licenses.bsd3; -} diff --git a/nix/packages/mmark.nix b/nix/packages/mmark.nix deleted file mode 100644 index 2e35264e7..000000000 --- a/nix/packages/mmark.nix +++ /dev/null @@ -1,28 +0,0 @@ -{ mkDerivation, aeson, base, case-insensitive, containers -, criterion, deepseq, dlist, email-validate, foldl, hashable, hspec -, hspec-megaparsec, html-entity-map, lib, lucid, megaparsec -, microlens, microlens-th, modern-uri, mtl, parser-combinators -, QuickCheck, text, text-metrics, unordered-containers, weigh, yaml -}: -mkDerivation { - pname = "mmark"; - version = "0.0.7.3"; - sha256 = "1a8c8bd99598204b81967b94cd831bac44353ec9a8750f62c74a868aa14cd4bd"; - revision = "2"; - editedCabalFile = "01cd2k4jz3f2ryhxdya8biypxdl44236mnavfqx7fm7bkjz4j5x0"; - enableSeparateDataOutput = true; - libraryHaskellDepends = [ - aeson base case-insensitive containers deepseq dlist email-validate - foldl hashable html-entity-map lucid megaparsec microlens - microlens-th modern-uri mtl parser-combinators text text-metrics - unordered-containers yaml - ]; - testHaskellDepends = [ - aeson base foldl hspec hspec-megaparsec lucid megaparsec modern-uri - QuickCheck text - ]; - benchmarkHaskellDepends = [ base criterion text weigh ]; - homepage = "https://github.com/mmark-md/mmark"; - description = "Strict markdown processor for writers"; - license = lib.licenses.bsd3; -} diff --git a/nix/packages/relude.nix b/nix/packages/relude.nix deleted file mode 100644 index 9e0f9fcda..000000000 --- a/nix/packages/relude.nix +++ /dev/null @@ -1,20 +0,0 @@ -{ mkDerivation, base, bytestring, containers, criterion, deepseq -, doctest, ghc-prim, Glob, hashable, hedgehog, lib, mtl, stm, text -, transformers, unordered-containers -}: -mkDerivation { - pname = "relude"; - version = "1.0.0.1"; - sha256 = "4fdcfe29205ebe8a2b976339207cffeb5bede18f8d7b3332245ac5ed5e508933"; - libraryHaskellDepends = [ - base bytestring containers deepseq ghc-prim hashable mtl stm text - transformers unordered-containers - ]; - testHaskellDepends = [ - base bytestring containers doctest Glob hedgehog text - ]; - benchmarkHaskellDepends = [ base criterion unordered-containers ]; - homepage = "https://github.com/kowainik/relude"; - description = "Safe, performant, user-friendly and lightweight Haskell Standard Library"; - license = lib.licenses.mit; -} diff --git a/nix/packages/semialign.nix b/nix/packages/semialign.nix deleted file mode 100644 index 5766eaf52..000000000 --- a/nix/packages/semialign.nix +++ /dev/null @@ -1,19 +0,0 @@ -{ mkDerivation, base, containers, hashable, indexed-traversable -, indexed-traversable-instances, lib, semigroupoids, tagged, these -, transformers, unordered-containers, vector -}: -mkDerivation { - pname = "semialign"; - version = "1.2.0.1"; - sha256 = "d900697041ae4b0cca3243273a2b3e80bcf74d937405d6a5ff34dc33ee952132"; - revision = "3"; - editedCabalFile = "0dbcdnksik508i12arh3s6bis6779lx5f1df0jkc0bp797inhd7f"; - libraryHaskellDepends = [ - base containers hashable indexed-traversable - indexed-traversable-instances semigroupoids tagged these - transformers unordered-containers vector - ]; - homepage = "https://github.com/haskellari/these"; - description = "Align and Zip type-classes from the common Semialign ancestor"; - license = lib.licenses.bsd3; -} diff --git a/nix/packages/text-rope.nix b/nix/packages/text-rope.nix deleted file mode 100644 index 125d30f24..000000000 --- a/nix/packages/text-rope.nix +++ /dev/null @@ -1,15 +0,0 @@ -{ mkDerivation, base, deepseq, lib, random, tasty, tasty-bench -, tasty-quickcheck, text, vector -}: -mkDerivation { - pname = "text-rope"; - version = "0.2"; - sha256 = "b14422855e9cc375a31c22758454013ac629671331de6ccb77b496509bcae78b"; - enableSeparateDataOutput = true; - libraryHaskellDepends = [ base deepseq text vector ]; - testHaskellDepends = [ base tasty tasty-quickcheck text ]; - benchmarkHaskellDepends = [ base random tasty-bench text ]; - homepage = "https://github.com/Bodigrim/text-rope"; - description = "Text lines and ropes"; - license = lib.licenses.bsd3; -} diff --git a/nix/pinnedNixpkgs.nix b/nix/pinnedNixpkgs.nix index 59f4fda2b..9165db16a 100644 --- a/nix/pinnedNixpkgs.nix +++ b/nix/pinnedNixpkgs.nix @@ -1,6 +1,6 @@ { nixpkgs = builtins.fetchTarball { - url = "https://github.com/NixOS/nixpkgs/archive/391f93a83c3a486475d60eb4a569bb6afbf306ad.tar.gz"; + url = "https://github.com/NixOS/nixpkgs/archive/458b097d81f90275b3fdf03796f0563844926708.tar.gz"; - sha256 = "0s5f7j2akh3g0013880jfbigdaac1z76r9dv46yw6k254ba2r6nq"; + sha256 = "1vpbqcdn0a2j20l84bp0fsxk8fc13kf0b04yf7s47djvna545z4s"; }; } diff --git a/nix/shared.nix b/nix/shared.nix index 548472570..de24f91ff 100644 --- a/nix/shared.nix +++ b/nix/shared.nix @@ -1,7 +1,7 @@ let pinned = import ./pinnedNixpkgs.nix; - defaultCompiler = "ghc8107"; + defaultCompiler = "ghc94"; in @@ -226,19 +226,51 @@ let ) (old: { postInstall = (old.postInstall or "") + '' - ${pkgsNew.closurecompiler}/bin/closure-compiler $out/bin/dhall-try.jsexe/all.js --jscomp_off=checkVars --externs=$out/bin/dhall-try.jsexe/all.js.externs > $out/bin/dhall-try.jsexe/all.min.js + ${pkgsNew.closurecompiler}/bin/closure-compiler $out/bin/dhall-try.jsexe/all.js --jscomp_off=checkVars --jscomp_off=uselessCode --externs=$out/bin/dhall-try.jsexe/all.js.externs > $out/bin/dhall-try.jsexe/all.min.js ''; } ); - gauge = + cborg = pkgsNew.haskell.lib.appendPatch - haskellPackagesOld.gauge + haskellPackagesOld.cborg (pkgsNew.fetchpatch { - url = "https://github.com/vincenthz/hs-gauge/commit/303a6b611804c85b9a6bc1cea5de4e6ce3429d24.patch"; - - sha256 = "sha256-4osUMo0cvTvyDTXF8lY9tQbFqLywRwsc3RkHIhqSriQ="; - }); + url = "https://patch-diff.githubusercontent.com/raw/well-typed/cborg/pull/322.patch"; + stripLen = 1; + hash = "sha256-YEaB8cilDx56uaAQODsTdFoQAbFfD+/q/23Rkdpxcp0="; + }) + ; + + haskeline = + if compiler == "ghcjs" + then haskellPackagesNew.haskeline_0_8_2_1 + else haskellPackagesOld.haskeline; + + terminfo = + if compiler == "ghcjs" + then haskellPackagesNew.terminfo_0_4_1_6 + else haskellPackagesOld.terminfo; + + # `aeson-1.5.6.0` doesn't build against the default versions + # of its dependencies, but it's only used in one place + # (where `ghcjs-base` unnecessarily downgrades `aeson`), so + # the simplest solution is to globally undo that downgrade + # here, because we don't want anything depending on this + # version of `aeson`. + aeson_1_5_6_0 = + if compiler == "ghcjs" + then haskellPackagesNew.aeson + else haskellPackagesOld.aeson_1_5_6_0; + + # The `aeson` test suite takes way too long to build and + # run using `ghcjs`. + aeson = + if compiler == "ghcjs" + then pkgsNew.haskell.lib.dontCheck haskellPackagesOld.aeson + else haskellPackagesOld.aeson; + + ghcjs-base = + pkgsNew.haskell.lib.doJailbreak haskellPackagesOld.ghcjs-base; }; in diff --git a/release.nix b/release.nix index 649582f3e..df97eecc6 100644 --- a/release.nix +++ b/release.nix @@ -13,7 +13,7 @@ let # We can re-enable this once https://github.com/NixOS/nixpkgs/issues/133271 # is fixed and Nixpkgs is upgraded to a version that incorporates GHCJS - # shared_ghcjs = callShared { compiler = "ghcjs"; }; + shared_ghcjs = callShared { compiler = "ghcjs"; }; shared = callShared { }; @@ -26,7 +26,7 @@ in { name = "dhall"; constituents = [ - # shared_ghcjs.dhall-try + shared_ghcjs.dhall-try shared.tarball-dhall shared.tarball-dhall-bash