Closed Bug 1715650 Opened 1 year ago Closed 1 year ago

Linter to catch new COM initialization calls in Windows builds

Categories

(Firefox Build System :: Lint and Formatting, task)

task

Tracking

(firefox91 fixed)

RESOLVED FIXED
91 Branch
Tracking Status
firefox91 --- fixed

People

(Reporter: bugzilla, Assigned: bugzilla)

References

Details

Attachments

(1 file)

As of bug 1707954 landing, I would like us to begin failing Windows builds when a patch adds new calls to the following functions:

  • CoInitialize
  • CoInitializeEx
  • CoUninitialize
  • OleUninitialize
  • OleInitialize
  • RoInitialize
  • RoUninitialize

We will need a list of exceptions, as there are many extant calls already in the tree. Furthermore, mozilla::mscom::ProcessRuntime and mozilla::mscom::EnsureMTA should be exempt, as these two classes are the ones that actually do need to make such calls.

This patch adds a new linter that will error when new code mentions any one of
the following strings:

  • CoInitialize;
  • CoInitializeEx;
  • OleInitialize;
  • RoInitialize;
  • CoUninitialize;
  • OleUninitialize; and
  • RoUninitialize.

Since I don't care about context, and just want to flag code containing these
names, I opted for a regex linter.

Yes, the regex does match a few strings beyond the above list (in particular, it
also matches additional strings that end with an Ex suffix), but since
functions with those names don't exist anyway (and would be errors in their own
right), I am not concerned about it.

All existing occurrences have been added to the exclusion list, with the
intent of removing most of them over time.

Assignee: nobody → aklotz
Status: NEW → ASSIGNED
Pushed by aklotz@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/61489e2d0094
Add linter for detecting COM initialization; r=linter-reviewers,andi
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 91 Branch
You need to log in before you can comment on or make changes to this bug.