[commit: ghc] ghc-7.10: Docs: make sure all libs are included in index.html (#10879) (f7c5359)

git at git.haskell.org git at git.haskell.org
Thu Oct 22 15:09:09 UTC 2015


Repository : ssh://git@git.haskell.org/ghc

On branch  : ghc-7.10
Link       : http://ghc.haskell.org/trac/ghc/changeset/f7c5359df283b15b416aef3317b3ae4362424f18/ghc

>---------------------------------------------------------------

commit f7c5359df283b15b416aef3317b3ae4362424f18
Author: Thomas Miedema <thomasmiedema at gmail.com>
Date:   Tue Sep 15 21:37:38 2015 +0200

    Docs: make sure all libs are included in index.html (#10879)
    
    During the build, when HADDOCK_DOCS=YES, the command 'cd libraries && sh
    gen_contents_index --intree' is run, which calls haddock to generate the
    haddock index at 'libraries/dist-haddock/index.html'.
    
    What it did before was check the ./packages file for all libraries. The
    problem is that 'base' and 'ghc-prim' were folded into the main repo
    some time ago, hence don't have an entry in the ./packages file anymore.
    As a result, 'base' and 'ghc-prim' were missing from the index.html
    file.
    
    It now simply runs haddock on all the all the `.haddock` files in the
    libraries directory.
    
    The only risk is that this could include the extra libraries in the
    index.html, if you ever built them in the past (with
    BUILD_EXTRA_PKGS=YES), even though now you want to exclude them (with
    BUILD_EXTRA_PKGS=NO). gen_contents_index doesn't have access to build
    system variables though (PACKAGES_STAGE1+PACKAGES_STAGE2), so fixing
    this would be a little bit fiddly.
    
    Test Plan:
    'make libraries/dist-haddock/index.html && grep -q base
    libraries/dist-haddock/index.html && echo ok'
    
    Reviewed by: austin
    
    Differential Revision: https://phabricator.haskell.org/D1247


>---------------------------------------------------------------

f7c5359df283b15b416aef3317b3ae4362424f18
 libraries/gen_contents_index | 18 ++----------------
 1 file changed, 2 insertions(+), 16 deletions(-)

diff --git a/libraries/gen_contents_index b/libraries/gen_contents_index
index 34e51f3..a9e58b7 100644
--- a/libraries/gen_contents_index
+++ b/libraries/gen_contents_index
@@ -33,22 +33,10 @@ then
     cd dist-haddock
 
     HADDOCK=../../inplace/bin/haddock
+    HADDOCK_FILES=`find ../ -name *.haddock | sort`
     HADDOCK_ARGS="-p ../prologue.txt"
-    for REPO in `grep '^libraries/[^ ]*  *- ' ../../packages | sed -e 's#libraries/##' -e 's/ .*//'`
+    for HADDOCK_FILE in $HADDOCK_FILES
     do
-        if [ -f "../$REPO/ghc-packages" ]
-        then
-            LIBS="`cat ../$REPO/ghc-packages`"
-            LIBROOT="../$REPO"
-        else
-            LIBS="$REPO"
-            LIBROOT=".."
-        fi
-        for LIB in $LIBS
-        do
-            HADDOCK_FILE="$LIBROOT/$LIB/dist-install/doc/html/$LIB/$LIB.haddock"
-            if [ -f "$HADDOCK_FILE" ]
-            then
                 LIBPATH=`echo "$HADDOCK_FILE" | sed 's#/dist-install.*##'`
                 NAME=`echo "$HADDOCK_FILE" | sed 's#.*/##' | sed 's#\.haddock$##'`
                 # It's easier to portably remove tabs with tr than to try to get
@@ -56,8 +44,6 @@ then
                 VERSION=`grep -i '^version:' $LIBPATH/$NAME.cabal | sed 's/.*://' | tr -d ' \t'`
                 HADDOCK_ARG="--read-interface=${NAME}-${VERSION},$HADDOCK_FILE"
                 HADDOCK_ARGS="$HADDOCK_ARGS $HADDOCK_ARG"
-            fi
-        done
     done
 else
     HADDOCK=../../../../../bin/haddock



More information about the ghc-commits mailing list