diff --git a/.bazelrc b/.bazelrc index 04c1064..02d3ded 100644 --- a/.bazelrc +++ b/.bazelrc @@ -1,3 +1,3 @@ -build --noincompatible_use_python_toolchains +build --incompatible_use_python_toolchains build --host_platform=@rules_haskell//haskell/platforms:linux_x86_64_nixpkgs build --host_javabase='@local_jdk//:jdk' diff --git a/BUILD.nix.part b/BUILD.nix.part index 7e12587..68d2927 100644 --- a/BUILD.nix.part +++ b/BUILD.nix.part @@ -43,7 +43,7 @@ haskell_toolchain( "-Wredundant-constraints", ], tools = ["@ghc//:bin"], - version = "8.6.5", + version = "8.8.4", is_static = False, libraries = toolchain_libraries, locale_archive = "@glibc_locales//:locale-archive", diff --git a/WORKSPACE b/WORKSPACE index db11ed6..6f59836 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -21,9 +21,9 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "rules_sh", - sha256 = "63eb736f7562ed80054e373392abb0d4950d70e22542665079158854bd2cd98f", - strip_prefix = "rules_sh-39e356843071f93caf2caaf427d46cd10717501b", - urls = ["https://github.com/tweag/rules_sh/archive/39e356843071f93caf2caaf427d46cd10717501b.tar.gz"], + sha256 = "83a065ba6469135a35786eb741e17d50f360ca92ab2897857475ab17c0d29931", + strip_prefix = "rules_sh-0.2.0", + urls = ["https://github.com/tweag/rules_sh/archive/v0.2.0.tar.gz"], ) load("@rules_sh//sh:repositories.bzl", "rules_sh_dependencies") @@ -33,9 +33,9 @@ rules_sh_dependencies() # NOTE: update release.nix if changing version of rules_haskell here. http_archive( name = "rules_haskell", - sha256 = "758f8190a9dd6e5e6fd7c9fb38a1bb4c5743a6e314d6678761e2cc070d8e465b", - strip_prefix = "rules_haskell-107ab5ccf0cdf884e19c1b3a37b9b8064c4e4e03", - urls = ["https://github.com/tweag/rules_haskell/archive/107ab5ccf0cdf884e19c1b3a37b9b8064c4e4e03.tar.gz"], + sha256 = "b4e2c00da9bc6668fa0404275fecfdb31beb700abdba0e029e74cacc388d94d6", + strip_prefix = "rules_haskell-0.13", + urls = ["https://github.com/tweag/rules_haskell/archive/v0.13.tar.gz"], ) load("@rules_haskell//haskell:repositories.bzl", "rules_haskell_dependencies") @@ -44,9 +44,9 @@ rules_haskell_dependencies() http_archive( name = "io_tweag_rules_nixpkgs", - sha256 = "f5af641e16fcff5b24f1a9ba5d93cab5ad26500271df59ede344f1a56fc3b17d", - strip_prefix = "rules_nixpkgs-0.6.0", - urls = ["https://github.com/tweag/rules_nixpkgs/archive/v0.6.0.tar.gz"], + sha256 = "5c80f5ed7b399a857dd04aa81e66efcb012906b268ce607aaf491d8d71f456c8", + strip_prefix = "rules_nixpkgs-0.7.0", + urls = ["https://github.com/tweag/rules_nixpkgs/archive/v0.7.0.tar.gz"], ) ### MARK: CUT START when building with nix @@ -104,12 +104,12 @@ haskell_register_ghc_nixpkgs( "//nix:versions.json", ], repositories = {"nixpkgs": "@nixpkgs//nix:nixpkgs.nix"}, - version = "8.6.5", + version = "8.8.4", ) -load("@rules_haskell//haskell:toolchain.bzl", "rules_haskell_toolchains") +#load("@rules_haskell//haskell:toolchain.bzl", "rules_haskell_toolchains") -rules_haskell_toolchains(version = "8.6.5") +#rules_haskell_toolchains(version = "8.8.4") load( "@io_tweag_rules_nixpkgs//nixpkgs:nixpkgs.bzl", diff --git a/brittany.yaml b/brittany.yaml new file mode 100644 index 0000000..4be7b62 --- /dev/null +++ b/brittany.yaml @@ -0,0 +1,2 @@ +conf_layout: + lconfig_indentAmount: 4 diff --git a/nix/versions.json b/nix/versions.json index 78e4c66..d83f34a 100644 --- a/nix/versions.json +++ b/nix/versions.json @@ -1,10 +1,10 @@ { "nixpkgs": { "owner": "NixOS", - "repo": "nixpkgs-channels", - "branch": "nixos-unstable", - "rev": "a21c2fa3ea2b88e698db6fc151d9c7259ae14d96", - "sha256": "1z3kxlbz6bqx1dlagcazg04vhk67r8byihzf959c3m0laf2a1w7y" + "repo": "nixpkgs", + "branch": "nixos-20.09", + "rev": "d105075a1fd870b1d1617a6008cb38b443e65433", + "sha256": "1jcs44wn0s6mlf2jps25bvcai1rij9b2dil6zcj8zqwf2i8xmqjh" }, "gitignore": { "owner": "hercules-ci", diff --git a/release.nix b/release.nix index 5274ebd..449c59d 100644 --- a/release.nix +++ b/release.nix @@ -16,8 +16,8 @@ with { rules_haskell = pkgs.fetchFromGitHub { owner = "tweag"; repo = "rules_haskell"; - rev = "107ab5ccf0cdf884e19c1b3a37b9b8064c4e4e03"; - sha256 = "092cx9xix6r8735yn4j247kanzmsh1bjjifgk39jq8fidgldlhsj"; + rev = "v0.13"; + sha256 = "092cx9xix6r8735yn4j247kanzmsh1bjjifgk39jq8fidgldlhs0"; }; }; with { diff --git a/tooling.nix b/tooling.nix index cec0a7e..8aa5af4 100644 --- a/tooling.nix +++ b/tooling.nix @@ -3,23 +3,7 @@ let pkgs = (import ./default.nix).pkgs; - haskellPackages = pkgs.haskellPackages.override (old: { - overrides = - with pkgs; - lib.composeExtensions (old.overrides or (_: _: {})) (self: super: { - # For brittany - multistate = haskell.lib.doJailbreak super.multistate; - # See https://github.com/NixOS/nixpkgs/issues/54534. - brittany = haskell.lib.doJailbreak (self.callCabal2nix "brittany" - (pkgs.fetchFromGitHub { - owner = "lspitzner"; - repo = "brittany"; - rev = "6c187da8f8166d595f36d6aaf419370283b3d1e9"; - sha256 = "0nmnxprbwws3w1sh63p80qj09rkrgn9888g7iim5p8611qyhdgky"; - }) {}); - }); - }); -in with haskellPackages; [ +in with pkgs.haskellPackages; [ ghcid brittany diff --git a/treetide/haskell/extended/optparse-applicative/Extended.hs b/treetide/haskell/extended/optparse-applicative/Extended.hs index 73ef279..c9898f9 100644 --- a/treetide/haskell/extended/optparse-applicative/Extended.hs +++ b/treetide/haskell/extended/optparse-applicative/Extended.hs @@ -10,15 +10,13 @@ module Options.Applicative.Extended where import Data.ByteString ( ByteString ) -import Data.Monoid ( (<>) ) +import Data.Monoid ( ) import Data.Text ( Text ) import qualified Data.Text as T import qualified Data.Text.Encoding as T import Options.Applicative import Options.Applicative.Builder.Internal - ( HasName - , HasValue - ) + ( ) -- | Shorthand for defining a program help and executing the option parser. parseOptionsIO :: Text -> Parser a -> IO a @@ -46,9 +44,10 @@ class Optionable a where -- complicated types manually. But preferrably complicated stuff should not be -- passed as options. instance (Show a, Read a, Num a) => Optionable a where - defineOption name defVal desc = - option auto (defOptionableMods name (defVal + 0 {- to force constraint -} - ) desc show) + defineOption name defVal desc = option + auto + (defOptionableMods name (defVal + 0 {- to force constraint -} + ) desc show) instance {-# OVERLAPPING #-} Optionable Text where defineOption name defVal desc = diff --git a/treetide/haskell/extended/xml-conduit/XmlConduit.hs b/treetide/haskell/extended/xml-conduit/XmlConduit.hs index e7527e6..cec281b 100644 --- a/treetide/haskell/extended/xml-conduit/XmlConduit.hs +++ b/treetide/haskell/extended/xml-conduit/XmlConduit.hs @@ -23,13 +23,10 @@ import Conduit ( ConduitT , yield , MonadThrow ) -import Control.Monad ( join - , void - ) -import Data.Function ( on ) -import Data.Text ( Text - , toCaseFold +import Control.Monad ( -- join + -- , void ) +import Data.Text ( toCaseFold ) import Data.XML.Types ( Event ) import qualified Text.XML as XML ( Name(..) ) @@ -60,17 +57,19 @@ matchingLocalName localName = XML.matching isTagWithLocalName -- | Skip tag with a given name. No-op if next tag to parse does not match. ignoreTagTree :: MonadThrow m => Text -> ConduitT Event o m () ignoreTagTree tagName = - void (XML.ignoreTreeContent $ matchingLocalName tagName) + void (XML.ignoreTreeContent (matchingLocalName tagName) ignoreAttrs) -- | Skip tags in sequence. Only tags in given order are skipped. ignoreTagSequence :: MonadThrow m => [Text] -> ConduitT Event o m () ignoreTagSequence = - mapM_ $ XML.many_ . XML.ignoreTreeContent . matchingLocalName + mapM_ + $ XML.many_ + . (\name -> XML.ignoreTreeContent (matchingLocalName name) ignoreAttrs) -- | Skip tags which are not on the list. ignoreTagsExcept :: MonadThrow m => [Text] -> ConduitT Event o m () ignoreTagsExcept tagsToKeep = XML.many_ - $ XML.ignoreTreeContent (XML.matching $ not . isTagToKeep) + $ XML.ignoreTreeContent (XML.matching $ not . isTagToKeep) ignoreAttrs where isTagToKeep :: XML.Name -> Bool isTagToKeep t = @@ -126,7 +125,7 @@ parseFoldState parsers0 s0 = Just <$> go s0 parsers = parsers0 <> [parseFallback] where -- Swallows an unhandled tag. - parseFallback s = fmap (fmap (const s)) XML.ignoreAnyTreeContent + parseFallback s = fmap (fmap (const s)) XML.ignoreAnyTreeContent -- | Tries the first subparser that works (falling back to an accept-any -- parser), and loops while there's any tag to try. go s = do