Skip to content

Instantly share code, notes, and snippets.

@DanielG
Last active February 26, 2018 14:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DanielG/c95205997ea2ae23eb66f813c3d1f096 to your computer and use it in GitHub Desktop.
Save DanielG/c95205997ea2ae23eb66f813c3d1f096 to your computer and use it in GitHub Desktop.
cabal-new-build-then-haddock-repro
name: cabal-build-then-haddock-repro
version: 0.1.0.0
license: BSD3
license-file: LICENSE
author: Daniel Gröber
maintainer: daniel@dps.uibk.ac.at
build-type: Simple
extra-source-files: ChangeLog.md
cabal-version: >=1.10
library
build-depends: base >=4.10 && <4.11
default-language: Haskell2010
exposed-modules: Lib
module Lib where
foo = 123
#!/bin/sh
does_doc_exist() {
[ -n "$(find dist-newstyle -name doc -type d)" ]
}
rm -r dist-newstyle/
cabal new-haddock
if does_doc_exist; then
echo "==== Running new-haddock on a clean project creates a doc/ directory, OK"
else
echo "==== Running new-haddock on a clean project does not create a doc/ directory, WAT?"
exit 3
fi
rm -r dist-newstyle/
cabal new-build
if does_doc_exist; then
echo "==== After new-build doc/ directory already exists, WAT?"
exit 2
else
echo "==== After new-build doc/ directory does not exist, OK"
fi
cabal new-haddock
if does_doc_exist; then
echo "==== After new-haddock doc/ directory now exists, bug fixed, woo!"
exit 0
else
echo "==== After new-haddock doc/ directory still does not exist, BUGGY but expected"
exit 1
fi
import Distribution.Simple
main = defaultMain
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment