mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-18 10:05:51 +00:00
SOCI is the C++ database access library. The SOCI recipe was updated in
Conan Center Index (CCI), and it breaks for our choice of options. This
breakage occurs when you build with a fresh Conan cache (e.g. when you
submit a PR, or delete `~/.conan/data`).
* Add a custom Conan recipe for SOCI v4.0.3
* Update dependency building to handle exporting and installing Snappy
and SOCI
* Fix workflows to use custom SOCI recipe
* Update BUILD.md to include instruction for exporting the SOCI Conan
recipe:
* `conan export external/soci soci/4.0.3@`
This solution has been verified on Ubuntu 20.04 and macOS.
Context:
* There is a compiler error that the `sqlite3.h` header is not available
when building soci.
* When package B depends on package A, it finds the pieces it needs by
importing the Package Configuration File (PCF) that Conan generates
for package A.
* Read the CMake written by package B to check that it is importing
the PCF correctly and linking its exports correctly.
* Since this can be difficult, it is often more efficient to check
https://github.com/conan-io/conan-center-index/issues for package B
to see if anyone else has seen a similar problem.
* One of the issues points to a problem area in soci's CMake. To
confirm the diagnosis, review soci's CMake (after any patches are
applied) in the Conan build directory `build/$buildId/src/`.
* Review the Conan-generated PCF in
`build/$buildId/build/$buildType/generators/`.
* In this case, the problem was likely (re)introduced by
https://github.com/conan-io/conan-center-index/pull/17026
* If there is a problem in the source or in the Conan recipe, the
fastest fix is to copy the recipe and either:
* Add a source patch to fix any problems in the source.
* Change the recipe to fix any problems in the recipe.
* In this case, this can be done by finding soci's Conan recipe at
https://github.com/conan-io/conan-center-index/tree/master/recipes/soci
and then copying the `all` directory as `external/$packageName` in our
project. Then, make any changes.
* Test packages can be removed from the recipe folder as they are not
needed.
* If adding a patch in the `patches` directory, add a description for
it to `conandata.yml`.
* Since `conanfile.py` has no `version` property on the recipe class,
builders need to pass a version on the command line (like they do
for our `snappy` recipe).
* Add an example command to `BUILD.md`.
Future work: It may make sense to refer to recipes by revision, by
checking in a lockfile.
40 lines
1.2 KiB
Diff
40 lines
1.2 KiB
Diff
From d491bf7b5040d314ffd0c6310ba01f78ff44c85e Mon Sep 17 00:00:00 2001
|
|
From: Rasmus Thomsen <rasmus.thomsen@dampsoft.de>
|
|
Date: Fri, 14 Apr 2023 09:16:29 +0200
|
|
Subject: [PATCH] Remove hardcoded INSTALL_NAME_DIR for relocatable libraries
|
|
on MacOS
|
|
|
|
---
|
|
cmake/SociBackend.cmake | 2 +-
|
|
src/core/CMakeLists.txt | 1 -
|
|
2 files changed, 1 insertion(+), 2 deletions(-)
|
|
|
|
diff --git a/cmake/SociBackend.cmake b/cmake/SociBackend.cmake
|
|
index 5d4ef0df..39fe1f77 100644
|
|
--- a/cmake/SociBackend.cmake
|
|
+++ b/cmake/SociBackend.cmake
|
|
@@ -171,7 +171,7 @@ macro(soci_backend NAME)
|
|
set_target_properties(${THIS_BACKEND_TARGET}
|
|
PROPERTIES
|
|
SOVERSION ${${PROJECT_NAME}_SOVERSION}
|
|
- INSTALL_NAME_DIR ${CMAKE_INSTALL_PREFIX}/lib)
|
|
+ )
|
|
|
|
if(APPLE)
|
|
set_target_properties(${THIS_BACKEND_TARGET}
|
|
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
|
|
index 3e7deeae..f9eae564 100644
|
|
--- a/src/core/CMakeLists.txt
|
|
+++ b/src/core/CMakeLists.txt
|
|
@@ -59,7 +59,6 @@ if (SOCI_SHARED)
|
|
PROPERTIES
|
|
VERSION ${SOCI_VERSION}
|
|
SOVERSION ${SOCI_SOVERSION}
|
|
- INSTALL_NAME_DIR ${CMAKE_INSTALL_PREFIX}/lib
|
|
CLEAN_DIRECT_OUTPUT 1)
|
|
endif()
|
|
|
|
--
|
|
2.25.1
|
|
|