3
0
Fork 0
forked from mirrors/nixpkgs
nixpkgs/pkgs/build-support/release
Austin Seipp 76b05b1630 releaseTools: add {clang,coverity}Analysis tools
These two expressions greatly simplify using the clang-analyzer or
Coverity static analyzer on your C/C++ projects. In fact, they are
identical to nixBuild in every way out of the box, and should 'Just
Work' providing your code can be compiled with Clang already.

The trick is that when running 'make', we actually just alias it to the
appropriate scan build tool, and add a post-build hook that will bundle
up the results appropriately and unalias it.

For Clang, we put the results in $out/analysis and add an 'analysis'
report to $out/nix-support/hydra-build-products pointing to the result
HTML - this means that if the analyzer finds any bugs, the HTML results
will automatically show up Hydra for easy viewing.

For Coverity, it's slightly different. Instead we run the build tool and
after we're done, we tar up the results in a format that Coverity Scan's
service understands. We put the tarball in $out/tarballs under the name
'foo-cov-int.xz' and add an entry for the file to hydra-build-products
as well for easy viewing.

Of course for Coverity you must then upload the build. A Hydra plugin to
do this is on the way, and it will automatically pick up the
cov-int.tar.xz for uploading.

Note that coverityAnalysis requires allowUnfree = true;, as well as the
cov-build tools, which you can download from https://scan.coverity.com -
they're not linked to your account or anything, it's just an annoying
registration wall.

Note this is a first draft. In particular, scan-build fixes the C/C++
compiler to be Clang, and it's perfectly reasonable to want to use Clang
for the analyzer but have scan-build invoke GCC instead.

Signed-off-by: Austin Seipp <aseipp@pobox.com>
2014-05-02 14:07:37 -05:00
..
ant-build.nix Replace lib/java -> share/java 2014-01-09 13:01:38 +01:00
binary-tarball.nix binary-tarball.nix: Forgot to source functions.sh 2012-08-09 07:12:20 -04:00
debian-build.nix debBuild: Allow setting a maintainer address 2014-02-06 14:36:50 +01:00
default.nix releaseTools: add {clang,coverity}Analysis tools 2014-05-02 14:07:37 -05:00
functions.sh Factor out repeated scriptlets from build-support/release/*.nix. 2012-07-23 20:33:04 +02:00
gcov-report.nix Move generation of coverage reports from nixos/lib/testing to releaseTools 2014-03-03 13:57:08 +01:00
maven-build.nix Do not assume a .rev attribute in available in src in maven-build.nix 2014-01-24 15:52:31 +01:00
nix-build.nix releaseTools: add {clang,coverity}Analysis tools 2014-05-02 14:07:37 -05:00
rpm-build.nix build-support/release: Simplify meta.description 2013-03-01 12:50:29 +01:00
source-tarball.nix Remove some hackery 2013-03-06 16:57:57 +01:00