Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build-lint-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ env:
RUST_BACKTRACE: full
RUST_LOG: trace
# Should include `INTEGRATION_TEST_BIN` from the `Makefile`
# TODO: Remove `build/libscylla-cpp-driver.*` after https://github.com/scylladb/cpp-rs-driver/issues/164 is fixed.
# TODO: Remove `build/libscylladb.*` after https://github.com/scylladb/cpp-rs-driver/issues/164 is fixed.
INTEGRATION_TEST_BIN: |
build/cassandra-integration-tests
build/libscylla-cpp-driver.*
build/libscylladb.*
Comment thread
wprzytula marked this conversation as resolved.
INTEGRATION_TEST_BIN_CACHE_KEY: integration-test-bin-${{ github.sha }}
Comment thread
coderabbitai[bot] marked this conversation as resolved.
# Goes to `Makefile` to let it pickup cached binary
DONT_REBUILD_INTEGRATION_BIN: true
Expand Down
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ option(CASS_USE_STATIC_LIBS "Link static libraries when building executables" OF
option(CASS_USE_STD_ATOMIC "Use std::atomic library" ON)
option(CASS_USE_TIMERFD "Use timerfd (Linux only)" ON)
option(CASS_USE_LIBUV "Use libuv" OFF)
option(CASS_INSTALL_CASSANDRA_COMPAT "Install cassandra compatibility symlinks" ON)

set(CASS_CPP_STANDARD "11" CACHE STRING "C++ standard (11, 14, 17, etc.)")

Expand Down Expand Up @@ -105,12 +106,12 @@ if(CASS_BUILD_EXAMPLES)
endif()

# Determine which driver target should be used as a dependency
set(PROJECT_LIB_NAME_TARGET scylla-cpp-driver)
set(PROJECT_LIB_NAME_TARGET scylladb)
if(CASS_USE_STATIC_LIBS OR
(WIN32 AND (CASS_BUILD_INTEGRATION_TESTS OR CASS_BUILD_UNIT_TESTS)))
set(CASS_USE_STATIC_LIBS ON) # Not all driver internals are exported for test executable (e.g. CASS_EXPORT)
set(CASS_BUILD_STATIC ON)
set(PROJECT_LIB_NAME_TARGET scylla-cpp-driver_static)
set(PROJECT_LIB_NAME_TARGET scylladb_static)
endif()

# Ensure the driver is configured to build
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -564,12 +564,12 @@ test-package-rpm: build-package
$(MAKE) -C $(SMOKE_TEST_DIR) remove-driver-dev-rpm || true; \
$(MAKE) -C $(SMOKE_TEST_DIR) remove-driver-rpm || true; \
$(MAKE) -C $(SMOKE_TEST_DIR) install-driver-dev-rpm; \
pc_file=$$(find /usr -name "scylla-cpp-driver.pc" 2>/dev/null | head -1); \
pc_file=$$(find /usr -name "scylladb.pc" 2>/dev/null | head -1); \
if [ -n "$$pc_file" ]; then \
pc_dir=$$(dirname "$$pc_file"); \
export PKG_CONFIG_PATH="$${pc_dir}:$${PKG_CONFIG_PATH:-}"; \
fi; \
lib_dir=$$(find /usr -name "libscylla-cpp-driver.so*" 2>/dev/null | head -1 | xargs dirname 2>/dev/null || true); \
lib_dir=$$(find /usr -name "libscylladb.so*" 2>/dev/null | head -1 | xargs dirname 2>/dev/null || true); \
if [ -n "$$lib_dir" ]; then \
export LD_LIBRARY_PATH="$${lib_dir}:$${LD_LIBRARY_PATH:-}"; \
fi; \
Expand Down
33 changes: 16 additions & 17 deletions cmake/CMakeCargo.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -19,30 +19,30 @@
# │ │ │ │
# │ OUTPUT: │ │ OUTPUT: │
# │ .../<profile>/ │ │ .../<profile>/ │
# │ libscylla_cpp_driver.a │ │ libscylla_cpp_driver.so │
# │ libscylladb.a │ │ libscylladb.so
# └────────────┬─────────────┘ └──────────────┬───────────────┘
# │ │
# ┌────────────▼─────────────┐ ┌──────────────▼───────────────┐
# │ scylla_cpp_driver │ │ scylla_cpp_driver
# │ scylladb │ │ scylladb
# │ _staticlib_target │ │ _cdylib_target │
# │ (custom target, ALL) │ │ (custom target, ALL) │
# └────────────┬─────────────┘ └──────────────┬───────────────┘
# │ │
# ┌────────────▼─────────────┐ ┌──────────────▼───────────────┐
# │ scylla_cpp_driver │ │ scylla_cpp_driver
# │ scylladb │ │ scylladb
# │ _staticlib │ │ _cdylib │
# │ (STATIC IMPORTED) │ │ (SHARED IMPORTED) │
# │ │ │ │
# │ IMPORTED_LOCATION: │ │ IMPORTED_LOCATION: │
# │ .../<profile>/ │ │ .../<profile>/ │
# │ libscylla_cpp_driver.a │ │ libscylla_cpp_driver.so │
# │ libscylladb.a │ │ libscylladb.so
# └────────────┬─────────────┘ └──────────────┬───────────────┘
# │ │
# $<TARGET_FILE:…> $<TARGET_FILE:…>
# (used by create_copy) (used by create_copy)
# │ │
# ┌────────────▼─────────────┐ ┌──────────────▼───────────────┐
# │ libscylla-cpp-driver │ │ libscylla-cpp-driver
# │ libscylladb │ │ libscylladb
# │ _static.a_copy │ │ .so.X.Y.Z_copy │
# │ (custom target, ALL) │ │ (custom target, ALL) │
# │ │ │ │
Expand All @@ -51,12 +51,12 @@
# └────────────┬─────────────┘ └──────────────┬───────────────┘
# │ │
# ┌────────────▼─────────────┐ ┌──────────────▼───────────────┐
# │ scylla-cpp-driver_static │ │ scylla-cpp-driver
# │ scylladb_static │ │ scylladb
# │ (STATIC IMPORTED) │ │ (SHARED IMPORTED) │
# │ │ │ │
# │ IMPORTED_LOCATION: │ │ IMPORTED_LOCATION: │
# │ build/libscylla-cpp- │ │ build/libscylla-cpp-
# │ driver_static.a │ │ driver.so.X.Y.Z │
# │ build/libscylladb │ │ build/libscylladb
# │ _static.a │ │ .so.X.Y.Z
# └────────────┬─────────────┘ │ │
# │ │ + symlinks: │
# │ │ .so.X → .so.X.Y.Z │
Expand All @@ -80,19 +80,18 @@
# _cdylib_target artifacts; give the build system a
# (custom targets, ALL) named handle to order on.
#
# (3) scylla_cpp_driver_staticlib / IMPORTED targets wrapping the raw cargo
# scylla_cpp_driver_cdylib output paths. Exist solely so that
# (3) scylladb_staticlib / IMPORTED targets wrapping the raw cargo
# scylladb_cdylib output paths. Exist solely so that
# (IMPORTED libraries) create_copy can use $<TARGET_FILE:…>
# generator expressions to get the path.
#
# (4) _copy targets Copy + rename from Cargo's underscore
# (custom targets, ALL) naming (libscylla_cpp_driver.so) to
# conventional C library naming
# (libscylla-cpp-driver.so.X.Y.Z) in
# the build root.
# (4) _copy targets Copy + rename from Cargo's output
# (custom targets, ALL) (libscylladb.so) to versioned naming
# (libscylladb.so.X.Y.Z) in the build
# root.
#
# (5) scylla-cpp-driver_static / Final IMPORTED targets pointing at the
# scylla-cpp-driver renamed copies. These are what the
# (5) scylladb_static / Final IMPORTED targets pointing at the
# scylladb renamed copies. These are what the
# (IMPORTED libraries) rest of the build system links against.
#
# ============================================================================
Expand Down
90 changes: 77 additions & 13 deletions docs/source/topics/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,19 +27,6 @@ Packages are available for some platforms - see the [Installation section](insta

They are available for download from the [Releases][cpp-rs-driver-releases] section.

NOTE: If you have Datastax or ScyllaDB C/C++ Driver installed, you need to remove it first:

```bash
# Ubuntu/Debian:
sudo apt remove cassandra-cpp-driver
sudo apt remove scylla-cpp-driver


# Rocky/RedHat:
sudo dnf remove cassandra-cpp-driver
sudo dnf remove scylla-cpp-driver
```

```bash
# Example: Ubuntu/Debian:
wget https://github.com/scylladb/cpp-rs-driver/releases/download/<LATEST_VERSION>/scylla_cpp_driver_<LATEST_VERSION>_amd64.deb \
Expand All @@ -54,6 +41,83 @@ wget https://github.com/scylladb/cpp-rs-driver/releases/download/<LATEST_VERSION
sudo dnf install -y ./scylla_cpp_driver_<LATEST_VERSION>_x86_64.rpm ./scylla_cpp_driver-devel_<LATEST_VERSION>_x86_64.rpm
```

NOTE: The package is named `scylla-cpp-driver` while the library file is
`libscylladb`. This is intentional — the package name reflects the project,
while the library name follows the convention established by `libcassandra`.

## Linking

### New users

Link with `-lscylladb`, or use pkg-config:

```bash
pkg-config --cflags --libs scylladb # shared
pkg-config --cflags --libs scylladb_static # static
```

CMake example using pkg-config:

```cmake
find_package(PkgConfig REQUIRED)
pkg_check_modules(SCYLLADB REQUIRED IMPORTED_TARGET scylladb)
target_link_libraries(my_app PRIVATE PkgConfig::SCYLLADB)
```

### Upgrading from CPP RS Driver 1.0.x

The library was renamed from `libscylla-cpp-driver` to `libscylladb` in
version 1.1.0. Update your build system accordingly:
Comment thread
wprzytula marked this conversation as resolved.

| What | Old | New |
|-----------------------|----------------------------------|------------------------|
| Shared library | `libscylla-cpp-driver.so` | `libscylladb.so` |
| Static library | `libscylla-cpp-driver_static.a` | `libscylladb_static.a` |
| Linker flag (shared) | `-lscylla-cpp-driver` | `-lscylladb` |
| Linker flag (static) | `-lscylla-cpp-driver_static` | `-lscylladb_static` |
| pkg-config module | `scylla-cpp-driver` | `scylladb` |
| pkg-config (static) | `scylla-cpp-driver_static` | `scylladb_static` |
| SONAME | `libscylla-cpp-driver.so.1` | `libscylladb.so.1` |

Package names (DEB/RPM) remain `scylla-cpp-driver` / `scylla-cpp-driver-dev`.

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 | 🟡 Minor | ⚡ Quick win

Clarify RPM dev package name to avoid migration confusion.

Line 82 currently implies a single -dev dev-package name across DEB/RPM, but this page also shows RPM using -devel. Please split this by distro family (e.g., Debian -dev, RPM -devel) to keep migration instructions accurate.

🧰 Tools
🪛 LanguageTool

[grammar] ~82-~82: Ensure spelling is correct
Context: ... (DEB/RPM) remain scylla-cpp-driver / scylla-cpp-driver-dev. ### Migrating from ScyllaDB CPP Driver (C++ ...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/source/topics/getting-started.md` at line 82, Update the wording around
the dev-package names so Debian and RPM are separated: replace the current
sentence that lists "scylla-cpp-driver / scylla-cpp-driver-dev" with two
distro-family examples (Debian/Ubuntu: scylla-cpp-driver and
scylla-cpp-driver-dev; RPM/Fedora/CentOS: scylla-cpp-driver and
scylla-cpp-driver-devel) and ensure the text references both "-dev" (Debian) and
"-devel" (RPM) explicitly to avoid migration confusion; update any adjacent
examples or package lists that still imply a single "-dev" name so they match
the new split.


### Migrating from ScyllaDB CPP Driver (C++ fork)

The ScyllaDB CPP Driver produced `libscylla-cpp-driver.so` (with a
`libcassandra.so` symlink). The CPP RS Driver replaces it with
`libscylladb.so`. A `libcassandra` compatibility symlink is installed by
default, so builds using `-lcassandra` will continue to work. For new
integrations, prefer `-lscylladb`.

Remove the old driver before installing:

```bash
# Ubuntu/Debian:
sudo apt remove scylla-cpp-driver

# Rocky/RedHat:
sudo dnf remove scylla-cpp-driver
```

### Migrating from DataStax CPP Driver

The DataStax driver produced `libcassandra.so`. The CPP RS Driver installs
a `libcassandra` compatibility symlink and a `cassandra.pc` pkg-config
file, so existing build systems using `-lcassandra` or
`pkg-config cassandra` will work without changes.

For new integrations, prefer `-lscylladb` / `pkg-config scylladb`.

Remove the old driver before installing:

```bash
# Ubuntu/Debian:
sudo apt remove cassandra-cpp-driver

# Rocky/RedHat:
sudo dnf remove cassandra-cpp-driver
```

## Connecting

```c
Expand Down
8 changes: 4 additions & 4 deletions packaging/smoke-test-app/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ get_filename_component(CPP_DRIVER_ROOT "${CMAKE_CURRENT_LIST_DIR}/.." ABSOLUTE)
get_filename_component(CPP_DRIVER_ROOT "${CPP_DRIVER_ROOT}/.." ABSOLUTE)

find_package(PkgConfig REQUIRED)
pkg_check_modules(SCYLLA_CPP_DRIVER REQUIRED IMPORTED_TARGET scylla-cpp-driver)
pkg_check_modules(SCYLLA_CPP_DRIVER REQUIRED IMPORTED_TARGET scylladb)

option(SCYLLA_SMOKE_BUILD_STATIC
"Build statically linked smoke test executable" OFF)
Expand All @@ -19,7 +19,7 @@ if(DEFINED PKG_CONFIG_USE_STATIC_LIBS)
set(_pkg_config_use_static_libs_saved "${PKG_CONFIG_USE_STATIC_LIBS}")
endif()
set(PKG_CONFIG_USE_STATIC_LIBS ON)
pkg_check_modules(SCYLLA_CPP_DRIVER_STATIC IMPORTED_TARGET scylla-cpp-driver_static)
pkg_check_modules(SCYLLA_CPP_DRIVER_STATIC IMPORTED_TARGET scylladb_static)
if(_pkg_config_use_static_libs_saved)
set(PKG_CONFIG_USE_STATIC_LIBS "${_pkg_config_use_static_libs_saved}")
else()
Expand Down Expand Up @@ -191,13 +191,13 @@ if(SCYLLA_SMOKE_BUILD_STATIC)
message(FATAL_ERROR "pkg-config executable not available for static linkage")
endif()
execute_process(
COMMAND ${PKG_CONFIG_EXECUTABLE} --libs --static scylla-cpp-driver_static
COMMAND ${PKG_CONFIG_EXECUTABLE} --libs --static scylladb_static
OUTPUT_VARIABLE _smoke_static_libs_output
RESULT_VARIABLE _smoke_static_libs_result
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(NOT _smoke_static_libs_result EQUAL 0 OR _smoke_static_libs_output STREQUAL "")
message(FATAL_ERROR
"Unable to resolve static link flags from scylla-cpp-driver_static pkg-config metadata")
"Unable to resolve static link flags from scylladb_static pkg-config metadata")
endif()
separate_arguments(_smoke_static_link_libraries UNIX_COMMAND "${_smoke_static_libs_output}")
if(NOT WIN32)
Expand Down
10 changes: 7 additions & 3 deletions packaging/smoke-test-app/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ install-driver-msi:
install-driver-dev-msi: install-driver-msi

verify-driver-dev-msi:
@pwsh.exe -NoProfile -Command "\$$ErrorActionPreference = 'Stop'; \$$installPath = '$(DRIVER_INSTALL_PATH)'; \$$headerPath = Join-Path \$$installPath 'include\cassandra.h'; if (-not (Test-Path \$$headerPath)) { throw 'ERROR: cassandra.h header not found at \$$headerPath - dev package may not be installed' }; \$$pkgConfigPath = Join-Path \$$installPath 'lib\pkgconfig\scylla-cpp-driver.pc'; if (-not (Test-Path \$$pkgConfigPath)) { throw 'ERROR: scylla-cpp-driver.pc not found at \$$pkgConfigPath - dev package may not be installed' }; Write-Host 'Dev package verification successful'"
@pwsh.exe -NoProfile -Command "\$$ErrorActionPreference = 'Stop'; \$$installPath = '$(DRIVER_INSTALL_PATH)'; \$$headerPath = Join-Path \$$installPath 'include\cassandra.h'; if (-not (Test-Path \$$headerPath)) { throw 'ERROR: cassandra.h header not found at \$$headerPath - dev package may not be installed' }; \$$pkgConfigPath = Join-Path \$$installPath 'lib\pkgconfig\scylladb.pc'; if (-not (Test-Path \$$pkgConfigPath)) { throw 'ERROR: scylladb.pc not found at \$$pkgConfigPath - dev package may not be installed' }; Write-Host 'Dev package verification successful'"

ifeq ($(OS_TYPE),macos)
install-driver: install-driver-pkg
Expand Down Expand Up @@ -420,10 +420,14 @@ remove-driver-pkg:

remove-driver-dev-dmg:
sudo rm -f /usr/local/include/cassandra.h 2>/dev/null || true
sudo rm -f /usr/local/lib/pkgconfig/scylla-cpp-driver.pc 2>/dev/null || true
sudo rm -f /usr/local/lib/pkgconfig/scylladb.pc 2>/dev/null || true
sudo rm -f /usr/local/lib/pkgconfig/scylladb_static.pc 2>/dev/null || true
sudo rm -f /usr/local/lib/pkgconfig/cassandra.pc 2>/dev/null || true
sudo rm -f /usr/local/lib/libscylladb_static.a 2>/dev/null || true
sudo rm -f /usr/local/lib/libcassandra.* 2>/dev/null || true

remove-driver-dmg:
Comment thread
wprzytula marked this conversation as resolved.
sudo rm -f /usr/local/lib/libscylla-cpp-driver.* 2>/dev/null || true
sudo rm -f /usr/local/lib/libscylladb.* 2>/dev/null || true

remove-app-dmg:
sudo rm -f /usr/local/bin/scylla-cpp-driver-smoke-test 2>/dev/null || true
Expand Down
Loading
Loading