Skip to content

fixup: dll name mismatch on windows#452

Open
MaikeR-TV wants to merge 1 commit into
scylladb:masterfrom
MaikeR-TV:fixSharedLibNameMismatch
Open

fixup: dll name mismatch on windows#452
MaikeR-TV wants to merge 1 commit into
scylladb:masterfrom
MaikeR-TV:fixSharedLibNameMismatch

Conversation

@MaikeR-TV
Copy link
Copy Markdown
Contributor

Since cargo_build produces scylla_cpp_driver.dll and .lib on shared build, when the "INSTALL_NAME"s are changed to scylla-cpp-driver, this will lead to "dll not found" errors when trying to run the final executable. While after the build, we could rename the dll again to circumvent the startup issue, this leaves a Conan CMakeDeps warning

fixes: -- DLL library not found, creating UNKNOWN IMPORTED target, searched for: scylla-cpp-driver
fixes: dll not found on startup

Pre-review checklist

  • I have split my patch into logically separate commits.
  • All commit messages clearly explain what they change and why.
  • PR description sums up the changes and reasons why they should be introduced.
  • I have implemented Rust unit tests for the features/changes introduced.
  • I have enabled appropriate tests in Makefile in {SCYLLA,CASSANDRA}_(NO_VALGRIND_)TEST_FILTER.
  • I added appropriate Fixes: annotations to PR description.

Since cargo_build produces scylla_cpp_driver.dll and .lib on shared build, when the "INSTALL_NAME"s are changed to scylla-cpp-driver, this will lead to "dll not found" errors when trying to run the final executable.
While after the build, we could rename the dll again to circumvent the startup issue, this causes other issues (like pdb mismatch upon debugging).
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Fixes Windows DLL naming mismatch where cargo_build produces scylla_cpp_driver.dll/.lib (with underscores) but the install names used hyphens, causing "dll not found" runtime errors and a Conan CMakeDeps warning.

Changes:

  • Update Windows INSTALL_NAME_SHARED and INSTALL_NAME_SHARED_IMPLIB to use underscores matching cargo's output.
  • Add a comment explaining the naming requirement.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The naming for libraries with the legacy cpp-driver used hyphens. As we wanted to preserve compatibility, cpp-rs-driver uses hyphens too.

The problem is, cargo outputs dynamic libraries normalized to underscores (not hyphens). Then we copy-rename the artifacts to ones with hyphens.

For Linux, this works because .SONAME is set correctly to hyphens. See readelf output:
0x000000000000000e (SONAME) Library soname: [libscylla-cpp-driver.so.1]

Windows doesn't have an equivalent of .SONAME, and the name the linker uses seems to be determined by the original cargo output (with underscores), not by the copied target (with hyphens).

Your fix breaks the assumption that the artifacts use hyphens, which is most likely a deviation from cpp-driver. Also, it introduces discrepancy between Windows (underscores) and Linux (hyphens).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@MaikeR-TV WDYT?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I understand that having differences between different OS and also between the old vs. new driver is problematic.
For us though, the rename seems to break the conan-cmake integration flow into our apps.

Since cargo doesn't support names with hyphens, we'll need to find another solution.
Could make this change configurable to allow the name to be overwritten.

Copy link
Copy Markdown
Contributor

@wprzytula wprzytula May 22, 2026

Choose a reason for hiding this comment

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

We're considering breaking the backwards naming compatibility by changing the library name for all platforms to scylla or scylladb, similarly to the original driver's name (cassandra). So no hyphens nor underscores.
Do you think this will affect users badly? Will switching the library name be mostly seamless?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

For us it should work just fine with a different name as long as the correct name is set in cmake so it can be resolved by conan.

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.

3 participants