Skip to content

Commit

Permalink
[travis] Check in libcmark.so to make the build work.
Browse files Browse the repository at this point in the history
To run bin/osh, we need the help builtin to work.

The help builtin needs help text.

The help text is rendered from __ HTML __.  So we can have the web text
match the shell text.

HTML is rendered by doctools/cmark.py, which uses libcmark.so.
  • Loading branch information
Andy Chu committed Dec 30, 2019
1 parent db6fc7f commit 3ce6e29
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion build/dev.sh
Expand Up @@ -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

Expand Down
11 changes: 10 additions & 1 deletion doctools/cmark.py
Expand Up @@ -7,10 +7,10 @@
"""
from __future__ import print_function

import cgi
import ctypes
import HTMLParser
import optparse
import os
import re
import sys

Expand All @@ -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)

Expand Down
15 changes: 15 additions & 0 deletions doctools/cmark.sh
Expand Up @@ -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
}
Expand Down
Binary file added doctools/travis-bin/libcmark.so.0.29.0
Binary file not shown.

0 comments on commit 3ce6e29

Please sign in to comment.