FS#66195 - [rocksdb] CMake reports .a file missing when using rocksdb's find module

Attached to Project: Arch Linux
Opened by Yonggang Li (gnaggnoyil) - Friday, 10 April 2020, 09:17 GMT
Last edited by Toolybird (Toolybird) - Tuesday, 26 September 2023, 06:04 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Anatol Pomozov (anatolik)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Currently CMake find_package configuration file of rocksdb packge adds a non-existent static library file to a CMake target, as shown in line 8-13 of `/usr/lib64/cmake/rocksdb/RocksDBTargets-release.cmake`:

```
# Import target "RocksDB::rocksdb" for configuration "Release"
set_property(TARGET RocksDB::rocksdb APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
set_target_properties(RocksDB::rocksdb PROPERTIES
IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "CXX"
IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/librocksdb.a"
)
```

Therefore, if we run a project with CMakeLists.txt like the following:

```
cmake_minimum_required(VERSION 3.10 FATAL_ERROR)

project(test_proj1)

find_package(RocksDB CONFIG REQUIRED)

add_executable(test1 test1.cpp)
target_link_libraries(test1 RocksDB::rocksdb)
```

The following error messages would be reported:

```
CMake Error at /usr/lib64/cmake/rocksdb/RocksDBTargets.cmake:96 (message):
The imported target "RocksDB::rocksdb" references the file

"/usr/lib/librocksdb.a"

but this file does not exist. Possible reasons include:

* The file was deleted, renamed, or moved to another location.

* An install or uninstall procedure did not complete successfully.

* The installation package was faulty and contained

"/usr/lib64/cmake/rocksdb/RocksDBTargets.cmake"

but not all the files it references.

Call Stack (most recent call first):
/usr/lib64/cmake/rocksdb/RocksDBConfig.cmake:36 (include)
CMakeLists.txt:5 (find_package)


-- Configuring incomplete, errors occurred!
```
This task depends upon

Closed by  Toolybird (Toolybird)
Tuesday, 26 September 2023, 06:04 GMT
Reason for closing:  Won't fix
Additional comments about closing:  cmake build was dropped in 6.23.3
Comment by Anatol Pomozov (anatolik) - Saturday, 11 April 2020, 22:05 GMT
That's because Arch Linux provides shared libraries only and does not have *.a static libs.

I would say rocksdb's CMake files should check whether one of *.so or *.a files present in the system and uses it for compilation. But rocksdb seems wants both types of libraries at the filesystem. I would talk to rocksdb upstream to clarify if such behavior is intended.

Also note that CMake for rocksdb is not going to work as the package dependencies (such as zstd package and probably more) do not have CMake files currently.
Comment by Buggy McBugFace (bugbot) - Tuesday, 08 August 2023, 19:11 GMT
This is an automated comment as this bug is open for more then 2 years. Please reply if you still experience this bug otherwise this issue will be closed after 1 month.

Loading...