Re: PSA: Local static analysis builds on Linux and Mac OS X

2015-10-16 Thread Nicholas Nethercote
On Fri, Oct 16, 2015 at 5:13 AM, Ehsan Akhgari  wrote:
>>
>> Is there an easy way to determine if that package has been installed?
>
> The easiest way is to turn it on in a build and see if the build succeeds.

On my stock Ubuntu 15.04 box it failed...

>> And if it's not installed, is there an easy way to install it?
>
> The answer there depends on the distro.  I think on Ubuntu it is
> libclang-devel, I think.

... so I tried this. The correct package name is "libclang-dev".

I then got a build failure "cannot find -ledit". Some googling
suggested that I install "libedit-dev" and then it worked. (At least,
compilation finished successfully.)

Nick
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: PSA: Local static analysis builds on Linux and Mac OS X

2015-10-16 Thread Ehsan Akhgari

On 2015-10-16 2:09 AM, Nicholas Nethercote wrote:

On Fri, Oct 16, 2015 at 5:13 AM, Ehsan Akhgari  wrote:


Is there an easy way to determine if that package has been installed?


The easiest way is to turn it on in a build and see if the build succeeds.


On my stock Ubuntu 15.04 box it failed...


And if it's not installed, is there an easy way to install it?


The answer there depends on the distro.  I think on Ubuntu it is
libclang-devel, I think.


... so I tried this. The correct package name is "libclang-dev".

I then got a build failure "cannot find -ledit". Some googling
suggested that I install "libedit-dev" and then it worked. (At least,
compilation finished successfully.)


That's great to know, thanks for reporting this!

___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: PSA: Local static analysis builds on Linux and Mac OS X

2015-10-15 Thread Nicholas Nethercote
On Wed, Oct 14, 2015 at 6:07 PM, Ehsan Akhgari  wrote:
>
> On Linux, most other recent versions of clang should work too, such as the
> one you usually get from your distro, provided that the dev package for
> LLVM/Clang has been installed.

Is there an easy way to determine if that package has been installed?
And if it's not installed, is there an easy way to install it?

Thank you.

Nick
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: PSA: Local static analysis builds on Linux and Mac OS X

2015-10-15 Thread Andrew Halberstadt

On 15/10/15 01:59 PM, Ehsan Akhgari wrote:

On 2015-10-14 9:18 PM, Mike Hommey wrote:

BTW, since we're growing the set of checks the plugin does, what do we
do to ensure that it doesn't add too much overhead to the compilation
time?


Currently nothing beyond taking care to not add slow checks.

Since we're talking about the build speed here, I hope that some day we
start tracking our build speed to understand how it regresses over time.
  Once we have that infrastructure, we can easily track this for static
analysis builds in addition to other kinds of builds.


This data is available in active data right now. Here's a really dumb 
query that returns a tuple of builder name and seconds it took the 
"mozharness build step" to complete:

http://activedata.allizom.org/tools/query.html#query_id=wIv23AVn

Someone who is better at querying than me could probably come up with 
something that returns a daily average by platform. See the "jobs" 
schema linked from the query tool for other parameters.

___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: PSA: Local static analysis builds on Linux and Mac OS X

2015-10-15 Thread Ehsan Akhgari

On 2015-10-14 9:18 PM, Mike Hommey wrote:

BTW, since we're growing the set of checks the plugin does, what do we
do to ensure that it doesn't add too much overhead to the compilation
time?


Currently nothing beyond taking care to not add slow checks.

Since we're talking about the build speed here, I hope that some day we 
start tracking our build speed to understand how it regresses over time. 
 Once we have that infrastructure, we can easily track this for static 
analysis builds in addition to other kinds of builds.

___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: PSA: Local static analysis builds on Linux and Mac OS X

2015-10-15 Thread Ehsan Akhgari

On 2015-10-14 9:32 PM, Gregory Szorc wrote:

On Wed, Oct 14, 2015 at 6:07 PM, Ehsan Akhgari > wrote:

Last weekend, I finished upgrading our Linux and OS X debug and opt
static
analysis builds ("S" jobs on TreeHerder) to the latest revision of clang
3.7.

Now, if you use the latest version of clang (3.7, which is available
from <
http://llvm.org/releases/download.html#3.7.0> in binary form), you
can turn
on static analysis checks locally by adding the following line to your
mozconfig:

ac_add_options --enable-clang-plugin

Doing this helps you in detecting errors specific to the "S" jobs early
during development, which simplifies the process of landing patches by
letting you see the errors at the same time as other compiler errors.

On Linux, most other recent versions of clang should work too, such
as the
one you usually get from your distro, provided that the dev package for
LLVM/Clang has been installed.  On OSX, the default clang that ships
with
recent versions of XCode lacks the dev headers and tools so it can't be
used, but the llvm.org  clang binaries should work
well.

I have been running this plugin locally in all of my builds for several
months now and once you migrate to this setup, everything should proceed
hassle free.  If you find issues getting your particular clang setup to
work with the plugin, please let me know, and I will help fix them.  I'd
like to eventually get us to a point where these checks are turned on by
default during local builds.


As you stated, this helps detect errors earlier during development,
which is a huge win. Is there a good reason configure doesn't enable the
clang plugin by default?


Like I said, that is what I would like to do eventually.  The problem is 
that right now I have no idea how many different clang setups work with 
the plugin, I just know that some of them (such as the Apple clang that 
ships with Xcode) doesn't work.  Right now I am trying to get feedback 
from early testers to get a better idea of how well this would work out 
of the box.  If possible, I would like to avoid turning this on 
opportunistically since then it would be hard for developers to say 
whether their build succeeded because it didn't trigger any static check 
errors or because their build has the clang plugin disabled...


(The situation would be a lot better if we had some kind of support for 
downloading the toolchain on Linux and OS X from tooltool similar to 
what we do on the infrastructure.)



If the plugin adds too much overhead, could we potentially factor out
the expensive checks so developers aren't burdened by them by default?


The plugin doesn't add much overhead right now.  The exact overhead 
really depends on the system in surprising ways.  Here are some 
measurements that I have performed:


On Linux builders, enabling the plugin doesn't have any measurable 
impact on the speed of the build.


On my Mac laptop, I did two measurements of a full debug build without 
and with the plugin enabled with clang 3.7.  The wall clock build times 
were 13m21.861s and 15m8.498s, respectively.


On my blazing fast Linux desktop machine, the same measurement yields 
8m26.966s and 8m39.880s respectively.


So the plugin overhead seems to be effectively negligible on Linux.  On 
Mac, the overhead is quite noticeable.


But back to your point, I agree that once we can turn it on by default 
reliably it would make sense to provide a --disable-clang-plugin option 
instead.

___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


PSA: Local static analysis builds on Linux and Mac OS X

2015-10-14 Thread Ehsan Akhgari
Last weekend, I finished upgrading our Linux and OS X debug and opt static
analysis builds ("S" jobs on TreeHerder) to the latest revision of clang
3.7.

Now, if you use the latest version of clang (3.7, which is available from <
http://llvm.org/releases/download.html#3.7.0> in binary form), you can turn
on static analysis checks locally by adding the following line to your
mozconfig:

ac_add_options --enable-clang-plugin

Doing this helps you in detecting errors specific to the "S" jobs early
during development, which simplifies the process of landing patches by
letting you see the errors at the same time as other compiler errors.

On Linux, most other recent versions of clang should work too, such as the
one you usually get from your distro, provided that the dev package for
LLVM/Clang has been installed.  On OSX, the default clang that ships with
recent versions of XCode lacks the dev headers and tools so it can't be
used, but the llvm.org clang binaries should work well.

I have been running this plugin locally in all of my builds for several
months now and once you migrate to this setup, everything should proceed
hassle free.  If you find issues getting your particular clang setup to
work with the plugin, please let me know, and I will help fix them.  I'd
like to eventually get us to a point where these checks are turned on by
default during local builds.

Thanks,
-- 
Ehsan
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: PSA: Local static analysis builds on Linux and Mac OS X

2015-10-14 Thread Mike Hommey
On Wed, Oct 14, 2015 at 09:07:10PM -0400, Ehsan Akhgari wrote:
> Last weekend, I finished upgrading our Linux and OS X debug and opt static
> analysis builds ("S" jobs on TreeHerder) to the latest revision of clang
> 3.7.
> 
> Now, if you use the latest version of clang (3.7, which is available from <
> http://llvm.org/releases/download.html#3.7.0> in binary form), you can turn
> on static analysis checks locally by adding the following line to your
> mozconfig:
> 
> ac_add_options --enable-clang-plugin
> 
> Doing this helps you in detecting errors specific to the "S" jobs early
> during development, which simplifies the process of landing patches by
> letting you see the errors at the same time as other compiler errors.
> 
> On Linux, most other recent versions of clang should work too, such as the
> one you usually get from your distro, provided that the dev package for
> LLVM/Clang has been installed.  On OSX, the default clang that ships with
> recent versions of XCode lacks the dev headers and tools so it can't be
> used, but the llvm.org clang binaries should work well.
> 
> I have been running this plugin locally in all of my builds for several
> months now and once you migrate to this setup, everything should proceed
> hassle free.  If you find issues getting your particular clang setup to
> work with the plugin, please let me know, and I will help fix them.  I'd
> like to eventually get us to a point where these checks are turned on by
> default during local builds.

BTW, since we're growing the set of checks the plugin does, what do we
do to ensure that it doesn't add too much overhead to the compilation
time?

Mike
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: PSA: Local static analysis builds on Linux and Mac OS X

2015-10-14 Thread Martin Thomson
On Wed, Oct 14, 2015 at 6:32 PM, Gregory Szorc  wrote:
> As you stated, this helps detect errors earlier during development, which
> is a huge win. Is there a good reason configure doesn't enable the clang
> plugin by default?


Yes please.  If the checks are expensive, ac_add_options
--disable-clang-plugin sounds about right.
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: PSA: Local static analysis builds on Linux and Mac OS X

2015-10-14 Thread Gregory Szorc
On Wed, Oct 14, 2015 at 6:07 PM, Ehsan Akhgari 
wrote:

> Last weekend, I finished upgrading our Linux and OS X debug and opt static
> analysis builds ("S" jobs on TreeHerder) to the latest revision of clang
> 3.7.
>
> Now, if you use the latest version of clang (3.7, which is available from <
> http://llvm.org/releases/download.html#3.7.0> in binary form), you can
> turn
> on static analysis checks locally by adding the following line to your
> mozconfig:
>
> ac_add_options --enable-clang-plugin
>
> Doing this helps you in detecting errors specific to the "S" jobs early
> during development, which simplifies the process of landing patches by
> letting you see the errors at the same time as other compiler errors.
>
> On Linux, most other recent versions of clang should work too, such as the
> one you usually get from your distro, provided that the dev package for
> LLVM/Clang has been installed.  On OSX, the default clang that ships with
> recent versions of XCode lacks the dev headers and tools so it can't be
> used, but the llvm.org clang binaries should work well.
>
> I have been running this plugin locally in all of my builds for several
> months now and once you migrate to this setup, everything should proceed
> hassle free.  If you find issues getting your particular clang setup to
> work with the plugin, please let me know, and I will help fix them.  I'd
> like to eventually get us to a point where these checks are turned on by
> default during local builds.
>

As you stated, this helps detect errors earlier during development, which
is a huge win. Is there a good reason configure doesn't enable the clang
plugin by default?

If the plugin adds too much overhead, could we potentially factor out the
expensive checks so developers aren't burdened by them by default?
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform


Re: PSA: Local static analysis builds on Linux and Mac OS X

2015-10-14 Thread Eric Rescorla
On Wed, Oct 14, 2015 at 6:37 PM, Martin Thomson  wrote:

> On Wed, Oct 14, 2015 at 6:32 PM, Gregory Szorc  wrote:
> > As you stated, this helps detect errors earlier during development, which
> > is a huge win. Is there a good reason configure doesn't enable the clang
> > plugin by default?
>
>
> Yes please.  If the checks are expensive, ac_add_options
> --disable-clang-plugin sounds about right.


+1. The more checks the better.

-Ekr
___
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform