[commit: ghc] wip/fix-docs: circleci: Fix documentation building (b3ce76f)

git at git.haskell.org git at git.haskell.org
Mon Aug 6 16:31:45 UTC 2018


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

On branch  : wip/fix-docs
Link       : http://ghc.haskell.org/trac/ghc/changeset/b3ce76f8a4ee27559a072a7cdf50f34271924e65/ghc

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

commit b3ce76f8a4ee27559a072a7cdf50f34271924e65
Author: Ben Gamari <ben at smart-cactus.org>
Date:   Fri Aug 3 16:48:18 2018 -0400

    circleci: Fix documentation building


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

b3ce76f8a4ee27559a072a7cdf50f34271924e65
 .circleci/config.yml                            | 14 +++++++-----
 .circleci/images/i386-linux/Dockerfile          |  6 +++++
 .circleci/images/update.sh                      | 30 +++++++++++++++++++++++++
 .circleci/images/x86_64-linux-fedora/Dockerfile | 12 +++++++++-
 .circleci/images/x86_64-linux/Dockerfile        | 10 ++++++++-
 .circleci/prepare-system.sh                     | 11 ++++++---
 6 files changed, 72 insertions(+), 11 deletions(-)

diff --git a/.circleci/config.yml b/.circleci/config.yml
index e52d38d..096e264 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -93,7 +93,7 @@ jobs:
   "validate-x86_64-linux":
     resource_class: xlarge
     docker:
-      - image: ghcci/x86_64-linux:0.0.2
+      - image: ghcci/x86_64-linux:0.0.3
     environment:
       <<: *buildenv
       GHC_COLLECTOR_FLAVOR: x86_64-linux
@@ -133,6 +133,8 @@ jobs:
     macos:
       xcode: "9.0"
     environment:
+      # Disable sphinx PDF output as MacTeX apparently doesn't provide xelatex
+      BUILD_SPHINX_PDF: "NO"
       MACOSX_DEPLOYMENT_TARGET: "10.7"
       # Only Sierra and onwards supports clock_gettime. See #12858
       ac_cv_func_clock_gettime: "no"
@@ -154,7 +156,7 @@ jobs:
   "validate-hadrian-x86_64-linux":
     resource_class: xlarge
     docker:
-      - image: ghcci/x86_64-linux:0.0.2
+      - image: ghcci/x86_64-linux:0.0.3
     environment:
       <<: *buildenv
     steps:
@@ -184,7 +186,7 @@ jobs:
   "validate-x86_64-linux-llvm":
     resource_class: xlarge
     docker:
-      - image: ghcci/x86_64-linux:0.0.2
+      - image: ghcci/x86_64-linux:0.0.3
     environment:
       <<: *buildenv
       BUILD_FLAVOUR: perf-llvm
@@ -209,7 +211,7 @@ jobs:
   "validate-x86_64-linux-debug":
     resource_class: xlarge
     docker:
-      - image: ghcci/x86_64-linux:0.0.2
+      - image: ghcci/x86_64-linux:0.0.3
     environment:
       BUILD_FLAVOUR: devel2
       <<: *buildenv
@@ -226,7 +228,7 @@ jobs:
   "validate-i386-linux":
     resource_class: xlarge
     docker:
-      - image: ghcci/i386-linux:0.0.2
+      - image: ghcci/i386-linux:0.0.4
     environment:
       <<: *buildenv
       GHC_COLLECTOR_FLAVOR: i386-linux
@@ -245,7 +247,7 @@ jobs:
   "validate-x86_64-fedora":
     resource_class: xlarge
     docker:
-      - image: ghcci/x86_64-linux-fedora:0.0.4
+      - image: ghcci/x86_64-linux-fedora:0.0.6
     environment:
       <<: *buildenv
       GHC_COLLECTOR_FLAVOR: x86_64-fedora
diff --git a/.circleci/images/i386-linux/Dockerfile b/.circleci/images/i386-linux/Dockerfile
index 33fe0e1..b576f99 100644
--- a/.circleci/images/i386-linux/Dockerfile
+++ b/.circleci/images/i386-linux/Dockerfile
@@ -5,7 +5,13 @@ ENV LANG C.UTF-8
 RUN echo 'deb http://ppa.launchpad.net/hvr/ghc/ubuntu trusty main' > /etc/apt/sources.list.d/ghc.list
 RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F6F88286
 RUN apt-get update -qq
+
+# Core build utilities
 RUN apt-get install -qy git make automake autoconf gcc perl python3 texinfo xz-utils lbzip2 bzip2 patch openssh-client sudo curl zlib1g-dev libtinfo-dev libsqlite3-0 libsqlite3-dev ca-certificates g++ cabal-install-2.2 ghc-8.4.2 happy alex
+
+# Documentation tools
+RUN apt-get install -qy python3-sphinx texlive-xetex
+
 ENV PATH /home/ghc/.cabal/bin:/home/ghc/.local/bin:/opt/cabal/2.2/bin:/opt/ghc/8.4.2/bin:$PATH
 
 # Get i386 GHC bindist for 32 bit CI builds.
diff --git a/.circleci/images/update.sh b/.circleci/images/update.sh
new file mode 100644
index 0000000..96f97a2
--- /dev/null
+++ b/.circleci/images/update.sh
@@ -0,0 +1,30 @@
+#!/usr/bin/env bash
+
+set -e
+
+repo=ghcci
+
+if [[ $# != 2 ]]; then
+    echo "Usage: $0 DIR VERSION"
+    echo
+    echo "Update Docker image in DIR, pushing it to the $repo repository as"
+    echo "version VERSION"
+    echo
+    echo "Example: $0 x86_64-linux-fedora 0.0.3"
+    exit 1
+fi
+
+name=$1
+version=$2
+
+if curl -s https://registry.hub.docker.com/v1/repositories/$repo/$name/tags | jq -r .[].name | grep $version > /dev/null; then
+    echo "Version $version of $name already exists"
+    exit 1
+fi
+
+docker build $name -t $repo/$name:$version
+docker push $repo/$name:$version
+
+repo_name="$repo/$name"
+sed -i -E -e "s%$repo_name"':[0-9]+(\.[0-9]+)*%'"$repo_name:$version%" ../config.yml
+echo "Built, pushed, and bumped $name:$version"
diff --git a/.circleci/images/x86_64-linux-fedora/Dockerfile b/.circleci/images/x86_64-linux-fedora/Dockerfile
index d976950..2661521 100644
--- a/.circleci/images/x86_64-linux-fedora/Dockerfile
+++ b/.circleci/images/x86_64-linux-fedora/Dockerfile
@@ -2,7 +2,17 @@ FROM fedora:27
 
 ENV LANG C.UTF-8
 
-RUN dnf -y install coreutils binutils which git make automake autoconf gcc perl python3 texinfo xz lbzip2 patch openssh-clients sudo curl zlib-devel sqlite ncurses-compat-libs gmp-devel ncurses-devel gcc-c++ findutils
+# Core build utilities
+RUN dnf -y install coreutils binutils which git make \
+    automake autoconf gcc perl python3 texinfo xz lbzip2 \
+    patch openssh-clients sudo curl zlib-devel sqlite \
+    ncurses-compat-libs gmp-devel ncurses-devel gcc-c++ findutils
+
+# Documentation tools
+RUN dnf -y install python3-sphinx \
+    texlive texlive-latex texlive-xetex \
+    texlive-collection-latex texlive-collection-latexrecommended \
+    texlive-xetex-def texlive-collection-xetex
 
 # systemd isn't running so remove it from nsswitch.conf
 # Failing to do this will result in testsuite failures due to
diff --git a/.circleci/images/x86_64-linux/Dockerfile b/.circleci/images/x86_64-linux/Dockerfile
index 512338b..4303e4d 100644
--- a/.circleci/images/x86_64-linux/Dockerfile
+++ b/.circleci/images/x86_64-linux/Dockerfile
@@ -5,7 +5,15 @@ ENV LANG C.UTF-8
 RUN echo 'deb http://ppa.launchpad.net/hvr/ghc/ubuntu trusty main' > /etc/apt/sources.list.d/ghc.list
 RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F6F88286
 RUN apt-get update -qq
-RUN apt-get install -qy cabal-install-2.2 ghc-8.4.2 happy alex zlib1g-dev libtinfo-dev libsqlite3-0 libsqlite3-dev ca-certificates g++ git curl git make automake autoconf gcc perl python3 texinfo xz-utils lbzip2 patch openssh-client sudo
+
+# Core build utilities
+RUN apt-get install -qy cabal-install-2.2 ghc-8.4.2 happy alex zlib1g-dev \
+    libtinfo-dev libsqlite3-0 libsqlite3-dev ca-certificates g++ git curl \
+    git make automake autoconf gcc perl python3 texinfo xz-utils lbzip2 \
+    patch openssh-client sudo
+
+# Documentation tools
+RUN apt-get install -qy python3-sphinx texlive-xetex
 
 # Stack intallation
 RUN curl -fSL https://github.com/commercialhaskell/stack/releases/download/v1.6.5/stack-1.6.5-linux-x86_64-static.tar.gz -o stack.tar.gz
diff --git a/.circleci/prepare-system.sh b/.circleci/prepare-system.sh
index df0da01..462d445 100755
--- a/.circleci/prepare-system.sh
+++ b/.circleci/prepare-system.sh
@@ -7,16 +7,18 @@ fail() {
   exit 1
 }
 
-echo 'BUILD_SPHINX_HTML = NO' > mk/validate.mk
-echo 'BUILD_SPHINX_PDF = NO' >> mk/validate.mk
 hackage_index_state="@1522046735"
 
+if [[ -z "${BUILD_SPHINX_HTML:-}" ]]; then BUILD_SPHINX_HTML=YES; fi
+if [[ -z "${BUILD_SPHINX_PDF:-}" ]]; then BUILD_SPHINX_PDF=YES; fi
+
 cat > mk/build.mk <<EOF
 V=1
 HADDOCK_DOCS=YES
 LATEX_DOCS=YES
 HSCOLOUR_SRCS=YES
-BUILD_DOCBOOK_HTML=YES
+BUILD_SPHINX_HTML=$BUILD_SPHINX_HTML
+BUILD_SPHINX_PDF=$BUILD_SPHINX_PDF
 BeConservative=YES
 EOF
 
@@ -47,6 +49,7 @@ case "$(uname)" in
       sudo ln -s /home/ghc/.cabal/bin/HsColour /usr/local/bin/HsColour || true
     fi
     ;;
+
   Darwin)
     if [[ -n ${TARGET:-} ]]; then
       fail "uname=$(uname) not supported for cross-compilation"
@@ -55,6 +58,8 @@ case "$(uname)" in
     # does not work.
     brew upgrade python
     brew install ghc cabal-install ncurses gmp
+    brew cask install mactex
+    pip3 install sphinx
     cabal update
     cabal install --reinstall alex happy haddock hscolour --index-state=$hackage_index_state
     # put them on the $PATH, don't fail if already installed



More information about the ghc-commits mailing list