Search code examples
haskellcabaltravis-ci

Haskell Travis CI show build logs


When I use Travis CI to build my Haskell project, it fails to build and mentions a log file:

$ cabal install --only-dependencies --enable-tests
...
Last 10 lines of the build log ( /home/travis/.cabal/logs/haskell-src-exts-1.16.0.log ):

My .travis.yml file is

language: haskell
ghc: 7.8

My .cabal file is on GitHub here.

How do I view the whole log file? Or, how do I configure cabal to output the log to standard output?


Solution

  • I don't think you can view it as Travis likely deletes the virtual machine as soon as it's done building.

    You might get more info if you run cabal install with --verbose (-v).

    Alternatively, since Travis allows you to run arbitrary shell commands, you can take advantage of that and use cat to dump the log file(s) to standard output:

    if ! cabal install --only-dependencies --enable-tests; then
        cat "$HOME"/.cabal/logs/haskell-src-exts-*.log
        exit 1
    fi