Page MenuHomePhabricator

[test] Fix plugin tests
ClosedPublic

Authored by hintonda on May 24 2019, 11:06 PM.

Details

Summary

The following changes were required to fix these tests:

  1. Change LLVM_ENABLE_PLUGINS to an option and move it to llvm/CMakeLists.txt with an appropriate default -- which matches the original default behavior.
  1. Move the plugins directory from clang/test/Analysis clang/lib/Analysis. It's not enough to add an exclude to the lit.local.cfg file because add_lit_testsuites recurses the tree and automatically adds the appropriate check- targets, which don't make sense for the plugins because they aren't tests and don't have RUN statements.

    Here's a list of the clang-check-anlysis* targets with this change:
$ ninja -t targets all| sed -n "s/.*\/\(check[^:]*\):.*/\1/p" | sort -u | grep clang-analysis
check-clang-analysis
check-clang-analysis-checkers
check-clang-analysis-copypaste
check-clang-analysis-diagnostics
check-clang-analysis-engine
check-clang-analysis-exploration_order
check-clang-analysis-html_diagnostics
check-clang-analysis-html_diagnostics-relevant_lines
check-clang-analysis-inlining
check-clang-analysis-objc
check-clang-analysis-unified-sources
check-clang-analysis-z3
  1. Simplify the logic and only include the subdirectories under clang/lib/Analysis/plugins if LLVM_ENABLE_PLUGINS is set.

Diff Detail

Repository
rL LLVM

Event Timeline

hintonda created this revision.May 24 2019, 11:06 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptMay 24 2019, 11:06 PM
hintonda edited the summary of this revision. (Show Details)May 24 2019, 11:09 PM
hintonda edited the summary of this revision. (Show Details)May 24 2019, 11:12 PM
NoQ accepted this revision.May 27 2019, 9:00 PM
NoQ added subscribers: mikhail.ramalho, ddcc.

Thanks!!

I think we're losing the Z3 constraint manager test suite this way after all (details inline), but i feel we should downprioritize this when it comes to fixing everybody's buildbots.

clang/test/CMakeLists.txt
141–147 ↗(On Diff #201391)

As far as i remember, this chunk of code is responsible for running the whole analyzer test suite with different parameters (with Z3 as a constraint manager instead of the ad-hoc range constraint manager), rather than running a smaller chunk of the suite.

@mikhail.ramalho, @ddcc - i think i should leave it up to you to decide if you want to keep this working. Right now these extra tests aren't run under any buildbot, and the facility that they're testing is probably never going to be used by actual users (as opposed to the z3 refutation). But i wouldn't love losing this facility because it's a great way of evaluating the static analyzer, i.e. figuring out how good *could* it have been with a good constraint solver, so that we had something to look forward to.

This revision is now accepted and ready to land.May 27 2019, 9:00 PM
hintonda marked an inline comment as done.May 27 2019, 9:26 PM
hintonda added inline comments.
clang/test/CMakeLists.txt
141–147 ↗(On Diff #201391)

Ah, that was unintentional. I didn't intend to touch Z3.

Let me see if I can put that part back.

hintonda marked an inline comment as done.May 27 2019, 9:50 PM
hintonda added inline comments.
clang/test/CMakeLists.txt
141–147 ↗(On Diff #201391)

Actually, on second thought, these get picked up automatically, so they shouldn't be added like this.

Closed by commit rC361790: [test] Fix plugin tests (authored by dhinton, committed by ). · Explain WhyMay 27 2019, 11:25 PM
This revision was automatically updated to reflect the committed changes.
hintonda reopened this revision.Jun 1 2019, 4:40 PM

This patch broke some of the bots, so reopening to track the fix.

This revision is now accepted and ready to land.Jun 1 2019, 4:40 PM
hintonda updated this revision to Diff 202573.Jun 1 2019, 4:40 PM
  • Fix dependencies so required plugins get built before tests.
Closed by commit rL362328: [test] Fix plugin tests (authored by dhinton, committed by ). · Explain WhyJun 2 2019, 8:54 AM
This revision was automatically updated to reflect the committed changes.

This broke non-PIC builds. Fixed: r362399

This broke non-PIC builds. Fixed: r362399

Sorry for the breakage, and thanks for the fix!

nathanchance added inline comments.
cfe/trunk/lib/Analysis/plugins/CMakeLists.txt
1

I think this should have a dependency on CLANG_ENABLE_STATIC_ANALYZER like in clang/test/CMakeLists.txt, otherwise my build (which disables CLANG_ENABLE_STATIC_ANALYZER) fails because these plugins are being added to the build.

[2058/2605] Linking CXX shared module lib/CheckerOptionHandlingAnalyzerPlugin.so
FAILED: lib/CheckerOptionHandlingAnalyzerPlugin.so 
: && /usr/bin/g++ -fPIC -O2 -march=native -mtune=native -fPIC -fvisibility-inlines-hidden -Werror=date-time -std=c++11 -w -fdiagnostics-color -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -fno-strict-aliasing -O3 -DNDEBUG  -Wl,-z,nodelete -fuse-ld=gold   -Wl,-O3 -Wl,--gc-sections  -Wl,--version-script,"/tc-build2/build/llvm/stage1/tools/clang/lib/Analysis/plugins/CheckerOptionHandling/CheckerOptionHandlingAnalyzerPlugin.exports" -shared  -o lib/CheckerOptionHandlingAnalyzerPlugin.so tools/clang/lib/Analysis/plugins/CheckerOptionHandling/CMakeFiles/CheckerOptionHandlingAnalyzerPlugin.dir/CheckerOptionHandling.cpp.o  -Wl,-rpath,"\$ORIGIN/../lib" lib/libLLVMSupport.a lib/libclangAnalysis.a lib/libclangAST.a -lclangStaticAnalyzerCore -lclangStaticAnalyzerFrontend lib/libLLVMSupport.a lib/libclangASTMatchers.a lib/libclangAST.a lib/libclangLex.a lib/libclangBasic.a lib/libLLVMCore.a lib/libLLVMRemarks.a lib/libLLVMMC.a lib/libLLVMBinaryFormat.a lib/libLLVMDebugInfoCodeView.a lib/libLLVMDebugInfoMSF.a lib/libLLVMSupport.a -lz -lrt -ldl -lpthread -lm lib/libLLVMDemangle.a && :
/usr/bin/ld.gold: error: cannot find -lclangStaticAnalyzerCore
/usr/bin/ld.gold: error: cannot find -lclangStaticAnalyzerFrontend
collect2: error: ld returned 1 exit status
[2059/2605] Building CXX object tools/clang/tools/clang-refactor/CMakeFiles/clang-refactor.dir/TestSupport.cpp.o
[2060/2605] Linking CXX shared module lib/CheckerDependencyHandlingAnalyzerPlugin.so
FAILED: lib/CheckerDependencyHandlingAnalyzerPlugin.so 
: && /usr/bin/g++ -fPIC -O2 -march=native -mtune=native -fPIC -fvisibility-inlines-hidden -Werror=date-time -std=c++11 -w -fdiagnostics-color -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -fno-strict-aliasing -O3 -DNDEBUG  -Wl,-z,nodelete -fuse-ld=gold   -Wl,-O3 -Wl,--gc-sections  -Wl,--version-script,"/tc-build2/build/llvm/stage1/tools/clang/lib/Analysis/plugins/CheckerDependencyHandling/CheckerDependencyHandlingAnalyzerPlugin.exports" -shared  -o lib/CheckerDependencyHandlingAnalyzerPlugin.so tools/clang/lib/Analysis/plugins/CheckerDependencyHandling/CMakeFiles/CheckerDependencyHandlingAnalyzerPlugin.dir/CheckerDependencyHandling.cpp.o  -Wl,-rpath,"\$ORIGIN/../lib" lib/libLLVMSupport.a lib/libclangAnalysis.a lib/libclangAST.a -lclangStaticAnalyzerCore -lclangStaticAnalyzerFrontend lib/libLLVMSupport.a lib/libclangASTMatchers.a lib/libclangAST.a lib/libclangLex.a lib/libclangBasic.a lib/libLLVMCore.a lib/libLLVMRemarks.a lib/libLLVMMC.a lib/libLLVMBinaryFormat.a lib/libLLVMDebugInfoCodeView.a lib/libLLVMDebugInfoMSF.a lib/libLLVMSupport.a -lz -lrt -ldl -lpthread -lm lib/libLLVMDemangle.a && :
/usr/bin/ld.gold: error: cannot find -lclangStaticAnalyzerCore
/usr/bin/ld.gold: error: cannot find -lclangStaticAnalyzerFrontend
collect2: error: ld returned 1 exit status
[2061/2605] Building CXX object tools/clang/lib/Tooling/CMakeFiles/obj.clangTooling.dir/CompilationDatabase.cpp.o
[2062/2605] Linking CXX shared module lib/SampleAnalyzerPlugin.so
FAILED: lib/SampleAnalyzerPlugin.so 
: && /usr/bin/g++ -fPIC -O2 -march=native -mtune=native -fPIC -fvisibility-inlines-hidden -Werror=date-time -std=c++11 -w -fdiagnostics-color -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -fno-strict-aliasing -O3 -DNDEBUG  -Wl,-z,nodelete -fuse-ld=gold   -Wl,-O3 -Wl,--gc-sections  -Wl,--version-script,"/tc-build2/build/llvm/stage1/tools/clang/lib/Analysis/plugins/SampleAnalyzer/SampleAnalyzerPlugin.exports" -shared  -o lib/SampleAnalyzerPlugin.so tools/clang/lib/Analysis/plugins/SampleAnalyzer/CMakeFiles/SampleAnalyzerPlugin.dir/MainCallChecker.cpp.o  -Wl,-rpath,"\$ORIGIN/../lib" lib/libLLVMSupport.a lib/libclangAnalysis.a lib/libclangAST.a -lclangStaticAnalyzerCore -lclangStaticAnalyzerFrontend lib/libLLVMSupport.a lib/libclangASTMatchers.a lib/libclangAST.a lib/libclangLex.a lib/libclangBasic.a lib/libLLVMCore.a lib/libLLVMRemarks.a lib/libLLVMMC.a lib/libLLVMBinaryFormat.a lib/libLLVMDebugInfoCodeView.a lib/libLLVMDebugInfoMSF.a lib/libLLVMSupport.a -lz -lrt -ldl -lpthread -lm lib/libLLVMDemangle.a && :
/usr/bin/ld.gold: error: cannot find -lclangStaticAnalyzerCore
/usr/bin/ld.gold: error: cannot find -lclangStaticAnalyzerFrontend
collect2: error: ld returned 1 exit status
hintonda marked an inline comment as done.Jun 4 2019, 12:21 PM
hintonda added inline comments.
cfe/trunk/lib/Analysis/plugins/CMakeLists.txt
1

Sounds reasonable, and sorry for the breakage -- I'll post a fix shortly.

hintonda marked an inline comment as done.Jun 4 2019, 3:05 PM
hintonda added inline comments.
cfe/trunk/lib/Analysis/plugins/CMakeLists.txt
1

Fixed in r362555.

Thanks again for reporting this...

NoQ added a comment.EditedFri, Aug 2, 6:23 PM

Ugh, there seems to be one more forgotten buildbot with plugins problems: http://green.lab.llvm.org/green/job/clang-stage2-cmake-RgSan/6406/consoleText

FAIL: Clang :: Analysis/checker-plugins.c (467 of 14955)
******************** TEST 'Clang :: Analysis/checker-plugins.c' FAILED ********************
Script:
--
: 'RUN: at line 3';   /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/bin/clang -cc1 -internal-isystem /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/lib/clang/9.0.0/include -nostdsysteminc -analyze -analyzer-constraints=range -verify /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/llvm/tools/clang/test/Analysis/checker-plugins.c    -load /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/./lib/SampleAnalyzerPlugin.dylib    -analyzer-checker='example.MainCallChecker'
: 'RUN: at line 15';   /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/bin/clang -cc1 -internal-isystem /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/lib/clang/9.0.0/include -nostdsysteminc -analyze -analyzer-constraints=range /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/llvm/tools/clang/test/Analysis/checker-plugins.c    -load /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/./lib/CheckerDependencyHandlingAnalyzerPlugin.dylib   -analyzer-checker=example.DependendentChecker    -analyzer-list-enabled-checkers    2>&1 | /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/bin/FileCheck /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/llvm/tools/clang/test/Analysis/checker-plugins.c -check-prefix=CHECK-IMPLICITLY-ENABLED
: 'RUN: at line 24';   /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/bin/clang -cc1 -internal-isystem /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/lib/clang/9.0.0/include -nostdsysteminc -analyze -analyzer-constraints=range /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/llvm/tools/clang/test/Analysis/checker-plugins.c    -load /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/./lib/CheckerDependencyHandlingAnalyzerPlugin.dylib   -analyzer-checker=example.DependendentChecker    -analyzer-disable-checker=example.Dependency    -analyzer-list-enabled-checkers    2>&1 | /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/bin/FileCheck /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/llvm/tools/clang/test/Analysis/checker-plugins.c -check-prefix=CHECK-IMPLICITLY-DISABLED
: 'RUN: at line 34';   /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/bin/clang -cc1 -internal-isystem /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/lib/clang/9.0.0/include -nostdsysteminc -analyze -analyzer-constraints=range /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/llvm/tools/clang/test/Analysis/checker-plugins.c    -load /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/./lib/CheckerOptionHandlingAnalyzerPlugin.dylib   -analyzer-checker=example.MyChecker    2>&1 | /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/bin/FileCheck /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/llvm/tools/clang/test/Analysis/checker-plugins.c -check-prefix=CHECK-CHECKER-OPTION-OUTPUT
: 'RUN: at line 41';   /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/bin/clang -cc1 -internal-isystem /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/lib/clang/9.0.0/include -nostdsysteminc -analyze -analyzer-constraints=range /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/llvm/tools/clang/test/Analysis/checker-plugins.c    -load /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/./lib/CheckerOptionHandlingAnalyzerPlugin.dylib   -analyzer-checker=example.MyChecker    -analyzer-config example.MyChecker:ExampleOption=true    2>&1 | /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/bin/FileCheck /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/llvm/tools/clang/test/Analysis/checker-plugins.c -check-prefix=CHECK-CHECKER-OPTION-OUTPUT-TRUE
: 'RUN: at line 49';   /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/bin/clang -cc1 -internal-isystem /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/lib/clang/9.0.0/include -nostdsysteminc -analyze -analyzer-constraints=range /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/llvm/tools/clang/test/Analysis/checker-plugins.c    -load /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/./lib/CheckerOptionHandlingAnalyzerPlugin.dylib   -analyzer-checker=example.MyChecker    -analyzer-checker=debug.ConfigDumper    2>&1 | /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/bin/FileCheck /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/llvm/tools/clang/test/Analysis/checker-plugins.c -check-prefix=CHECK-CHECKER-OPTION
: 'RUN: at line 57';   /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/bin/clang -cc1 -internal-isystem /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/lib/clang/9.0.0/include -nostdsysteminc -analyze -analyzer-constraints=range /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/llvm/tools/clang/test/Analysis/checker-plugins.c    -load /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/./lib/CheckerOptionHandlingAnalyzerPlugin.dylib   -analyzer-checker=example.MyChecker    -analyzer-checker=debug.ConfigDumper    -analyzer-config example.MyChecker:ExampleOption=true    2>&1 | /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/bin/FileCheck /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/llvm/tools/clang/test/Analysis/checker-plugins.c -check-prefix=CHECK-CHECKER-OPTION-TRUE
: 'RUN: at line 66';   not /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/bin/clang -cc1 -internal-isystem /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/lib/clang/9.0.0/include -nostdsysteminc -analyze -analyzer-constraints=range -verify /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/llvm/tools/clang/test/Analysis/checker-plugins.c    -load /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/./lib/CheckerOptionHandlingAnalyzerPlugin.dylib   -analyzer-checker=example.MyChecker    -analyzer-config example.MyChecker:Example=true    2>&1 | /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/bin/FileCheck /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/llvm/tools/clang/test/Analysis/checker-plugins.c -check-prefix=CHECK-NON-EXISTENT-CHECKER-OPTION
: 'RUN: at line 75';   not /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/bin/clang -cc1 -internal-isystem /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/lib/clang/9.0.0/include -nostdsysteminc -analyze -analyzer-constraints=range -verify /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/llvm/tools/clang/test/Analysis/checker-plugins.c    -load /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/./lib/CheckerOptionHandlingAnalyzerPlugin.dylib   -analyzer-checker=example.MyChecker    -analyzer-config-compatibility-mode=true    -analyzer-config example.MyChecker:Example=true
: 'RUN: at line 82';   not /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/bin/clang -cc1 -internal-isystem /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/lib/clang/9.0.0/include -nostdsysteminc -analyze -analyzer-constraints=range -verify /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/llvm/tools/clang/test/Analysis/checker-plugins.c    -load /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/./lib/CheckerOptionHandlingAnalyzerPlugin.dylib   -analyzer-checker=example.MyChecker    -analyzer-config example.MyChecker:ExampleOption=example    2>&1 | /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/bin/FileCheck /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/llvm/tools/clang/test/Analysis/checker-plugins.c -check-prefix=CHECK-INVALID-BOOL-VALUE
: 'RUN: at line 92';   not /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/bin/clang -cc1 -internal-isystem /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/lib/clang/9.0.0/include -nostdsysteminc -analyze -analyzer-constraints=range -verify /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/llvm/tools/clang/test/Analysis/checker-plugins.c    -load /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/./lib/CheckerOptionHandlingAnalyzerPlugin.dylib   -analyzer-checker=example.MyChecker    -analyzer-config-compatibility-mode=true    -analyzer-config example.MyChecker:ExampleOption=example
: 'RUN: at line 98';   /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/bin/clang -cc1 -internal-isystem /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/lib/clang/9.0.0/include -nostdsysteminc -analyze -analyzer-constraints=range /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/llvm/tools/clang/test/Analysis/checker-plugins.c    -load /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/./lib/CheckerOptionHandlingAnalyzerPlugin.dylib   -analyzer-checker=example.MyChecker    -analyzer-checker=debug.ConfigDumper    -analyzer-config-compatibility-mode=true    -analyzer-config example.MyChecker:ExampleOption=example    2>&1 | /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/bin/FileCheck /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/llvm/tools/clang/test/Analysis/checker-plugins.c -check-prefix=CHECK-CORRECTED-BOOL-VALUE
: 'RUN: at line 108';   /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/bin/clang -cc1 -internal-isystem /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/lib/clang/9.0.0/include -nostdsysteminc -analyze -analyzer-constraints=range /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/llvm/tools/clang/test/Analysis/checker-plugins.c    -load /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/./lib/CheckerOptionHandlingAnalyzerPlugin.dylib   -analyzer-checker=example.MyChecker    -analyzer-checker-option-help    2>&1 | /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/bin/FileCheck /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/llvm/tools/clang/test/Analysis/checker-plugins.c -check-prefix=CHECK-CHECKER-OPTION-HELP
--
Exit Code: 1

The error message doesn't seem to be very expressive. I also can't reproduce it locally.

It got suddenly fixed in http://green.lab.llvm.org/green/job/clang-stage2-cmake-RgSan/6409/ but then immediately failed again later and it's still failing in a similar manner, and nobody noticed for two months =/

I'll keep looking into this but i'd love to hear if you have any immediate thoughts on that :)

In D62445#1613268, @NoQ wrote:

Ugh, there seems to be one more forgotten buildbot with plugins problems: http://green.lab.llvm.org/green/job/clang-stage2-cmake-RgSan/6406/consoleText

FAIL: Clang :: Analysis/checker-plugins.c (467 of 14955)
******************** TEST 'Clang :: Analysis/checker-plugins.c' FAILED ********************
Script:
--
: 'RUN: at line 3';   /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/bin/clang -cc1 -internal-isystem /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/lib/clang/9.0.0/include -nostdsysteminc -analyze -analyzer-constraints=range -verify /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/llvm/tools/clang/test/Analysis/checker-plugins.c    -load /Users/buildslave/jenkins/workspace/clang-stage2-cmake-RgSan/clang-build/./lib/SampleAnalyzerPlugin.dylib    -analyzer-checker='example.MainCallChecker'

<snip>

  • Exit Code: 1 `

    The error message doesn't seem to be very expressive. I also can't reproduce it locally.

    It got suddenly fixed in http://green.lab.llvm.org/green/job/clang-stage2-cmake-RgSan/6409/ but then immediately failed again later and it's still failing in a similar manner, and nobody noticed for two months =/

    I'll keep looking into this but i'd love to hear if you have any immediate thoughts on that :)

I don't see anything obvious, but could change the bot to pass "-vv" to lit instead of just "-v"? That way the actual error will make to the log.

In D62445#1613268, @NoQ wrote:

Ugh, there seems to be one more forgotten buildbot with plugins problems: http://green.lab.llvm.org/green/job/clang-stage2-cmake-RgSan/6406/consoleText

<snip>

It got suddenly fixed in http://green.lab.llvm.org/green/job/clang-stage2-cmake-RgSan/6409/ but then immediately failed again later and it's still failing in a similar manner, and nobody noticed for two months =/

The fix was accidental and fortuitous.

r362399 tried to set LLVM_ENABLE_PLUGINS_default to the value of LLVM_ENABLE_PIC, but had a typo that actually turn off LLVM_ENABLE_PLUGINS, so the test was marked unsupported in build #6409. That typo was fixed in r362492 which caused the next build, #6411 and all subsequent builds, to fail.

Will now look into cause/fix.

Just FYI – Having LLVM_ENABLE_PLUGINS_default depend on LLVM_ENABLE_PIC is a hack that should go away someday. Doing so requires that plugin dependencies either always build PIC (and therefore ignore LLVM_ENABLE_PIC), or are linked into the executables that load them and the plugin knows how to find them in the executable. In the case of the latter and on Mach-O platforms, this requires passing -bundle_loader $PATH_TO_EXECUTABLE to the linker when creating the plugin (a.k.a. "bundle"), but on ELF platforms, I'm not sure what needs to be done.

Just FYI – Having LLVM_ENABLE_PLUGINS_default depend on LLVM_ENABLE_PIC is a hack that should go away someday. Doing so requires that plugin dependencies either always build PIC (and therefore ignore LLVM_ENABLE_PIC), or are linked into the executables that load them and the plugin knows how to find them in the executable. In the case of the latter and on Mach-O platforms, this requires passing -bundle_loader $PATH_TO_EXECUTABLE to the linker when creating the plugin (a.k.a. "bundle"), but on ELF platforms, I'm not sure what needs to be done.

It just occurred to me: option 3 is to statically link the plugins if PIC is disabled.

These are all just tradeoffs of course, and the worst among them is what we have today: conflating "enable plugins" with the default PIC behavior for the project.

NoQ added a comment.Wed, Aug 14, 3:49 PM

I didn't make much progress so far, but i marked the test as // UNSUPPORTED: darwin in rC368765, so the buildbot is now green starting with http://green.lab.llvm.org/green/job/clang-stage2-cmake-RgSan/6519/.