[clang-tools-extra] [llvm] Add bazel support for clangd as a library. (PR #81556)

2024-02-12 Thread via cfe-commits

https://github.com/josh11b created 
https://github.com/llvm/llvm-project/pull/81556

Both creates a `BUILD.bazel` file for the `clangd` directory in the project 
overlay, and removes an unnecessary `#include "Feature.h"` to reduce the 
dependencies from `Transport.h`.

This upstreams the patch that allows 
https://github.com/carbon-language/carbon-lang/tree/trunk/language_server to 
use `clangd` as a library. This was created as part of a Summer of Code project 
building a prototype Carbon language server. If this is not an appropriate 
architecture, I'm very open to alternative paths forward.

Thanks!

>From 25c2f4f22adda315205f12c5d62dbc839395c9c3 Mon Sep 17 00:00:00 2001
From: Josh L 
Date: Mon, 12 Feb 2024 22:59:21 +
Subject: [PATCH] Add bazel support for clangd as a library.

---
 clang-tools-extra/clangd/Transport.h  |  1 -
 .../clang-tools-extra/clangd/BUILD.bazel  | 45 +++
 2 files changed, 45 insertions(+), 1 deletion(-)
 create mode 100644 
utils/bazel/llvm-project-overlay/clang-tools-extra/clangd/BUILD.bazel

diff --git a/clang-tools-extra/clangd/Transport.h 
b/clang-tools-extra/clangd/Transport.h
index 4e80ea95b8537d..f17441cfc1ef22 100644
--- a/clang-tools-extra/clangd/Transport.h
+++ b/clang-tools-extra/clangd/Transport.h
@@ -18,7 +18,6 @@
 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_TRANSPORT_H
 #define LLVM_CLANG_TOOLS_EXTRA_CLANGD_TRANSPORT_H
 
-#include "Feature.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/JSON.h"
 #include "llvm/Support/raw_ostream.h"
diff --git 
a/utils/bazel/llvm-project-overlay/clang-tools-extra/clangd/BUILD.bazel 
b/utils/bazel/llvm-project-overlay/clang-tools-extra/clangd/BUILD.bazel
new file mode 100644
index 00..0e25dd1c166560
--- /dev/null
+++ b/utils/bazel/llvm-project-overlay/clang-tools-extra/clangd/BUILD.bazel
@@ -0,0 +1,45 @@
+# This file is licensed under the Apache License v2.0 with LLVM Exceptions.
+# See https://llvm.org/LICENSE.txt for license information.
+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+
+package(default_visibility = ["//visibility:public"])
+
+licenses(["notice"])
+
+cc_library(
+name = "clangd_library",
+srcs = [
+"JSONTransport.cpp",
+"Protocol.cpp",
+"URI.cpp",
+"index/SymbolID.cpp",
+"support/Logger.cpp",
+"support/Trace.cpp",
+"support/MemoryTree.cpp",
+"support/Context.cpp",
+"support/Cancellation.cpp",
+"support/ThreadCrashReporter.cpp",
+"support/Shutdown.cpp",
+],
+hdrs = [
+"Transport.h",
+"Protocol.h",
+"URI.h",
+"LSPBinder.h",
+"index/SymbolID.h",
+"support/Function.h",
+"support/Cancellation.h",
+"support/ThreadCrashReporter.h",
+"support/Logger.h",
+"support/Trace.h",
+"support/MemoryTree.h",
+"support/Context.h",
+"support/Shutdown.h",
+],
+includes = ["."],
+deps = [
+"//llvm:Support",
+"//clang:basic",
+"//clang:index",
+],
+)

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] [llvm] Add bazel support for clangd as a library. (PR #81556)

2024-02-12 Thread via cfe-commits

github-actions[bot] wrote:



Thank you for submitting a Pull Request (PR) to the LLVM Project!

This PR will be automatically labeled and the relevant teams will be
notified.

If you wish to, you can add reviewers by using the "Reviewers" section on this 
page.

If this is not working for you, it is probably because you do not have write
permissions for the repository. In which case you can instead tag reviewers by
name in a comment by using `@` followed by their GitHub username.

If you have received no comments on your PR for a week, you can request a review
by "ping"ing the PR by adding a comment “Ping”. The common courtesy "ping" rate
is once a week. Please remember that you are asking for valuable time from 
other developers.

If you have further questions, they may be answered by the [LLVM GitHub User 
Guide](https://llvm.org/docs/GitHub.html).

You can also ask questions in a comment on this PR, on the [LLVM 
Discord](https://discord.com/invite/xS7Z362) or on the 
[forums](https://discourse.llvm.org/).

https://github.com/llvm/llvm-project/pull/81556
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] [llvm] Add bazel support for clangd as a library. (PR #81556)

2024-02-12 Thread via cfe-commits

llvmbot wrote:




@llvm/pr-subscribers-clangd

Author: None (josh11b)


Changes

Both creates a `BUILD.bazel` file for the `clangd` directory in the project 
overlay, and removes an unnecessary `#include "Feature.h"` to reduce the 
dependencies from `Transport.h`.

This upstreams the patch that allows 
https://github.com/carbon-language/carbon-lang/tree/trunk/language_server to 
use `clangd` as a library. This was created as part of a Summer of Code project 
building a prototype Carbon language server. If this is not an appropriate 
architecture, I'm very open to alternative paths forward.

Thanks!

---
Full diff: https://github.com/llvm/llvm-project/pull/81556.diff


2 Files Affected:

- (modified) clang-tools-extra/clangd/Transport.h (-1) 
- (added) utils/bazel/llvm-project-overlay/clang-tools-extra/clangd/BUILD.bazel 
(+45) 


``diff
diff --git a/clang-tools-extra/clangd/Transport.h 
b/clang-tools-extra/clangd/Transport.h
index 4e80ea95b8537d..f17441cfc1ef22 100644
--- a/clang-tools-extra/clangd/Transport.h
+++ b/clang-tools-extra/clangd/Transport.h
@@ -18,7 +18,6 @@
 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_TRANSPORT_H
 #define LLVM_CLANG_TOOLS_EXTRA_CLANGD_TRANSPORT_H
 
-#include "Feature.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/JSON.h"
 #include "llvm/Support/raw_ostream.h"
diff --git 
a/utils/bazel/llvm-project-overlay/clang-tools-extra/clangd/BUILD.bazel 
b/utils/bazel/llvm-project-overlay/clang-tools-extra/clangd/BUILD.bazel
new file mode 100644
index 00..0e25dd1c166560
--- /dev/null
+++ b/utils/bazel/llvm-project-overlay/clang-tools-extra/clangd/BUILD.bazel
@@ -0,0 +1,45 @@
+# This file is licensed under the Apache License v2.0 with LLVM Exceptions.
+# See https://llvm.org/LICENSE.txt for license information.
+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+
+package(default_visibility = ["//visibility:public"])
+
+licenses(["notice"])
+
+cc_library(
+name = "clangd_library",
+srcs = [
+"JSONTransport.cpp",
+"Protocol.cpp",
+"URI.cpp",
+"index/SymbolID.cpp",
+"support/Logger.cpp",
+"support/Trace.cpp",
+"support/MemoryTree.cpp",
+"support/Context.cpp",
+"support/Cancellation.cpp",
+"support/ThreadCrashReporter.cpp",
+"support/Shutdown.cpp",
+],
+hdrs = [
+"Transport.h",
+"Protocol.h",
+"URI.h",
+"LSPBinder.h",
+"index/SymbolID.h",
+"support/Function.h",
+"support/Cancellation.h",
+"support/ThreadCrashReporter.h",
+"support/Logger.h",
+"support/Trace.h",
+"support/MemoryTree.h",
+"support/Context.h",
+"support/Shutdown.h",
+],
+includes = ["."],
+deps = [
+"//llvm:Support",
+"//clang:basic",
+"//clang:index",
+],
+)

``




https://github.com/llvm/llvm-project/pull/81556
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] [llvm] Add bazel support for clangd as a library. (PR #81556)

2024-02-12 Thread via cfe-commits

github-actions[bot] wrote:

⚠️ We detected that you are using a GitHub private e-mail address to contribute 
to the repo.
  Please turn off [Keep my email addresses 
private](https://github.com/settings/emails) setting in your account.
  See [LLVM 
Discourse](https://discourse.llvm.org/t/hidden-emails-on-github-should-we-do-something-about-it)
 for more information.


https://github.com/llvm/llvm-project/pull/81556
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] [llvm] Add bazel support for clangd as a library. (PR #81556)

2024-02-12 Thread via cfe-commits

https://github.com/josh11b updated 
https://github.com/llvm/llvm-project/pull/81556

>From e2b83f086e51d7144d8e6ac1d1850300de55f01f Mon Sep 17 00:00:00 2001
From: Josh L 
Date: Mon, 12 Feb 2024 22:59:21 +
Subject: [PATCH] Add bazel support for clangd as a library.

---
 clang-tools-extra/clangd/Transport.h  |  1 -
 .../clang-tools-extra/clangd/BUILD.bazel  | 45 +++
 2 files changed, 45 insertions(+), 1 deletion(-)
 create mode 100644 
utils/bazel/llvm-project-overlay/clang-tools-extra/clangd/BUILD.bazel

diff --git a/clang-tools-extra/clangd/Transport.h 
b/clang-tools-extra/clangd/Transport.h
index 4e80ea95b8537d..f17441cfc1ef22 100644
--- a/clang-tools-extra/clangd/Transport.h
+++ b/clang-tools-extra/clangd/Transport.h
@@ -18,7 +18,6 @@
 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_TRANSPORT_H
 #define LLVM_CLANG_TOOLS_EXTRA_CLANGD_TRANSPORT_H
 
-#include "Feature.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/JSON.h"
 #include "llvm/Support/raw_ostream.h"
diff --git 
a/utils/bazel/llvm-project-overlay/clang-tools-extra/clangd/BUILD.bazel 
b/utils/bazel/llvm-project-overlay/clang-tools-extra/clangd/BUILD.bazel
new file mode 100644
index 00..0e25dd1c166560
--- /dev/null
+++ b/utils/bazel/llvm-project-overlay/clang-tools-extra/clangd/BUILD.bazel
@@ -0,0 +1,45 @@
+# This file is licensed under the Apache License v2.0 with LLVM Exceptions.
+# See https://llvm.org/LICENSE.txt for license information.
+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+
+package(default_visibility = ["//visibility:public"])
+
+licenses(["notice"])
+
+cc_library(
+name = "clangd_library",
+srcs = [
+"JSONTransport.cpp",
+"Protocol.cpp",
+"URI.cpp",
+"index/SymbolID.cpp",
+"support/Logger.cpp",
+"support/Trace.cpp",
+"support/MemoryTree.cpp",
+"support/Context.cpp",
+"support/Cancellation.cpp",
+"support/ThreadCrashReporter.cpp",
+"support/Shutdown.cpp",
+],
+hdrs = [
+"Transport.h",
+"Protocol.h",
+"URI.h",
+"LSPBinder.h",
+"index/SymbolID.h",
+"support/Function.h",
+"support/Cancellation.h",
+"support/ThreadCrashReporter.h",
+"support/Logger.h",
+"support/Trace.h",
+"support/MemoryTree.h",
+"support/Context.h",
+"support/Shutdown.h",
+],
+includes = ["."],
+deps = [
+"//llvm:Support",
+"//clang:basic",
+"//clang:index",
+],
+)

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] [llvm] Add bazel support for clangd as a library. (PR #81556)

2024-02-14 Thread via cfe-commits

josh11b wrote:

I've made my email address public, as requested.

https://github.com/llvm/llvm-project/pull/81556
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] [llvm] Add bazel support for clangd as a library. (PR #81556)

2024-03-14 Thread via cfe-commits

josh11b wrote:

Ping!

https://github.com/llvm/llvm-project/pull/81556
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] [llvm] Add bazel support for clangd as a library. (PR #81556)

2024-03-14 Thread Fangrui Song via cfe-commits


@@ -0,0 +1,45 @@
+# This file is licensed under the Apache License v2.0 with LLVM Exceptions.
+# See https://llvm.org/LICENSE.txt for license information.
+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+
+package(default_visibility = ["//visibility:public"])

MaskRay wrote:

Add `features = ["layering_check"],`

https://github.com/llvm/llvm-project/pull/81556
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] [llvm] Add bazel support for clangd as a library. (PR #81556)

2024-03-14 Thread Fangrui Song via cfe-commits


@@ -0,0 +1,45 @@
+# This file is licensed under the Apache License v2.0 with LLVM Exceptions.
+# See https://llvm.org/LICENSE.txt for license information.
+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+
+package(default_visibility = ["//visibility:public"])
+
+licenses(["notice"])
+
+cc_library(
+name = "clangd_library",

MaskRay wrote:

clangDaemon would match the library name in 
clang-tools-extra/clangd/CMakeLists.txt

https://github.com/llvm/llvm-project/pull/81556
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] [llvm] Add bazel support for clangd as a library. (PR #81556)

2024-03-14 Thread via cfe-commits

https://github.com/josh11b updated 
https://github.com/llvm/llvm-project/pull/81556

>From e2b83f086e51d7144d8e6ac1d1850300de55f01f Mon Sep 17 00:00:00 2001
From: Josh L 
Date: Mon, 12 Feb 2024 22:59:21 +
Subject: [PATCH 1/2] Add bazel support for clangd as a library.

---
 clang-tools-extra/clangd/Transport.h  |  1 -
 .../clang-tools-extra/clangd/BUILD.bazel  | 45 +++
 2 files changed, 45 insertions(+), 1 deletion(-)
 create mode 100644 
utils/bazel/llvm-project-overlay/clang-tools-extra/clangd/BUILD.bazel

diff --git a/clang-tools-extra/clangd/Transport.h 
b/clang-tools-extra/clangd/Transport.h
index 4e80ea95b8537d..f17441cfc1ef22 100644
--- a/clang-tools-extra/clangd/Transport.h
+++ b/clang-tools-extra/clangd/Transport.h
@@ -18,7 +18,6 @@
 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_TRANSPORT_H
 #define LLVM_CLANG_TOOLS_EXTRA_CLANGD_TRANSPORT_H
 
-#include "Feature.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/JSON.h"
 #include "llvm/Support/raw_ostream.h"
diff --git 
a/utils/bazel/llvm-project-overlay/clang-tools-extra/clangd/BUILD.bazel 
b/utils/bazel/llvm-project-overlay/clang-tools-extra/clangd/BUILD.bazel
new file mode 100644
index 00..0e25dd1c166560
--- /dev/null
+++ b/utils/bazel/llvm-project-overlay/clang-tools-extra/clangd/BUILD.bazel
@@ -0,0 +1,45 @@
+# This file is licensed under the Apache License v2.0 with LLVM Exceptions.
+# See https://llvm.org/LICENSE.txt for license information.
+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+
+package(default_visibility = ["//visibility:public"])
+
+licenses(["notice"])
+
+cc_library(
+name = "clangd_library",
+srcs = [
+"JSONTransport.cpp",
+"Protocol.cpp",
+"URI.cpp",
+"index/SymbolID.cpp",
+"support/Logger.cpp",
+"support/Trace.cpp",
+"support/MemoryTree.cpp",
+"support/Context.cpp",
+"support/Cancellation.cpp",
+"support/ThreadCrashReporter.cpp",
+"support/Shutdown.cpp",
+],
+hdrs = [
+"Transport.h",
+"Protocol.h",
+"URI.h",
+"LSPBinder.h",
+"index/SymbolID.h",
+"support/Function.h",
+"support/Cancellation.h",
+"support/ThreadCrashReporter.h",
+"support/Logger.h",
+"support/Trace.h",
+"support/MemoryTree.h",
+"support/Context.h",
+"support/Shutdown.h",
+],
+includes = ["."],
+deps = [
+"//llvm:Support",
+"//clang:basic",
+"//clang:index",
+],
+)

>From 9dc8c8e9196fa51a9f687fd6542dc8ca0de70173 Mon Sep 17 00:00:00 2001
From: Josh L 
Date: Thu, 14 Mar 2024 21:02:52 +
Subject: [PATCH 2/2] Implement suggestions from review

---
 .../clang-tools-extra/clangd/BUILD.bazel | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git 
a/utils/bazel/llvm-project-overlay/clang-tools-extra/clangd/BUILD.bazel 
b/utils/bazel/llvm-project-overlay/clang-tools-extra/clangd/BUILD.bazel
index 0e25dd1c166560..c1d24058e21a1d 100644
--- a/utils/bazel/llvm-project-overlay/clang-tools-extra/clangd/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/clang-tools-extra/clangd/BUILD.bazel
@@ -2,12 +2,13 @@
 # See https://llvm.org/LICENSE.txt for license information.
 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 
-package(default_visibility = ["//visibility:public"])
+package(features = ["layering_check"],
+default_visibility = ["//visibility:public"])
 
 licenses(["notice"])
 
 cc_library(
-name = "clangd_library",
+name = "clangDaemon",
 srcs = [
 "JSONTransport.cpp",
 "Protocol.cpp",

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] [llvm] Add bazel support for clangd as a library. (PR #81556)

2024-03-14 Thread via cfe-commits


@@ -0,0 +1,45 @@
+# This file is licensed under the Apache License v2.0 with LLVM Exceptions.
+# See https://llvm.org/LICENSE.txt for license information.
+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+
+package(default_visibility = ["//visibility:public"])
+
+licenses(["notice"])
+
+cc_library(
+name = "clangd_library",

josh11b wrote:

Renamed

https://github.com/llvm/llvm-project/pull/81556
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] [llvm] Add bazel support for clangd as a library. (PR #81556)

2024-03-14 Thread via cfe-commits


@@ -0,0 +1,45 @@
+# This file is licensed under the Apache License v2.0 with LLVM Exceptions.
+# See https://llvm.org/LICENSE.txt for license information.
+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+
+package(default_visibility = ["//visibility:public"])

josh11b wrote:

Added

https://github.com/llvm/llvm-project/pull/81556
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] [llvm] Add bazel support for clangd as a library. (PR #81556)

2024-03-14 Thread via cfe-commits

https://github.com/josh11b updated 
https://github.com/llvm/llvm-project/pull/81556

>From e2b83f086e51d7144d8e6ac1d1850300de55f01f Mon Sep 17 00:00:00 2001
From: Josh L 
Date: Mon, 12 Feb 2024 22:59:21 +
Subject: [PATCH 1/2] Add bazel support for clangd as a library.

---
 clang-tools-extra/clangd/Transport.h  |  1 -
 .../clang-tools-extra/clangd/BUILD.bazel  | 45 +++
 2 files changed, 45 insertions(+), 1 deletion(-)
 create mode 100644 
utils/bazel/llvm-project-overlay/clang-tools-extra/clangd/BUILD.bazel

diff --git a/clang-tools-extra/clangd/Transport.h 
b/clang-tools-extra/clangd/Transport.h
index 4e80ea95b8537d..f17441cfc1ef22 100644
--- a/clang-tools-extra/clangd/Transport.h
+++ b/clang-tools-extra/clangd/Transport.h
@@ -18,7 +18,6 @@
 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_TRANSPORT_H
 #define LLVM_CLANG_TOOLS_EXTRA_CLANGD_TRANSPORT_H
 
-#include "Feature.h"
 #include "llvm/ADT/StringRef.h"
 #include "llvm/Support/JSON.h"
 #include "llvm/Support/raw_ostream.h"
diff --git 
a/utils/bazel/llvm-project-overlay/clang-tools-extra/clangd/BUILD.bazel 
b/utils/bazel/llvm-project-overlay/clang-tools-extra/clangd/BUILD.bazel
new file mode 100644
index 00..0e25dd1c166560
--- /dev/null
+++ b/utils/bazel/llvm-project-overlay/clang-tools-extra/clangd/BUILD.bazel
@@ -0,0 +1,45 @@
+# This file is licensed under the Apache License v2.0 with LLVM Exceptions.
+# See https://llvm.org/LICENSE.txt for license information.
+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+
+package(default_visibility = ["//visibility:public"])
+
+licenses(["notice"])
+
+cc_library(
+name = "clangd_library",
+srcs = [
+"JSONTransport.cpp",
+"Protocol.cpp",
+"URI.cpp",
+"index/SymbolID.cpp",
+"support/Logger.cpp",
+"support/Trace.cpp",
+"support/MemoryTree.cpp",
+"support/Context.cpp",
+"support/Cancellation.cpp",
+"support/ThreadCrashReporter.cpp",
+"support/Shutdown.cpp",
+],
+hdrs = [
+"Transport.h",
+"Protocol.h",
+"URI.h",
+"LSPBinder.h",
+"index/SymbolID.h",
+"support/Function.h",
+"support/Cancellation.h",
+"support/ThreadCrashReporter.h",
+"support/Logger.h",
+"support/Trace.h",
+"support/MemoryTree.h",
+"support/Context.h",
+"support/Shutdown.h",
+],
+includes = ["."],
+deps = [
+"//llvm:Support",
+"//clang:basic",
+"//clang:index",
+],
+)

>From 9dc8c8e9196fa51a9f687fd6542dc8ca0de70173 Mon Sep 17 00:00:00 2001
From: Josh L 
Date: Thu, 14 Mar 2024 21:02:52 +
Subject: [PATCH 2/2] Implement suggestions from review

---
 .../clang-tools-extra/clangd/BUILD.bazel | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git 
a/utils/bazel/llvm-project-overlay/clang-tools-extra/clangd/BUILD.bazel 
b/utils/bazel/llvm-project-overlay/clang-tools-extra/clangd/BUILD.bazel
index 0e25dd1c166560..c1d24058e21a1d 100644
--- a/utils/bazel/llvm-project-overlay/clang-tools-extra/clangd/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/clang-tools-extra/clangd/BUILD.bazel
@@ -2,12 +2,13 @@
 # See https://llvm.org/LICENSE.txt for license information.
 # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
 
-package(default_visibility = ["//visibility:public"])
+package(features = ["layering_check"],
+default_visibility = ["//visibility:public"])
 
 licenses(["notice"])
 
 cc_library(
-name = "clangd_library",
+name = "clangDaemon",
 srcs = [
 "JSONTransport.cpp",
 "Protocol.cpp",

___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] [llvm] Add bazel support for clangd as a library. (PR #81556)

2024-03-14 Thread Fangrui Song via cfe-commits

MaskRay wrote:

> Ping!

llvm-project email notifications are extremely high-volume and nobody can 
notice every change even if they are subscribed to the relevant labels...

If you don't have write/triage role 
(https://docs.github.com/en/organizations/managing-user-access-to-your-organizations-repositories/managing-repository-roles/repository-roles-for-an-organization#repository-roles-for-organizations),
 the best is to CC relevant people (`git log -- directory` and finding recent 
reviewers is a good way).

(Now, I noticed this patch because I noticed a message in an IM I am subscribed 
to... not that I actively check clang-tools-extra patches/issues)

Feel free to ping the patch once a week when no feedback is received per 
https://llvm.org/docs/Contributing.html#how-to-submit-a-patch

> If you have received no comments on your patch for a week, you can request a 
> review by ‘ping’ing the GitHub PR with “Ping”. The common courtesy ‘ping’ 
> rate is once a week. Please remember that you are asking for valuable time 
> from other professional developers.

https://github.com/llvm/llvm-project/pull/81556
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] [llvm] Add bazel support for clangd as a library. (PR #81556)

2024-03-14 Thread Fangrui Song via cfe-commits

https://github.com/MaskRay edited 
https://github.com/llvm/llvm-project/pull/81556
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] [llvm] Add bazel support for clangd as a library. (PR #81556)

2024-03-14 Thread Fangrui Song via cfe-commits

https://github.com/MaskRay approved this pull request.

bazel-specific changes often have a title `[bazel] Add clangd support`. Please 
consider following suit.

It would be nice to have a fuller support, but I understand having this 
cc_library first can make your downstream changes easier, so LGTM.

https://github.com/llvm/llvm-project/pull/81556
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] [llvm] Add bazel support for clangd as a library. (PR #81556)

2024-03-14 Thread Fangrui Song via cfe-commits


@@ -18,7 +18,6 @@
 #ifndef LLVM_CLANG_TOOLS_EXTRA_CLANGD_TRANSPORT_H
 #define LLVM_CLANG_TOOLS_EXTRA_CLANGD_TRANSPORT_H
 
-#include "Feature.h"

MaskRay wrote:

This change should be removed.

https://github.com/llvm/llvm-project/pull/81556
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] [llvm] Add bazel support for clangd as a library. (PR #81556)

2024-03-14 Thread Fangrui Song via cfe-commits


@@ -0,0 +1,46 @@
+# This file is licensed under the Apache License v2.0 with LLVM Exceptions.
+# See https://llvm.org/LICENSE.txt for license information.
+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+
+package(features = ["layering_check"],

MaskRay wrote:

llvm/BUILD.bazel places `default_visibility` before `features`. Best to follow 
its convention.

https://github.com/llvm/llvm-project/pull/81556
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] [llvm] Add bazel support for clangd as a library. (PR #81556)

2024-03-14 Thread Jordan Rupprecht via cfe-commits


@@ -0,0 +1,45 @@
+# This file is licensed under the Apache License v2.0 with LLVM Exceptions.
+# See https://llvm.org/LICENSE.txt for license information.
+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+
+package(default_visibility = ["//visibility:public"])
+
+licenses(["notice"])
+
+cc_library(
+name = "clangd_library",

rupprecht wrote:

Small nit: IIUC the convention in the llvm bzl tree is to use casing like 
`ClangDaemon`.

https://github.com/llvm/llvm-project/pull/81556
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] [llvm] Add bazel support for clangd as a library. (PR #81556)

2024-03-14 Thread Jordan Rupprecht via cfe-commits


@@ -0,0 +1,45 @@
+# This file is licensed under the Apache License v2.0 with LLVM Exceptions.
+# See https://llvm.org/LICENSE.txt for license information.
+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+
+package(default_visibility = ["//visibility:public"])
+
+licenses(["notice"])
+
+cc_library(
+name = "clangd_library",
+srcs = [
+"JSONTransport.cpp",
+"Protocol.cpp",
+"URI.cpp",
+"index/SymbolID.cpp",
+"support/Logger.cpp",
+"support/Trace.cpp",
+"support/MemoryTree.cpp",
+"support/Context.cpp",
+"support/Cancellation.cpp",
+"support/ThreadCrashReporter.cpp",
+"support/Shutdown.cpp",
+],
+hdrs = [
+"Transport.h",
+"Protocol.h",
+"URI.h",
+"LSPBinder.h",
+"index/SymbolID.h",
+"support/Function.h",
+"support/Cancellation.h",
+"support/ThreadCrashReporter.h",
+"support/Logger.h",
+"support/Trace.h",
+"support/MemoryTree.h",
+"support/Context.h",
+"support/Shutdown.h",
+],

rupprecht wrote:

clangd/CMakeLists.txt lists many other files needed by the clangDaemon target.

I think this is totally fine to submit as-is, as maybe this is the minimal set 
of files that one needs for basic clangd functionality, but we should probably 
have a TODO to pick up other files (e.g. `glob(["*.cpp", "dir/**/*.cpp", 
...])`) for more complete functionality. (I'm not a clangd expert, so I'm not 
sure what the implication of leaving out all those other files is).

https://github.com/llvm/llvm-project/pull/81556
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[clang-tools-extra] [llvm] Add bazel support for clangd as a library. (PR #81556)

2024-02-28 Thread via cfe-commits

josh11b wrote:

Ping!

https://github.com/llvm/llvm-project/pull/81556
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits