Closed Bug 1405602 Opened 2 years ago Closed 2 years ago

mach static-analyzer check --fix is failing (binary missing)

Categories

(Firefox Build System :: Source Code Analysis, defect)

defect
Not set

Tracking

(firefox58 affected)

RESOLVED FIXED
Tracking Status
firefox58 --- affected

People

(Reporter: Sylvestre, Assigned: andi)

References

Details

Attachments

(2 files, 1 obsolete file)

./mach static-analyzer check --check google-readability-braces-around-statements --fix dom/presentation/Presentation.cpp 


 0:07.39 
 0:07.39 Applying fixes ...
 0:07.39 Traceback (most recent call last):
 0:07.39     main()
 0:07.39     apply_fixes(args, tmpdir)
 0:07.39     subprocess.call(invocation)
 0:07.39   File "/usr/lib/python2.7/subprocess.py", line 168, in call
 0:07.39     return Popen(*popenargs, **kwargs).wait()
 0:07.39   File "/usr/lib/python2.7/subprocess.py", line 390, in __init__
 0:07.39     errread, errwrite)
 0:07.39   File "/usr/lib/python2.7/subprocess.py", line 1025, in _execute_child
 0:07.39     raise child_exception
 0:07.39 OSError: [Errno 2] No such file or directory
Error running mach:

probably because clang-apply-replacement is not installed.
As a workaround on Debian
sudo ln -s clang-apply-replacements-5.0 clang-apply-replacements
or
sudo apt-get install clang
This should come in the toolchain binary that we use.
Assignee: nobody → bpostelnicu
Depends on: 1405654
We will need people to download clang-tidy again to get the version with clang-apply-replacement. Do you manage that?
(In reply to Sylvestre Ledru [:sylvestre] from comment #4)
> We will need people to download clang-tidy again to get the version with
> clang-apply-replacement. Do you manage that?

The process is automatic, this patch adds the integrity check to see if it has all of the binaries needed. If it sees missing binaries it will re-download clang-tidy. So this change is not transparent to the end-user.
Attachment #8915127 - Flags: review?(sledru)
This change should not be landed before the binaries are built on toolchain.
MozReview-Commit-ID: 1BT2ukzLoC3
Attachment #8915163 - Flags: review?(ehsan)
(In reply to Andi-Bogdan Postelnicu [:andi] from comment #7)
> Created attachment 8915163 [details] [diff] [review]
> add clang-apply-replacements to the clang-tidy build generated by toolchains
> 
> MozReview-Commit-ID: 1BT2ukzLoC3

This addresses the issue where the clang-apply-replacements binary was not present in the archive from artefact build.
MozReview-Commit-ID: 1BT2ukzLoC3
Attachment #8915168 - Flags: review?(nfroyd)
Attachment #8915163 - Attachment is obsolete: true
Attachment #8915163 - Flags: review?(ehsan)
Attachment #8915168 - Flags: review?(nfroyd) → review+
I've marked this issue to remain open since we need to also land the issue from review board after will be reviewed.
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/cca8c45c7a34
Add clang-apply-replacements to the clang-tidy build generated by toolchains. r=ehsan
Keywords: checkin-needed
Comment on attachment 8915127 [details]
Bug 1405602 - add clang-apply-replacements to path used by mach static-analysis.

https://reviewboard.mozilla.org/r/186380/#review192218

Looks like the right stuff to do, bravo
Attachment #8915127 - Flags: review?(sledru) → review+
Note to self: remove leave-open flag after the two patches land in m-c.
Flags: needinfo?(bpostelnicu)
Pushed by bpostelnicu@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/45f4d7722995
add clang-apply-replacements to path used by mach static-analysis. r=sylvestre
This ca-n be closed now since all of the parchet Landes.
Flags: needinfo?(bpostelnicu)
Keywords: leave-open
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.