Skip to content

third_party submodule を FetchContent に移行 (P8) #64

Description

@thawk105

#37 (close 済み) から分離。元の [P4+P8+P10] のうちの P8。

進捗 (2026-05-14 時点)

  • spdlog の切り出し対応 (#71 で完了、master に merge 済み) のみ完了。
  • FetchContent 本体移行 (masstree/mimalloc/googletest の移行、bootstrap.sh 削除、CI ステップ削除、性能 regression 検証) は未着手*。
  • third_party: 未使用の spdlog submodule を除去 (#64 の一部) #71 が残した follow-up は本 issue 末尾の「## 備考」を参照。

背景

現状の構成:

FetchContent に移行すれば:

  • cmake -S . -B build && cmake --build build だけで完結 → bootstrap*.sh を削除可能
  • バージョン宣言が Dockerfile / git submodule ではなく CMake で明示 され、再現性が上がる
  • CI の Build third-party (...) ステップが消える (FetchContent の内部 caching に置き換わる)

提案

cmake/ThirdParty.cmake 等にまとめる:

include(FetchContent)

FetchContent_Declare(mimalloc
  GIT_REPOSITORY https://github.com/microsoft/mimalloc.git
  GIT_TAG v2.3.2)
FetchContent_MakeAvailable(mimalloc)
add_library(ccbench::mimalloc ALIAS mimalloc-static)

FetchContent_Declare(googletest
  GIT_REPOSITORY https://github.com/google/googletest.git
  GIT_TAG v1.17.0)
FetchContent_MakeAvailable(googletest)

# masstree は明示 tag が無いので commit SHA で pin
FetchContent_Declare(masstree
  GIT_REPOSITORY https://github.com/...
  GIT_TAG b3c5d054b66b08374d7a6ff5a0faeaf28b041a38)   # 現 submodule の commit
# masstree は CMake project ではないので Populate のみして手動で add_library

注意点 (重要)

ccbench は性能比較のための研究ベンチマークなので、以下を強く確認すべき:

  1. mimalloc の性能特性は allocator の挙動に直結する。現 submodule の v2.3.2 と FetchContent で取得するバージョンで「全プロトコルの YCSB / TPC-C / BoMB 数値が変わらない」ことを実測で確認 (= 性能 regression がないこと)。v2.1.7 のような古い tag に下げるなら更に慎重に。
  2. masstree は upstream の Kohler の repo に明示的な version tag がない (master 追従の submodule)。FetchContent でも commit SHA で pin する形で固定し、勝手に master 追従しないようにする。
  3. third_party/spdlogthird_party: 未使用の spdlog submodule を除去 (#64 の一部) #71 で調査済み・除去済み。調査の結果、参照元は include/logger.h 1 ファイルのみで、その logger.h 自体がどこからも #include されていない dead code だった (submodule もそもそも init されていなかった)。CMake / CI / Dockerfile / build_tools からの参照は 0 件。third_party: 未使用の spdlog submodule を除去 (#64 の一部) #71.gitmodules の spdlog セクション削除 + gitlink 削除を実施済みのため、FetchContent 移行対象には含めない
  4. bootstrap_tbb.shthird_party/tbb を参照しているが、tbb は submodule に登録されていない (CLAUDE.md の言及あり)。FetchContent 移行のついでに、tbb 関連の dead な bootstrap script も削除候補。

To-do

完了条件

  • cmake -B build && cmake --build build がスクリプトなしで成功する
  • bootstrap*.sh 系が削除されている
  • CI で Build third-party (...) 系ステップが消えている
  • 全プロトコルのビルドが通る
  • 全プロトコルの YCSB/TPC-C/BoMB 数値が submodule 版と一致する (性能 regression なし)

優先度

高 (構造改善) だが工数大。性能 regression 検証 が地味に時間がかかる (x86_64 Linux 実機が必要)。devcontainer の QEMU では数値検証できない点に注意。

備考: #71 のスコープ外として残った follow-up

#71 (spdlog submodule 除去) は submodule の除去のみを行い、以下 2 点はスコープ外として残している。本 issue の論点 (FetchContent 移行) とは別なので、別 issue で整理するのが望ましい:

  • include/logger.h が dead code として残存している (どこからも #include されておらず削除候補)。
  • docs/architecture_{ja,en}.md の submodule 一覧記述に spdlog がまだ残っている (現状と不整合)。

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions