From 2923d1ea9bab85cbd0c55bffba76bd4f1cf2ce48 Mon Sep 17 00:00:00 2001 From: "(cdep)illabout" Date: Sun, 27 Dec 2020 13:09:44 +0900 Subject: [PATCH 01/12] Try adding stack-nightly.yaml. --- stack-nightly.yaml | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 stack-nightly.yaml diff --git a/stack-nightly.yaml b/stack-nightly.yaml new file mode 100644 index 00000000..173345b6 --- /dev/null +++ b/stack-nightly.yaml @@ -0,0 +1,40 @@ +# For more information, see: http://docs.haskellstack.org/en/stable/yaml_configuration.html + +# Specifies the GHC version and set of packages available (e.g., lts-3.5, nightly-2015-09-21, ghc-7.10.2) +resolver: nightly-2020-12-14 + +# Local packages, usually specified by relative directory name +packages: + - '.' + +# Packages to be pulled from upstream that are not in the resolver (e.g., acme-missiles-0.3) +extra-deps: [] + +# Override default flag values for local packages and extra-deps +flags: {} + +# Extra package databases containing global packages +extra-package-dbs: [] + +# Control whether we use the GHC we find on the path +# system-ghc: true + +# Require a specific version of stack, using version ranges +# require-stack-version: -any # Default +# require-stack-version: >= 1.0.0 + +# Override the architecture used by stack, especially useful on Windows +# arch: i386 +# arch: x86_64 + +# Extra directories used by stack for building +# extra-include-dirs: [/path/to/dir] +# extra-lib-dirs: [/path/to/dir] + +# Allow a newer minor version of GHC than the snapshot specifies +# compiler-check: newer-minor + +nix: + packages: [] + pure: true + shell-file: .nix-helpers/stack-shell.nix From e3d99a8c36e24cf9f422951179f1d5f0bb94740f Mon Sep 17 00:00:00 2001 From: "(cdep)illabout" Date: Sun, 27 Dec 2020 11:50:20 +0900 Subject: [PATCH 02/12] Bump GitHub Actions setup-haskell version to 1.1.4 so that it works again. --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3fcb9490..e5e0699e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,7 @@ jobs: - uses: actions/checkout@v2 #if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/master' - - uses: actions/setup-haskell@v1.1 + - uses: actions/setup-haskell@v1.1.4 id: setup-haskell-cabal name: Setup Haskell with: @@ -59,7 +59,7 @@ jobs: - uses: actions/checkout@v2 #if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/master' - - uses: actions/setup-haskell@v1.1 + - uses: actions/setup-haskell@v1.1.4 name: Setup Haskell Stack with: stack-version: ${{ matrix.stack }} From c5c408bd914d09f04380920d80559fa902851ff9 Mon Sep 17 00:00:00 2001 From: "(cdep)illabout" Date: Sun, 27 Dec 2020 11:57:54 +0900 Subject: [PATCH 03/12] Update to use haskell/actions/setup instead of actions/setup-haskell. --- .github/workflows/ci.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e5e0699e..25426d40 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,13 +18,13 @@ jobs: cabal: ["latest"] ghc: - "8.8.4" - - "8.10.2" + - "8.10.3" steps: - uses: actions/checkout@v2 #if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/master' - - uses: actions/setup-haskell@v1.1.4 + - uses: haskell/actions/setup@v1 id: setup-haskell-cabal name: Setup Haskell with: @@ -59,10 +59,11 @@ jobs: - uses: actions/checkout@v2 #if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/master' - - uses: actions/setup-haskell@v1.1.4 + - uses: haskell/actions/setup@v1 name: Setup Haskell Stack with: stack-version: ${{ matrix.stack }} + enable-stack: true - uses: actions/cache@v1 name: Cache ~/.stack From cb5eb7ff0dc0e61ece41978acdf680693db69e4c Mon Sep 17 00:00:00 2001 From: "(cdep)illabout" Date: Sun, 27 Dec 2020 13:26:47 +0900 Subject: [PATCH 04/12] Bump to install-nix-actionv12 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 25426d40..39402aad 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -86,7 +86,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - uses: cachix/install-nix-action@v10 + - uses: cachix/install-nix-action@v12 with: nix_path: nixpkgs=channel:nixos-unstable - run: nix-build From 5c1f9a7af8d4d567bf4fca3058039104fade0b31 Mon Sep 17 00:00:00 2001 From: "(cdep)illabout" Date: Sun, 27 Dec 2020 14:10:38 +0900 Subject: [PATCH 05/12] Add a stack-nightly.yaml.lock file. --- stack-nightly.yaml.lock | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 stack-nightly.yaml.lock diff --git a/stack-nightly.yaml.lock b/stack-nightly.yaml.lock new file mode 100644 index 00000000..d7802a4d --- /dev/null +++ b/stack-nightly.yaml.lock @@ -0,0 +1,12 @@ +# This file was autogenerated by Stack. +# You should not edit this file by hand. +# For more information, please see the documentation at: +# https://docs.haskellstack.org/en/stable/lock_files + +packages: [] +snapshots: +- completed: + size: 558061 + url: https://raw.githubusercontent.com/commercialhaskell/stackage-snapshots/master/nightly/2020/12/14.yaml + sha256: 0c80697b1db876c0ab31b43e42be53f886657a336eca59c73c361078e631d65b + original: nightly-2020-12-14 From af7f095b18cbb84e3e292fbbce51b4a38dcea023 Mon Sep 17 00:00:00 2001 From: "(cdep)illabout" Date: Sun, 27 Dec 2020 14:11:30 +0900 Subject: [PATCH 06/12] Bump nixpkgs version to master around 2020-12-27 --- .nix-helpers/nixpkgs.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.nix-helpers/nixpkgs.nix b/.nix-helpers/nixpkgs.nix index b9c75db1..366f8e6c 100644 --- a/.nix-helpers/nixpkgs.nix +++ b/.nix-helpers/nixpkgs.nix @@ -26,13 +26,13 @@ let if isNull nixpkgs then builtins.fetchTarball { - # Recent version of nixpkgs master as of 2020-08-18 which uses LTS-16.9. - url = "https://github.com/NixOS/nixpkgs/archive/c5815280e92112a25d958a2ec8b3704d7d90c506.tar.gz"; - sha256 = "09ic4s9s7w3lm0gmcxszm5j20cfv4n5lfvhdvgi7jzdbbbdps1nh"; + # Recent version of nixpkgs master as of 2020-12-27 which uses nightly-2020-12-14. + url = "https://github.com/NixOS/nixpkgs/archive/84917aa00bf23c88e5874c683abe05edb0ba4078.tar.gz"; + sha256 = "1x3qh815d7k9yc72zpn5cfaaq2b1942q4pka6rx8b5i33yz4m61q"; } else nixpkgs; - compilerVersion = if isNull compiler then "ghc884" else compiler; + compilerVersion = if isNull compiler then "ghc8103" else compiler; # An overlay that adds termonad to all haskell package sets. haskellPackagesOverlay = self: super: { From 3fcb707f840fa40d184b2513e8e33d8464e2e8c1 Mon Sep 17 00:00:00 2001 From: "(cdep)illabout" Date: Sun, 27 Dec 2020 15:04:27 +0900 Subject: [PATCH 07/12] Add required libs to stack-nightly.yaml --- stack-nightly.yaml | 4 +++- stack-nightly.yaml.lock | 16 +++++++++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/stack-nightly.yaml b/stack-nightly.yaml index 173345b6..6e0ba39a 100644 --- a/stack-nightly.yaml +++ b/stack-nightly.yaml @@ -8,7 +8,9 @@ packages: - '.' # Packages to be pulled from upstream that are not in the resolver (e.g., acme-missiles-0.3) -extra-deps: [] +extra-deps: + - gi-vte-2.91.27@sha256:22faf2c2333ca2fe90780d44defcc7b095c619b72f27b90c9de1f5e2a960a5e3,3731 + - xml-html-qq-0.1.0.1@sha256:1e6dc32d764da2b80eed8809cdbee0cb1f57011fa95ad1d8fe5949c4d8bde568,2331 # Override default flag values for local packages and extra-deps flags: {} diff --git a/stack-nightly.yaml.lock b/stack-nightly.yaml.lock index d7802a4d..46c7925e 100644 --- a/stack-nightly.yaml.lock +++ b/stack-nightly.yaml.lock @@ -3,7 +3,21 @@ # For more information, please see the documentation at: # https://docs.haskellstack.org/en/stable/lock_files -packages: [] +packages: +- completed: + hackage: gi-vte-2.91.27@sha256:22faf2c2333ca2fe90780d44defcc7b095c619b72f27b90c9de1f5e2a960a5e3,3731 + pantry-tree: + size: 356 + sha256: 2bfa50f6abba8feda2a8b5b1a36c589562d4f31ecc3c351239bdd3b4454c4458 + original: + hackage: gi-vte-2.91.27@sha256:22faf2c2333ca2fe90780d44defcc7b095c619b72f27b90c9de1f5e2a960a5e3,3731 +- completed: + hackage: xml-html-qq-0.1.0.1@sha256:1e6dc32d764da2b80eed8809cdbee0cb1f57011fa95ad1d8fe5949c4d8bde568,2331 + pantry-tree: + size: 499 + sha256: 4bc9e68d9470b2d37eddc97235700c1a7fb7b64740f3ba4d3196ff4f16973676 + original: + hackage: xml-html-qq-0.1.0.1@sha256:1e6dc32d764da2b80eed8809cdbee0cb1f57011fa95ad1d8fe5949c4d8bde568,2331 snapshots: - completed: size: 558061 From 99e3fa7192fb5a3c4cb1e923774a6a396d9e3bab Mon Sep 17 00:00:00 2001 From: "(cdep)illabout" Date: Sun, 27 Dec 2020 18:32:52 +0900 Subject: [PATCH 08/12] Get termonad building correctly with nix and fix pcre2 error. --- .nix-helpers/nixpkgs.nix | 76 ++++++++++++++++++++++++++++++++++------ 1 file changed, 65 insertions(+), 11 deletions(-) diff --git a/.nix-helpers/nixpkgs.nix b/.nix-helpers/nixpkgs.nix index 366f8e6c..4c518708 100644 --- a/.nix-helpers/nixpkgs.nix +++ b/.nix-helpers/nixpkgs.nix @@ -27,12 +27,24 @@ let then builtins.fetchTarball { # Recent version of nixpkgs master as of 2020-12-27 which uses nightly-2020-12-14. - url = "https://github.com/NixOS/nixpkgs/archive/84917aa00bf23c88e5874c683abe05edb0ba4078.tar.gz"; - sha256 = "1x3qh815d7k9yc72zpn5cfaaq2b1942q4pka6rx8b5i33yz4m61q"; + # url = "https://github.com/NixOS/nixpkgs/archive/84917aa00bf23c88e5874c683abe05edb0ba4078.tar.gz"; + # sha256 = "1x3qh815d7k9yc72zpn5cfaaq2b1942q4pka6rx8b5i33yz4m61q"; + + # bad + url = "https://github.com/NixOS/nixpkgs/archive/06279ee84f5dd62.tar.gz"; + sha256 = "1p033qi1bq565alfmjnhw1xmnnq6vh4gjlpjd3fn2lv80f9ww8pb"; + + # good + # url = "https://github.com/nixos/nixpkgs/archive/774d5acfcfd244397f.tar.gz"; + # sha256 = "07aj8y8r28ca72d47qp5l1pgprgxqs5dx2kg0f0c99gpvph8nxq0"; + + # old + # url = "https://github.com/NixOS/nixpkgs/archive/c5815280e92112.tar.gz"; + # sha256 = "09ic4s9s7w3lm0gmcxszm5j20cfv4n5lfvhdvgi7jzdbbbdps1nh"; } else nixpkgs; - compilerVersion = if isNull compiler then "ghc8103" else compiler; + compilerVersion = if isNull compiler then "ghc8102" else compiler; # An overlay that adds termonad to all haskell package sets. haskellPackagesOverlay = self: super: { @@ -60,15 +72,57 @@ let extraCabal2nixOptions = self.lib.optionalString buildExamples "-fbuildexamples"; + termonadPkg = + { mkDerivation, adjunctions, base, Cabal, cabal-doctest + , classy-prelude, colour, constraints, containers, data-default + , directory, distributive, doctest, dyre, file-embed, filepath + , focuslist, genvalidity-containers, genvalidity-hspec, gi-gdk + , gi-gio, gi-glib, gi-gtk, gi-pango, gi-vte, gtk3, haskell-gi-base + , hedgehog, inline-c, lens, mono-traversable, pcre2, pretty-simple + , QuickCheck, stdenv, tasty, tasty-hedgehog, tasty-hspec + , template-haskell, text, transformers, vte_291, xml-conduit + , xml-html-qq, yaml + }: + mkDerivation { + pname = "termonad"; + version = "4.0.1.1"; + inherit src; + isLibrary = true; + isExecutable = true; + enableSeparateDataOutput = true; + setupHaskellDepends = [ base Cabal cabal-doctest ]; + libraryHaskellDepends = [ + adjunctions base classy-prelude colour constraints containers + data-default directory distributive dyre file-embed filepath + focuslist gi-gdk gi-gio gi-glib gi-gtk gi-pango gi-vte + haskell-gi-base inline-c lens mono-traversable pretty-simple + QuickCheck text transformers xml-conduit xml-html-qq yaml + ]; + libraryPkgconfigDepends = [ gtk3 pcre2 vte_291 ]; + executableHaskellDepends = [ base ]; + testHaskellDepends = [ + base doctest genvalidity-containers genvalidity-hspec hedgehog lens + QuickCheck tasty tasty-hedgehog tasty-hspec template-haskell + ]; + homepage = "https://github.com/cdepillabout/termonad"; + description = "Terminal emulator configurable in Haskell"; + license = stdenv.lib.licenses.bsd3; + }; + termonadDrv = - hself.callCabal2nixWithOptions - "termonad" - src - extraCabal2nixOptions - { - inherit (self) gtk3; - vte_291 = self.vte; - }; + # hself.callCabal2nixWithOptions + # "termonad" + # src + # extraCabal2nixOptions + # { + # inherit (self) gtk3; + # vte_291 = self.vte; + # }; + hself.callPackage termonadPkg { + gtk3 = self.gtk3; + pcre2 = self.pcre2; + vte_291 = self.vte; + }; in termonadDrv; }; From e4fd607c7e0bc7d52e730adaff6e8bc94d3ff06b Mon Sep 17 00:00:00 2001 From: "(cdep)illabout" Date: Sun, 27 Dec 2020 20:12:49 +0900 Subject: [PATCH 09/12] Get termonad compiling with cabal. --- .nix-helpers/nixpkgs.nix | 79 +++++++--------------------------------- termonad.cabal | 1 + 2 files changed, 15 insertions(+), 65 deletions(-) diff --git a/.nix-helpers/nixpkgs.nix b/.nix-helpers/nixpkgs.nix index 4c518708..7e815895 100644 --- a/.nix-helpers/nixpkgs.nix +++ b/.nix-helpers/nixpkgs.nix @@ -27,24 +27,12 @@ let then builtins.fetchTarball { # Recent version of nixpkgs master as of 2020-12-27 which uses nightly-2020-12-14. - # url = "https://github.com/NixOS/nixpkgs/archive/84917aa00bf23c88e5874c683abe05edb0ba4078.tar.gz"; - # sha256 = "1x3qh815d7k9yc72zpn5cfaaq2b1942q4pka6rx8b5i33yz4m61q"; - - # bad - url = "https://github.com/NixOS/nixpkgs/archive/06279ee84f5dd62.tar.gz"; - sha256 = "1p033qi1bq565alfmjnhw1xmnnq6vh4gjlpjd3fn2lv80f9ww8pb"; - - # good - # url = "https://github.com/nixos/nixpkgs/archive/774d5acfcfd244397f.tar.gz"; - # sha256 = "07aj8y8r28ca72d47qp5l1pgprgxqs5dx2kg0f0c99gpvph8nxq0"; - - # old - # url = "https://github.com/NixOS/nixpkgs/archive/c5815280e92112.tar.gz"; - # sha256 = "09ic4s9s7w3lm0gmcxszm5j20cfv4n5lfvhdvgi7jzdbbbdps1nh"; + url = "https://github.com/NixOS/nixpkgs/archive/84917aa00bf23c88e5874c683abe05edb0ba4078.tar.gz"; + sha256 = "1x3qh815d7k9yc72zpn5cfaaq2b1942q4pka6rx8b5i33yz4m61q"; } else nixpkgs; - compilerVersion = if isNull compiler then "ghc8102" else compiler; + compilerVersion = if isNull compiler then "ghc8103" else compiler; # An overlay that adds termonad to all haskell package sets. haskellPackagesOverlay = self: super: { @@ -72,57 +60,18 @@ let extraCabal2nixOptions = self.lib.optionalString buildExamples "-fbuildexamples"; - termonadPkg = - { mkDerivation, adjunctions, base, Cabal, cabal-doctest - , classy-prelude, colour, constraints, containers, data-default - , directory, distributive, doctest, dyre, file-embed, filepath - , focuslist, genvalidity-containers, genvalidity-hspec, gi-gdk - , gi-gio, gi-glib, gi-gtk, gi-pango, gi-vte, gtk3, haskell-gi-base - , hedgehog, inline-c, lens, mono-traversable, pcre2, pretty-simple - , QuickCheck, stdenv, tasty, tasty-hedgehog, tasty-hspec - , template-haskell, text, transformers, vte_291, xml-conduit - , xml-html-qq, yaml - }: - mkDerivation { - pname = "termonad"; - version = "4.0.1.1"; - inherit src; - isLibrary = true; - isExecutable = true; - enableSeparateDataOutput = true; - setupHaskellDepends = [ base Cabal cabal-doctest ]; - libraryHaskellDepends = [ - adjunctions base classy-prelude colour constraints containers - data-default directory distributive dyre file-embed filepath - focuslist gi-gdk gi-gio gi-glib gi-gtk gi-pango gi-vte - haskell-gi-base inline-c lens mono-traversable pretty-simple - QuickCheck text transformers xml-conduit xml-html-qq yaml - ]; - libraryPkgconfigDepends = [ gtk3 pcre2 vte_291 ]; - executableHaskellDepends = [ base ]; - testHaskellDepends = [ - base doctest genvalidity-containers genvalidity-hspec hedgehog lens - QuickCheck tasty tasty-hedgehog tasty-hspec template-haskell - ]; - homepage = "https://github.com/cdepillabout/termonad"; - description = "Terminal emulator configurable in Haskell"; - license = stdenv.lib.licenses.bsd3; - }; - termonadDrv = - # hself.callCabal2nixWithOptions - # "termonad" - # src - # extraCabal2nixOptions - # { - # inherit (self) gtk3; - # vte_291 = self.vte; - # }; - hself.callPackage termonadPkg { - gtk3 = self.gtk3; - pcre2 = self.pcre2; - vte_291 = self.vte; - }; + hself.callCabal2nixWithOptions + "termonad" + src + extraCabal2nixOptions + { + # There are Haskell packages called gtk3 and pcre2, which + # makes these system dependencies not able to be resolved + # correctly. + inherit (self) gtk3 pcre2; + vte_291 = self.vte; + }; in termonadDrv; }; diff --git a/termonad.cabal b/termonad.cabal index 816e7b77..c8595539 100644 --- a/termonad.cabal +++ b/termonad.cabal @@ -147,6 +147,7 @@ test-suite doctests , doctest , QuickCheck , template-haskell + , termonad default-language: Haskell2010 ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N From 79cae52cef1475974e8506fe77b647e2b044eeaa Mon Sep 17 00:00:00 2001 From: "(cdep)illabout" Date: Sun, 27 Dec 2020 21:22:17 +0900 Subject: [PATCH 10/12] Only build doctests when using ghc-8.10.2 or earlier. See https://github.com/cdepillabout/termonad/issues/174 for a description of this problem. This commit is only working around the problem, not fixing it. --- termonad.cabal | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/termonad.cabal b/termonad.cabal index c8595539..3f894628 100644 --- a/termonad.cabal +++ b/termonad.cabal @@ -150,6 +150,12 @@ test-suite doctests , termonad default-language: Haskell2010 ghc-options: -Wall -threaded -rtsopts -with-rtsopts=-N + -- For some reason doctests appear to be segfaulting when compiling with + -- ghc-8.10.3, so only build them when using ghc-8.10.2 or earlier. + if impl(ghc <= 8.10.2) + buildable: True + else + buildable: False test-suite termonad-test type: exitcode-stdio-1.0 From 53bf4672294b11b51686ab0be235851c7391ae24 Mon Sep 17 00:00:00 2001 From: "(cdep)illabout" Date: Sun, 27 Dec 2020 21:24:53 +0900 Subject: [PATCH 11/12] Enable building on 8.10.2 on github actions ci. --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 39402aad..b5d2dd75 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,6 +18,7 @@ jobs: cabal: ["latest"] ghc: - "8.8.4" + - "8.10.2" # doctests are disabled on 8.10.3, but still working on 8.10.2. - "8.10.3" steps: From 923c1a995b5827c35c6b52f8e52d61e1c6fd3c5b Mon Sep 17 00:00:00 2001 From: "(cdep)illabout" Date: Sun, 27 Dec 2020 21:56:45 +0900 Subject: [PATCH 12/12] Bump version to 4.0.1.2. --- CHANGELOG.md | 6 ++++++ termonad.cabal | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 50f91953..7f26a0cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +## 4.0.1.2 + +* Disable doctest test-suite when building with GHC-8.10.3. The doctests + appear to be segfaulting, but only when compiled with GHC-8.10.3. + [#175](https://github.com/cdepillabout/termonad/pull/175). + ## 4.0.1.1 * Bump upper dependency on `base` so that Termonad is compatible with diff --git a/termonad.cabal b/termonad.cabal index 3f894628..049a51fc 100644 --- a/termonad.cabal +++ b/termonad.cabal @@ -1,5 +1,5 @@ name: termonad -version: 4.0.1.1 +version: 4.0.1.2 synopsis: Terminal emulator configurable in Haskell description: Termonad is a terminal emulator configurable in Haskell. It is extremely