diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 36f59264..49811e72 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -1,8 +1,7 @@ name: benchmark on: - pull_request: - branches: [main] + workflow_dispatch: jobs: benchmark: diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d3cec081..a0848f80 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,7 +19,7 @@ jobs: clice: ${{ steps.filter.outputs.clice }} vscode: ${{ steps.filter.outputs.vscode }} cmake: ${{ steps.filter.outputs.cmake }} - xmake: ${{ steps.filter.outputs.xmake }} + steps: - uses: actions/checkout@v4 - uses: dorny/paths-filter@v3 @@ -46,13 +46,6 @@ jobs: - 'tests/**' - 'config/**' - '.github/workflows/test-cmake.yml' - xmake: - - 'xmake.lua' - - 'src/**' - - 'include/**' - - 'tests/**' - - 'config/**' - - '.github/workflows/test-xmake.yml' format: needs: changes @@ -82,11 +75,6 @@ jobs: if: ${{ needs.changes.outputs.cmake == 'true' }} uses: ./.github/workflows/test-cmake.yml - # xmake: - # needs: changes - # if: ${{ needs.changes.outputs.xmake == 'true' }} - # uses: ./.github/workflows/test-xmake.yml - release-clice: permissions: contents: write @@ -109,11 +97,11 @@ jobs: # - clice - vscode - cmake - # - xmake + runs-on: ubuntu-latest steps: - name: Check results uses: re-actors/alls-green@release/v1 with: - allowed-skips: format,deploy,clice,vscode,cmake,xmake + allowed-skips: format,deploy,clice,vscode,cmake jobs: ${{ toJSON(needs) }} diff --git a/.github/workflows/publish-clice.yml b/.github/workflows/publish-clice.yml index f8c319f3..07c4fb05 100644 --- a/.github/workflows/publish-clice.yml +++ b/.github/workflows/publish-clice.yml @@ -29,32 +29,18 @@ jobs: runs-on: ${{ matrix.os }} + defaults: + run: + shell: bash + steps: - name: Checkout repository uses: actions/checkout@v4 - - name: Setup xmake - uses: xmake-io/github-action-setup-xmake@v1 - with: - xmake-version: 3.0.5 - actions-cache-folder: ".xmake-cache" - actions-cache-key: ${{ matrix.os }} - package-cache: true - package-cache-key: ${{ matrix.os }}-pkg-release-v1 - build-cache: true - build-cache-key: ${{ matrix.os }}-build-release-v1 - - uses: ./.github/actions/setup-pixi with: environments: package - - name: Remove ci llvm toolchain on Windows - if: runner.os == 'Windows' - run: | - # @see https://github.com/xmake-io/xmake/issues/7158 - xmake lua os.rmdir "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/Llvm" - xmake lua os.rmdir "C:/Program Files/LLVM" - - name: Package run: pixi run package @@ -63,7 +49,7 @@ jobs: uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: build/xpack/clice/${{ matrix.artifact_name }} + file: build/RelWithDebInfo/${{ matrix.artifact_name }} asset_name: ${{ matrix.asset_name }} tag: ${{ github.ref }} overwrite: true @@ -73,7 +59,7 @@ jobs: uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} - file: build/xpack/clice/${{ matrix.symbol_artifact_name }} + file: build/RelWithDebInfo/${{ matrix.symbol_artifact_name }} asset_name: ${{ matrix.symbol_asset_name }} tag: ${{ github.ref }} overwrite: true diff --git a/.github/workflows/test-xmake.yml b/.github/workflows/test-xmake.yml deleted file mode 100644 index 1a0427f3..00000000 --- a/.github/workflows/test-xmake.yml +++ /dev/null @@ -1,42 +0,0 @@ -name: xmake - -on: - workflow_call: - -jobs: - build: - strategy: - fail-fast: false - matrix: - os: [windows-2025, ubuntu-24.04, macos-15] - build_type: [debug, releasedbg] - exclude: - - os: windows-2025 - build_type: debug - runs-on: ${{ matrix.os }} - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Setup xmake - uses: xmake-io/github-action-setup-xmake@v1 - with: - xmake-version: 3.0.5 - actions-cache-folder: ".xmake-cache" - actions-cache-key: ${{ matrix.os }} - package-cache: true - package-cache-key: ${{ matrix.os }}-pixi - build-cache: true - build-cache-key: ${{ matrix.os }}-${{ matrix.build_type }} - - - uses: ./.github/actions/setup-pixi - - - name: Build - run: pixi run xmake ${{ matrix.build_type }} - - - name: Test - run: pixi run xmake-test - - - name: Remove llvm package (Linux) - if: runner.os == 'Linux' - run: xmake require --uninstall clice-llvm diff --git a/.gitignore b/.gitignore index f8f1cb8b..8fe8decc 100644 --- a/.gitignore +++ b/.gitignore @@ -35,7 +35,7 @@ *build*/ temp/ .cache/ -.xmake/ + .llvm*/ .clice/ compile_commands.json diff --git a/docs/en/dev/build.md b/docs/en/dev/build.md index e561f094..2eee94c8 100644 --- a/docs/en/dev/build.md +++ b/docs/en/dev/build.md @@ -32,18 +32,6 @@ pixi run integration-test Debug > [!TIP] > If you want to develop directly with `cmake`, `ninja`, `clang++`, etc., run `pixi shell` to enter a shell with all env vars configured. -### XMake - -We also support building with XMake: - -```shell -# config & build (default releasedbg) -pixi run xmake - -# unit & integration -pixi run xmake-test -``` - ## Manual Build If you plan to build manually, first ensure your toolchain matches the versions defined in `pixi.toml`. @@ -70,30 +58,13 @@ Optional build options: | CLICE_USE_LIBCXX | OFF | Build clice with libc++ (adds `-std=libc++`); if enabled, ensure the LLVM libs are also built with libc++ | | CLICE_CI_ENVIRONMENT | OFF | Enable the `CLICE_CI_ENVIRONMENT` macro; some tests only run in CI | -### XMake - -Build clice with: - -```bash -xmake f -c --mode=releasedbg --toolchain=clang -xmake build --all -``` - -Optional build options: - -| Option | Default | Effect | -| ------------- | ------- | ---------------------------------------- | -| --llvm | "" | Build clice with LLVM from a custom path | -| --enable_test | false | Build clice unit tests | -| --ci | false | Enable `CLICE_CI_ENVIRONMENT` | - ## About LLVM clice calls Clang APIs to parse C++ code, so it must link against LLVM/Clang. Because clice uses Clang's private headers (usually absent from distro packages), the system LLVM package cannot be used directly. Two ways to satisfy this dependency: -1. We publish prebuilt binaries of the LLVM version we use at [clice-llvm](https://github.com/clice-io/clice-llvm/releases) for CI and release builds. During builds, cmake and xmake download these LLVM libs by default. +1. We publish prebuilt binaries of the LLVM version we use at [clice-llvm](https://github.com/clice-io/clice-llvm/releases) for CI and release builds. During builds, cmake downloads these LLVM libs by default. > [!IMPORTANT] > diff --git a/docs/en/dev/test-and-debug.md b/docs/en/dev/test-and-debug.md index f8467616..ba0024e9 100644 --- a/docs/en/dev/test-and-debug.md +++ b/docs/en/dev/test-and-debug.md @@ -18,13 +18,6 @@ We use pytest to run integration tests. Please refer to `pyproject.toml` to inst $ pytest -s --log-cli-level=INFO tests/integration --executable=./build/bin/clice ``` -If you use xmake as your build system, you can run the tests directly with xmake: - -```shell -$ xmake run --verbose unit_tests -$ xmake test --verbose integration_tests/default -``` - ## Debug If you want to attach a debugger to clice for debugging, it is recommended to first start clice in socket mode independently, and then connect the client to it. diff --git a/docs/zh/dev/build.md b/docs/zh/dev/build.md index 48e3eb65..37e4abe9 100644 --- a/docs/zh/dev/build.md +++ b/docs/zh/dev/build.md @@ -32,18 +32,6 @@ pixi run integration-test Debug > [!TIP] > 如果你想直接使用 `cmake`, `ninja`, `clang++` 等命令进行开发,请运行 `pixi shell` 进入已配置好环境变量的终端 -### XMake - -我们同样支持使用 XMake 构建: - -```shell -# config & build (default releasedbg) -pixi run xmake - -# unit & integration -pixi run xmake-test -``` - ## Manual Build 如果你打算手动构建,请务必先确认你的工具链满足 pixi.toml 中定义的版本要求。 @@ -70,30 +58,13 @@ cmake -B build -G Ninja \ | CLICE_USE_LIBCXX | OFF | 是否使用 libc++ 来构建 clice(添加 `-std=libc++`),如果开启,请确保 LLVM 库也是使用 libc++ 编译的 | | CLICE_CI_ENVIRONMENT | OFF | 是否打开 `CLICE_CI_ENVIRONMENT` 这个宏,有些测试在 CI 环境才会执行 | -### XMake - -使用如下命令即可构建 clice: - -```bash -xmake f -c --mode=releasedbg --toolchain=clang -xmake build --all -``` - -可选的构建选项: - -| 选项 | 默认值 | 效果 | -| ------------- | ------ | ------------------------------------ | -| --llvm | "" | 使用自定义路径的 LLVM 库来构建 clice | -| --enable_test | false | 是否构建 clice 的单元测试 | -| --ci | false | 是否打开 `CLICE_CI_ENVIRONMENT` | - ## About LLVM clice 调用 Clang API 来解析 C++ 代码,因此必须链接 LLVM/Clang 库。由于 clice 使用了 Clang 的私有头文件(这些文件通常不包含在发行版中),不能直接使用系统安装的 LLVM 包。 主要有两种方式解决这个依赖问题: -1. 我们在 [clice-llvm](https://github.com/clice-io/clice-llvm/releases) 上会发布使用的 LLVM 版本的预编译二进制,用于 CI 或者 release 构建。在构建时 cmake 和 xmake 默认会从此处下载 LLVM 库然后使用。 +1. 我们在 [clice-llvm](https://github.com/clice-io/clice-llvm/releases) 上会发布使用的 LLVM 版本的预编译二进制,用于 CI 或者 release 构建。在构建时 cmake 默认会从此处下载 LLVM 库然后使用。 > [!IMPORTANT] > diff --git a/docs/zh/dev/test-and-debug.md b/docs/zh/dev/test-and-debug.md index aae43fac..7686ffa2 100644 --- a/docs/zh/dev/test-and-debug.md +++ b/docs/zh/dev/test-and-debug.md @@ -18,13 +18,6 @@ $ ./build/bin/unit_tests --test-dir="./tests/data" $ pytest -s --log-cli-level=INFO tests/integration --executable=./build/bin/clice ``` -如果你使用 xmake 作为构建系统,可以直接通过 xmake 运行测试: - -```shell -$ xmake run --verbose unit_tests -$ xmake test --verbose integration_tests/default -``` - ## Debug 如果想在 clice 上附加调试器并进行调试,推荐先单独以 socket 模式启动 clice,然后再将客户端连接到 clice 上 diff --git a/pixi.toml b/pixi.toml index 8fad9277..f60975cc 100644 --- a/pixi.toml +++ b/pixi.toml @@ -62,6 +62,15 @@ lsprotocol = ">=2024.0.0" [feature.package.dependencies] xz = ">=5.8.1,<6" +[feature.package.tasks.package] +cmd = """ +cmake -B build/RelWithDebInfo -G Ninja \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_TOOLCHAIN_FILE=cmake/toolchain.cmake \ + -DCLICE_RELEASE=ON && \ +cmake --build build/RelWithDebInfo +""" + # ============================================================================== # # CMAKE # # ============================================================================== # @@ -119,39 +128,6 @@ depends-on = [ { task = "integration-test", args = ["{{ type }}"] }, ] -# ============================================================================== # -# XMAKE # -# ============================================================================== # -[feature.build.tasks.xmake-config] -args = [ - { arg = "type", default = "releasedbg" }, - { arg = "ci", default = "n" }, -] -cmd = "xmake config --yes --mode={{ type }} --toolchain=clang --ci={{ ci }}" - -[feature.build.tasks.xmake-build] -cmd = "xmake build --verbose --diagnosis --all" - -[feature.build.tasks.xmake] -args = [ - { arg = "type", default = "releasedbg" }, - { arg = "ci", default = "n" }, -] -depends-on = [ - { task = "xmake-config", args = ["{{ type }}", "{{ ci }}"] }, - { task = "xmake-build" }, -] - -[feature.test.tasks.xmake-test] -cmd = "xmake test --verbose" - -[feature.package.tasks.package] -cmd = """ -xmake config --yes --toolchain=clang --mode=releasedbg \ - --enable_test=n --dev=n --release=y && \ -xmake pack --verbose -""" - # ============================================================================== # # HELPER TASKS # # ============================================================================== # diff --git a/src/clice.cc b/src/clice.cc index 31b74771..393725e2 100644 --- a/src/clice.cc +++ b/src/clice.cc @@ -15,42 +15,53 @@ namespace clice { +using deco::decl::KVStyle; + struct Options { - DecoKV(names = {"--mode"}; - help = "Running mode: pipe, socket, stateless-worker, stateful-worker"; - required = false;) + DecoKV(style = KVStyle::JoinedOrSeparate, + help = "Running mode: pipe, socket, stateless-worker, stateful-worker", + required = false) mode; - DecoKV(names = {"--host"}; help = "Socket mode address"; required = false;) + DecoKV(style = KVStyle::JoinedOrSeparate, help = "Socket mode address", required = false) host = "127.0.0.1"; - DecoKV(names = {"--port"}; help = "Socket mode port"; required = false;) + DecoKV(style = KVStyle::JoinedOrSeparate, help = "Socket mode port", required = false) port = 50051; - DecoKV(names = {"--stateful-worker-count"}; help = "Number of stateful workers"; - required = false;) + DecoKV(style = KVStyle::JoinedOrSeparate, + names = {"--stateful-worker-count", "--stateful-worker-count="}, + help = "Number of stateful workers", + required = false) stateful_worker_count; - DecoKV(names = {"--stateless-worker-count"}; help = "Number of stateless workers"; - required = false;) + DecoKV(style = KVStyle::JoinedOrSeparate, + names = {"--stateless-worker-count", "--stateless-worker-count="}, + help = "Number of stateless workers", + required = false) stateless_worker_count; - DecoKV(names = {"--worker-memory-limit"}; help = "Memory limit per stateful worker (bytes)"; - required = false;) + DecoKV(style = KVStyle::JoinedOrSeparate, + names = {"--worker-memory-limit", "--worker-memory-limit="}, + help = "Memory limit per stateful worker (bytes)", + required = false) worker_memory_limit; - DecoKV(names = {"--log-level"}; help = "Log level: trace, debug, info, warn, error, off"; - required = false;) + DecoKV(style = KVStyle::JoinedOrSeparate, + names = {"--log-level", "--log-level="}, + help = "Log level: trace, debug, info, warn, error, off", + required = false) log_level = "info"; - DecoKV(names = {"--record"}; help = "Record LSP input to file for replay testing"; - required = false;) + DecoKV(style = KVStyle::JoinedOrSeparate, + help = "Record LSP input to file for replay testing", + required = false) record; - DecoFlag(names = {"-h", "--help"}; help = "Show help message"; required = false;) + DecoFlag(names = {"-h", "--help"}, help = "Show help message", required = false) help; - DecoFlag(names = {"-v", "--version"}; help = "Show version"; required = false;) + DecoFlag(names = {"-v", "--version"}, help = "Show version", required = false) version; }; diff --git a/tests/unit/unit_tests.cc b/tests/unit/unit_tests.cc index 19b96b53..b90d9732 100644 --- a/tests/unit/unit_tests.cc +++ b/tests/unit/unit_tests.cc @@ -7,22 +7,25 @@ namespace { -constexpr auto kv_style = static_cast(deco::decl::KVStyle::Joined) | - static_cast(deco::decl::KVStyle::Separate); +using deco::decl::KVStyle; struct TestOptions { - DecoKVStyled(kv_style, names = {"--test-filter", "--test-filter="}; - help = "Filter tests by name"; - required = false;) + DecoKV(style = KVStyle::JoinedOrSeparate, + names = {"--test-filter", "--test-filter="}, + help = "Filter tests by name", + required = false) test_filter; - DecoKVStyled(kv_style, names = {"--log-level", "--log-level="}; - help = "Log level: trace/debug/info/warn/err"; - required = false;) + DecoKV(style = KVStyle::JoinedOrSeparate, + names = {"--log-level", "--log-level="}, + help = "Log level: trace/debug/info/warn/err", + required = false) log_level; - DecoKVStyled(kv_style, names = {"--test-dir", "--test-dir="}; help = "Test data directory"; - required = false;) + DecoKV(style = KVStyle::JoinedOrSeparate, + names = {"--test-dir", "--test-dir="}, + help = "Test data directory", + required = false) test_dir; }; diff --git a/tests/uv.lock b/tests/uv.lock deleted file mode 100644 index 797aa4d1..00000000 --- a/tests/uv.lock +++ /dev/null @@ -1,198 +0,0 @@ -version = 1 -revision = 3 -requires-python = ">=3.13" - -[[package]] -name = "cfgv" -version = "3.4.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/11/74/539e56497d9bd1d484fd863dd69cbbfa653cd2aa27abfe35653494d85e94/cfgv-3.4.0.tar.gz", hash = "sha256:e52591d4c5f5dead8e0f673fb16db7949d2cfb3f7da4582893288f0ded8fe560", size = 7114, upload-time = "2023-08-12T20:38:17.776Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/c5/55/51844dd50c4fc7a33b653bfaba4c2456f06955289ca770a5dbd5fd267374/cfgv-3.4.0-py2.py3-none-any.whl", hash = "sha256:b7265b1f29fd3316bfcd2b330d63d024f2bfd8bcb8b0272f8e19a504856c48f9", size = 7249, upload-time = "2023-08-12T20:38:16.269Z" }, -] - -[[package]] -name = "clice" -version = "0.1.0" -source = { virtual = "." } - -[package.dev-dependencies] -dev = [ - { name = "pre-commit" }, - { name = "pytest" }, - { name = "pytest-asyncio" }, -] - -[package.metadata] - -[package.metadata.requires-dev] -dev = [ - { name = "pre-commit", specifier = ">=4.3.0" }, - { name = "pytest" }, - { name = "pytest-asyncio", specifier = ">=1.1.0" }, -] - -[[package]] -name = "colorama" -version = "0.4.6" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/d8/53/6f443c9a4a8358a93a6792e2acffb9d9d5cb0a5cfd8802644b7b1c9a02e4/colorama-0.4.6.tar.gz", hash = "sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44", size = 27697, upload-time = "2022-10-25T02:36:22.414Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl", hash = "sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6", size = 25335, upload-time = "2022-10-25T02:36:20.889Z" }, -] - -[[package]] -name = "distlib" -version = "0.4.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/96/8e/709914eb2b5749865801041647dc7f4e6d00b549cfe88b65ca192995f07c/distlib-0.4.0.tar.gz", hash = "sha256:feec40075be03a04501a973d81f633735b4b69f98b05450592310c0f401a4e0d", size = 614605, upload-time = "2025-07-17T16:52:00.465Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/33/6b/e0547afaf41bf2c42e52430072fa5658766e3d65bd4b03a563d1b6336f57/distlib-0.4.0-py2.py3-none-any.whl", hash = "sha256:9659f7d87e46584a30b5780e43ac7a2143098441670ff0a49d5f9034c54a6c16", size = 469047, upload-time = "2025-07-17T16:51:58.613Z" }, -] - -[[package]] -name = "filelock" -version = "3.19.1" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/40/bb/0ab3e58d22305b6f5440629d20683af28959bf793d98d11950e305c1c326/filelock-3.19.1.tar.gz", hash = "sha256:66eda1888b0171c998b35be2bcc0f6d75c388a7ce20c3f3f37aa8e96c2dddf58", size = 17687, upload-time = "2025-08-14T16:56:03.016Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/42/14/42b2651a2f46b022ccd948bca9f2d5af0fd8929c4eec235b8d6d844fbe67/filelock-3.19.1-py3-none-any.whl", hash = "sha256:d38e30481def20772f5baf097c122c3babc4fcdb7e14e57049eb9d88c6dc017d", size = 15988, upload-time = "2025-08-14T16:56:01.633Z" }, -] - -[[package]] -name = "identify" -version = "2.6.14" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/52/c4/62963f25a678f6a050fb0505a65e9e726996171e6dbe1547f79619eefb15/identify-2.6.14.tar.gz", hash = "sha256:663494103b4f717cb26921c52f8751363dc89db64364cd836a9bf1535f53cd6a", size = 99283, upload-time = "2025-09-06T19:30:52.938Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/e5/ae/2ad30f4652712c82f1c23423d79136fbce338932ad166d70c1efb86a5998/identify-2.6.14-py2.py3-none-any.whl", hash = "sha256:11a073da82212c6646b1f39bb20d4483bfb9543bd5566fec60053c4bb309bf2e", size = 99172, upload-time = "2025-09-06T19:30:51.759Z" }, -] - -[[package]] -name = "iniconfig" -version = "2.1.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/f2/97/ebf4da567aa6827c909642694d71c9fcf53e5b504f2d96afea02718862f3/iniconfig-2.1.0.tar.gz", hash = "sha256:3abbd2e30b36733fee78f9c7f7308f2d0050e88f0087fd25c2645f63c773e1c7", size = 4793, upload-time = "2025-03-19T20:09:59.721Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/2c/e1/e6716421ea10d38022b952c159d5161ca1193197fb744506875fbb87ea7b/iniconfig-2.1.0-py3-none-any.whl", hash = "sha256:9deba5723312380e77435581c6bf4935c94cbfab9b1ed33ef8d238ea168eb760", size = 6050, upload-time = "2025-03-19T20:10:01.071Z" }, -] - -[[package]] -name = "nodeenv" -version = "1.9.1" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/43/16/fc88b08840de0e0a72a2f9d8c6bae36be573e475a6326ae854bcc549fc45/nodeenv-1.9.1.tar.gz", hash = "sha256:6ec12890a2dab7946721edbfbcd91f3319c6ccc9aec47be7c7e6b7011ee6645f", size = 47437, upload-time = "2024-06-04T18:44:11.171Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/d2/1d/1b658dbd2b9fa9c4c9f32accbfc0205d532c8c6194dc0f2a4c0428e7128a/nodeenv-1.9.1-py2.py3-none-any.whl", hash = "sha256:ba11c9782d29c27c70ffbdda2d7415098754709be8a7056d79a737cd901155c9", size = 22314, upload-time = "2024-06-04T18:44:08.352Z" }, -] - -[[package]] -name = "packaging" -version = "25.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/a1/d4/1fc4078c65507b51b96ca8f8c3ba19e6a61c8253c72794544580a7b6c24d/packaging-25.0.tar.gz", hash = "sha256:d443872c98d677bf60f6a1f2f8c1cb748e8fe762d2bf9d3148b5599295b0fc4f", size = 165727, upload-time = "2025-04-19T11:48:59.673Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/20/12/38679034af332785aac8774540895e234f4d07f7545804097de4b666afd8/packaging-25.0-py3-none-any.whl", hash = "sha256:29572ef2b1f17581046b3a2227d5c611fb25ec70ca1ba8554b24b0e69331a484", size = 66469, upload-time = "2025-04-19T11:48:57.875Z" }, -] - -[[package]] -name = "platformdirs" -version = "4.4.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/23/e8/21db9c9987b0e728855bd57bff6984f67952bea55d6f75e055c46b5383e8/platformdirs-4.4.0.tar.gz", hash = "sha256:ca753cf4d81dc309bc67b0ea38fd15dc97bc30ce419a7f58d13eb3bf14c4febf", size = 21634, upload-time = "2025-08-26T14:32:04.268Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/40/4b/2028861e724d3bd36227adfa20d3fd24c3fc6d52032f4a93c133be5d17ce/platformdirs-4.4.0-py3-none-any.whl", hash = "sha256:abd01743f24e5287cd7a5db3752faf1a2d65353f38ec26d98e25a6db65958c85", size = 18654, upload-time = "2025-08-26T14:32:02.735Z" }, -] - -[[package]] -name = "pluggy" -version = "1.6.0" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/f9/e2/3e91f31a7d2b083fe6ef3fa267035b518369d9511ffab804f839851d2779/pluggy-1.6.0.tar.gz", hash = "sha256:7dcc130b76258d33b90f61b658791dede3486c3e6bfb003ee5c9bfb396dd22f3", size = 69412, upload-time = "2025-05-15T12:30:07.975Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/54/20/4d324d65cc6d9205fabedc306948156824eb9f0ee1633355a8f7ec5c66bf/pluggy-1.6.0-py3-none-any.whl", hash = "sha256:e920276dd6813095e9377c0bc5566d94c932c33b27a3e3945d8389c374dd4746", size = 20538, upload-time = "2025-05-15T12:30:06.134Z" }, -] - -[[package]] -name = "pre-commit" -version = "4.3.0" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "cfgv" }, - { name = "identify" }, - { name = "nodeenv" }, - { name = "pyyaml" }, - { name = "virtualenv" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/ff/29/7cf5bbc236333876e4b41f56e06857a87937ce4bf91e117a6991a2dbb02a/pre_commit-4.3.0.tar.gz", hash = "sha256:499fe450cc9d42e9d58e606262795ecb64dd05438943c62b66f6a8673da30b16", size = 193792, upload-time = "2025-08-09T18:56:14.651Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/5b/a5/987a405322d78a73b66e39e4a90e4ef156fd7141bf71df987e50717c321b/pre_commit-4.3.0-py2.py3-none-any.whl", hash = "sha256:2b0747ad7e6e967169136edffee14c16e148a778a54e4f967921aa1ebf2308d8", size = 220965, upload-time = "2025-08-09T18:56:13.192Z" }, -] - -[[package]] -name = "pygments" -version = "2.19.2" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/b0/77/a5b8c569bf593b0140bde72ea885a803b82086995367bf2037de0159d924/pygments-2.19.2.tar.gz", hash = "sha256:636cb2477cec7f8952536970bc533bc43743542f70392ae026374600add5b887", size = 4968631, upload-time = "2025-06-21T13:39:12.283Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/c7/21/705964c7812476f378728bdf590ca4b771ec72385c533964653c68e86bdc/pygments-2.19.2-py3-none-any.whl", hash = "sha256:86540386c03d588bb81d44bc3928634ff26449851e99741617ecb9037ee5ec0b", size = 1225217, upload-time = "2025-06-21T13:39:07.939Z" }, -] - -[[package]] -name = "pytest" -version = "8.4.1" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "colorama", marker = "sys_platform == 'win32'" }, - { name = "iniconfig" }, - { name = "packaging" }, - { name = "pluggy" }, - { name = "pygments" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/08/ba/45911d754e8eba3d5a841a5ce61a65a685ff1798421ac054f85aa8747dfb/pytest-8.4.1.tar.gz", hash = "sha256:7c67fd69174877359ed9371ec3af8a3d2b04741818c51e5e99cc1742251fa93c", size = 1517714, upload-time = "2025-06-18T05:48:06.109Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/29/16/c8a903f4c4dffe7a12843191437d7cd8e32751d5de349d45d3fe69544e87/pytest-8.4.1-py3-none-any.whl", hash = "sha256:539c70ba6fcead8e78eebbf1115e8b589e7565830d7d006a8723f19ac8a0afb7", size = 365474, upload-time = "2025-06-18T05:48:03.955Z" }, -] - -[[package]] -name = "pytest-asyncio" -version = "1.1.0" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "pytest" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/4e/51/f8794af39eeb870e87a8c8068642fc07bce0c854d6865d7dd0f2a9d338c2/pytest_asyncio-1.1.0.tar.gz", hash = "sha256:796aa822981e01b68c12e4827b8697108f7205020f24b5793b3c41555dab68ea", size = 46652, upload-time = "2025-07-16T04:29:26.393Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/c7/9d/bf86eddabf8c6c9cb1ea9a869d6873b46f105a5d292d3a6f7071f5b07935/pytest_asyncio-1.1.0-py3-none-any.whl", hash = "sha256:5fe2d69607b0bd75c656d1211f969cadba035030156745ee09e7d71740e58ecf", size = 15157, upload-time = "2025-07-16T04:29:24.929Z" }, -] - -[[package]] -name = "pyyaml" -version = "6.0.2" -source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/54/ed/79a089b6be93607fa5cdaedf301d7dfb23af5f25c398d5ead2525b063e17/pyyaml-6.0.2.tar.gz", hash = "sha256:d584d9ec91ad65861cc08d42e834324ef890a082e591037abe114850ff7bbc3e", size = 130631, upload-time = "2024-08-06T20:33:50.674Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/ef/e3/3af305b830494fa85d95f6d95ef7fa73f2ee1cc8ef5b495c7c3269fb835f/PyYAML-6.0.2-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:efdca5630322a10774e8e98e1af481aad470dd62c3170801852d752aa7a783ba", size = 181309, upload-time = "2024-08-06T20:32:43.4Z" }, - { url = "https://files.pythonhosted.org/packages/45/9f/3b1c20a0b7a3200524eb0076cc027a970d320bd3a6592873c85c92a08731/PyYAML-6.0.2-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:50187695423ffe49e2deacb8cd10510bc361faac997de9efef88badc3bb9e2d1", size = 171679, upload-time = "2024-08-06T20:32:44.801Z" }, - { url = "https://files.pythonhosted.org/packages/7c/9a/337322f27005c33bcb656c655fa78325b730324c78620e8328ae28b64d0c/PyYAML-6.0.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0ffe8360bab4910ef1b9e87fb812d8bc0a308b0d0eef8c8f44e0254ab3b07133", size = 733428, upload-time = "2024-08-06T20:32:46.432Z" }, - { url = "https://files.pythonhosted.org/packages/a3/69/864fbe19e6c18ea3cc196cbe5d392175b4cf3d5d0ac1403ec3f2d237ebb5/PyYAML-6.0.2-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:17e311b6c678207928d649faa7cb0d7b4c26a0ba73d41e99c4fff6b6c3276484", size = 763361, upload-time = "2024-08-06T20:32:51.188Z" }, - { url = "https://files.pythonhosted.org/packages/04/24/b7721e4845c2f162d26f50521b825fb061bc0a5afcf9a386840f23ea19fa/PyYAML-6.0.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:70b189594dbe54f75ab3a1acec5f1e3faa7e8cf2f1e08d9b561cb41b845f69d5", size = 759523, upload-time = "2024-08-06T20:32:53.019Z" }, - { url = "https://files.pythonhosted.org/packages/2b/b2/e3234f59ba06559c6ff63c4e10baea10e5e7df868092bf9ab40e5b9c56b6/PyYAML-6.0.2-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:41e4e3953a79407c794916fa277a82531dd93aad34e29c2a514c2c0c5fe971cc", size = 726660, upload-time = "2024-08-06T20:32:54.708Z" }, - { url = "https://files.pythonhosted.org/packages/fe/0f/25911a9f080464c59fab9027482f822b86bf0608957a5fcc6eaac85aa515/PyYAML-6.0.2-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:68ccc6023a3400877818152ad9a1033e3db8625d899c72eacb5a668902e4d652", size = 751597, upload-time = "2024-08-06T20:32:56.985Z" }, - { url = "https://files.pythonhosted.org/packages/14/0d/e2c3b43bbce3cf6bd97c840b46088a3031085179e596d4929729d8d68270/PyYAML-6.0.2-cp313-cp313-win32.whl", hash = "sha256:bc2fa7c6b47d6bc618dd7fb02ef6fdedb1090ec036abab80d4681424b84c1183", size = 140527, upload-time = "2024-08-06T20:33:03.001Z" }, - { url = "https://files.pythonhosted.org/packages/fa/de/02b54f42487e3d3c6efb3f89428677074ca7bf43aae402517bc7cca949f3/PyYAML-6.0.2-cp313-cp313-win_amd64.whl", hash = "sha256:8388ee1976c416731879ac16da0aff3f63b286ffdd57cdeb95f3f2e085687563", size = 156446, upload-time = "2024-08-06T20:33:04.33Z" }, -] - -[[package]] -name = "virtualenv" -version = "20.34.0" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "distlib" }, - { name = "filelock" }, - { name = "platformdirs" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/1c/14/37fcdba2808a6c615681cd216fecae00413c9dab44fb2e57805ecf3eaee3/virtualenv-20.34.0.tar.gz", hash = "sha256:44815b2c9dee7ed86e387b842a84f20b93f7f417f95886ca1996a72a4138eb1a", size = 6003808, upload-time = "2025-08-13T14:24:07.464Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/76/06/04c8e804f813cf972e3262f3f8584c232de64f0cde9f703b46cf53a45090/virtualenv-20.34.0-py3-none-any.whl", hash = "sha256:341f5afa7eee943e4984a9207c025feedd768baff6753cd660c857ceb3e36026", size = 5983279, upload-time = "2025-08-13T14:24:05.111Z" }, -] diff --git a/xmake.lua b/xmake.lua deleted file mode 100644 index a8d659e3..00000000 --- a/xmake.lua +++ /dev/null @@ -1,425 +0,0 @@ -set_xmakever("3.0.0") -set_project("clice") - -set_allowedplats("windows", "linux", "macosx") -set_allowedmodes("debug", "release", "releasedbg") - -option("enable_test", { default = true }) -option("dev", { default = true }) -option("release", { default = false }) -option("llvm", { default = nil, description = "Specify pre-compiled llvm binary directory." }) -option("ci", { default = false }) - -if has_config("dev") then - set_policy("build.ccache", true) - set_policy("package.install_only", true) -- Don't fetch system package - if is_plat("windows") then - set_runtimes("MD") - if is_mode("debug") then - print( - "clice does not support build in debug mode with pre-compiled llvm binary on windows.\n" - .. "See https://github.com/clice-io/clice/issues/42 for more information." - ) - os.raise() - end - elseif is_mode("debug") and is_plat("linux", "macosx") then - set_policy("build.sanitizer.address", true) - end -end - -local libuv_require = "libuv" - -if has_config("release") then - set_policy("build.optimization.lto", true) - set_policy("package.cmake_generator.ninja", true) - set_policy("package.install_only", true) -- Don't fetch system package - - if is_plat("windows") then - set_runtimes("MD") - -- workaround cmake - libuv_require = "libuv[toolchains=clang-cl]" - end - - includes("@builtin/xpack") -end - -if is_plat("macosx", "linux") then - local cxflags - if is_plat("macosx") then - -- https://conda-forge.org/docs/maintainer/knowledge_base/#newer-c-features-with-old-sdk - cxflags = "-D_LIBCPP_DISABLE_AVAILABILITY=1" - end - local ldflags = "-fuse-ld=lld" - local shflags = "-fuse-ld=lld" - - add_cxflags(cxflags) - add_ldflags(ldflags) - add_shflags(shflags) - - add_requireconfs("**|cmake", { - configs = { - cxflags = cxflags, - ldflags = ldflags, - shflags = shflags, - }, - }) -end - -add_defines("TOML_EXCEPTIONS=0") -add_requires( - "spdlog", - { system = false, version = "1.15.3", configs = { header_only = false, std_format = true, noexcept = true } } -) -add_requires(libuv_require, "toml++", "croaring", "flatbuffers", "cpptrace") -add_requires("clice-llvm", { alias = "llvm" }) - -add_rules("mode.release", "mode.debug", "mode.releasedbg") -set_languages("c++23") -add_rules("clice_build_config") - -target("clice-core", function() - set_kind("$(kind)") - add_files("src/**.cpp|Driver/*.cpp", "include/Index/schema.fbs") - add_includedirs("include", { public = true }) - - add_rules("flatbuffers.schema.gen", "clice_clang_tidy_config") - add_packages("flatbuffers") - add_packages("libuv", "spdlog", "toml++", "croaring", { public = true }) - - if is_mode("debug") then - add_packages("llvm", { - public = true, - links = { - "LLVMSupport", - "LLVMFrontendOpenMP", - "LLVMOption", - "LLVMTargetParser", - "clangAST", - "clangASTMatchers", - "clangBasic", - "clangDriver", - "clangFormat", - "clangFrontend", - "clangLex", - "clangSema", - "clangSerialization", - "clangTidy", - "clangTidyUtils", - -- ALL_CLANG_TIDY_CHECKS - "clangTidyAndroidModule", - "clangTidyAbseilModule", - "clangTidyAlteraModule", - "clangTidyBoostModule", - "clangTidyBugproneModule", - "clangTidyCERTModule", - "clangTidyConcurrencyModule", - "clangTidyCppCoreGuidelinesModule", - "clangTidyDarwinModule", - "clangTidyFuchsiaModule", - "clangTidyGoogleModule", - "clangTidyHICPPModule", - "clangTidyLinuxKernelModule", - "clangTidyLLVMModule", - "clangTidyLLVMLibcModule", - "clangTidyMiscModule", - "clangTidyModernizeModule", - "clangTidyObjCModule", - "clangTidyOpenMPModule", - "clangTidyPerformanceModule", - "clangTidyPortabilityModule", - "clangTidyReadabilityModule", - "clangTidyZirconModule", - "clangTooling", - "clangToolingCore", - "clangToolingInclusions", - "clangToolingInclusionsStdlib", - "clangToolingSyntax", - }, - }) - on_config(function(target) - local llvm_dynlib_dir = path.join(target:pkg("llvm"):installdir(), "lib") - target:add("rpathdirs", llvm_dynlib_dir) - end) - elseif is_mode("release", "releasedbg") then - add_packages("llvm", { public = true }) - end -end) - -target("clice", function() - set_kind("binary") - add_files("src/clice.cc") - add_deps("clice-core") - - -- workaround - -- @see https://github.com/xmake-io/xmake/issues/7029 - if is_plat("macosx") then - set_toolset("dsymutil", "dsymutil") - end - - on_config(function(target) - local llvm_dir = target:dep("clice-core"):pkg("llvm"):installdir() - target:add("installfiles", path.join(llvm_dir, "lib/clang/(**)"), { prefixdir = "lib/clang" }) - end) - - after_build(function(target) - local res_dir = path.join(target:targetdir(), "../lib/clang") - if not os.exists(res_dir) then - local llvm_dir = target:dep("clice-core"):pkg("llvm"):installdir() - os.vcp(path.join(llvm_dir, "lib/clang"), res_dir) - end - end) -end) - -target("unit_tests", function() - set_default(false) - set_kind("binary") - add_files("tests/unit/unit_tests.cc", "tests/unit/**.cpp") - add_includedirs(".", { public = true }) - - add_packages("cpptrace") - add_deps("clice-core") - - add_tests("default") - - after_load(function(target) - target:set("runargs", "--test-dir=" .. path.absolute("tests/data")) - end) -end) - -target("integration_tests", function() - set_default(false) - set_kind("phony") - - add_deps("clice") - add_packages("llvm") - - add_tests("default") - - on_test(function(target, opt) - local argv = { - "--log-cli-level=INFO", - "-s", - "tests/integration", - "--executable=" .. target:dep("clice"):targetfile(), - } - local run_opt = { curdir = os.projectdir() } - os.vrunv("pytest", argv, run_opt) - - return true - end) -end) - -rule("clice_clang_tidy_config", function() - on_load(function(target) - import("core.project.depend") - - local autogendir = path.join(target:autogendir(), "rules/clice_clang_tidy_config") - os.mkdir(autogendir) - target:add("includedirs", autogendir, { public = true }) - - local src = path.join(os.projectdir(), "config/clang-tidy-config.h") - depend.on_changed(function() - os.vcp(src, path.join(autogendir, "clang-tidy-config.h")) - end, { - files = src, - changed = target:is_rebuilt(), - }) - end) - - before_build(function(target) - local dest = path.join(target:autogendir(), "rules/clice_clang_tidy_config/clang-tidy-config.h") - if not os.exists(dest) then - local src = path.join(os.projectdir(), "config/clang-tidy-config.h") - os.vcp(src, dest) - end - end) -end) - -rule("clice_build_config", function() - on_load(function(target) - target:set("exceptions", "no-cxx") - target:add("cxflags", "-fno-rtti", "-Wno-undefined-inline", { tools = { "clang", "clangxx", "gcc", "gxx" } }) - target:add("cxflags", "/GR-", "/Zc:preprocessor", { tools = { "clang_cl", "cl" } }) - - if target:is_plat("windows") and not target:toolchain("msvc") then - target:set("toolset", "ar", "llvm-ar") - if target:toolchain("clang-cl") then - target:set("toolset", "ld", "lld-link") - target:set("toolset", "sh", "lld-link") - else - target:add("ldflags", "-fuse-ld=lld-link") - end - elseif target:is_plat("linux") then - target:add("ldflags", "-fuse-ld=lld", "-static-libstdc++", "-Wl,--gc-sections") - elseif target:is_plat("macosx") then - target:add("ldflags", "-fuse-ld=lld", "-Wl,-dead_strip,-object_path_lto,clice.lto.o", { force = true }) - -- dsymutil so slow, disable it in dev ci - if not has_config("release") and is_mode("releasedbg") and has_config("ci") then - target:rule_enable("utils.symbols.extract", false) - end - end - - if has_config("release") then - -- pixi clang failed to add lto flags because it need `-fuse-ld=lld` - target:add("ldflags", "-flto=thin", { force = true }) - end - - if has_config("ci") then - target:add("cxxflags", "-DCLICE_CI_ENVIRONMENT=1") - end - - if has_config("enable_test") then - target:add("cxxflags", "-DCLICE_ENABLE_TEST=1") - end - end) -end) - -rule("flatbuffers.schema.gen", function() - set_extensions(".fbs") - - on_prepare_files(function(target, jobgraph, sourcebatch, opt) - import("lib.detect.find_tool") - import("core.project.depend") - import("utils.progress") - - assert( - target:pkg("flatbuffers"), - 'Please configure add_packages("flatbuffers") for target(' .. target:name() .. ")" - ) - local envs = target:pkgenvs() - local flatc = assert(find_tool("flatc", { envs = envs }), "flatc not found!") - - local group_name = path.join(target:fullname(), "generate/fbs") - local autogendir = path.join(target:autogendir(), "rules/flatbuffers") - jobgraph:group(group_name, function() - for _, sourcefile in ipairs(sourcebatch.sourcefiles) do - local job = path.join(group_name, sourcefile) - local generate_dir = path.normalize(path.join(autogendir, path.directory(sourcefile))) - target:add("includedirs", generate_dir, { public = true }) - os.mkdir(generate_dir) - jobgraph:add(job, function(index, total, opt) - local argv = { - "--cpp", - "-o", - generate_dir, - sourcefile, - } - - depend.on_changed(function() - progress.show(flatc.progress or 0, "${color.build.object}generating.fbs %s", sourcefile) - os.vrunv(flatc.program, argv) - end, { - files = sourcefile, - dependfile = target:dependfile(sourcefile), - changed = target:is_rebuilt(), - }) - end) - end - end) - end, { jobgraph = true }) -end) - -package("clice-llvm", function() - if has_config("llvm") then - set_sourcedir(get_config("llvm")) - else - on_source(function(package) - import("core.base.json") - - local build_type = { - Debug = "debug", - Release = "release", - RelWithDebInfo = "releasedbg", - } - local info = json.loadfile("./config/llvm-manifest.json") - for _, info in ipairs(info) do - local current_plat = get_config("plat") - local current_mode = get_config("mode") - local info_plat = info.platform:lower() - local info_mode = build_type[info.build_type] - local mode_match = (info_mode == current_mode) - or (info_mode == "releasedbg" and current_mode == "release") - if info_plat == current_plat and mode_match and (info.lto == has_config("release")) then - package:add( - "urls", - format( - "https://github.com/clice-io/clice-llvm/releases/download/%s/%s", - info.version, - info.filename - ) - ) - package:add("versions", info.version, info.sha256) - end - end - end) - end - - if is_plat("linux", "macosx") then - if is_mode("debug") then - add_configs( - "shared", - { description = "Build shared library.", default = true, type = "boolean", readonly = true } - ) - end - end - - if is_plat("windows", "mingw") then - add_syslinks("version", "ntdll") - end - - on_install(function(package) - if not package:config("shared") then - package:add("defines", "CLANG_BUILD_STATIC") - end - - os.trycp("bin", package:installdir()) - os.vcp("lib", package:installdir()) - os.vcp("include", package:installdir()) - end) -end) - -if has_config("release") then - xpack("clice") - if is_plat("windows") then - set_formats("zip") - set_extension(".zip") - else - set_formats("targz") - set_extension(".tar.gz") - end - - set_prefixdir("clice") - - add_targets("clice") - -- add_installfiles(path.join(os.projectdir(), "docs/clice.toml")) - - on_package(function(package) - import("utils.archive") - - local build_dir = path.absolute(package:install_rootdir()) - os.tryrm(build_dir) - os.mkdir(build_dir) - - local function clice_archive(output_file) - local old_dir = os.cd(build_dir) - local archive_files = os.files("**") - os.cd(old_dir) - os.tryrm(output_file) - cprint("packing %s .. ", output_file) - archive.archive(path.absolute(output_file), archive_files, { curdir = build_dir, compress = "best" }) - end - - local target = package:target("clice") - os.vcp(target:symbolfile(), build_dir) - clice_archive(path.join(package:outputdir(), "clice-symbol" .. package:extension())) - - os.tryrm(build_dir) - os.mkdir(path.join(build_dir, "bin")) - os.vcp(target:targetfile(), path.join(build_dir, "bin")) - os.vcp(path.join(os.projectdir(), "docs/clice.toml"), build_dir) - - local llvm_dir = target:dep("clice-core"):pkg("llvm"):installdir() - os.vcp(path.join(llvm_dir, "lib/clang"), path.join(build_dir, "lib/clang")) - clice_archive(path.join(package:outputdir(), "clice" .. package:extension())) - end) -end