palvaro / molly

An implementation of LDFI
126 stars 23 forks source link

Add CircleCI configuration and rewrite Makefile #3

Closed JoshRosen closed 8 years ago

JoshRosen commented 8 years ago

This PR rewrites Molly's Makefile and adds configurations for testing on CircleCI and gathering coverage metrics with https://codecov.io. For an example of what the CircleCI output looks like, see https://circleci.com/gh/JoshRosen/molly/32. For a sample code coverage report, see https://codecov.io/github/JoshRosen/molly/src/main/scala/edu/berkeley/cs/boom/molly?ref=53f2d67600faf1848b2708e8b6623f178cb6ed55. The coverage is currently reported as being fairly low, but that's because Molly has several large CLI interfaces which aren't exercised in the current tests. You can tell Codecov to ignore those paths if you don't want that to count towards your reported coverage percentage.

The only real trickiness in this is getting the Makefile dependencies to work well with CircleCI's dependency caching. If necessary, the Makefile will build both C4 and Z3 from source, but this is an expensive process that we'd like to avoid if at all possible. The basic strategy implemented here is to tie the invalidation of the .so/.dylib targets to the timestamps of the commits that changed .gitmodules or the submodule SHAs.

Our original reason for building Z3 from source was the fact that older Z3 binary releases did not contain the libz3 artifacts, but this has been fixed in newer releases. An advantage of the current approach is that we don't have to worry about the target architecture and don't need to burden the user / developer with installing the right binary for their platform (Z3 doesn't publish binaries that are targeted for older OS X versions, for example).

After merging this, visit https://circleci.com/add-projects in order to enable CircleCI for this repo. This PR currently incorporates the changes in #1 and #2, so it may need to be rebased after those are merged.

JoshRosen commented 8 years ago

Hmm, it looks like my original attempt at avoiding unnecessary lib/z3 compilation was a little too clever... I'll need to revisit and simplify this, since it looks like the current code isn't properly recompiling Z3 in Circle.