Closed Bug 1791682 Opened 2 months ago Closed 2 months ago

Expand no-new-threads checker's input file format

Categories

(Developer Infrastructure :: Source Code Analysis, enhancement)

enhancement

Tracking

(firefox107 fixed)

RESOLVED FIXED
Tracking Status
firefox107 --- fixed

People

(Reporter: rkraesig, Assigned: rkraesig)

Details

Attachments

(3 files)

The no-new-threads checker's input files are currently just bare lists of thread names and file names.

It would be nice to at least allow comments in these files as well.

Expand the processor for ThreadAllows.txt and ThreadFileAllows.txt to
also recognize and permit comments prefixed by #.

Filenames alone do not uniquely identify files in the Mozilla codebase.
Allow specification of path-elements alongside filenames.

Depends on D157760

Remove all the thread names only used in tests from ThreadAllows.txt.
Instead, list the test files that create them in ThreadFileAllows.txt.

Depends on D157761

Pushed by rkraesig@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/a2e1831539e7
[1/3] Allow comments in thread-checker definition files  r=andi
https://hg.mozilla.org/integration/autoland/rev/5be243995b2f
[2/3] Allow multiple path-elements in ThreadFileAllows.txt  r=andi
https://hg.mozilla.org/integration/autoland/rev/c7e6bf99e7f7
[3/3] Remove thread names only used in tests  r=andi

Backed out for causing spider-monkey failures

Backout link: https://hg.mozilla.org/integration/autoland/rev/8b438fac729bbd32ba68d531a7e24385c3a1924a

Push with failures

Failure log

File "Z:/task_166397572491888/src/build/clang-plugin/ThreadAllows.py", line 9, in <module>
[task 2022-09-23T23:48:55.753Z]     from typing import Iterable, Literal, Set
[task 2022-09-23T23:48:55.753Z] ImportError: cannot import name 'Literal'
[task 2022-09-23T23:48:55.753Z] mozmake[3]: *** [backend.mk:15: build/clang-plugin/.deps/ThreadAllows.h.stub] Error 1
Flags: needinfo?(rkraesig)
Pushed by rkraesig@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/b25c6da3ee7d
[1/3] Allow comments in thread-checker definition files  r=andi
https://hg.mozilla.org/integration/autoland/rev/b3156ecbf138
[2/3] Allow multiple path-elements in ThreadFileAllows.txt  r=andi
https://hg.mozilla.org/integration/autoland/rev/3b3c9438df66
[3/3] Remove thread names only used in tests  r=andi

Somewhat belatedly: this was due to use of a typechecking-only import (Literal) which was introduced in Python 3.8.

Since it's not like we actually ever run mypy (or similar) on any of this, out it goes.

Flags: needinfo?(rkraesig)
You need to log in before you can comment on or make changes to this bug.