Page MenuHomePhabricator

[analyzer] Teach scan-build to find /usr/bin/clang when installed in /usr/local/bin/

Authored by dcoughlin on Mar 14 2019, 9:30 PM.



Change scan-build on the Mac to support the scenario where scan-build is installed in
$TOOLCHAIN/usr/local/bin/ but clang itself is installed in $TOOLCHAIN/usr/bin/.


Diff Detail


Event Timeline

dcoughlin created this revision.Mar 14 2019, 9:30 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 14 2019, 9:30 PM
NoQ added a comment.Mar 15 2019, 5:30 PM

This should indeed take care of our relatively tricky macOS use-case! I'm a bit worried for unexpected consequences on some of the more exotic linux setups - who knows what ../.. is supposed to contain. Maybe restrict this lookup to Darwin somehow? - And i guess let's eventually consider supporting $PATH :)

dcoughlin updated this revision to Diff 190931.Mar 15 2019, 5:52 PM
dcoughlin edited the summary of this revision. (Show Details)

Update to restrict the new behavior to when Xcode is present.

That's a good point. I've updated the patch to look for 'xcrun'

NoQ accepted this revision.Mar 15 2019, 5:55 PM


This revision is now accepted and ready to land.Mar 15 2019, 5:55 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptMar 15 2019, 6:00 PM