New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(wip) init infer at v0.15.0 #52408
(wip) init infer at v0.15.0 #52408
Conversation
|
Noting here - infer released |
I guess you should use |
@Pitometsu thanks for the advice. I'm trying an approach right now by just manually setting OPAMROOT to a subdir under |
Closing this since 0.15.0 is pretty out of date. Hopefully i can come back and get 0.17.0 working in a different PR. |
Motivation for this change
New package for infer, an open-source static analysis tool maintained by facebook.
12/16/18: This PR is NOT FINISHED yet. I'm putting it here to ask for some help with a couple issues I've run into trying to compile these tools.
Organization:
This PR currently contains three new packages:
infer-deps
- the ocaml4.06.1+flambda
compiler and the opam requirements from theopam.lock
file for inferfacebook-clang
- a custom clang for infer (see facebook-clang-plugins) that facilitates plugins forclang-analyzer
andclang-frontend
infer
- the project itself, for analysis of Java, C, C++, and Objective C codesource.nix
for installing the precompiled binaries, but I assume that won't be liked upstream since we prefer binaries built on the nix build farm?Problems:
As you can see from their install and getting started pages, they recommend running Infer inside a Docker container on Linux. There is a homebrew formula available for macOS, but on Linux they recommend using their precompiled binaries if not using Docker.
The problems I'm having with writing this package generally revolve around the custom clang:
make
with this (truncated) error message:macOS dynamic lib issue
I assume this might be the type of issue that could be fixed by
fixDarwinDylibNames
but I don't know enough about how that pkg works to use it here. I'm also wary of continuing the attempt on macOS before getting the Linux side fully working since I think I might run into similar errors later on.compiler-rt
, and building this tool fails here:CMakeError.log from
compiler-rt
In the custom clang build script, this option is enabled with
-DLLVM_BUILD_EXTERNAL_COMPILER_RT=On
. I poked around in the nix expression forllvm_7
and thellvm.Packages.compiler-rt
files, but I'm still not entirely sure how to fix an impure path being linked with nix. I expect the cmake config for compiler-rt is linking against the library path it shouldn't be, but addinggcc
,gcc_multi
,clang_5
,glibc
orllvm
tobuildInputs
didn't seem to fix the issue. I tried not passing that option to facebook-clang, but if I do that then theinfer
build eventually fails with a similar issue:Lines from
infer/config.log
when trying to build using custom clang WITHOUT compiler-rtThose are the current issues with this project. Any advice/edits would be much appreciated. Also feel free tell me if I should reorganize the files - I don't really like that three new packages are being added instead of just one, but I don't know how to put these all in the same directory and make them "inferPackages" like how llvm does it.
TODO
checkPhase
call formake test
should work properlyinfer-deps
andfacebook-clang
intoinfer
to one package to clean uppostUnpack
phases ininfer-deps
andfacebook-clang
to work with opammake config_tests
, which runs when one of java or c analyzers are disabledThings done
sandbox
innix.conf
on non-NixOS)nix-shell -p nox --run "nox-review wip"
./result/bin/
)nix path-info -S
before and after)