Skip to content

Commit 418e190

Browse files
16bit-ykikoclaude
andauthored
chore(deps): migrate from eventide to kotatsu (#428)
## Summary - The `eventide` dep was renamed to [kotatsu](https://github.com/clice-io/kotatsu) with a broad rename of CMake identifiers, namespaces, header paths, and a few module reorgs (`serde` → `codec`, `reflection` → `meta`, `common` → `support`). Align clice to the new names. - CMake: FetchContent target, option prefix (`ETD_*` → `KOTA_*`, `ETD_SERDE_*` → `KOTA_CODEC_*`), target names (`eventide::{ipc::lsp,serde::toml,deco,zest}` → `kota::{ipc::lsp,codec::toml,deco,zest}`). - Namespaces: `eventide::` → `kota::`, `eventide::serde::` → `kota::codec::`, `eventide::refl::` → `kota::meta::`. The short `et` alias is dropped — all usages now spell `kota::` directly. - Headers: `eventide/*` → `kota/*`, including special cases `serde/serde/raw_value.h` → `codec/raw_value.h`, `ipc/json_codec.h` → `ipc/codec/json.h`, `common/meta.h` → `support/type_traits.h`, `common/ranges.h` → `support/ranges.h`. - Kotatsu split `JsonPeer` / `BincodePeer` out of `ipc/peer.h` into the codec-specific headers; added `kota/ipc/codec/{json,bincode}.h` includes where those types are used. - Depends on clice-io/kotatsu#110 (already merged) to prevent `-Wall -Wextra -Werror` from transitively propagating out of `kota::project_options`. ## Test plan - [x] `pixi run unit-test RelWithDebInfo` — 518/518 pass (9 skipped, unchanged from main) - [x] `pixi run integration-test RelWithDebInfo` — 119/119 pass - [x] `pixi run smoke-test RelWithDebInfo` — 2/2 pass - [x] `pixi run format` clean ## Notes - `tests/smoke/rapid_edit.jsonl` was intentionally left untouched: the embedded `#include "eventide/..."` strings are frozen snapshots of file contents the client sent at record time, not clice source. 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Updated internal dependencies from `eventide` to `kota`, including async runtime, IPC transport, serialization codec, and metadata libraries. * Updated build configuration and CMake variables to align with the new dependency. * **Refactor** * Migrated internal implementation to use `kota` namespace and APIs throughout the codebase. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent d42d9d5 commit 418e190

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+475
-484
lines changed

.clang-format

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ SortIncludes: true
100100
SortUsingDeclarations: Never
101101
IncludeBlocks: Regroup
102102
IncludeCategories:
103-
- Regex: '^["<](spdlog|toml\+\+|coraing|cpptrace|flatbuffers)/'
103+
- Regex: '^["<](spdlog|toml\+\+|coraing|cpptrace|flatbuffers|kota)/'
104104
Priority: 30
105105
SortPriority: 31
106106

CMakeLists.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -151,13 +151,13 @@ target_link_libraries(clice-core PUBLIC
151151
spdlog::spdlog
152152
roaring::roaring
153153
flatbuffers
154-
eventide::ipc::lsp
155-
eventide::serde::toml
154+
kota::ipc::lsp
155+
kota::codec::toml
156156
simdjson::simdjson
157157
)
158158

159159
add_executable(clice "${PROJECT_SOURCE_DIR}/src/clice.cc")
160-
target_link_libraries(clice PRIVATE clice::core eventide::deco)
160+
target_link_libraries(clice PRIVATE clice::core kota::deco)
161161
install(TARGETS clice RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
162162

163163
add_custom_target(copy_clang_resource ALL
@@ -189,7 +189,7 @@ if(CLICE_ENABLE_TEST)
189189
"${PROJECT_SOURCE_DIR}/src"
190190
"${PROJECT_SOURCE_DIR}/tests/unit"
191191
)
192-
target_link_libraries(unit_tests PRIVATE clice::core eventide::zest eventide::deco)
192+
target_link_libraries(unit_tests PRIVATE clice::core kota::zest kota::deco)
193193
endif()
194194

195195
if(CLICE_ENABLE_BENCHMARK)
@@ -199,7 +199,7 @@ if(CLICE_ENABLE_BENCHMARK)
199199
target_include_directories(scan_benchmark PRIVATE
200200
"${PROJECT_SOURCE_DIR}/src"
201201
)
202-
target_link_libraries(scan_benchmark PRIVATE clice::core eventide::deco)
202+
target_link_libraries(scan_benchmark PRIVATE clice::core kota::deco)
203203
endif()
204204

205205
if(CLICE_RELEASE)

benchmarks/scan_benchmark.cpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,15 @@
2121
#include <thread>
2222

2323
#include "command/command.h"
24-
#include "eventide/deco/deco.h"
25-
#include "eventide/serde/json/serializer.h"
2624
#include "support/filesystem.h"
2725
#include "support/logging.h"
2826
#include "support/path_pool.h"
2927
#include "syntax/dependency_graph.h"
3028

29+
#include "kota/codec/json/serializer.h"
30+
#include "kota/deco/deco.h"
3131
#include "llvm/Support/FileSystem.h"
3232

33-
namespace et = eventide;
34-
3533
using namespace clice;
3634

3735
struct BenchmarkOptions {
@@ -97,7 +95,7 @@ void export_graph_json(const PathPool& path_pool,
9795
export_data.files.push_back(std::move(node));
9896
}
9997

100-
auto json = et::serde::json::to_json(export_data);
98+
auto json = kota::codec::json::to_json(export_data);
10199
if(!json) {
102100
std::println(stderr, "Failed to serialize dependency graph");
103101
return;
@@ -221,8 +219,8 @@ void print_report(const ScanReport& report) {
221219
}
222220

223221
int main(int argc, const char** argv) {
224-
auto args = deco::util::argvify(argc, argv);
225-
auto result = deco::cli::parse<BenchmarkOptions>(args);
222+
auto args = kota::deco::util::argvify(argc, argv);
223+
auto result = kota::deco::cli::parse<BenchmarkOptions>(args);
226224

227225
if(!result.has_value()) {
228226
std::println(stderr, "Error: {}", result.error().message);
@@ -233,7 +231,7 @@ int main(int argc, const char** argv) {
233231

234232
if(opts.help.value_or(false) || !opts.cdb_path.has_value()) {
235233
std::ostringstream oss;
236-
deco::cli::write_usage_for<BenchmarkOptions>(oss, "scan_benchmark [OPTIONS] <cdb>");
234+
kota::deco::cli::write_usage_for<BenchmarkOptions>(oss, "scan_benchmark [OPTIONS] <cdb>");
237235
std::print("{}", oss.str());
238236
return opts.help.value_or(false) ? 0 : 1;
239237
}

cmake/package.cmake

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,18 @@ set(FLATBUFFERS_BUILD_TESTS OFF CACHE BOOL "" FORCE)
3939
set(FLATBUFFERS_BUILD_FLATHASH OFF CACHE BOOL "" FORCE)
4040

4141
FetchContent_Declare(
42-
eventide
43-
GIT_REPOSITORY https://github.com/clice-io/eventide
42+
kotatsu
43+
GIT_REPOSITORY https://github.com/clice-io/kotatsu
4444
GIT_TAG main
4545
GIT_SHALLOW TRUE
4646
)
4747

48-
set(ETD_ENABLE_ZEST ON)
49-
set(ETD_ENABLE_TEST OFF)
50-
set(ETD_SERDE_ENABLE_SIMDJSON ON)
51-
set(ETD_SERDE_ENABLE_YYJSON ON)
52-
set(ETD_SERDE_ENABLE_TOML ON)
53-
set(ETD_ENABLE_EXCEPTIONS OFF)
54-
set(ETD_ENABLE_RTTI OFF)
48+
set(KOTA_ENABLE_ZEST ON)
49+
set(KOTA_ENABLE_TEST OFF)
50+
set(KOTA_CODEC_ENABLE_SIMDJSON ON)
51+
set(KOTA_CODEC_ENABLE_YYJSON ON)
52+
set(KOTA_CODEC_ENABLE_TOML ON)
53+
set(KOTA_ENABLE_EXCEPTIONS OFF)
54+
set(KOTA_ENABLE_RTTI OFF)
5555

56-
FetchContent_MakeAvailable(eventide spdlog croaring flatbuffers)
56+
FetchContent_MakeAvailable(kotatsu spdlog croaring flatbuffers)

docs/en/architecture.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ The worker pool (`src/server/worker_pool.cpp`) manages spawning and communicatin
9191

9292
### Communication
9393

94-
Workers communicate with the master via **stdio pipes** using a **bincode** serialization format (via `eventide::ipc::BincodePeer`). This is more compact and faster than JSON for internal IPC, while the master handles JSON for the external LSP protocol.
94+
Workers communicate with the master via **stdio pipes** using a **bincode** serialization format (via `kota::ipc::BincodePeer`). This is more compact and faster than JSON for internal IPC, while the master handles JSON for the external LSP protocol.
9595

9696
### Stateful Worker Routing
9797

@@ -111,7 +111,7 @@ The stateful worker (`src/server/stateful_worker.cpp`) caches compiled ASTs in m
111111
- **Feature queries**: Look up the cached AST and invoke the corresponding `feature::*` function (hover, semantic tokens, etc.), serializing the result to JSON
112112
- **Document updates**: Received as notifications — the worker updates the stored text and marks the document as `dirty`, causing feature queries to return `null` until recompilation
113113
- **Eviction**: LRU-based; evicts the oldest document when capacity is exceeded, notifying the master
114-
- **Concurrency**: Each document has a per-document `et::mutex` (strand) to serialize compilation and feature queries. Heavy work (compilation, feature extraction) runs on a thread pool via `et::queue`.
114+
- **Concurrency**: Each document has a per-document `kota::mutex` (strand) to serialize compilation and feature queries. Heavy work (compilation, feature extraction) runs on a thread pool via `kota::queue`.
115115

116116
## Stateless Worker
117117

@@ -123,7 +123,7 @@ The stateless worker (`src/server/stateless_worker.cpp`) handles one-shot reques
123123
- **Build PCM**: Compiles a C++20 module interface to a temporary file
124124
- **Index**: Compiles a file for indexing (TUIndex generation — currently a stub)
125125

126-
All requests are dispatched to a thread pool via `et::queue`.
126+
All requests are dispatched to a thread pool via `kota::queue`.
127127

128128
## Compile Graph
129129

@@ -132,7 +132,7 @@ The compile graph (`src/server/compile_graph.cpp`) tracks compilation unit depen
132132
- **Registration**: Each file registers its included dependencies
133133
- **Cascade invalidation**: When a file changes, all transitive dependents are marked dirty and their ongoing compilations are cancelled
134134
- **Dependency compilation**: Before compiling a file, `compile_deps` ensures all dependencies (PCH, PCMs) are built first
135-
- **Cancellation**: Uses `et::cancellation_source` to abort in-flight compilations when files are invalidated
135+
- **Cancellation**: Uses `kota::cancellation_source` to abort in-flight compilations when files are invalidated
136136

137137
## Configuration
138138

src/clice.cc

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,21 @@
44
#include <print>
55
#include <string>
66

7-
#include "eventide/async/async.h"
8-
#include "eventide/deco/deco.h"
9-
#include "eventide/ipc/peer.h"
10-
#include "eventide/ipc/recording_transport.h"
11-
#include "eventide/ipc/transport.h"
127
#include "server/master_server.h"
138
#include "server/stateful_worker.h"
149
#include "server/stateless_worker.h"
1510
#include "support/logging.h"
1611

12+
#include "kota/async/async.h"
13+
#include "kota/deco/deco.h"
14+
#include "kota/ipc/codec/json.h"
15+
#include "kota/ipc/peer.h"
16+
#include "kota/ipc/recording_transport.h"
17+
#include "kota/ipc/transport.h"
18+
1719
namespace clice {
1820

19-
using deco::decl::KVStyle;
21+
using kota::deco::decl::KVStyle;
2022

2123
struct Options {
2224
DecoKV(style = KVStyle::JoinedOrSeparate,
@@ -72,8 +74,8 @@ int main(int argc, const char** argv) {
7274
signal(SIGPIPE, SIG_IGN);
7375
#endif
7476

75-
auto args = deco::util::argvify(argc, argv);
76-
auto result = deco::cli::parse<clice::Options>(args);
77+
auto args = kota::deco::util::argvify(argc, argv);
78+
auto result = kota::deco::cli::parse<clice::Options>(args);
7779

7880
if(!result.has_value()) {
7981
LOG_ERROR("{}", result.error().message);
@@ -83,7 +85,7 @@ int main(int argc, const char** argv) {
8385
auto& opts = result->options;
8486

8587
if(opts.help.value_or(false)) {
86-
deco::cli::write_usage_for<clice::Options>(std::cout, "clice [OPTIONS]");
88+
kota::deco::cli::write_usage_for<clice::Options>(std::cout, "clice [OPTIONS]");
8789
return 0;
8890
}
8991

@@ -132,23 +134,22 @@ int main(int argc, const char** argv) {
132134
if(mode == "pipe") {
133135
clice::logging::stderr_logger("master", clice::logging::options);
134136

135-
namespace et = eventide;
136-
et::event_loop loop;
137+
kota::event_loop loop;
137138

138-
auto transport = et::ipc::StreamTransport::open_stdio(loop);
139+
auto transport = kota::ipc::StreamTransport::open_stdio(loop);
139140
if(!transport) {
140141
LOG_ERROR("failed to open stdio transport");
141142
return 1;
142143
}
143144

144-
std::unique_ptr<et::ipc::Transport> final_transport = std::move(*transport);
145+
std::unique_ptr<kota::ipc::Transport> final_transport = std::move(*transport);
145146
if(opts.record.has_value()) {
146147
final_transport =
147-
std::make_unique<et::ipc::RecordingTransport>(std::move(final_transport),
148-
*opts.record);
148+
std::make_unique<kota::ipc::RecordingTransport>(std::move(final_transport),
149+
*opts.record);
149150
}
150151

151-
et::ipc::JsonPeer peer(loop, std::move(final_transport));
152+
kota::ipc::JsonPeer peer(loop, std::move(final_transport));
152153
clice::MasterServer server(loop, peer, std::move(self_path));
153154
server.register_handlers();
154155

@@ -160,21 +161,20 @@ int main(int argc, const char** argv) {
160161
if(mode == "socket") {
161162
clice::logging::stderr_logger("master", clice::logging::options);
162163

163-
namespace et = eventide;
164-
et::event_loop loop;
164+
kota::event_loop loop;
165165

166166
auto host = opts.host.value_or("127.0.0.1");
167167
auto port = opts.port.value_or(50051);
168168

169-
auto acceptor = et::tcp::listen(host, port, {}, loop);
169+
auto acceptor = kota::tcp::listen(host, port, {}, loop);
170170
if(!acceptor) {
171171
LOG_ERROR("failed to listen on {}:{}", host, port);
172172
return 1;
173173
}
174174

175175
LOG_INFO("Listening on {}:{} ...", host, port);
176176

177-
auto task = [&]() -> et::task<> {
177+
auto task = [&]() -> kota::task<> {
178178
auto client = co_await acceptor->accept();
179179
if(!client.has_value()) {
180180
LOG_ERROR("failed to accept connection");
@@ -184,13 +184,13 @@ int main(int argc, const char** argv) {
184184

185185
LOG_INFO("Client connected");
186186

187-
std::unique_ptr<et::ipc::Transport> transport =
188-
std::make_unique<et::ipc::StreamTransport>(std::move(client.value()));
187+
std::unique_ptr<kota::ipc::Transport> transport =
188+
std::make_unique<kota::ipc::StreamTransport>(std::move(client.value()));
189189
if(opts.record.has_value()) {
190-
transport = std::make_unique<et::ipc::RecordingTransport>(std::move(transport),
191-
*opts.record);
190+
transport = std::make_unique<kota::ipc::RecordingTransport>(std::move(transport),
191+
*opts.record);
192192
}
193-
et::ipc::JsonPeer peer(loop, std::move(transport));
193+
kota::ipc::JsonPeer peer(loop, std::move(transport));
194194
clice::MasterServer server(loop, peer, std::string(self_path));
195195
server.register_handlers();
196196

src/command/toolchain.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
#include <vector>
66

77
#include "command/argument_parser.h"
8-
#include "eventide/reflection/enum.h"
98
#include "support/filesystem.h"
109
#include "support/logging.h"
1110

11+
#include "kota/meta/enum.h"
1212
#include "llvm/ADT/ScopeExit.h"
1313
#include "llvm/Support/CommandLine.h"
1414
#include "llvm/Support/FileSystem.h"
@@ -363,7 +363,7 @@ std::vector<const char*> query_toolchain(const QueryParams& params) {
363363
case CompilerFamily::Unknown: {
364364
/// TODO: nvcc and intel compilers need further exploration.
365365
LOG_ERROR("Fail to query driver, unknown supported driver kind: {}, driver is {}",
366-
eventide::refl::enum_name(family),
366+
kota::meta::enum_name(family),
367367
driver);
368368

369369
std::vector<const char*> result;

src/feature/diagnostics.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22
#include <string>
33
#include <vector>
44

5-
#include "eventide/ipc/lsp/uri.h"
65
#include "feature/feature.h"
76

7+
#include "kota/ipc/lsp/uri.h"
8+
89
namespace clice::feature {
910

1011
namespace {
1112

12-
namespace lsp = eventide::ipc::lsp;
13+
namespace lsp = kota::ipc::lsp;
1314

1415
auto to_uri(llvm::StringRef file) -> std::string {
1516
const auto file_view = std::string_view(file.data(), file.size());

src/feature/feature.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
77

88
#include "compile/compilation.h"
99
#include "compile/compilation_unit.h"
10-
#include "eventide/ipc/lsp/position.h"
11-
#include "eventide/ipc/lsp/protocol.h"
10+
11+
#include "kota/ipc/lsp/position.h"
12+
#include "kota/ipc/lsp/protocol.h"
1213

1314
namespace clang {
1415

@@ -18,11 +19,11 @@ class NamedDecl;
1819

1920
namespace clice::feature {
2021

21-
namespace protocol = eventide::ipc::protocol;
22+
namespace protocol = kota::ipc::protocol;
2223

23-
using eventide::ipc::lsp::PositionEncoding;
24-
using eventide::ipc::lsp::PositionMapper;
25-
using eventide::ipc::lsp::parse_position_encoding;
24+
using kota::ipc::lsp::PositionEncoding;
25+
using kota::ipc::lsp::PositionMapper;
26+
using kota::ipc::lsp::parse_position_encoding;
2627

2728
inline auto to_range(const PositionMapper& converter, LocalSourceRange range) -> protocol::Range {
2829
return protocol::Range{

0 commit comments

Comments
 (0)