Commit Graph

63 Commits

Author SHA1 Message Date
ykiko
94bc872cdb feat: add LSP trace recording and smoke test replay (#383)
## Summary

Add LSP trace recording and replay-based smoke testing infrastructure.

### clice changes (`src/clice.cc`)
- Add `--log-level` CLI option with validation (rejects unknown levels
instead of silently defaulting to off)
- Add `--record <path>` CLI option that wraps the transport with
`RecordingTransport` to capture client→server messages as timestamped
JSONL
- Works in both pipe and socket modes
- Fix exit code: `loop.run()` returns non-zero after `uv_stop()`,
explicitly return 0 after clean shutdown

### Compile logging (`src/compile/compilation.cpp`)
- Print compile commands at debug log level

### Replay script (`tests/replay.py`)
- Timestamp-based pacing: sleeps between messages based on recorded
intervals, faithful to original editor session
- Automatic workspace path rewriting: infers repo root from script
location, rewrites absolute paths in trace so CI replay works without
extra arguments
- Handles server→client requests (workDoneProgress/create,
registerCapability, etc.) with default responses
- Waits for all pending responses before sending shutdown/exit
- Detects server exit mid-replay and fails pending futures immediately
instead of hanging
- Reports PASS/FAIL/SKIP with stderr tail on failure

### CI & config
- Add `smoke-test` pixi task and CI workflow step (runs after
integration tests)
- `.gitattributes`: mark `tests/smoke/*.jsonl` as `linguist-generated
binary` to suppress diffs
- Add sample trace file `tests/smoke/session.jsonl`

### VSCode extension
- Add restart command (`clice.restart`)
- Support `CLICE_MODE` env var to override mode setting (for debug
launch configs)
- Split launch configs into socket/pipe variants with
`--disable-extensions`

## Test plan
- [x] `python tests/replay.py tests/smoke/session.jsonl --clice
./build/RelWithDebInfo/bin/clice` passes locally
- [ ] CI smoke test passes on Linux/macOS/Windows

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-03 14:21:28 +08:00
ykiko
eb0a6b35ee refactor(cmake): clean up toolchain and CMakeLists separation (#379)
## Summary

Improve CMake build system: cleaner separation, compiler caching, and
release packaging.

### Toolchain & Build
- Clean up `toolchain.cmake` to only contain clang/lld-specific setup
(compiler paths, linker selection, llvm tools), allowing other
toolchains like GCC to work without it
- Add ccache (Linux/macOS) and sccache (Windows) support via toolchain
auto-detection
- Move project-universal flags (`-ffunction-sections`, `--gc-sections`,
`-static-libstdc++`, etc.) to `CMakeLists.txt` so they apply regardless
of toolchain
- Add `-fno-exceptions` to project compile options; fix `/EHs-c-` for
proper MSVC exception disabling
- Use MSVC/clang-cl frontend detection instead of `WIN32` for
MSVC-specific linker flags
- Declare missing options: `CLICE_USE_LIBCXX`, `CLICE_OFFLINE_BUILD`,
`CLICE_ENABLE_BENCHMARK`, `CLICE_RELEASE`

### Release Packaging (`cmake/release.cmake`)
- Strip debug symbols and produce separate symbol archives (`.debug` /
`.dSYM` / `.pdb`)
- Windows: copy PDB via `$<TARGET_PDB_FILE:clice>`; macOS: use
`copy_directory` for dSYM bundle
- Package clice binary + clang resource dir + config into distributable
tarball/zip
- `cmake/archive.cmake` helper for cross-platform archive creation
- Activated via `-DCLICE_RELEASE=ON` (auto-enables LTO)

### Code Cleanup
- Replace manual 40+ line source file list with `GLOB_RECURSE` for
clice-core
- Fix duplicate `include_resolver.cpp` entry
- Use build-time `add_custom_target` for clang resource dir copy
(instead of configure-time `file(COPY)`)
- Gate `scan_benchmark` behind `CLICE_ENABLE_BENCHMARK` option

### CI
- Add compiler cache with env var control (`CCACHE_DIR`/`SCCACHE_DIR`)
and `actions/cache` for persistence
- Proper cache lifecycle: zero-stats before build, show-stats +
stop-server after
- Stop sccache server before pixi cleanup to fix Windows EBUSY error
- Pass `CLICE_ENABLE_BENCHMARK=ON` in benchmark workflow
- Platform-specific ccache/sccache dependencies in pixi.toml

## Test plan
- [x] Local build (RelWithDebInfo) passes
- [x] Local release build (LTO + strip + pack) produces correct archives
- [ ] CI: Linux Debug/RelWithDebInfo
- [ ] CI: macOS Debug/RelWithDebInfo
- [ ] CI: Windows Debug/RelWithDebInfo
- [ ] CI: Benchmark (all platforms)

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-31 20:51:01 +08:00
ykiko
f8a39147a7 feat: add include resolver, dependency graph, BFS scanner (#368)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-28 17:40:29 +08:00
ykiko
020c2cb3cc feat: implement multi-process LSP server architecture (#364)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-22 23:37:08 +08:00
ykiko
73afcfbb58 refactor: introduce syntax/scan module with DependencyDirectivesGetter (#357)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-16 21:45:31 +08:00
ykiko
ce2f355988 refactor: introduce eventide and rewrite server architecture (#355) 2026-03-01 18:17:02 +08:00
ykiko
5b016b1317 ci: add doc publishment workflow (#353)
Co-authored-by: yihtseu <i@yizhou.ac.cn>
2026-02-01 23:01:06 +08:00
ykiko
dd8f0dd90d refactor: diagnostic handling (#337) 2026-01-03 16:23:06 +08:00
ykiko
dee5e136b7 fix: docs spelling and workflow check (#336) 2026-01-01 00:48:14 +08:00
ykiko
4d16cf7b0a docs: update build (#335) 2026-01-01 00:36:07 +08:00
ykiko
aa3e5111de fix: only publish when a tag is created (#332) 2025-12-29 11:55:18 +08:00
ykiko
7a29560065 build: optimize the workflow (#331) 2025-12-29 09:19:45 +08:00
ykiko
7105e36803 chore: use pixi to manage the format tools and format the world (#330) 2025-12-28 19:36:06 +08:00
star9029
bc523b0681 build: use pixi in package ci (#326) 2025-12-21 16:47:42 +08:00
star9029
b8da7e79db build: use pixi in ci (#325)
Co-authored-by: ykiko <ykikoykikoykiko@gmail.com>
2025-12-17 13:04:02 +08:00
ykiko
1da34574c9 build: use pixi for managing build toolchains (#322) 2025-12-16 01:53:25 +08:00
ykiko
cec13ec29b refactor: tests and format the world (#314) 2025-11-30 15:21:27 +08:00
ykiko
2214d53ea5 chore: simplify config file (#319) 2025-11-28 02:07:06 +08:00
ykiko
caf9a172d6 extension: migrate vscode to editors/ (#316) 2025-11-28 00:37:22 +08:00
ykiko
8aff090a08 refactor: incremental update for compilation database and introduce query toolchain (#311) 2025-11-23 18:43:36 +08:00
ykiko
f16867902c build: update package workflow (#307)
Co-authored-by: star9029 <hengxings783@gmail.com>
2025-11-17 00:45:44 +08:00
ykiko
4a2a6aa65a build: update llvm checksum and refactor ci (#304) 2025-11-16 02:17:37 +08:00
star9029
3c53d3bc72 build: update llvm 21.1.4 checksum (#303) 2025-11-09 11:35:03 +08:00
star9029
8a2ef62596 build: enable xmake ci package cache (#295) 2025-11-05 23:33:28 +08:00
ykiko
397eb71dad build: update llvm to 21.1.4 (#292) 2025-11-02 22:23:11 +08:00
ykiko
a10908d3d9 Fix release ci (#282)
Co-authored-by: star9029 <hengxings783@gmail.com>
2025-10-20 21:43:46 +08:00
ykiko
4a184a26ce Fix unit_test fail doesn't result in error in CI (#270) 2025-10-03 14:50:38 +08:00
qingfengzl
2b350400bd Fix unit test of driver query (#267) 2025-09-27 11:13:39 +08:00
ykiko
f65876903c Improve integration test (#246) 2025-09-09 02:03:59 +08:00
ykiko
3cc3bae441 Format and simplify intergration test (#245) 2025-09-07 23:27:39 +08:00
Myriad-Dreamin
a942279765 Build clice container (#196) 2025-09-06 16:21:28 +08:00
ClSlaid
cb3bfd54f9 [CI] Dowload prebuilt llvm in cmake (#192)
Signed-off-by: 蔡略 <cailue@apache.org>
Co-authored-by: ykiko <ykikoykikoykiko@gmail.com>
2025-09-03 22:05:45 +08:00
star9029
2fb36b7251 Fix release ci (#210) 2025-08-28 23:40:19 +08:00
Myriad-Dreamin
90d424b72a Init uv project for pytest (#193)
Co-authored-by: star9029 <hengxings783@gmail.com>
2025-08-26 00:05:50 +08:00
ykiko
ce4b16ce30 Refactor and clean (#189) 2025-08-24 15:03:07 +08:00
ykiko
41d5ac1173 Fix docs and improve ci (#182) 2025-08-17 11:47:44 +08:00
ykiko
04cd848f3d Update docs (#174) 2025-08-13 20:21:54 +08:00
ykiko
f3e918b314 Update LLVM Version (#173)
Co-authored-by: star9029 <hengxings783@gmail.com>
2025-08-12 13:16:10 +08:00
ykiko
893edc7634 Publish diagnostics (#164) 2025-07-30 23:41:03 +08:00
star9029
7aec7feb6e Add resource dir option for integration tests (#163) 2025-07-26 10:20:59 +08:00
ykiko
686538533a Improve document and add github pages (#161) 2025-07-23 22:18:39 +08:00
ykiko
0ce30fb072 Add DidOpen test (#160) 2025-07-23 10:05:07 +08:00
star9029
572e9d04e2 Add integration tests for xmake (#158) 2025-07-22 12:29:44 +08:00
ykiko
836d9dc988 Add basic test client (#156)
Co-authored-by: star9029 <hengxings783@gmail.com>
2025-07-21 17:55:10 +08:00
qingfengzl
e8c4b034ed Fix selection tree, add some unit tests (#154)
Co-authored-by: ykiko <ykikoykikoykiko@gmail.com>
2025-07-18 20:17:09 +08:00
star9029
bfd6bbadbb Improve windows ci (#143) 2025-06-23 19:13:37 +08:00
qingfengzl
8c8e5dec59 MacOS Adaptation (#125) 2025-05-31 09:43:23 +08:00
ykiko
c332c93433 Add issue templates (#104) 2025-03-16 00:05:20 +08:00
star9029
6bbd25ded5 Support packaging for project release (#96)
Co-authored-by: ykiko <ykikoykikoykiko@gmail.com>
2025-03-15 20:33:13 +08:00
ur4t
5e29848f24 Allow build with libc++ (#85) 2025-02-19 19:22:42 +08:00