diff options
author | Ben Gamari <ben@smart-cactus.org> | 2018-08-03 16:48:18 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2018-08-08 23:16:02 -0400 |
commit | 9f937142f67ccf1c8bff9bb809539deca39a7a6f (patch) | |
tree | 3bab777b87e8fd77606a2778c472fcb9f842f9c5 | |
parent | e2b5c54f30a31f6b030d29394356fb133b8a0001 (diff) | |
download | haskell-9f937142f67ccf1c8bff9bb809539deca39a7a6f.tar.gz |
circleci: Fix documentation building
-rw-r--r-- | .circleci/config.yml | 21 | ||||
-rw-r--r-- | .circleci/images/i386-linux/Dockerfile | 6 | ||||
-rwxr-xr-x | .circleci/images/update-image | 33 | ||||
-rw-r--r-- | .circleci/images/x86_64-linux-fedora/Dockerfile | 20 | ||||
-rw-r--r-- | .circleci/images/x86_64-linux/Dockerfile | 10 | ||||
-rwxr-xr-x | .circleci/prepare-system.sh | 20 |
6 files changed, 95 insertions, 15 deletions
diff --git a/.circleci/config.yml b/.circleci/config.yml index a046b3d181..8035114931 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -95,7 +95,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.4 environment: <<: *buildenv GHC_COLLECTOR_FLAVOR: x86_64-linux @@ -135,12 +135,13 @@ 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" - environment: - <<: *buildenv GHC_COLLECTOR_FLAVOR: x86_64-darwin + <<: *buildenv steps: - checkout - *prepare @@ -156,7 +157,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.4 environment: <<: *buildenv steps: @@ -170,7 +171,7 @@ jobs: "validate-x86_64-linux-unreg": resource_class: xlarge docker: - - image: ghcci/x86_64-linux:0.0.2 + - image: ghcci/x86_64-linux:0.0.4 environment: <<: *buildenv steps: @@ -186,7 +187,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.4 environment: <<: *buildenv BUILD_FLAVOUR: perf-llvm @@ -211,7 +212,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.4 environment: BUILD_FLAVOUR: devel2 <<: *buildenv @@ -228,7 +229,7 @@ jobs: "validate-i386-linux": resource_class: xlarge docker: - - image: ghcci/i386-linux:0.0.2 + - image: ghcci/i386-linux:0.0.5 environment: <<: *buildenv GHC_COLLECTOR_FLAVOR: i386-linux @@ -247,7 +248,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.15 environment: <<: *buildenv GHC_COLLECTOR_FLAVOR: x86_64-fedora @@ -266,7 +267,7 @@ jobs: "slow-validate-x86_64-linux": resource_class: xlarge docker: - - image: ghcci/x86_64-linux:0.0.2 + - image: ghcci/x86_64-linux:0.0.4 environment: <<: *buildenv GHC_COLLECTOR_FLAVOR: x86_64-linux diff --git a/.circleci/images/i386-linux/Dockerfile b/.circleci/images/i386-linux/Dockerfile index 33fe0e1160..13a5721d8c 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 texlive-latex-extra + 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-image b/.circleci/images/update-image new file mode 100755 index 0000000000..5a3cae506c --- /dev/null +++ b/.circleci/images/update-image @@ -0,0 +1,33 @@ +#!/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 + +versions="$(curl -s https://registry.hub.docker.com/v1/repositories/$repo/$name/tags | jq -r .[].name)" +if echo "$versions" | grep $version > /dev/null; then + echo "Version $version of $name already exists" + echo "Previous versions are:" + echo "$versions" + 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 d976950e86..f60398d990 100644 --- a/.circleci/images/x86_64-linux-fedora/Dockerfile +++ b/.circleci/images/x86_64-linux-fedora/Dockerfile @@ -2,7 +2,25 @@ 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 \ + python-sphinx-latex dejavu-sans-fonts dejavu-serif-fonts \ + dejavu-sans-mono-fonts + +# This is in the PATH when I ssh into the CircleCI machine but somehow +# sphinx-build isn't found during configure unless we explicitly +# add it here as well; perhaps PATH is being overridden by CircleCI's +# infrastructure? +ENV PATH /usr/libexec/python3-sphinx:$PATH # 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 512338bdae..f68c7e6a71 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 texlive-latex-extra # 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 df0da01f35..dbb1011df5 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,11 @@ case "$(uname)" in # does not work. brew upgrade python brew install ghc cabal-install ncurses gmp + + pip3 install sphinx + # PDF documentation disabled as MacTeX apparently doesn't include xelatex. + #brew cask install mactex + 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 @@ -65,3 +73,9 @@ case "$(uname)" in *) fail "uname=$(uname) not supported" esac + +echo "=================================================" +echo "Build.mk:" +echo "" +cat mk/build.mk +echo "=================================================" |