diff --git a/.travis.yml b/.travis.yml index 7410bfb984..367597e4a8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,7 +30,8 @@ install: - pip install --user flake8 typing # mypy requires Python 3 - pip3 install --user mypy - - build/dev.sh minimal + # hack for cmark + - TRAVIS_HACK=1 build/dev.sh minimal script: - test/lint.sh travis diff --git a/build/dev.sh b/build/dev.sh index 5f63d7e42e..16fdcfe9fb 100755 --- a/build/dev.sh +++ b/build/dev.sh @@ -262,7 +262,7 @@ minimal() { touch _devbuild/__init__.py _devbuild/gen/__init__.py # Generates _devbuild/help - build/doc.sh minimal-help + build/doc.sh all-help oil-asdl-to-py # depends on Id diff --git a/doctools/cmark.py b/doctools/cmark.py index ad74cff3d0..a2aba8400d 100755 --- a/doctools/cmark.py +++ b/doctools/cmark.py @@ -7,10 +7,10 @@ """ from __future__ import print_function -import cgi import ctypes import HTMLParser import optparse +import os import re import sys @@ -27,6 +27,15 @@ #assert libname, "cmark not found" libname = '/usr/local/lib/libcmark.so' + +# Hack for Travis. Will only work on 64-bit Ubuntu (and ABI compatible +# machines) +if not os.path.exists(libname) and os.getenv('TRAVIS_HACK'): + import glob + _paths = glob.glob('doctools/travis-bin/libcmark.so.*') + assert len(_paths) == 1, _paths + libname = _paths[0] + cmark = ctypes.CDLL(libname) #print dir(cmark) diff --git a/doctools/cmark.sh b/doctools/cmark.sh index a7acc1faeb..1ba753a030 100755 --- a/doctools/cmark.sh +++ b/doctools/cmark.sh @@ -38,6 +38,21 @@ run-tests() { popd } +travis-hack() { + ### Check the libcmark.so into git. This only works on Ubuntu! + # We're doing this because otherwise we'll have to download the tarball on + # every Travis build, install cmake, build it, and install it. That's not + # terrible but it slows things down a bit. + + local so=$(echo $CMARK_DIR/build/src/libcmark.so.*) + ls -l $so + echo + ldd $so + + cp -v $so doctools/travis-bin +} + + demo-theirs() { echo '*hi*' | cmark } diff --git a/doctools/travis-bin/libcmark.so.0.29.0 b/doctools/travis-bin/libcmark.so.0.29.0 new file mode 100755 index 0000000000..dbab8fbf9f Binary files /dev/null and b/doctools/travis-bin/libcmark.so.0.29.0 differ