git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] travis-ci: run scan-build every time

From
Samuel Lijin <sxlijin@gmail.com>
Date
Feb 27, 2017, 00:34 UTC
Message-ID
<CAJZjrdVaUvrfq5+fAurrtMME42Om+-QyXZEVpNDGAbG9iieggA@mail.gmail.com>
In-Reply-To
<71030110-EB19-4F54-95F1-443D3EAE5286@gmail.com>

On Sun, Feb 26, 2017 at 8:12 AM, Lars Schneider <larsxschneider@gmail.com> wrote:

Show 36 quoted lines
>
>> On 26 Feb 2017, at 03:09, Samuel Lijin <sxlijin@gmail.com> wrote:
>>
>> On Sat, Feb 25, 2017 at 3:48 PM, Lars Schneider
>> <larsxschneider@gmail.com> wrote:
>>>
>>>> On 24 Feb 2017, at 18:29, Samuel Lijin <sxlijin@gmail.com> wrote:
>>>>
>>>> It's worth noting that there seems to be a weird issue with scan-build
>>>> where it *will* generate a report for something locally, but won't do it
>>>> on Travis. See [2] for an example where I have a C program with a
>>>> very obvious memory leak but scan-build on Travis doesn't generate
>>>> a report (despite complaining about it in stdout), even though it does
>>>> on my local machine.
>>>>
>>>> [1] https://travis-ci.org/sxlijin/git/builds/204853233
>>>> [2] https://travis-ci.org/sxlijin/travis-testing/jobs/205025319#L331-L342
>>>
>>> Scan-build stores the report in some temp folder. I assume you can't access
>>> this folder on TravisCI. Try the scan-build option "-o scan-build-results"
>>> to store the report in the local directory.
>>
>> That occurred to me, but I don't quite think that's the issue. I just
>> noticed that on the repo I use to test build matrices, jobs 1-8 don't
>> generate a report, but 9-14 and 19-20 do [1]. I don't think it's an
>> issue with write permissions (scan-build complains much more vocally
>> if that happens), but it doesn't seem to matter if the output dir is
>> in the tmpfs [2] or a local directory [3].
>>
>> [1] https://travis-ci.org/sxlijin/travis-testing/builds/205054253
>> [2] https://travis-ci.org/sxlijin/git/jobs/205028920#L1000
>> [2] https://travis-ci.org/sxlijin/git/jobs/205411705#L998
>
> Scan-build somehow replaces the compiler. My guess is that you
> tell scan-build to substitute clang but "make" is really using
> gcc or something?

Your hunch is spot-on. I took a look at the Makefile and lo and behold, it overrides $CC [1]. Looking at the commit which introduced it [2] I have to admit I'm somewhat surprised that scan-build works at all...

[1] https://github.com/git/git/blob/master/Makefile#L454 [2] https://github.com/git/git/commit/6d62c983f7d91565a15e49955b3ed94ae7c73434

Show 9 quoted lines
> I reported something strange about the compilers
> on TravisCI some time ago but I can't find it anymore. I think I
> remember on OSX they always use clang even if you define gcc.
> Maybe it makes sense to reach out to TravisCI support in case
> this is a bug on their end?
>
> Based on your work I tried the following and it seems to work:
> https://travis-ci.org/larsxschneider/git/jobs/205507241
> https://github.com/larsxschneider/git/commit/faf4ecfdca1a732459c1f93c334928ee2826d490
That's promising!
> - Lars
Previous: Lars Schneider
Message 7 of 7 in “travis-ci: run scan-build every time”
  1. travis-ci: run scan-build every timeSamuel Lijin, Feb 24, 2017
  2. Lars SchneiderFeb 25, 2017
  3. Jeff KingFeb 25, 2017
  4. Lars SchneiderFeb 25, 2017
  5. Samuel LijinFeb 26, 2017
  6. Lars SchneiderFeb 26, 2017
  7. Samuel LijinFeb 27, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.