Skip to content
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

Improve analyzegc experience #32171

Merged
merged 8 commits into from
Jun 3, 2019
Merged

Improve analyzegc experience #32171

merged 8 commits into from
Jun 3, 2019

Conversation

staticfloat
Copy link
Sponsor Member

This makes the analyzegc experience faster, more beautiful, and a lot easier to run from a clean clone, as we expect to do regularly on CI. In particular, the clang analysis pass is now invoked in serial, which reduces runtime from 6.5 minutes to 2.5 minutes on a 4-core box; which isn't a bad speedup.

This fixes a bunch of compiler errors when trying to run `make -C src analyzegc` from a fresh clone of Julia.  Also adds an explicit dependency of `flisp` on `libutf8proc`, which needs to be here.
This ekes a little more parallelism out of the build system by not
needlessly serializing things.
src/Makefile Outdated Show resolved Hide resolved
src/Makefile Show resolved Hide resolved
src/Makefile Outdated Show resolved Hide resolved
src/Makefile Outdated Show resolved Hide resolved
src/flisp/Makefile Outdated Show resolved Hide resolved
staticfloat and others added 5 commits May 28, 2019 16:24
Co-Authored-By: Jameson Nash <[email protected]>
Those changes weren't really doing anything since other things would
break; just keep it simple
Co-Authored-By: Jameson Nash <[email protected]>
@staticfloat staticfloat reopened this May 29, 2019
@staticfloat
Copy link
Sponsor Member Author

Triggered a new CI run; looks like it's working! :D

Will clang return nonzero if something fails an analysis sweep? If not, it's always going to be green.

@Keno
Copy link
Member

Keno commented May 30, 2019

Will clang return nonzero if something fails an analysis sweep? If not, it's always going to be green.

I think so, but you can try it out, but just deleting any JL_GC_POP line. The analyzer will catch that.

@staticfloat
Copy link
Sponsor Member Author

I think so, but you can try it out, but just deleting any JL_GC_POP line. The analyzer will catch that.

Looks like the answer is no, clang does not turn analyzer warnings into errors, even with -Werror. Here's an SO answer about the same thing, with a very mac/iphone specific solution that I don't think will work for us.

We could check to make sure that clang does not output anything, but that seems a little fragile.

@StefanKarpinski
Copy link
Sponsor Member

Wut?! This is UNIX 101. Maybe submit a patch to clang to make it work the right way when running in static analysis mode?

@staticfloat
Copy link
Sponsor Member Author

@Keno is it possible for us to write a checker plugin that processes the results of all other checkers and turns any exception into something fatal? The only other option that I can think of is to have it output something more structured, such as a .plist, consume that .plist and ensure that it is an empty array.

@Keno
Copy link
Member

Keno commented Jun 1, 2019

I looked into this for a bit, but didn't see anything obvious. Enabling the analyzer explicitly disables -Werror and the analyzer is hardcoded to emit its results as a warning. I do feel like we must be missing something stupid, so probably worth emailing the clang list to ask about.

@staticfloat
Copy link
Sponsor Member Author

I'm going to merge this for now, to get rid of the red X's, and because we will want these changes merged in any case; we'll fix the fault detection in a future PR.

@staticfloat staticfloat merged commit b80eb0d into master Jun 3, 2019
@fredrikekre fredrikekre deleted the sf/clangsa_from_scratch branch June 3, 2019 06:43
@Keno
Copy link
Member

Keno commented Jun 3, 2019

Shall I email cfe-dev or do you want to?

@staticfloat
Copy link
Sponsor Member Author

Please go ahead; I couldn't even find the source for the analyzer parts of clang.

@Keno
Copy link
Member

Keno commented Jun 4, 2019

With https://reviews.llvm.org/D62885, adding -Xanalyzer -analyzer-werror will do what you want

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants