|
| 1 | +From 66011b9d3b8ef4fce5d70f11a381e7cc83dff4c8 Mon Sep 17 00:00:00 2001 |
| 2 | +From: Yoann Congal < [email protected]> |
| 3 | +Date: Tue, 25 Mar 2025 22:25:55 +0100 |
| 4 | +Subject: [PATCH] clangd: Add a build option to disable building dexp |
| 5 | + |
| 6 | +Building dexp on Debian 11 currently causes intermittent failure[0][1]. |
| 7 | + |
| 8 | +Adding the CLANGD_BUILD_DEXP option to disable dexp from the build |
| 9 | +allows Debian 11 users to build clang (albeit without the dexp tool). |
| 10 | + |
| 11 | +This option is set to "Build Dexp" by default so, no change is expected |
| 12 | +without manual setting. |
| 13 | + |
| 14 | +[0]: https://bugzilla.yoctoproject.org/show_bug.cgi?id=15803 |
| 15 | +[1]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1101322 |
| 16 | + |
| 17 | +Upstream-Status: Submitted [https://github.com/llvm/llvm-project/pull/133124] |
| 18 | +Signed-off-by: Yoann Congal < [email protected]> |
| 19 | +--- |
| 20 | + clang-tools-extra/clangd/CMakeLists.txt | 6 +++++- |
| 21 | + clang-tools-extra/clangd/test/CMakeLists.txt | 7 +++++-- |
| 22 | + clang-tools-extra/clangd/test/lit.site.cfg.py.in | 1 + |
| 23 | + .../gn/secondary/clang-tools-extra/clangd/test/BUILD.gn | 6 +++++- |
| 24 | + 4 files changed, 16 insertions(+), 4 deletions(-) |
| 25 | + |
| 26 | +diff --git a/clang-tools-extra/clangd/CMakeLists.txt b/clang-tools-extra/clangd/CMakeLists.txt |
| 27 | +index 6f10afe4a..279515d63 100644 |
| 28 | +--- a/clang-tools-extra/clangd/CMakeLists.txt |
| 29 | ++++ b/clang-tools-extra/clangd/CMakeLists.txt |
| 30 | +@@ -220,4 +220,8 @@ option(CLANGD_ENABLE_REMOTE "Use gRPC library to enable remote index support for |
| 31 | + set(GRPC_INSTALL_PATH "" CACHE PATH "Path to gRPC library manual installation.") |
| 32 | + |
| 33 | + add_subdirectory(index/remote) |
| 34 | +-add_subdirectory(index/dex/dexp) |
| 35 | ++ |
| 36 | ++option(CLANGD_BUILD_DEXP "Build the dexp tool as part of Clangd" ON) |
| 37 | ++if(CLANGD_BUILD_DEXP) |
| 38 | ++ add_subdirectory(index/dex/dexp) |
| 39 | ++endif() |
| 40 | +diff --git a/clang-tools-extra/clangd/test/CMakeLists.txt b/clang-tools-extra/clangd/test/CMakeLists.txt |
| 41 | +index b51f461a4..42fc35066 100644 |
| 42 | +--- a/clang-tools-extra/clangd/test/CMakeLists.txt |
| 43 | ++++ b/clang-tools-extra/clangd/test/CMakeLists.txt |
| 44 | +@@ -3,8 +3,6 @@ set(CLANGD_TEST_DEPS |
| 45 | + ClangdTests |
| 46 | + clangd-indexer |
| 47 | + split-file |
| 48 | +- # No tests for it, but we should still make sure they build. |
| 49 | +- dexp |
| 50 | + ) |
| 51 | + |
| 52 | + if(CLANGD_BUILD_XPC) |
| 53 | +@@ -12,6 +10,11 @@ if(CLANGD_BUILD_XPC) |
| 54 | + list(APPEND CLANGD_TEST_DEPS ClangdXpcUnitTests) |
| 55 | + endif() |
| 56 | + |
| 57 | ++if(CLANGD_BUILD_DEXP) |
| 58 | ++ # No tests for it, but we should still make sure they build. |
| 59 | ++ list(APPEND CLANGD_TEST_DEPS dexp) |
| 60 | ++endif() |
| 61 | ++ |
| 62 | + if(CLANGD_ENABLE_REMOTE) |
| 63 | + list(APPEND CLANGD_TEST_DEPS clangd-index-server clangd-index-server-monitor) |
| 64 | + endif() |
| 65 | +diff --git a/clang-tools-extra/clangd/test/lit.site.cfg.py.in b/clang-tools-extra/clangd/test/lit.site.cfg.py.in |
| 66 | +index 1fe7c8d0f..a0bb3561e 100644 |
| 67 | +--- a/clang-tools-extra/clangd/test/lit.site.cfg.py.in |
| 68 | ++++ b/clang-tools-extra/clangd/test/lit.site.cfg.py.in |
| 69 | +@@ -15,6 +15,7 @@ config.llvm_shlib_dir = "@SHLIBDIR@" |
| 70 | + config.clangd_source_dir = "@CMAKE_CURRENT_SOURCE_DIR@/.." |
| 71 | + config.clangd_binary_dir = "@CMAKE_CURRENT_BINARY_DIR@/.." |
| 72 | + config.clangd_build_xpc = @CLANGD_BUILD_XPC@ |
| 73 | ++config.clangd_build_dexp = @CLANGD_BUILD_DEXP@ |
| 74 | + config.clangd_enable_remote = @CLANGD_ENABLE_REMOTE@ |
| 75 | + config.clangd_tidy_checks = @CLANGD_TIDY_CHECKS@ |
| 76 | + config.have_zlib = @LLVM_ENABLE_ZLIB@ |
| 77 | +diff --git a/llvm/utils/gn/secondary/clang-tools-extra/clangd/test/BUILD.gn b/llvm/utils/gn/secondary/clang-tools-extra/clangd/test/BUILD.gn |
| 78 | +index 9d42409f1..8bfcb1282 100644 |
| 79 | +--- a/llvm/utils/gn/secondary/clang-tools-extra/clangd/test/BUILD.gn |
| 80 | ++++ b/llvm/utils/gn/secondary/clang-tools-extra/clangd/test/BUILD.gn |
| 81 | +@@ -77,7 +77,6 @@ group("test") { |
| 82 | + deps = [ |
| 83 | + ":lit_site_cfg", |
| 84 | + ":lit_unit_site_cfg", |
| 85 | +- "//clang-tools-extra/clangd/index/dex/dexp", |
| 86 | + "//clang-tools-extra/clangd/indexer:clangd-indexer", |
| 87 | + "//clang-tools-extra/clangd/tool:clangd", |
| 88 | + "//clang-tools-extra/clangd/unittests:ClangdTests", |
| 89 | +@@ -92,6 +91,11 @@ group("test") { |
| 90 | + "//clang-tools-extra/clangd/xpc/test-client:clangd-xpc-test-client", |
| 91 | + ] |
| 92 | + } |
| 93 | ++ if (clangd_build_dexp) { |
| 94 | ++ deps += [ |
| 95 | ++ "//clang-tools-extra/clangd/index/dex/dexp", |
| 96 | ++ ] |
| 97 | ++ } |
| 98 | + testonly = true |
| 99 | + } |
| 100 | + |
0 commit comments