Skip to content

Conversation

HerrCai0907
Copy link
Contributor

reapply #131804 and #159289
Fixed cmake link issue.

DeNiCoN and others added 30 commits March 17, 2025 08:06
This reverts commit a686695.
@HerrCai0907
Copy link
Contributor Author

HerrCai0907 commented Sep 18, 2025

@ingomueller-net could you kindly review this PR. I think I have fixed build issue but since I cannot reproduce it locally. I am not 100% sure it can work. Fix commit: 296eea3

Copy link
Contributor

@ingomueller-net ingomueller-net left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was able to build clangTidy in my set-up, so it seems to work now. Approval for that aspect.

Copy link
Contributor

@ingomueller-net ingomueller-net left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, spoke too soon. Building clang-tidy still has a lot of problems. The first one is the following but there are too many to copy them here.

ld.lld: error: undefined symbol: clang::ast_matchers::MatchFinder::addDynamicMatcher(clang::ast_matchers::internal::DynTypedMatcher const&, clang::ast_matchers::MatchFinder::MatchCallback*)
>>> referenced by QueryCheck.cpp:123 (/usr/local/google/home/ingomueller/git/llvm-project/clang-tools-extra/clang-tidy/custom/QueryCheck.cpp:123)
>>>               tools/clang/tools/extra/clang-tidy/custom/CMakeFiles/obj.clangTidyCustomModule.dir/QueryCheck.cpp.o:(clang::tidy::custom::QueryCheck::registerMatchers(clang::ast_matchers::MatchFinder*))

Did you try to build with BUILD_SHARED_LIB?

@HerrCai0907
Copy link
Contributor Author

I found how to reproduce it. Build failed happened in ubuntu with cmake -S llvm -B build/release-gcc-shared -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=MinSizeRel -DBUILD_SHARED_LIBS=1 -DLLVM_ENABLE_ASSERTIONS=1 -DLLVM_ENABLE_PROJECTS="clang;clang-tools-extra" -DLLVM_TARGETS_TO_BUILD="X86".
Neither mac + clang nor ubuntu + clang can be reproduced.

@HerrCai0907
Copy link
Contributor Author

I think it works now.

@HerrCai0907 HerrCai0907 merged commit 584af2f into main Sep 19, 2025
11 checks passed
@HerrCai0907 HerrCai0907 deleted the users/ccc/clang-tidy/query-check branch September 19, 2025 13:48
@nico
Copy link
Contributor

nico commented Sep 19, 2025

These tests seem to fail when the new option is set to OFF:

  Clang Tools :: clang-tidy/checkers/custom/query-incorrect-query.cpp
  Clang Tools :: clang-tidy/checkers/custom/query-partially-active-check.cpp
  Clang Tools :: clang-tidy/checkers/custom/query.cpp
  Clang Tools :: clang-tidy/infrastructure/custom-query-check.cpp

CLANG_TIDY_ENABLE_STATIC_ANALYZER has a toggle in clang-tools-extra/test/lit.site.cfg.py.in which is used to not run the tests that need that feature if it's off. This PR here probably needs something similar?

(originally at #131804 (comment) but here makes more sense)

@HerrCai0907
Copy link
Contributor Author

fixed in #159809

These tests seem to fail when the new option is set to OFF:

  Clang Tools :: clang-tidy/checkers/custom/query-incorrect-query.cpp
  Clang Tools :: clang-tidy/checkers/custom/query-partially-active-check.cpp
  Clang Tools :: clang-tidy/checkers/custom/query.cpp
  Clang Tools :: clang-tidy/infrastructure/custom-query-check.cpp

CLANG_TIDY_ENABLE_STATIC_ANALYZER has a toggle in clang-tools-extra/test/lit.site.cfg.py.in which is used to not run the tests that need that feature if it's off. This PR here probably needs something similar?

(originally at #131804 (comment) but here makes more sense)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants