Closed Bug 1648213 Opened 5 years ago Closed 5 years ago

clang-plugin test failures in build/clang-plugin/tests/TestAssertWithAssignment.cpp, TestCanRunScript.cpp

Categories

(Developer Infrastructure :: Source Code Analysis, task)

Tracking

(Not tracked)

RESOLVED WORKSFORME

People

(Reporter: jorendorff, Unassigned)

Details

Building with the following mozconfig options on a Mac:

ac_add_options --enable-debug
ac_add_options --disable-optimize
ac_add_options --enable-clang-plugin

The command below fails some clang-plugin tests:

$ mach build --keep-going build/clang-plugin/
 0:01.13 /usr/local/bin/gmake -C build/clang-plugin -j8 -s -k
 0:01.89 error: 'error' diagnostics expected but not seen:
 0:01.89   File /Users/jorendorff/work/mozilla-central/build/clang-plugin/tests/TestAssertWithAssignment.cpp Line 35: Forbidden assignment in assert expression
 0:01.89   File /Users/jorendorff/work/mozilla-central/build/clang-plugin/tests/TestAssertWithAssignment.cpp Line 39: Forbidden assignment in assert expression
 0:01.89   File /Users/jorendorff/work/mozilla-central/build/clang-plugin/tests/TestAssertWithAssignment.cpp Line 62: Forbidden assignment in assert expression
 0:01.89   File /Users/jorendorff/work/mozilla-central/build/clang-plugin/tests/TestAssertWithAssignment.cpp Line 64: Forbidden assignment in assert expression
 0:01.89   File /Users/jorendorff/work/mozilla-central/build/clang-plugin/tests/TestAssertWithAssignment.cpp Line 65: Forbidden assignment in assert expression
 0:01.89 error: 'error' diagnostics seen but not expected:
 0:01.89   File /Users/jorendorff/work/mozilla-central/build/clang-plugin/tests/TestAssertWithAssignment.cpp Line 1: 'mozilla/MacroArgs.h' file not found
 0:01.89 6 errors generated.
 0:01.89 gmake[4]: *** [/Users/jorendorff/work/mozilla-central/config/rules.mk:748: TestAssertWithAssignment.o] Error 1
 0:02.02 error: 'error' diagnostics expected but not seen:
 0:02.02   File /Users/jorendorff/work/mozilla-central/build/clang-plugin/tests/TestCanRunScript.cpp Line 12: functions marked as MOZ_CAN_RUN_SCRIPT can only be called from functions also marked as MOZ_CAN_RUN_SCRIPT
 0:02.02   File /Users/jorendorff/work/mozilla-central/build/clang-plugin/tests/TestCanRunScript.cpp Line 37: functions marked as MOZ_CAN_RUN_SCRIPT can only be called from functions also marked as MOZ_CAN_RUN_SCRIPT
 0:02.02   File /Users/jorendorff/work/mozilla-central/build/clang-plugin/tests/TestCanRunScript.cpp Line 55: functions marked as MOZ_CAN_RUN_SCRIPT can only be called from functions also marked as MOZ_CAN_RUN_SCRIPT
 0:02.02   File /Users/jorendorff/work/mozilla-central/build/clang-plugin/tests/TestCanRunScript.cpp Line 63: arguments must all be strong refs or caller's parameters when calling a function marked as MOZ_CAN_RUN_SCRIPT (including the implicit object argument).  'new RefCountedBase' is neither.
 0:02.02   File /Users/jorendorff/work/mozilla-central/build/clang-plugin/tests/TestCanRunScript.cpp Line 63: functions marked as MOZ_CAN_RUN_SCRIPT can only be called from functions also marked as MOZ_CAN_RUN_SCRIPT
 0:02.02   File /Users/jorendorff/work/mozilla-central/build/clang-plugin/tests/TestCanRunScript.cpp Line 68: arguments must all be strong refs or caller's parameters when calling a function marked as MOZ_CAN_RUN_SCRIPT (including the implicit object argument).  'new RefCountedBase' is neither.
 0:02.02   File /Users/jorendorff/work/mozilla-central/build/clang-plugin/tests/TestCanRunScript.cpp Line 92: arguments must all be strong refs or caller's parameters when calling a function marked as MOZ_CAN_RUN_SCRIPT (including the implicit object argument).  't' is neither.
 0:02.02   File /Users/jorendorff/work/mozilla-central/build/clang-plugin/tests/TestCanRunScript.cpp Line 93: arguments must all be strong refs or caller's parameters when calling a function marked as MOZ_CAN_RUN_SCRIPT (including the implicit object argument).  't' is neither.
 0:02.02   File /Users/jorendorff/work/mozilla-central/build/clang-plugin/tests/TestCanRunScript.cpp Line 111: functions marked as MOZ_CAN_RUN_SCRIPT can only be called from functions also marked as MOZ_CAN_RUN_SCRIPT
 0:02.02   File /Users/jorendorff/work/mozilla-central/build/clang-plugin/tests/TestCanRunScript.cpp Line 115: functions marked as MOZ_CAN_RUN_SCRIPT cannot override functions that are not marked MOZ_CAN_RUN_SCRIPT
 0:02.02   File /Users/jorendorff/work/mozilla-central/build/clang-plugin/tests/TestCanRunScript.cpp Line 118: functions marked as MOZ_CAN_RUN_SCRIPT cannot override functions that are not marked MOZ_CAN_RUN_SCRIPT
 0:02.02   File /Users/jorendorff/work/mozilla-central/build/clang-plugin/tests/TestCanRunScript.cpp Line 157: arguments must all be strong refs or caller's parameters when calling a function marked as MOZ_CAN_RUN_SCRIPT (including the implicit object argument).  'x' is neither.
 0:02.02   File /Users/jorendorff/work/mozilla-central/build/clang-plugin/tests/TestCanRunScript.cpp Line 166: arguments must all be strong refs or caller's parameters when calling a function marked as MOZ_CAN_RUN_SCRIPT (including the implicit object argument).  '*t' is neither.
 0:02.02   File /Users/jorendorff/work/mozilla-central/build/clang-plugin/tests/TestCanRunScript.cpp Line 171: arguments must all be strong refs or caller's parameters when calling a function marked as MOZ_CAN_RUN_SCRIPT (including the implicit object argument).  '*t' is neither.
 0:02.02   File /Users/jorendorff/work/mozilla-central/build/clang-plugin/tests/TestCanRunScript.cpp Line 177: arguments must all be strong refs or caller's parameters when calling a function marked as MOZ_CAN_RUN_SCRIPT (including the implicit object argument).  'ref' is neither.
 0:02.02   File /Users/jorendorff/work/mozilla-central/build/clang-plugin/tests/TestCanRunScript.cpp Line 183: arguments must all be strong refs or caller's parameters when calling a function marked as MOZ_CAN_RUN_SCRIPT (including the implicit object argument).  'ref' is neither.
 0:02.02   File /Users/jorendorff/work/mozilla-central/build/clang-plugin/tests/TestCanRunScript.cpp Line 210: arguments must all be strong refs or caller's parameters when calling a function marked as MOZ_CAN_RUN_SCRIPT (including the implicit object argument).  '*(RefCountedBase*)x' is neither.
 0:02.02   File /Users/jorendorff/work/mozilla-central/build/clang-plugin/tests/TestCanRunScript.cpp Line 218: arguments must all be strong refs or caller's parameters when calling a function marked as MOZ_CAN_RUN_SCRIPT (including the implicit object argument).  '*x' is neither.
 0:02.02   File /Users/jorendorff/work/mozilla-central/build/clang-plugin/tests/TestCanRunScript.cpp Line 225: arguments must all be strong refs or caller's parameters when calling a function marked as MOZ_CAN_RUN_SCRIPT (including the implicit object argument).  '*unsafe' is neither.
 0:02.02   File /Users/jorendorff/work/mozilla-central/build/clang-plugin/tests/TestCanRunScript.cpp Line 232: arguments must all be strong refs or caller's parameters when calling a function marked as MOZ_CAN_RUN_SCRIPT (including the implicit object argument).  '(*safe)' is neither.
 0:02.02   File /Users/jorendorff/work/mozilla-central/build/clang-plugin/tests/TestCanRunScript.cpp Line 244: arguments must all be strong refs or caller's parameters when calling a function marked as MOZ_CAN_RUN_SCRIPT (including the implicit object argument).  't' is neither.
 0:02.02   File /Users/jorendorff/work/mozilla-central/build/clang-plugin/tests/TestCanRunScript.cpp Line 252: arguments must all be strong refs or caller's parameters when calling a function marked as MOZ_CAN_RUN_SCRIPT (including the implicit object argument).  'new RefCountedBase()' is neither.
 0:02.02   File /Users/jorendorff/work/mozilla-central/build/clang-plugin/tests/TestCanRunScript.cpp Line 261: arguments must all be strong refs or caller's parameters when calling a function marked as MOZ_CAN_RUN_SCRIPT (including the implicit object argument).  't' is neither.
 0:02.02   File /Users/jorendorff/work/mozilla-central/build/clang-plugin/tests/TestCanRunScript.cpp Line 285: arguments must all be strong refs or caller's parameters when calling a function marked as MOZ_CAN_RUN_SCRIPT (including the implicit object argument).  'mRefCounted' is neither.
 0:02.02   File /Users/jorendorff/work/mozilla-central/build/clang-plugin/tests/TestCanRunScript.cpp Line 288: arguments must all be strong refs or caller's parameters when calling a function marked as MOZ_CAN_RUN_SCRIPT (including the implicit object argument).  'mRefCounted' is neither.
 0:02.02   File /Users/jorendorff/work/mozilla-central/build/clang-plugin/tests/TestCanRunScript.cpp Line 295: arguments must all be strong refs or caller's parameters when calling a function marked as MOZ_CAN_RUN_SCRIPT (including the implicit object argument).  'mRefCounted.get()' is neither.
 0:02.02   File /Users/jorendorff/work/mozilla-central/build/clang-plugin/tests/TestCanRunScript.cpp Line 298: arguments must all be strong refs or caller's parameters when calling a function marked as MOZ_CAN_RUN_SCRIPT (including the implicit object argument).  'mRefCounted.get()' is neither.
 0:02.03   File /Users/jorendorff/work/mozilla-central/build/clang-plugin/tests/TestCanRunScript.cpp Line 321: arguments must all be strong refs or caller's parameters when calling a function marked as MOZ_CAN_RUN_SCRIPT (including the implicit object argument).  'MOZ_KnownLive(mWeakPtrReturner1)->getWeakPtr()' is neither.
 0:02.03   File /Users/jorendorff/work/mozilla-central/build/clang-plugin/tests/TestCanRunScript.cpp Line 325: arguments must all be strong refs or caller's parameters when calling a function marked as MOZ_CAN_RUN_SCRIPT (including the implicit object argument).  'MOZ_KnownLive(mWeakPtrReturner1)->getWeakPtr()' is neither.
 0:02.03   File /Users/jorendorff/work/mozilla-central/build/clang-plugin/tests/TestCanRunScript.cpp Line 329: arguments must all be strong refs or caller's parameters when calling a function marked as MOZ_CAN_RUN_SCRIPT (including the implicit object argument).  'MOZ_KnownLive(mWeakPtrReturner2)->getWeakPtr()' is neither.
 0:02.03   File /Users/jorendorff/work/mozilla-central/build/clang-plugin/tests/TestCanRunScript.cpp Line 333: arguments must all be strong refs or caller's parameters when calling a function marked as MOZ_CAN_RUN_SCRIPT (including the implicit object argument).  'MOZ_KnownLive(mWeakPtrReturner2)->getWeakPtr()' is neither.
 0:02.03   File /Users/jorendorff/work/mozilla-central/build/clang-plugin/tests/TestCanRunScript.cpp Line 360: arguments must all be strong refs or caller's parameters when calling a function marked as MOZ_CAN_RUN_SCRIPT (including the implicit object argument).  'mMember->mRefCounted' is neither.
 0:02.03   File /Users/jorendorff/work/mozilla-central/build/clang-plugin/tests/TestCanRunScript.cpp Line 363: arguments must all be strong refs or caller's parameters when calling a function marked as MOZ_CAN_RUN_SCRIPT (including the implicit object argument).  'mMember->mRefCounted' is neither.
 0:02.03   File /Users/jorendorff/work/mozilla-central/build/clang-plugin/tests/TestCanRunScript.cpp Line 370: arguments must all be strong refs or caller's parameters when calling a function marked as MOZ_CAN_RUN_SCRIPT (including the implicit object argument).  'mRefCounted' is neither.
 0:02.03   File /Users/jorendorff/work/mozilla-central/build/clang-plugin/tests/TestCanRunScript.cpp Line 373: arguments must all be strong refs or caller's parameters when calling a function marked as MOZ_CAN_RUN_SCRIPT (including the implicit object argument).  'mRefCounted' is neither.
 0:02.03   File /Users/jorendorff/work/mozilla-central/build/clang-plugin/tests/TestCanRunScript.cpp Line 408: arguments must all be strong refs or caller's parameters when calling a function marked as MOZ_CAN_RUN_SCRIPT (including the implicit object argument).  'WeakSmartPtr(new RefCountedBase())' is neither.
 0:02.03   File /Users/jorendorff/work/mozilla-central/build/clang-plugin/tests/TestCanRunScript.cpp Line 412: arguments must all be strong refs or caller's parameters when calling a function marked as MOZ_CAN_RUN_SCRIPT (including the implicit object argument).  '*WeakSmartPtr(new RefCountedBase())' is neither.
 0:02.03   File /Users/jorendorff/work/mozilla-central/build/clang-plugin/tests/TestCanRunScript.cpp Line 416: arguments must all be strong refs or caller's parameters when calling a function marked as MOZ_CAN_RUN_SCRIPT (including the implicit object argument).  'WeakSmartPtr(new RefCountedBase())' is neither.
 0:02.03   File /Users/jorendorff/work/mozilla-central/build/clang-plugin/tests/TestCanRunScript.cpp Line 432: arguments must all be strong refs or caller's parameters when calling a function marked as MOZ_CAN_RUN_SCRIPT (including the implicit object argument).  'mArray[0]' is neither.
 0:02.03   File /Users/jorendorff/work/mozilla-central/build/clang-plugin/tests/TestCanRunScript.cpp Line 435: arguments must all be strong refs or caller's parameters when calling a function marked as MOZ_CAN_RUN_SCRIPT (including the implicit object argument).  'mArray[0]' is neither.
 0:02.03   File /Users/jorendorff/work/mozilla-central/build/clang-plugin/tests/TestCanRunScript.cpp Line 442: arguments must all be strong refs or caller's parameters when calling a function marked as MOZ_CAN_RUN_SCRIPT (including the implicit object argument).  'mArray[0]' is neither.
 0:02.03   File /Users/jorendorff/work/mozilla-central/build/clang-plugin/tests/TestCanRunScript.cpp Line 445: arguments must all be strong refs or caller's parameters when calling a function marked as MOZ_CAN_RUN_SCRIPT (including the implicit object argument).  'mArray[0]' is neither.
 0:02.03   File /Users/jorendorff/work/mozilla-central/build/clang-plugin/tests/TestCanRunScript.cpp Line 571: arguments must all be strong refs or caller's parameters when calling a function marked as MOZ_CAN_RUN_SCRIPT (including the implicit object argument).  'bogus' is neither.
 0:02.03   File /Users/jorendorff/work/mozilla-central/build/clang-plugin/tests/TestCanRunScript.cpp Line 575: arguments must all be strong refs or caller's parameters when calling a function marked as MOZ_CAN_RUN_SCRIPT (including the implicit object argument).  'bogus' is neither.
 0:02.03   File /Users/jorendorff/work/mozilla-central/build/clang-plugin/tests/TestCanRunScript.cpp Line 583: arguments must all be strong refs or caller's parameters when calling a function marked as MOZ_CAN_RUN_SCRIPT (including the implicit object argument).  'item' is neither.
 0:02.03   File /Users/jorendorff/work/mozilla-central/build/clang-plugin/tests/TestCanRunScript.cpp Line 588: arguments must all be strong refs or caller's parameters when calling a function marked as MOZ_CAN_RUN_SCRIPT (including the implicit object argument).  'item' is neither.
 0:02.03   File /Users/jorendorff/work/mozilla-central/build/clang-plugin/tests/TestCanRunScript.cpp Line 603: arguments must all be strong refs or caller's parameters when calling a function marked as MOZ_CAN_RUN_SCRIPT (including the implicit object argument).  'item' is neither.
 0:02.03   File /Users/jorendorff/work/mozilla-central/build/clang-plugin/tests/TestCanRunScript.cpp Line 608: arguments must all be strong refs or caller's parameters when calling a function marked as MOZ_CAN_RUN_SCRIPT (including the implicit object argument).  'item' is neither.
 0:02.03 error: 'error' diagnostics seen but not expected:
 0:02.03   File /Users/jorendorff/work/mozilla-central/build/clang-plugin/tests/TestCanRunScript.cpp Line 1: 'mozilla/RefPtr.h' file not found
 0:02.03 error: 'note' diagnostics expected but not seen:
 0:02.03   File /Users/jorendorff/work/mozilla-central/build/clang-plugin/tests/TestCanRunScript.cpp Line 11: caller function declared here
 0:02.03   File /Users/jorendorff/work/mozilla-central/build/clang-plugin/tests/TestCanRunScript.cpp Line 36: caller function declared here
 0:02.03   File /Users/jorendorff/work/mozilla-central/build/clang-plugin/tests/TestCanRunScript.cpp Line 54: caller function declared here
 0:02.03   File /Users/jorendorff/work/mozilla-central/build/clang-plugin/tests/TestCanRunScript.cpp Line 62: caller function declared here
 0:02.03   File /Users/jorendorff/work/mozilla-central/build/clang-plugin/tests/TestCanRunScript.cpp Line 107: overridden function declared here
 0:02.03   File /Users/jorendorff/work/mozilla-central/build/clang-plugin/tests/TestCanRunScript.cpp Line 107: overridden function declared here
 0:02.03   File /Users/jorendorff/work/mozilla-central/build/clang-plugin/tests/TestCanRunScript.cpp Line 107: caller function declared here
 0:02.03 56 errors generated.
 0:02.05 gmake[4]: *** [/Users/jorendorff/work/mozilla-central/config/rules.mk:748: TestCanRunScript.o] Error 1
 0:08.55 gmake[4]: Target 'target-objects' not remade because of errors.
 0:08.55 gmake[3]: *** [/Users/jorendorff/work/mozilla-central/config/recurse.mk:72: build/clang-plugin/tests/target-objects] Error 2
 0:08.55 gmake[3]: Target 'recurse_compile' not remade because of errors.
 0:08.55 gmake[2]: *** [/Users/jorendorff/work/mozilla-central/config/recurse.mk:34: compile] Error 2
 0:08.55 gmake[1]: *** [/Users/jorendorff/work/mozilla-central/config/recurse.mk:150: compile] Error 2
 0:08.56 gmake: *** [/Users/jorendorff/work/mozilla-central/config/rules.mk:390: default] Error 2
 0:08.56 295 compiler warnings present.
Component: Lint and Formatting → Source Code Analysis

The tests fail because /mfbt isn't in the include path.

I haven't seen these tests pass on my machine. Bisect here finds some irrelevant edge between commits that fail the test and commits where mach build doesn't even get past the "configure" phase: https://hg.mozilla.org/mozilla-central/rev/d1001fea6e4c

This fails if you've clobbered. Running a full build first fixes it!

I'm told mach build DIR just doesn't work for most build directories.

First you need to have the exports and exports so doing:

./mach configure
./mach build pre-export export
./mach build build/clang-plugin

Will work.

Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → WORKSFORME
Product: Firefox Build System → Developer Infrastructure
You need to log in before you can comment on or make changes to this bug.