GaloisInc / cclyzerpp

cclyzer++ is a precise and scalable pointer analysis for LLVM code.
https://galoisinc.github.io/cclyzerpp/
BSD 3-Clause "New" or "Revised" License
134 stars 15 forks source link

Nix flake support #160

Closed peperunas closed 1 year ago

peperunas commented 1 year ago

I have created a rudimentary Nix flake.

I am available to fix the flake as requested, as I am certain this is now the proper way to package cclyzerpp. The best way to pack everything would be to add install directives in the CMakelists.txt file so that we can leverage Nix's builders - avoiding manually specified outputs.

The flake does not build the C++ interface, as I could not get it to compile. I did not look into it much as I don't have a use case for myself as of now.

Thanks!

peperunas commented 1 year ago

Looks fine to me! Could we stash these in a directory, e.g. contrib/nix?

We can stash default.nix but not flake.nix and flake.lock. flake.nix and flake.lock have to be in the root of the repository to allow Nix users to access the flake directly from the command line, like this:

nix build github:galoisinc/cclyzerpp
langston-barrett commented 1 year ago

Gotcha. Last thing then: I'd like to either (1) add comments to the top of these files that say that they aren't evaluated in CI or necessarily as maintained as the CMake/Docker setup, or (2) get these running in CI. I'm happy either way.

peperunas commented 1 year ago

I believe this PR is ready for review.

I modified the CMakeLists.txt and added an install directive to have a standard installation interface CMake exposes. I modified the flake to use Nix's built-in builders that transparently handle CMake projects.

In synthesis, the flake exposes factgen-exe, libPAPass and libSoufflePA and supersedes the old shell.nix by invoking nix develop in the repository root.

NB: I removed the datalog/ folder for the output store path. Is it supposed to be shipped? I didn't see it in CMake's deb target.

peperunas commented 1 year ago

Absolutely right, sorry about that! I forgot to remove the extra default.nix 🤦