Skip to content

Fix compile for gcs - #247

Merged
thweetkomputer merged 2 commits into
mainfrom
fix-compile-zc
Dec 3, 2025
Merged

Fix compile for gcs#247
thweetkomputer merged 2 commits into
mainfrom
fix-compile-zc

Conversation

@thweetkomputer

@thweetkomputer thweetkomputer commented Nov 29, 2025

Copy link
Copy Markdown
Collaborator

Here are some reminders before you submit the pull request

  • Add tests for the change
  • Document changes
  • Reference the link of issue using fixes eloqdb/tx_service#issue_id
  • Reference the link of RFC if exists
  • Pass ./mtr --suite=mono_main,mono_multi,mono_basic

Summary by CodeRabbit

  • New Features

    • Added support for RocksDB Cloud with Google Cloud Storage as a data store backend option.
  • Chores

    • Enhanced build configuration validation for cloud storage library dependencies.
    • Improved build logging for cloud storage library detection and status reporting.
    • Consolidated cloud storage dependency checks to reduce redundancy in build configuration.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai

coderabbitai Bot commented Nov 29, 2025

Copy link
Copy Markdown

Walkthrough

CMakeLists.txt is updated to introduce a new data store option ELOQDSS_ROCKSDB_CLOUD_GCS with KV_STORAGE_VAL set to 3 and compile definition DATA_STORE_TYPE_ELOQDSS_ROCKSDB_CLOUD_GCS. The RocksDB Cloud library checking logic is consolidated by moving the ROCKSDB_CLOUD_LIB existence check earlier with logging and removing redundant checks later in the configuration.

Changes

Cohort / File(s) Summary
CMake Build Configuration
CMakeLists.txt
Adds ELOQDSS_ROCKSDB_CLOUD_GCS data store option (KV_STORAGE_VAL = 3) with associated compile definition; consolidates RocksDB Cloud library detection logic (ROCKSDB_CLOUD_LIB existence check with fatal error, logging, and library appending) to early configuration phase, removing redundant checks and logs from later section.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Verify the new KV_STORAGE_VAL value (3) does not conflict with existing data store option values
  • Confirm the compile definition naming (DATA_STORE_TYPE_ELOQDSS_ROCKSDB_CLOUD_GCS) follows project conventions
  • Ensure the consolidated library checking logic replacement does not inadvertently skip processing for any configuration path

Possibly related PRs

Suggested reviewers

  • liunyl
  • xiexiaoy

Poem

🐰 A hop and a skip through CMake we go,
New GCS paths in a unified flow,
Library checks consolidated neat,
One early dance, no redundant repeat,
Cloud storage options now complete! ☁️

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Description check ⚠️ Warning The description only includes an unchecked template checklist without providing any actual pull request summary, context, or explanation of the changes being made. Add a proper description explaining the compilation issue, the changes made to CMakeLists.txt, why the ROCKSDB_CLOUD_LIB check was moved, and which issue this fixes.
Title check ❓ Inconclusive The title 'Fix compile for gcs' is vague and does not clearly describe what was fixed or why. It lacks specificity about the actual changes made to the CMakeLists.txt file. Provide a more specific title that describes the specific compilation issue being addressed, such as 'Add RocksDB Cloud GCS data store option and consolidate library handling'.
✅ Passed checks (1 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-compile-zc

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
CMakeLists.txt (2)

363-364: Add ELOQDSS_ROCKSDB_CLOUD_GCS to library linking condition (line 363).

The library linking condition excludes ELOQDSS_ROCKSDB_CLOUD_GCS, preventing ROCKSDB_LIBRARIES from being linked for GCS builds. This will cause linker failures.

Line 363 must include ELOQDSS_ROCKSDB_CLOUD_GCS:

-if(WITH_DATA_STORE STREQUAL "ELOQDSS_ROCKSDB" OR WITH_DATA_STORE STREQUAL "ELOQDSS_ROCKSDB_CLOUD_S3")
+if(WITH_DATA_STORE STREQUAL "ELOQDSS_ROCKSDB" OR WITH_DATA_STORE STREQUAL "ELOQDSS_ROCKSDB_CLOUD_S3" OR WITH_DATA_STORE STREQUAL "ELOQDSS_ROCKSDB_CLOUD_GCS")

160-209: Add GCS-specific library discovery for ROCKSDB_CLOUD_GCS in root CMakeLists.txt.

The root CMakeLists.txt (lines 160–209) includes ROCKSDB_CLOUD_GCS in the outer condition (line 160), but provides no corresponding GCS-specific library discovery block. Lines 162–199 handle S3-specific AWS SDK dependencies (aws-cpp-sdk-core, aws-cpp-sdk-s3, and rocksdb-cloud-aws), but there is no parallel GCS block for Google Cloud dependencies. When ROCKSDB_CLOUD_GCS is selected, only the common RocksDB Cloud header setup (lines 200–209) executes, leaving Google Cloud SDK headers and libraries undiscovered.

Add a GCS-specific section after line 199 (following the S3 block), parallel in structure to lines 162–199. It should:

  • Find Google Cloud Storage headers (google/cloud/storage/client.h)
  • Find and validate Google Cloud libraries (google_cloud_cpp_common, google_cloud_cpp_storage)
  • Find and validate the GCS-specific RocksDB Cloud library (rocksdb-cloud-gcp or equivalent)
  • Add these to ROCKSDB_INCLUDE_PATH and ROCKSDB_LIBRARIES

Note: The ELOQDSS_ROCKSDB_CLOUD_GCS variant is handled separately in store_handler/eloq_data_store_service/CMakeLists.txt (lines 247–264), but the plain ROCKSDB_CLOUD_GCS option requires this addition to the root CMakeLists.txt.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2e1fb67 and df6fd3f.

📒 Files selected for processing (1)
  • CMakeLists.txt (2 hunks)

Comment thread CMakeLists.txt
Comment on lines +126 to +128
elseif(WITH_DATA_STORE STREQUAL "ELOQDSS_ROCKSDB_CLOUD_GCS")
set(KV_STORAGE_VAL 3 CACHE STRING "eloq_ds" FORCE)
add_compile_definitions(DATA_STORE_TYPE_ELOQDSS_ROCKSDB_CLOUD_GCS)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash

# Get line count to understand file size
wc -l CMakeLists.txt

# Check lines around 299 (source files condition)
echo "=== Lines 295-305 (source files condition) ==="
sed -n '295,305p' CMakeLists.txt

# Check lines around 363 (library linking condition)
echo "=== Lines 360-370 (library linking condition) ==="
sed -n '360,370p' CMakeLists.txt

# Check lines around 213 (proto compilation)
echo "=== Lines 210-220 (proto compilation) ==="
sed -n '210,220p' CMakeLists.txt

# Search for all GCS-related configuration
echo "=== All GCS references in file ==="
grep -n "GCS\|gcs" CMakeLists.txt

# Check library discovery patterns (S3 section)
echo "=== Lines 162-199 (S3 library discovery section) ==="
sed -n '162,199p' CMakeLists.txt

Repository: eloqdata/tx_service

Length of output: 5748


🏁 Script executed:

#!/bin/bash

# Check S3-specific source files (lines 320-326 mentioned in review)
echo "=== Lines 315-330 (S3-specific sources) ==="
sed -n '315,330p' CMakeLists.txt

# Search for any GCS-specific source files or patterns
echo "=== Search for GCS source file references ==="
rg -n "gcs|GCS" CMakeLists.txt | grep -i "source\|file\|\.cpp"

# Check what source files are in the data substrate sources block
echo "=== Lines 299-350 (full source files block) ==="
sed -n '299,350p' CMakeLists.txt

# Look for rocksdb-cloud library naming
echo "=== Lines 190-200 (rocksdb-cloud library pattern) ==="
sed -n '190,200p' CMakeLists.txt

Repository: eloqdata/tx_service

Length of output: 4364


🏁 Script executed:

#!/bin/bash

# Search for gcs file downloader or GCS-specific sources
echo "=== Search for GCS source patterns ==="
find . -name "*.cpp" -o -name "*.h" | xargs grep -l "gcs\|GCS\|google.*cloud" 2>/dev/null | head -20

# Check for rocksdb-cloud-gcs references
echo "=== Search for rocksdb-cloud-gcs ==="
rg "rocksdb-cloud-gcs" --type cmake --type cpp --type h

# List available source files related to cloud storage
echo "=== Available cloud storage related sources ==="
find store_handler -name "*downloader*" -o -name "*cloud*" 2>/dev/null

# Check if gcs_file_downloader exists or similar
echo "=== Check for any GCS-related implementation files ==="
find . -type f \( -name "*.cpp" -o -name "*.h" \) | xargs basename -a | grep -i gcs

Repository: eloqdata/tx_service

Length of output: 1236


🏁 Script executed:

#!/bin/bash

# Check rocksdb_cloud_data_store.cpp for GCS support
echo "=== rocksdb_cloud_data_store.cpp content (first 100 lines) ==="
head -100 store_handler/eloq_data_store_service/rocksdb_cloud_data_store.cpp

# Check for conditional compilation markers or cloud provider handling
echo "=== Search for cloud provider logic in rocksdb_cloud_data_store ==="
rg -n "S3|GCS|google|aws" store_handler/eloq_data_store_service/rocksdb_cloud_data_store.cpp

Repository: eloqdata/tx_service

Length of output: 4282


Perfect. I've now gathered enough evidence to verify the review comment. The verification shows that:

  1. Line 299 condition is indeed incomplete - it excludes ELOQDSS_ROCKSDB_CLOUD_GCS from source file inclusion
  2. Line 363 condition is indeed incomplete - it excludes ELOQDSS_ROCKSDB_CLOUD_GCS from library linking
  3. GCS library discovery block is missing - only S3 has library discovery (rocksdb-cloud-aws)
  4. GCS source handling pattern is missing - no equivalent to the S3 elseif block (lines 320-326)

Most critically, rocksdb_cloud_data_store.cpp already contains GCS support (with #ifdef DATA_STORE_TYPE_ELOQDSS_ROCKSDB_CLOUD_GCS), but CMakeLists.txt prevents it from being compiled for GCS builds.


Add ELOQDSS_ROCKSDB_CLOUD_GCS to source files, library linking, and library discovery conditions.

The new ELOQDSS_ROCKSDB_CLOUD_GCS option is partially integrated: compile definitions are set (line 128), and rocksdb_cloud_data_store.cpp contains GCS-specific code with #ifdef DATA_STORE_TYPE_ELOQDSS_ROCKSDB_CLOUD_GCS. However, three critical gaps prevent GCS builds from compiling:

  1. Line 299: Add ELOQDSS_ROCKSDB_CLOUD_GCS to the source file inclusion condition alongside ELOQDSS_ROCKSDB_CLOUD_S3
  2. Lines 320–326: Add an elseif(WITH_DATA_STORE STREQUAL "ELOQDSS_ROCKSDB_CLOUD_GCS") block for GCS-specific sources (e.g., gcs_file_downloader.cpp or platform-specific equivalent)
  3. Line 363: Add ELOQDSS_ROCKSDB_CLOUD_GCS to the library linking condition
  4. Lines 162–199: Add a GCS-specific library discovery block (similar to S3) to find rocksdb-cloud-gcs library and Google Cloud C++ headers
🤖 Prompt for AI Agents
In CMakeLists.txt around lines 126-199, 299, 320-326, and 363, the new
DATA_STORE_TYPE_ELOQDSS_ROCKSDB_CLOUD_GCS compile definition is set but CMake
does not include GCS sources, discover GCS libraries/headers, or link GCS
libraries; update the file by (1) adding ELOQDSS_ROCKSDB_CLOUD_GCS to the
source-file inclusion condition at ~line 299 alongside ELOQDSS_ROCKSDB_CLOUD_S3,
(2) inserting an elseif(WITH_DATA_STORE STREQUAL "ELOQDSS_ROCKSDB_CLOUD_GCS")
block in the sources section (around lines 320–326) mirroring the S3 block and
listing GCS-specific sources (e.g., gcs downloader/adapter files), (3) adding
ELOQDSS_ROCKSDB_CLOUD_GCS to the library-linking condition at ~line 363 so the
rocksdb-cloud-gcs lib is linked, and (4) adding a GCS library discovery block
(modeled on the existing S3 discovery in lines ~162–199) to find the
rocksdb-cloud-gcs library and Google Cloud C++ headers and set the appropriate
include/link variables.

@thweetkomputer
thweetkomputer merged commit da6e47e into main Dec 3, 2025
4 checks passed
@thweetkomputer
thweetkomputer deleted the fix-compile-zc branch December 3, 2025 04:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants