From 58458db7b58fd42ec4e2641d37277ed1be6ba21f Mon Sep 17 00:00:00 2001 From: Tom Scogland Date: Mon, 4 Nov 2024 12:15:39 -0800 Subject: [PATCH] intern: fold into fluxion-data and version the so problem: the libintern so wasn't being versioned, causing problems on upgrades, see https://github.com/flux-framework/flux-sched/issues/1308 solution: the real dependency should be on libfluxion-data anyway, which was closer to how we wanted it. The libintern library is now built static, linked into libfluxion-data, and provided that way. Additionally, the libfluxion-data library is installed as `libfluxion-data.so.{version without git suffix}` and linked as `libfluxion-data.so.{version major}.{version minor}` with no unsuffixed link installed. --- qmanager/modules/CMakeLists.txt | 1 - resource/CMakeLists.txt | 11 ++++++++--- resource/libjobspec/CMakeLists.txt | 3 +-- resource/modules/CMakeLists.txt | 1 - src/common/libintern/CMakeLists.txt | 4 +--- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/qmanager/modules/CMakeLists.txt b/qmanager/modules/CMakeLists.txt index a6cd40a6c..36615d8ee 100644 --- a/qmanager/modules/CMakeLists.txt +++ b/qmanager/modules/CMakeLists.txt @@ -10,6 +10,5 @@ target_link_libraries(sched-fluxion-qmanager PRIVATE flux::core flux::schedutil PkgConfig::JANSSON - intern cppwrappers ) diff --git a/resource/CMakeLists.txt b/resource/CMakeLists.txt index 2ab5b922b..625be874c 100644 --- a/resource/CMakeLists.txt +++ b/resource/CMakeLists.txt @@ -1,5 +1,12 @@ add_library(fluxion-data SHARED schema/data_std.cpp) -install(TARGETS fluxion-data LIBRARY) +target_link_libraries(fluxion-data PRIVATE + intern + ) +set_target_properties(fluxion-data PROPERTIES + VERSION ${PROJECT_VERSION} + SOVERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} + ) +install(TARGETS fluxion-data LIBRARY NAMELINK_SKIP) add_subdirectory(libjobspec) add_subdirectory(planner) set(RESOURCE_HEADERS @@ -77,7 +84,6 @@ add_library(resource STATIC target_include_directories(resource PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) target_link_libraries(resource PRIVATE planner - intern ) target_link_libraries(resource PUBLIC flux::hostlist @@ -87,7 +93,6 @@ target_link_libraries(resource PUBLIC PkgConfig::UUID Boost::graph jobspec_conv - fluxion-data ) add_sanitizers(resource) diff --git a/resource/libjobspec/CMakeLists.txt b/resource/libjobspec/CMakeLists.txt index 7a4f2a8c9..b8e0aa9e7 100644 --- a/resource/libjobspec/CMakeLists.txt +++ b/resource/libjobspec/CMakeLists.txt @@ -13,7 +13,6 @@ add_sanitizers(jobspec_conv) target_link_libraries(jobspec_conv PUBLIC flux::hostlist flux::idset flux::core yaml-cpp PkgConfig::JANSSON PkgConfig::UUID - intern fluxion-data ) @@ -26,5 +25,5 @@ target_link_libraries(flux-jobspec-validate PRIVATE jobspec_conv) add_executable(test_constraint.t test/constraint.cpp) add_sanitizers(test_constraint.t) -target_link_libraries(test_constraint.t jobspec_conv libtap intern) +target_link_libraries(test_constraint.t jobspec_conv libtap) flux_add_test(NAME test_constraint COMMAND test_constraint.t) diff --git a/resource/modules/CMakeLists.txt b/resource/modules/CMakeLists.txt index 915d526cf..bbf43989f 100644 --- a/resource/modules/CMakeLists.txt +++ b/resource/modules/CMakeLists.txt @@ -7,6 +7,5 @@ target_link_libraries (sched-fluxion-resource PRIVATE resource PkgConfig::JANSSON PkgConfig::UUID - intern cppwrappers ) diff --git a/src/common/libintern/CMakeLists.txt b/src/common/libintern/CMakeLists.txt index ec2bc19d0..2eb657831 100644 --- a/src/common/libintern/CMakeLists.txt +++ b/src/common/libintern/CMakeLists.txt @@ -1,7 +1,5 @@ -add_library(intern SHARED +add_library(intern STATIC interner.cpp) -install(TARGETS intern - LIBRARY) add_executable(interned_string_test test/interned_string_test.cpp) add_sanitizers(interned_string_test)