[commit: ghc] wip/fix-docs: circleci: Install sphinx and TexLive (fb70a63)

git at git.haskell.org git at git.haskell.org
Sun Aug 5 14:50:01 UTC 2018


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

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

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

commit fb70a6360d58408d3a447d27c4e2760c0fc80308
Author: Ben Gamari <ben at smart-cactus.org>
Date:   Sat Aug 4 00:21:58 2018 -0400

    circleci: Install sphinx and TexLive


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

fb70a6360d58408d3a447d27c4e2760c0fc80308
 .circleci/config.yml                            | 12 +++++-----
 .circleci/images/update.sh                      | 29 +++++++++++++++++++++++++
 .circleci/images/x86_64-linux-fedora/Dockerfile | 12 +++++++++-
 .circleci/images/x86_64-linux/Dockerfile        | 10 ++++++++-
 .circleci/prepare-system.sh                     | 11 +++++++---
 5 files changed, 64 insertions(+), 10 deletions(-)

diff --git a/.circleci/config.yml b/.circleci/config.yml
index e52d38d..f79e8c6 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.3
     environment:
       <<: *buildenv
       GHC_COLLECTOR_FLAVOR: i386-linux
diff --git a/.circleci/images/update.sh b/.circleci/images/update.sh
new file mode 100644
index 0000000..4d99092
--- /dev/null
+++ b/.circleci/images/update.sh
@@ -0,0 +1,29 @@
+#!/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
+
+sed -i -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..70253a0 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 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 c9320ed..08769f2 100755
--- a/.circleci/prepare-system.sh
+++ b/.circleci/prepare-system.sh
@@ -9,14 +9,16 @@ fail() {
 
 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=YES
-BUILD_SPHINX_PDF=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