From 29cd92ba36cd2009cbeb4f9d1ce7c4fe58bd65b6 Mon Sep 17 00:00:00 2001 From: Anton-Latukha Date: Wed, 17 Jun 2020 15:37:43 +0300 Subject: [PATCH 01/13] CI: .travis.tml: clean-up Since conf no longer multiplies rows into matrix, but provides it explitly, exclusions not needed. M .travis.yml --- .travis.yml | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/.travis.yml b/.travis.yml index 712e5e3..f9f7ff7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -112,19 +112,6 @@ jobs: dist: bionic allow_failures: - env: GHCVERSION=ghcjs - # 2020-05-26: NOTE: Discard macOS GHCJS build + -> CI loop becomes ~30-40 minutes shorter - exclude: - - os: osx - env: GHCVERSION=ghcjs - - os: osx - env: GHCVERSION=ghc8101 - - os: osx - env: GHCVERSION=ghc865 - - os: osx - env: GHCVERSION=ghc844 - # NOTE: Discard Linux GHC 8.8.3 in favour of macOS GHC 8.8.3, Nixpkgs channel is the same and Nix package code is the same, since we test other Linux deployments and since 8.8.3 builds on macOS - we can be sure it builds inside Nix in Linux also. So lets optimize number of CI builds - - os: linux - env: GHCVERSION=ghc883 before_script: - sudo mount -o remount,exec,size=4G,mode=755 /run/user || true From c580b4e8376307771767b5a3ae3c90b4420d086d Mon Sep 17 00:00:00 2001 From: Anton-Latukha Date: Wed, 17 Jun 2020 19:40:21 +0300 Subject: [PATCH 02/13] CI: make generate*Complettions work and accept a list of executables M .travis.yml M build.sh M default.nix --- .travis.yml | 3 ++- build.sh | 20 +++++++------------- default.nix | 7 ++++--- 3 files changed, 13 insertions(+), 17 deletions(-) diff --git a/.travis.yml b/.travis.yml index f9f7ff7..455dfbc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -73,7 +73,8 @@ env: # # command: name of an executable # pkg: Haskell package that builds the executables - - generateOptparseApplicativeCompletion=false + - generateOptparseApplicativeCompletions=false + - executableNamesToShellComplete='[ "hnix" ]' # NOTE: Don't fail at configure time if there are multiple versions of the same package in the (recursive) dependencies of the package being built. Will delay failures, if any, to compile time. - allowInconsistentDependencies=false # NOTE: Log file to dump GHCJS build into diff --git a/build.sh b/build.sh index 2909a82..051515a 100755 --- a/build.sh +++ b/build.sh @@ -28,6 +28,8 @@ buildStackProject=${buildStackProject:-'false'} # NOTE: *Oprparse* key is redifined in the code further generateOptparseApplicativeCompletions=${generateOptparseApplicativeCompletions:-'false'} allowInconsistentDependencies=${allowInconsistentDependencies:-'false'} +executableNamesToShellComplete=${executableNamesToShellComplete:-'[ "defaultBinaryName" ]'} + ghcjsTmpLogFile=${ghcjsTmpLogFile:-'/tmp/ghcjsTmpLogFile.log'} ghcjsLogTailLength=${ghcjsLogTailLength:-'10000'} # NOTE: If key not provided (branch is not inside the central repo) - init CACHIX_SIGNING_KEY as empty @@ -69,16 +71,6 @@ SILENT(){ BUILD_PROJECT(){ -# NOTE: Resulting value injects into `nix-build` commands -if [ "$generateOptparseApplicativeCompletion" = 'true' ] - then - # NOTE: Enable shell completion generation - generateOptparseApplicativeCompletion="--arg generateOptparseApplicativeCompletion $name $pkgName" - else - # NOTE: Skip the shell completion generation - generateOptparseApplicativeCompletion='' -fi - IFS=$'\n\t' if [ "$GHCVERSION" = "ghcjs" ] @@ -107,8 +99,9 @@ if [ "$GHCVERSION" = "ghcjs" ] --arg buildStrictly "$buildStrictly" \ --arg disableOptimization "$disableOptimization" \ --arg buildStackProject "$buildStackProject" \ - "$generateOptparseApplicativeCompletion" \ --arg allowInconsistentDependencies "$allowInconsistentDependencies" \ + --arg generateOptparseApplicativeCompletions "$generateOptparseApplicativeCompletions" \ + --arg executableNamesToShellComplete "$executableNamesToShellComplete" \ ghcjs else @@ -132,8 +125,9 @@ if [ "$GHCVERSION" = "ghcjs" ] --arg buildStrictly "$buildStrictly" \ --arg disableOptimization "$disableOptimization" \ --arg buildStackProject "$buildStackProject" \ - "$generateOptparseApplicativeCompletion" \ - --arg allowInconsistentDependencies "$allowInconsistentDependencies" + --arg allowInconsistentDependencies "$allowInconsistentDependencies" \ + --arg generateOptparseApplicativeCompletions "$generateOptparseApplicativeCompletions" \ + --arg executableNamesToShellComplete "$executableNamesToShellComplete" fi } diff --git a/default.nix b/default.nix index 08e59cc..bc2fb1b 100644 --- a/default.nix +++ b/default.nix @@ -53,7 +53,8 @@ # doBenchmark: Dependency checking + compilation and execution for benchmarks listed in the package description file. , doBenchmark ? false # Modify a Haskell package to add shell completion scripts for the given executable produced by it. These completion scripts will be picked up automatically if the resulting derivation is installed -, generateOptparseApplicativeCompletion ? false +, generateOptparseApplicativeCompletions ? false +, executableNamesToShellComplete ? [ "hnix" ] , withHoogle ? true @@ -191,8 +192,8 @@ let function = pkgs.haskell.lib.checkUnusedPackages {}; } { - switch = generateOptparseApplicativeCompletion; - function = pkgs.haskell.lib.generateOptparseApplicativeCompletion "hnix"; + switch = generateOptparseApplicativeCompletions; + function = pkgs.haskell.lib.generateOptparseApplicativeCompletions executableNamesToShellComplete; } { switch = doHyperlinkSource; From 222489baf35c453e2a2b0e8900fc97ed45ff2c7f Mon Sep 17 00:00:00 2001 From: Anton-Latukha Date: Wed, 17 Jun 2020 19:41:25 +0300 Subject: [PATCH 03/13] CI: rm buildStackProject, it does not work that way, and better to use real stack M .travis.yml M build.sh --- .travis.yml | 1 - build.sh | 4 ---- 2 files changed, 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 455dfbc..eba7370 100644 --- a/.travis.yml +++ b/.travis.yml @@ -66,7 +66,6 @@ env: - buildStrictly=false # NOTE: Disable core optimizations, significantly speeds up the build - disableOptimization=true - - buildStackProject=false # NOTE: Modify a Haskell package to add shell completion scripts for the given executable produced by it. These completion scripts will be picked up automatically if the resulting derivation is installed, e.g. by `nix-env -i`. # Invocation: # generateOptparseApplicativeCompletions command pkg diff --git a/build.sh b/build.sh index 051515a..5b819de 100755 --- a/build.sh +++ b/build.sh @@ -10,7 +10,6 @@ GHCVERSION=${GHCVERSION:-'ghc883'} rev=${rev:-'nixpkgs-unstable'} NIX_PATH=${NIX_PATH:-"nixpkgs=https://github.com/nixos/nixpkgs/archive/$rev.tar.gz"} export NIX_PATH -name=${name:-'defaultBinaryName'} pkgName=${pkgName:-'defaultPkgName'} failOnAllWarnings=${failOnAllWarnings:-'false'} checkUnusedPackages=${checkUnusedPackages:-'false'} @@ -24,7 +23,6 @@ enableLibraryProfiling=${enableLibraryProfiling:-'false'} buildFromSdist=${buildFromSdist:-'false'} buildStrictly=${buildStrictly:-'false'} disableOptimization=${disableOptimization:-'true'} -buildStackProject=${buildStackProject:-'false'} # NOTE: *Oprparse* key is redifined in the code further generateOptparseApplicativeCompletions=${generateOptparseApplicativeCompletions:-'false'} allowInconsistentDependencies=${allowInconsistentDependencies:-'false'} @@ -98,7 +96,6 @@ if [ "$GHCVERSION" = "ghcjs" ] --arg buildFromSdist "$buildFromSdist" \ --arg buildStrictly "$buildStrictly" \ --arg disableOptimization "$disableOptimization" \ - --arg buildStackProject "$buildStackProject" \ --arg allowInconsistentDependencies "$allowInconsistentDependencies" \ --arg generateOptparseApplicativeCompletions "$generateOptparseApplicativeCompletions" \ --arg executableNamesToShellComplete "$executableNamesToShellComplete" \ @@ -124,7 +121,6 @@ if [ "$GHCVERSION" = "ghcjs" ] --arg buildFromSdist "$buildFromSdist" \ --arg buildStrictly "$buildStrictly" \ --arg disableOptimization "$disableOptimization" \ - --arg buildStackProject "$buildStackProject" \ --arg allowInconsistentDependencies "$allowInconsistentDependencies" \ --arg generateOptparseApplicativeCompletions "$generateOptparseApplicativeCompletions" \ --arg executableNamesToShellComplete "$executableNamesToShellComplete" From c859eae01306c2a604341245f419bac0e4673c7a Mon Sep 17 00:00:00 2001 From: Anton-Latukha Date: Wed, 17 Jun 2020 15:45:42 +0300 Subject: [PATCH 04/13] default.nix: clean-up docs M default.nix --- default.nix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/default.nix b/default.nix index bc2fb1b..e1e1c83 100644 --- a/default.nix +++ b/default.nix @@ -18,9 +18,8 @@ # `failOnAllWarnings` + `buildFromSdist` , buildStrictly ? false # 2020-06-02: NOTE: enableDeadCodeElimination = true: On GHC =< 8.8.3 macOS build falls due to https://gitlab.haskell.org/ghc/ghc/issues/17283 -# Disable GHC code optimizations for faster dev loops. Enable optimizations for production use or benchmarks. , enableDeadCodeElimination ? false -# Optimization disabled for faster compiling/dev loop +# Disable GHC code optimizations for faster dev loops. Enable optimizations for production use or benchmarks. , disableOptimization ? true # Use faster `gold` ELF linker from GNU binutils instead of older&slower but more versatile GNU linker. Is not available by default since macOS does not have it. , linkWithGold ? false From 61c9ae15be5c9595a0cbfc59d2dae951af52cb34 Mon Sep 17 00:00:00 2001 From: Anton-Latukha Date: Wed, 17 Jun 2020 15:46:02 +0300 Subject: [PATCH 05/13] build.sh: default to GHC 8.10 M build.sh --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 5b819de..132f6f9 100755 --- a/build.sh +++ b/build.sh @@ -6,7 +6,7 @@ set -Eexuo pipefail # NOTE: If var not imported - set to the default value -GHCVERSION=${GHCVERSION:-'ghc883'} +GHCVERSION=${GHCVERSION:-'ghc8101'} rev=${rev:-'nixpkgs-unstable'} NIX_PATH=${NIX_PATH:-"nixpkgs=https://github.com/nixos/nixpkgs/archive/$rev.tar.gz"} export NIX_PATH From 0ea19e4125baf201356cbeffc56d074c6a1d5380 Mon Sep 17 00:00:00 2001 From: Anton-Latukha Date: Wed, 17 Jun 2020 15:48:13 +0300 Subject: [PATCH 06/13] build.sh: sort the options into logical order M build.sh --- build.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/build.sh b/build.sh index 132f6f9..4206ab0 100755 --- a/build.sh +++ b/build.sh @@ -11,21 +11,21 @@ rev=${rev:-'nixpkgs-unstable'} NIX_PATH=${NIX_PATH:-"nixpkgs=https://github.com/nixos/nixpkgs/archive/$rev.tar.gz"} export NIX_PATH pkgName=${pkgName:-'defaultPkgName'} -failOnAllWarnings=${failOnAllWarnings:-'false'} -checkUnusedPackages=${checkUnusedPackages:-'false'} -doCoverage=${doCoverage:-'false'} -doHaddock=${doHaddock:-'false'} +allowInconsistentDependencies=${allowInconsistentDependencies:-'false'} doJailbreak=${doJailbreak:-'false'} doCheck=${doCheck:-'true'} -doBenchmark=${doBenchmark:-'false'} -enableExecutableProfiling=${enableExecutableProfiling:-'false'} -enableLibraryProfiling=${enableLibraryProfiling:-'false'} buildFromSdist=${buildFromSdist:-'false'} +failOnAllWarnings=${failOnAllWarnings:-'false'} buildStrictly=${buildStrictly:-'false'} disableOptimization=${disableOptimization:-'true'} +enableLibraryProfiling=${enableLibraryProfiling:-'false'} +enableExecutableProfiling=${enableExecutableProfiling:-'false'} +checkUnusedPackages=${checkUnusedPackages:-'false'} +doHaddock=${doHaddock:-'false'} +doCoverage=${doCoverage:-'false'} +doBenchmark=${doBenchmark:-'false'} # NOTE: *Oprparse* key is redifined in the code further generateOptparseApplicativeCompletions=${generateOptparseApplicativeCompletions:-'false'} -allowInconsistentDependencies=${allowInconsistentDependencies:-'false'} executableNamesToShellComplete=${executableNamesToShellComplete:-'[ "defaultBinaryName" ]'} ghcjsTmpLogFile=${ghcjsTmpLogFile:-'/tmp/ghcjsTmpLogFile.log'} From de057de8e1cba3a194601464063caf095a44a29b Mon Sep 17 00:00:00 2001 From: Anton-Latukha Date: Wed, 17 Jun 2020 15:51:28 +0300 Subject: [PATCH 07/13] build.sh: provide docs to options M build.sh --- build.sh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/build.sh b/build.sh index 4206ab0..14bce9c 100755 --- a/build.sh +++ b/build.sh @@ -11,18 +11,31 @@ rev=${rev:-'nixpkgs-unstable'} NIX_PATH=${NIX_PATH:-"nixpkgs=https://github.com/nixos/nixpkgs/archive/$rev.tar.gz"} export NIX_PATH pkgName=${pkgName:-'defaultPkgName'} + +# Don't fail at configure time if there are multiple versions of the same package in the (recursive) dependencies of the package being built. Will delay failures, if any, to compile time. allowInconsistentDependencies=${allowInconsistentDependencies:-'false'} + +# Escape the version bounds from the cabal file. You may want to avoid this function. doJailbreak=${doJailbreak:-'false'} +# Nix dependency checking, compilation and execution of test suites listed in the package description file. doCheck=${doCheck:-'true'} +# Produce SDist tarball and build project from it buildFromSdist=${buildFromSdist:-'false'} failOnAllWarnings=${failOnAllWarnings:-'false'} +# `failOnAllWarnings` + `buildFromSdist` buildStrictly=${buildStrictly:-'false'} +# Disable GHC code optimizations for faster dev loops. Enable optimizations for production use or benchmarks. disableOptimization=${disableOptimization:-'true'} +# Provide an inventory of performance events and timings for the execution. Provides informaiton in an absolute sense. Nothing is timestamped. enableLibraryProfiling=${enableLibraryProfiling:-'false'} enableExecutableProfiling=${enableExecutableProfiling:-'false'} +# Add a post-build check to verify that dependencies declared in the .cabal file are actually used. checkUnusedPackages=${checkUnusedPackages:-'false'} +# Generation and installation of haddock API documentation doHaddock=${doHaddock:-'false'} +# Generation and installation of a coverage report. See https://wiki.haskell.org/Haskell_program_coverage doCoverage=${doCoverage:-'false'} +# doBenchmark: Dependency checking + compilation and execution for benchmarks listed in the package description file. doBenchmark=${doBenchmark:-'false'} # NOTE: *Oprparse* key is redifined in the code further generateOptparseApplicativeCompletions=${generateOptparseApplicativeCompletions:-'false'} From 701600a19ee38cad5e5330ac005bc6bcf31cd1df Mon Sep 17 00:00:00 2001 From: Anton-Latukha Date: Wed, 17 Jun 2020 15:51:48 +0300 Subject: [PATCH 08/13] build.sh: add disclamer for options M build.sh --- build.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/build.sh b/build.sh index 14bce9c..039c718 100755 --- a/build.sh +++ b/build.sh @@ -12,6 +12,10 @@ NIX_PATH=${NIX_PATH:-"nixpkgs=https://github.com/nixos/nixpkgs/archive/$rev.tar. export NIX_PATH pkgName=${pkgName:-'defaultPkgName'} +# This settings expose most of the Nixpkgs Haskell.lib API: https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/haskell-modules/lib.nix + +# Some of these options implicitly enable other options they require, and some counterpoint options clash, obviously + # Don't fail at configure time if there are multiple versions of the same package in the (recursive) dependencies of the package being built. Will delay failures, if any, to compile time. allowInconsistentDependencies=${allowInconsistentDependencies:-'false'} From 6f320076f8f0473a5d6e5c15d5e3543cd98eb68e Mon Sep 17 00:00:00 2001 From: Anton-Latukha Date: Wed, 17 Jun 2020 15:54:38 +0300 Subject: [PATCH 09/13] build.sh: add more options and their docs M build.sh --- build.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/build.sh b/build.sh index 039c718..47d04c8 100755 --- a/build.sh +++ b/build.sh @@ -23,16 +23,39 @@ allowInconsistentDependencies=${allowInconsistentDependencies:-'false'} doJailbreak=${doJailbreak:-'false'} # Nix dependency checking, compilation and execution of test suites listed in the package description file. doCheck=${doCheck:-'true'} +# Just produce a SDist src tarball +sdistTarball=${sdistTarball:-'false'} # Produce SDist tarball and build project from it buildFromSdist=${buildFromSdist:-'false'} failOnAllWarnings=${failOnAllWarnings:-'false'} # `failOnAllWarnings` + `buildFromSdist` buildStrictly=${buildStrictly:-'false'} +# 2020-06-02: NOTE: enableDeadCodeElimination = true: On GHC =< 8.8.3 macOS build falls due to https://gitlab.haskell.org/ghc/ghc/issues/17283 +enableDeadCodeElimination=${enableDeadCodeElimination:-'false'} # Disable GHC code optimizations for faster dev loops. Enable optimizations for production use or benchmarks. disableOptimization=${disableOptimization:-'true'} +# Use faster `gold` ELF linker from GNU binutils instead of older&slower but more versatile GNU linker. Is not available by default since macOS does not have it. +linkWithGold=${linkWithGold:-'false'} # Provide an inventory of performance events and timings for the execution. Provides informaiton in an absolute sense. Nothing is timestamped. enableLibraryProfiling=${enableLibraryProfiling:-'false'} enableExecutableProfiling=${enableExecutableProfiling:-'false'} +# Include tracing information & abilities. Tracing records the chronology, often with timestamps and is extensive in time +doTracing=${doTracing:-'false'} +# Include DWARF debugging information & abilities +enableDWARFDebugging=${enableDWARFDebugging:-'false'} +# Strip results from all debugging symbols +doStrip=${doStrip:-'false'} +# Generate hyperlinked source code for documentation using HsColour, and have Haddock documentation link to it. +doHyperlinkSource=${doHyperlinkSource:-'false'} +# Nixpkgs expects shared libraries +enableSharedLibraries=${enableSharedLibraries:-'true'} +# Ability to make static libraries +enableStaticLibraries=${enableStaticLibraries:-'false'} +# Make hybrid executable that is also a shared library +enableSharedExecutables=${enableSharedExecutables:-'false'} +# link executables statically against haskell libs to reduce closure size +justStaticExecutables=${justStaticExecutables:-'false'} +enableSeparateBinOutput=${enableSeparateBinOutput:-'false'} # Add a post-build check to verify that dependencies declared in the .cabal file are actually used. checkUnusedPackages=${checkUnusedPackages:-'false'} # Generation and installation of haddock API documentation @@ -45,6 +68,9 @@ doBenchmark=${doBenchmark:-'false'} generateOptparseApplicativeCompletions=${generateOptparseApplicativeCompletions:-'false'} executableNamesToShellComplete=${executableNamesToShellComplete:-'[ "defaultBinaryName" ]'} +# Include Hoogle into derivation +withHoogle=${withHoogle:-'false'} + ghcjsTmpLogFile=${ghcjsTmpLogFile:-'/tmp/ghcjsTmpLogFile.log'} ghcjsLogTailLength=${ghcjsLogTailLength:-'10000'} # NOTE: If key not provided (branch is not inside the central repo) - init CACHIX_SIGNING_KEY as empty From 19fbe4dea6ad39c2f640ddcc1bbf8e65a39f448d Mon Sep 17 00:00:00 2001 From: Anton-Latukha Date: Wed, 17 Jun 2020 19:42:24 +0300 Subject: [PATCH 10/13] build.sh: add new options into the build commands M build.sh --- build.sh | 68 +++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 45 insertions(+), 23 deletions(-) diff --git a/build.sh b/build.sh index 47d04c8..b1a071e 100755 --- a/build.sh +++ b/build.sh @@ -125,48 +125,70 @@ if [ "$GHCVERSION" = "ghcjs" ] # But Travis then terminates on 10 min no stdout timeout # so HACK: SILENT wrapper allows to surpress the huge log, while still preserves the Cachix caching ability in any case of the build # On build failure outputs the last 10000 lines of log (that should be more then enough), and terminates - SILENT nix-build \ - --arg failOnAllWarnings "$failOnAllWarnings" \ - --arg buildStrictly "$buildStrictly" \ - --arg checkUnusedPackages "$checkUnusedPackages" \ - --arg doCoverage "$doCoverage" \ - --arg doHaddock "$doHaddock" \ + SILENT nix-build \ + --arg allowInconsistentDependencies "$allowInconsistentDependencies" \ --arg doJailbreak "$doJailbreak" \ --arg doCheck "$doCheck" \ - --arg doBenchmark "$doBenchmark" \ - --arg enableExecutableProfiling "$enableExecutableProfiling" \ - --arg enableLibraryProfiling "$enableLibraryProfiling" \ + --arg sdistTarball "$sdistTarball" \ --arg buildFromSdist "$buildFromSdist" \ + --arg failOnAllWarnings "$failOnAllWarnings" \ --arg buildStrictly "$buildStrictly" \ + --arg enableDeadCodeElimination "$enableDeadCodeElimination" \ --arg disableOptimization "$disableOptimization" \ - --arg allowInconsistentDependencies "$allowInconsistentDependencies" \ + --arg linkWithGold "$linkWithGold" \ + --arg enableLibraryProfiling "$enableLibraryProfiling" \ + --arg enableExecutableProfiling "$enableExecutableProfiling" \ + --arg doTracing "$doTracing" \ + --arg enableDWARFDebugging "$enableDWARFDebugging" \ + --arg doStrip "$doStrip" \ + --arg doHyperlinkSource "$doHyperlinkSource" \ + --arg enableSharedLibraries "$enableSharedLibraries" \ + --arg enableStaticLibraries "$enableStaticLibraries" \ + --arg enableSharedExecutables "$enableSharedExecutables" \ + --arg justStaticExecutables "$justStaticExecutables" \ + --arg checkUnusedPackages "$checkUnusedPackages" \ + --arg doCoverage "$doCoverage" \ + --arg doHaddock "$doHaddock" \ + --arg doBenchmark "$doBenchmark" \ --arg generateOptparseApplicativeCompletions "$generateOptparseApplicativeCompletions" \ --arg executableNamesToShellComplete "$executableNamesToShellComplete" \ + --arg withHoogle "$withHoogle" \ ghcjs else # NOTE: Normal GHC build # NOTE: GHC sometimes produces logs so big - that Travis terminates builds, so multiple --quiet - nix-build \ - --quiet --quiet \ - --argstr compiler "$GHCVERSION" \ - --arg failOnAllWarnings "$failOnAllWarnings" \ - --arg buildStrictly "$buildStrictly" \ - --arg checkUnusedPackages "$checkUnusedPackages" \ - --arg doCoverage "$doCoverage" \ - --arg doHaddock "$doHaddock" \ + nix-build \ + --quiet --quiet \ + --argstr compiler "$GHCVERSION" \ + --arg allowInconsistentDependencies "$allowInconsistentDependencies" \ --arg doJailbreak "$doJailbreak" \ --arg doCheck "$doCheck" \ - --arg doBenchmark "$doBenchmark" \ - --arg enableExecutableProfiling "$enableExecutableProfiling" \ - --arg enableLibraryProfiling "$enableLibraryProfiling" \ + --arg sdistTarball "$sdistTarball" \ --arg buildFromSdist "$buildFromSdist" \ + --arg failOnAllWarnings "$failOnAllWarnings" \ --arg buildStrictly "$buildStrictly" \ + --arg enableDeadCodeElimination "$enableDeadCodeElimination" \ --arg disableOptimization "$disableOptimization" \ - --arg allowInconsistentDependencies "$allowInconsistentDependencies" \ + --arg linkWithGold "$linkWithGold" \ + --arg enableLibraryProfiling "$enableLibraryProfiling" \ + --arg enableExecutableProfiling "$enableExecutableProfiling" \ + --arg doTracing "$doTracing" \ + --arg enableDWARFDebugging "$enableDWARFDebugging" \ + --arg doStrip "$doStrip" \ + --arg doHyperlinkSource "$doHyperlinkSource" \ + --arg enableSharedLibraries "$enableSharedLibraries" \ + --arg enableStaticLibraries "$enableStaticLibraries" \ + --arg enableSharedExecutables "$enableSharedExecutables" \ + --arg justStaticExecutables "$justStaticExecutables" \ + --arg checkUnusedPackages "$checkUnusedPackages" \ + --arg doCoverage "$doCoverage" \ + --arg doHaddock "$doHaddock" \ + --arg doBenchmark "$doBenchmark" \ --arg generateOptparseApplicativeCompletions "$generateOptparseApplicativeCompletions" \ - --arg executableNamesToShellComplete "$executableNamesToShellComplete" + --arg executableNamesToShellComplete "$executableNamesToShellComplete" \ + --arg withHoogle "$withHoogle" fi } From 94002e3b1fa64ac74b9cd9b55a1334e3795f9197 Mon Sep 17 00:00:00 2001 From: Anton-Latukha Date: Wed, 17 Jun 2020 15:55:32 +0300 Subject: [PATCH 11/13] CI: .travis.yml: use linkWithGold in Linux builds, a bit faster builds M .travis.yml --- .travis.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index eba7370..8491765 100644 --- a/.travis.yml +++ b/.travis.yml @@ -86,13 +86,16 @@ env: jobs: include: - name: GHC 8.4.4, Linux - env: GHCVERSION=ghc844 + env: + - GHCVERSION=ghc844 + - linkWithGold=true os: linux dist: bionic - name: GHC 8.6.5, Linux, Strict env: - GHCVERSION=ghc865 - buildStrictly=true + - linkWithGold=true os: linux dist: bionic - name: GHC 8.8.3, macOS @@ -103,6 +106,7 @@ jobs: env: - GHCVERSION=ghc8101 - buildFromSdist=true + - linkWithGold=true os: linux dist: bionic - name: GHCJS, Linux From 23008422c0b226b52c287767db3723a379faf984 Mon Sep 17 00:00:00 2001 From: Anton-Latukha Date: Wed, 17 Jun 2020 15:56:29 +0300 Subject: [PATCH 12/13] CI: .travis.yml: GHC 8.10: add Haddock, optimize, Benchmark, Shell Complettions M .travis.yml --- .travis.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 8491765..f1e2dd8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -102,11 +102,16 @@ jobs: env: - GHCVERSION=ghc883 os: osx - - name: GHC 8.10.1, Linux, SDist + - name: GHC 8.10.1, Linux, SDist, Optimize, Benchmark, Haddock, Shell Completions env: - GHCVERSION=ghc8101 - buildFromSdist=true - linkWithGold=true + - doHaddock=true + - doBenchmark=true + - disableOptimization=false + - enableDeadCodeElimination=true + - generateOptparseApplicativeCompletions=true os: linux dist: bionic - name: GHCJS, Linux From 5120235ba37b836a062ba05b1874d6189dfd8b17 Mon Sep 17 00:00:00 2001 From: Anton-Latukha Date: Wed, 17 Jun 2020 19:44:50 +0300 Subject: [PATCH 13/13] build.sh: rm `pkgName` (not used), return `name` - used by Cachix M build.sh --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index b1a071e..be3fea0 100755 --- a/build.sh +++ b/build.sh @@ -10,7 +10,7 @@ GHCVERSION=${GHCVERSION:-'ghc8101'} rev=${rev:-'nixpkgs-unstable'} NIX_PATH=${NIX_PATH:-"nixpkgs=https://github.com/nixos/nixpkgs/archive/$rev.tar.gz"} export NIX_PATH -pkgName=${pkgName:-'defaultPkgName'} +name=${name:-'defaultProjectName'} # This settings expose most of the Nixpkgs Haskell.lib API: https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/haskell-modules/lib.nix