From bd99e5d7de66deb37a308298f5acfd58ad84b914 Mon Sep 17 00:00:00 2001 From: Alexander Bantyev Date: Thu, 5 Dec 2019 18:09:55 +0300 Subject: [PATCH 1/2] Build binary instead of a library --- default.nix | 2 +- package.yaml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/default.nix b/default.nix index 479cf7b..6c64701 100644 --- a/default.nix +++ b/default.nix @@ -17,4 +17,4 @@ in (hn.stackProject { url = "https://github.com/${lootbox.owner}/${lootbox.repo}.git"; subdir = "code/prelude"; }]; -}).crossref-verifier +}).crossref-verifier.components.exes diff --git a/package.yaml b/package.yaml index f9fcf1f..ead8df4 100644 --- a/package.yaml +++ b/package.yaml @@ -95,6 +95,7 @@ executables: - -O2 dependencies: - crossref-verifier + - yaml tests: crossref-verifier-tests: From 5fb8841df876da06e66cb7cdcd24c1ce9b477359 Mon Sep 17 00:00:00 2001 From: Alexander Bantyev Date: Thu, 5 Dec 2019 18:21:34 +0300 Subject: [PATCH 2/2] Also build tests --- .gitignore | 3 ++- default.nix | 34 ++++++++++++++++++---------------- package.yaml | 1 - 3 files changed, 20 insertions(+), 18 deletions(-) diff --git a/.gitignore b/.gitignore index aa2faad..2c82b86 100644 --- a/.gitignore +++ b/.gitignore @@ -21,4 +21,5 @@ cabal.project.local cabal.project.local~ .HTF/ .ghc.environment.* -result*/ \ No newline at end of file +result +result-* \ No newline at end of file diff --git a/default.nix b/default.nix index 6c64701..68adc1e 100644 --- a/default.nix +++ b/default.nix @@ -2,19 +2,21 @@ let sources = import ./nix/sources.nix; nixpkgs = import sources.nixpkgs (import sources."haskell.nix"); hn = nixpkgs.haskell-nix; -in (hn.stackProject { - src = hn.haskellLib.cleanGit { src = ./.; }; - modules = [{ - packages.crossref-verifier = { - # More failures during CI == Less failures in runtime! - postHaddock = ''[[ -z "$(ls -A dist/doc/html)" ]] && exit 1 || echo "haddock successfully generated documentation"''; - package.ghcOptions = "-Werror"; - }; - }]; - cache = with sources; [{ - name = "loot-prelude"; - inherit (lootbox) sha256 rev; - url = "https://github.com/${lootbox.owner}/${lootbox.repo}.git"; - subdir = "code/prelude"; - }]; -}).crossref-verifier.components.exes + project = hn.stackProject { + src = hn.haskellLib.cleanGit { src = ./.; }; + modules = [{ + packages.crossref-verifier = { + # More failures during CI == Less failures in runtime! + postHaddock = '' + [[ -z "$(ls -A dist/doc/html)" ]] && exit 1 || echo "haddock successfully generated documentation"''; + package.ghcOptions = "-Werror"; + }; + }]; + cache = with sources; [{ + name = "loot-prelude"; + inherit (lootbox) sha256 rev; + url = "https://github.com/${lootbox.owner}/${lootbox.repo}.git"; + subdir = "code/prelude"; + }]; + }; +in with project; [ crossref-verifier.components.exes crossref-verifier ] diff --git a/package.yaml b/package.yaml index ead8df4..f9fcf1f 100644 --- a/package.yaml +++ b/package.yaml @@ -95,7 +95,6 @@ executables: - -O2 dependencies: - crossref-verifier - - yaml tests: crossref-verifier-tests: