Skip to content

Commit ead94af

Browse files
authored
Rename lib to scylladb (scylladb#472)
Fixes: scylladb#464 ## Summary Rename the library artifact from `libscylla-cpp-driver` to `libscylladb`, eliminating both hyphens and underscores from the name. This fixes the Windows DLL naming mismatch (scylladb#452) where the import library internally referenced Cargo's underscore output (`scylla_cpp_driver.dll`) while the installed file used hyphens (`scylla-cpp-driver.dll`), causing "dll not found" errors at runtime. The new name `scylladb` is consistent with the original DataStax driver's convention (`cassandra`) and works cleanly across all platforms. ## Commits 1. **Rename library from scylla-cpp-driver to scylladb** Core rename: Cargo.toml `[lib] name`, all CMake naming (INSTALL_NAME variables, SONAME, targets), pkg-config files (now `scylladb.pc` / `scylladb_static.pc`), CI workflow, and Makefiles. Package names (DEB/RPM) intentionally remain `scylla-cpp-driver`. 2. **Add cassandra compatibility symlinks** Install `libcassandra.so` -> `libscylladb.so`, `libcassandra_static.a` -> `libscylladb_static.a`, and a `cassandra.pc` pkg-config file. Controlled by `CASS_INSTALL_CASSANDRA_COMPAT` (ON by default). This eases migration from the DataStax CPP Driver where users link with `-lcassandra`. 3. **smoke-test: Remove all dev artifacts in DMG cleanup** The remove-driver-dev-dmg target was missing removal of `scylladb_static.pc` and `libscylladb_static.a`, which could leave stale files under `/usr/local` between smoke-test runs. 4. **Document library naming and migration paths** Add a "Linking" section to `getting-started.md` covering new users, upgraders from CPP RS 1.0.x, migrators from ScyllaDB CPP Driver, and migrators from DataStax CPP Driver. Includes a mapping table of old vs. new names and a note explaining the package-vs-library name discrepancy. ## Migration impact - **API/ABI**: Unchanged. Only the library filename and pkg-config module name change. - **Build systems**: Users must update linker flags (`-lscylladb` instead of `-lscylla-cpp-driver`) and pkg-config invocations. - **DataStax migrators**: No action needed thanks to `libcassandra` symlinks. - **Package names**: Unchanged (`scylla-cpp-driver`, `scylla-cpp-driver-dev`).
2 parents 1253dd5 + c7e037b commit ead94af

16 files changed

Lines changed: 229 additions & 120 deletions

File tree

.github/workflows/build-lint-and-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ env:
1111
RUST_BACKTRACE: full
1212
RUST_LOG: trace
1313
# Should include `INTEGRATION_TEST_BIN` from the `Makefile`
14-
# TODO: Remove `build/libscylla-cpp-driver.*` after https://github.com/scylladb/cpp-rs-driver/issues/164 is fixed.
14+
# TODO: Remove `build/libscylladb.*` after https://github.com/scylladb/cpp-rs-driver/issues/164 is fixed.
1515
INTEGRATION_TEST_BIN: |
1616
build/cassandra-integration-tests
17-
build/libscylla-cpp-driver.*
17+
build/libscylladb.*
1818
INTEGRATION_TEST_BIN_CACHE_KEY: integration-test-bin-${{ github.sha }}
1919
# Goes to `Makefile` to let it pickup cached binary
2020
DONT_REBUILD_INTEGRATION_BIN: true

CMakeLists.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ option(CASS_USE_STATIC_LIBS "Link static libraries when building executables" OF
6666
option(CASS_USE_STD_ATOMIC "Use std::atomic library" ON)
6767
option(CASS_USE_TIMERFD "Use timerfd (Linux only)" ON)
6868
option(CASS_USE_LIBUV "Use libuv" OFF)
69+
option(CASS_INSTALL_CASSANDRA_COMPAT "Install cassandra compatibility symlinks" ON)
6970

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

@@ -105,12 +106,12 @@ if(CASS_BUILD_EXAMPLES)
105106
endif()
106107

107108
# Determine which driver target should be used as a dependency
108-
set(PROJECT_LIB_NAME_TARGET scylla-cpp-driver)
109+
set(PROJECT_LIB_NAME_TARGET scylladb)
109110
if(CASS_USE_STATIC_LIBS OR
110111
(WIN32 AND (CASS_BUILD_INTEGRATION_TESTS OR CASS_BUILD_UNIT_TESTS)))
111112
set(CASS_USE_STATIC_LIBS ON) # Not all driver internals are exported for test executable (e.g. CASS_EXPORT)
112113
set(CASS_BUILD_STATIC ON)
113-
set(PROJECT_LIB_NAME_TARGET scylla-cpp-driver_static)
114+
set(PROJECT_LIB_NAME_TARGET scylladb_static)
114115
endif()
115116

116117
# Ensure the driver is configured to build

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -564,12 +564,12 @@ test-package-rpm: build-package
564564
$(MAKE) -C $(SMOKE_TEST_DIR) remove-driver-dev-rpm || true; \
565565
$(MAKE) -C $(SMOKE_TEST_DIR) remove-driver-rpm || true; \
566566
$(MAKE) -C $(SMOKE_TEST_DIR) install-driver-dev-rpm; \
567-
pc_file=$$(find /usr -name "scylla-cpp-driver.pc" 2>/dev/null | head -1); \
567+
pc_file=$$(find /usr -name "scylladb.pc" 2>/dev/null | head -1); \
568568
if [ -n "$$pc_file" ]; then \
569569
pc_dir=$$(dirname "$$pc_file"); \
570570
export PKG_CONFIG_PATH="$${pc_dir}:$${PKG_CONFIG_PATH:-}"; \
571571
fi; \
572-
lib_dir=$$(find /usr -name "libscylla-cpp-driver.so*" 2>/dev/null | head -1 | xargs dirname 2>/dev/null || true); \
572+
lib_dir=$$(find /usr -name "libscylladb.so*" 2>/dev/null | head -1 | xargs dirname 2>/dev/null || true); \
573573
if [ -n "$$lib_dir" ]; then \
574574
export LD_LIBRARY_PATH="$${lib_dir}:$${LD_LIBRARY_PATH:-}"; \
575575
fi; \

cmake/CMakeCargo.cmake

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -19,30 +19,30 @@
1919
# │ │ │ │
2020
# │ OUTPUT: │ │ OUTPUT: │
2121
# │ .../<profile>/ │ │ .../<profile>/ │
22-
#libscylla_cpp_driver.a │ │ libscylla_cpp_driver.so │
22+
#libscylladb.a │ │ libscylladb.so
2323
# └────────────┬─────────────┘ └──────────────┬───────────────┘
2424
# │ │
2525
# ┌────────────▼─────────────┐ ┌──────────────▼───────────────┐
26-
#scylla_cpp_driver │ │ scylla_cpp_driver
26+
#scylladb │ │ scylladb
2727
# │ _staticlib_target │ │ _cdylib_target │
2828
# │ (custom target, ALL) │ │ (custom target, ALL) │
2929
# └────────────┬─────────────┘ └──────────────┬───────────────┘
3030
# │ │
3131
# ┌────────────▼─────────────┐ ┌──────────────▼───────────────┐
32-
#scylla_cpp_driver │ │ scylla_cpp_driver
32+
#scylladb │ │ scylladb
3333
# │ _staticlib │ │ _cdylib │
3434
# │ (STATIC IMPORTED) │ │ (SHARED IMPORTED) │
3535
# │ │ │ │
3636
# │ IMPORTED_LOCATION: │ │ IMPORTED_LOCATION: │
3737
# │ .../<profile>/ │ │ .../<profile>/ │
38-
#libscylla_cpp_driver.a │ │ libscylla_cpp_driver.so │
38+
#libscylladb.a │ │ libscylladb.so
3939
# └────────────┬─────────────┘ └──────────────┬───────────────┘
4040
# │ │
4141
# $<TARGET_FILE:…> $<TARGET_FILE:…>
4242
# (used by create_copy) (used by create_copy)
4343
# │ │
4444
# ┌────────────▼─────────────┐ ┌──────────────▼───────────────┐
45-
#libscylla-cpp-driver │ │ libscylla-cpp-driver
45+
#libscylladb │ │ libscylladb
4646
# │ _static.a_copy │ │ .so.X.Y.Z_copy │
4747
# │ (custom target, ALL) │ │ (custom target, ALL) │
4848
# │ │ │ │
@@ -51,12 +51,12 @@
5151
# └────────────┬─────────────┘ └──────────────┬───────────────┘
5252
# │ │
5353
# ┌────────────▼─────────────┐ ┌──────────────▼───────────────┐
54-
#scylla-cpp-driver_static │ │ scylla-cpp-driver
54+
#scylladb_static │ │ scylladb
5555
# │ (STATIC IMPORTED) │ │ (SHARED IMPORTED) │
5656
# │ │ │ │
5757
# │ IMPORTED_LOCATION: │ │ IMPORTED_LOCATION: │
58-
# │ build/libscylla-cpp- │ │ build/libscylla-cpp-
59-
#driver_static.a │ │ driver.so.X.Y.Z │
58+
# │ build/libscylladb │ │ build/libscylladb
59+
#_static.a │ │ .so.X.Y.Z
6060
# └────────────┬─────────────┘ │ │
6161
# │ │ + symlinks: │
6262
# │ │ .so.X → .so.X.Y.Z │
@@ -80,19 +80,18 @@
8080
# _cdylib_target artifacts; give the build system a
8181
# (custom targets, ALL) named handle to order on.
8282
#
83-
# (3) scylla_cpp_driver_staticlib / IMPORTED targets wrapping the raw cargo
84-
# scylla_cpp_driver_cdylib output paths. Exist solely so that
83+
# (3) scylladb_staticlib / IMPORTED targets wrapping the raw cargo
84+
# scylladb_cdylib output paths. Exist solely so that
8585
# (IMPORTED libraries) create_copy can use $<TARGET_FILE:…>
8686
# generator expressions to get the path.
8787
#
88-
# (4) _copy targets Copy + rename from Cargo's underscore
89-
# (custom targets, ALL) naming (libscylla_cpp_driver.so) to
90-
# conventional C library naming
91-
# (libscylla-cpp-driver.so.X.Y.Z) in
92-
# the build root.
88+
# (4) _copy targets Copy + rename from Cargo's output
89+
# (custom targets, ALL) (libscylladb.so) to versioned naming
90+
# (libscylladb.so.X.Y.Z) in the build
91+
# root.
9392
#
94-
# (5) scylla-cpp-driver_static / Final IMPORTED targets pointing at the
95-
# scylla-cpp-driver renamed copies. These are what the
93+
# (5) scylladb_static / Final IMPORTED targets pointing at the
94+
# scylladb renamed copies. These are what the
9695
# (IMPORTED libraries) rest of the build system links against.
9796
#
9897
# ============================================================================

docs/source/topics/getting-started.md

Lines changed: 77 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,6 @@ Packages are available for some platforms - see the [Installation section](insta
2727

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

30-
NOTE: If you have Datastax or ScyllaDB C/C++ Driver installed, you need to remove it first:
31-
32-
```bash
33-
# Ubuntu/Debian:
34-
sudo apt remove cassandra-cpp-driver
35-
sudo apt remove scylla-cpp-driver
36-
37-
38-
# Rocky/RedHat:
39-
sudo dnf remove cassandra-cpp-driver
40-
sudo dnf remove scylla-cpp-driver
41-
```
42-
4330
```bash
4431
# Example: Ubuntu/Debian:
4532
wget https://github.com/scylladb/cpp-rs-driver/releases/download/<LATEST_VERSION>/scylla_cpp_driver_<LATEST_VERSION>_amd64.deb \
@@ -54,6 +41,83 @@ wget https://github.com/scylladb/cpp-rs-driver/releases/download/<LATEST_VERSION
5441
sudo dnf install -y ./scylla_cpp_driver_<LATEST_VERSION>_x86_64.rpm ./scylla_cpp_driver-devel_<LATEST_VERSION>_x86_64.rpm
5542
```
5643

44+
NOTE: The package is named `scylla-cpp-driver` while the library file is
45+
`libscylladb`. This is intentional — the package name reflects the project,
46+
while the library name follows the convention established by `libcassandra`.
47+
48+
## Linking
49+
50+
### New users
51+
52+
Link with `-lscylladb`, or use pkg-config:
53+
54+
```bash
55+
pkg-config --cflags --libs scylladb # shared
56+
pkg-config --cflags --libs scylladb_static # static
57+
```
58+
59+
CMake example using pkg-config:
60+
61+
```cmake
62+
find_package(PkgConfig REQUIRED)
63+
pkg_check_modules(SCYLLADB REQUIRED IMPORTED_TARGET scylladb)
64+
target_link_libraries(my_app PRIVATE PkgConfig::SCYLLADB)
65+
```
66+
67+
### Upgrading from CPP RS Driver 1.0.x
68+
69+
The library was renamed from `libscylla-cpp-driver` to `libscylladb` in
70+
version 1.1.0. Update your build system accordingly:
71+
72+
| What | Old | New |
73+
|-----------------------|----------------------------------|------------------------|
74+
| Shared library | `libscylla-cpp-driver.so` | `libscylladb.so` |
75+
| Static library | `libscylla-cpp-driver_static.a` | `libscylladb_static.a` |
76+
| Linker flag (shared) | `-lscylla-cpp-driver` | `-lscylladb` |
77+
| Linker flag (static) | `-lscylla-cpp-driver_static` | `-lscylladb_static` |
78+
| pkg-config module | `scylla-cpp-driver` | `scylladb` |
79+
| pkg-config (static) | `scylla-cpp-driver_static` | `scylladb_static` |
80+
| SONAME | `libscylla-cpp-driver.so.1` | `libscylladb.so.1` |
81+
82+
Package names (DEB/RPM) remain `scylla-cpp-driver` / `scylla-cpp-driver-dev`.
83+
84+
### Migrating from ScyllaDB CPP Driver (C++ fork)
85+
86+
The ScyllaDB CPP Driver produced `libscylla-cpp-driver.so` (with a
87+
`libcassandra.so` symlink). The CPP RS Driver replaces it with
88+
`libscylladb.so`. A `libcassandra` compatibility symlink is installed by
89+
default, so builds using `-lcassandra` will continue to work. For new
90+
integrations, prefer `-lscylladb`.
91+
92+
Remove the old driver before installing:
93+
94+
```bash
95+
# Ubuntu/Debian:
96+
sudo apt remove scylla-cpp-driver
97+
98+
# Rocky/RedHat:
99+
sudo dnf remove scylla-cpp-driver
100+
```
101+
102+
### Migrating from DataStax CPP Driver
103+
104+
The DataStax driver produced `libcassandra.so`. The CPP RS Driver installs
105+
a `libcassandra` compatibility symlink and a `cassandra.pc` pkg-config
106+
file, so existing build systems using `-lcassandra` or
107+
`pkg-config cassandra` will work without changes.
108+
109+
For new integrations, prefer `-lscylladb` / `pkg-config scylladb`.
110+
111+
Remove the old driver before installing:
112+
113+
```bash
114+
# Ubuntu/Debian:
115+
sudo apt remove cassandra-cpp-driver
116+
117+
# Rocky/RedHat:
118+
sudo dnf remove cassandra-cpp-driver
119+
```
120+
57121
## Connecting
58122

59123
```c

packaging/smoke-test-app/CMakeLists.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ get_filename_component(CPP_DRIVER_ROOT "${CMAKE_CURRENT_LIST_DIR}/.." ABSOLUTE)
99
get_filename_component(CPP_DRIVER_ROOT "${CPP_DRIVER_ROOT}/.." ABSOLUTE)
1010

1111
find_package(PkgConfig REQUIRED)
12-
pkg_check_modules(SCYLLA_CPP_DRIVER REQUIRED IMPORTED_TARGET scylla-cpp-driver)
12+
pkg_check_modules(SCYLLA_CPP_DRIVER REQUIRED IMPORTED_TARGET scylladb)
1313

1414
option(SCYLLA_SMOKE_BUILD_STATIC
1515
"Build statically linked smoke test executable" OFF)
@@ -19,7 +19,7 @@ if(DEFINED PKG_CONFIG_USE_STATIC_LIBS)
1919
set(_pkg_config_use_static_libs_saved "${PKG_CONFIG_USE_STATIC_LIBS}")
2020
endif()
2121
set(PKG_CONFIG_USE_STATIC_LIBS ON)
22-
pkg_check_modules(SCYLLA_CPP_DRIVER_STATIC IMPORTED_TARGET scylla-cpp-driver_static)
22+
pkg_check_modules(SCYLLA_CPP_DRIVER_STATIC IMPORTED_TARGET scylladb_static)
2323
if(_pkg_config_use_static_libs_saved)
2424
set(PKG_CONFIG_USE_STATIC_LIBS "${_pkg_config_use_static_libs_saved}")
2525
else()
@@ -191,13 +191,13 @@ if(SCYLLA_SMOKE_BUILD_STATIC)
191191
message(FATAL_ERROR "pkg-config executable not available for static linkage")
192192
endif()
193193
execute_process(
194-
COMMAND ${PKG_CONFIG_EXECUTABLE} --libs --static scylla-cpp-driver_static
194+
COMMAND ${PKG_CONFIG_EXECUTABLE} --libs --static scylladb_static
195195
OUTPUT_VARIABLE _smoke_static_libs_output
196196
RESULT_VARIABLE _smoke_static_libs_result
197197
OUTPUT_STRIP_TRAILING_WHITESPACE)
198198
if(NOT _smoke_static_libs_result EQUAL 0 OR _smoke_static_libs_output STREQUAL "")
199199
message(FATAL_ERROR
200-
"Unable to resolve static link flags from scylla-cpp-driver_static pkg-config metadata")
200+
"Unable to resolve static link flags from scylladb_static pkg-config metadata")
201201
endif()
202202
separate_arguments(_smoke_static_link_libraries UNIX_COMMAND "${_smoke_static_libs_output}")
203203
if(NOT WIN32)

packaging/smoke-test-app/Makefile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ install-driver-msi:
342342
install-driver-dev-msi: install-driver-msi
343343

344344
verify-driver-dev-msi:
345-
@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'"
345+
@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'"
346346

347347
ifeq ($(OS_TYPE),macos)
348348
install-driver: install-driver-pkg
@@ -420,10 +420,14 @@ remove-driver-pkg:
420420

421421
remove-driver-dev-dmg:
422422
sudo rm -f /usr/local/include/cassandra.h 2>/dev/null || true
423-
sudo rm -f /usr/local/lib/pkgconfig/scylla-cpp-driver.pc 2>/dev/null || true
423+
sudo rm -f /usr/local/lib/pkgconfig/scylladb.pc 2>/dev/null || true
424+
sudo rm -f /usr/local/lib/pkgconfig/scylladb_static.pc 2>/dev/null || true
425+
sudo rm -f /usr/local/lib/pkgconfig/cassandra.pc 2>/dev/null || true
426+
sudo rm -f /usr/local/lib/libscylladb_static.a 2>/dev/null || true
427+
sudo rm -f /usr/local/lib/libcassandra.* 2>/dev/null || true
424428

425429
remove-driver-dmg:
426-
sudo rm -f /usr/local/lib/libscylla-cpp-driver.* 2>/dev/null || true
430+
sudo rm -f /usr/local/lib/libscylladb.* 2>/dev/null || true
427431

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

0 commit comments

Comments
 (0)