Skip to content

Fail when haddock fails by default #359

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 18, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 11 additions & 17 deletions builder/comp-builder.nix
Original file line number Diff line number Diff line change
Expand Up @@ -220,34 +220,28 @@ stdenv.mkDerivation ({

haddockPhase = ''
runHook preHaddock
# If we don't have any source files, no need to run haddock
[[ -n $(find . -name "*.hs" -o -name "*.lhs") ]] && {
docdir="${docdir "$doc"}"
mkdir -p "$docdir"

# We accept that this might not produce any
# output (hence the || true). Depending of
# configuration flags, there might just be no
# modules to run haddock on. E.g. a package
# might turn into an empty one (see the fail
# pkg).
$SETUP_HS haddock \
"--html" \
${lib.optionalString doHoogle "--hoogle"} \
${lib.optionalString hyperlinkSource "--hyperlink-source"} \
${lib.concatStringsSep " " (component.setupHaddockFlags ++ setupGhcOptions)} \
|| true

html="dist/doc/html/${componentId.cname}"

if [ -d "$html" ]; then
# Ensure that libraries are not pulled into the docs closure.
# As an example, the prettified source code of a
# Paths_package module will contain store paths of the library package.
for x in "$html/src/"*.html; do
remove-references-to -t $out $x
done

cp -R "$html" "$docdir"/html
fi
# Ensure that libraries are not pulled into the docs closure.
# As an example, the prettified source code of a
# Paths_package module will contain store paths of the library package.
for x in "$html/src/"*.html; do
remove-references-to -t $out $x
done

cp -R "$html" "$docdir"/html
}
runHook postHaddock
'';

Expand Down