From 3491f90ac3d43d6c1116e41f9e7c45757b10bb1c Mon Sep 17 00:00:00 2001 From: Noah Oblath Date: Mon, 22 Jan 2024 16:49:04 -0800 Subject: [PATCH 01/12] Add Pybind11 for when we need it --- CMakeLists.txt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index e5aec70b..05e6e9e6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -55,6 +55,20 @@ add_definitions( -DDL_MAX_PAYLOAD_SIZE=${Dripline_MAX_PAYLOAD_SIZE} ) set( PUBLIC_EXT_LIBS ) set( PRIVATE_EXT_LIBS ) +# Pybind11 +if( Dripline_BUILD_PYTHON ) + find_package( Python3 REQUIRED COMPONENTS Interpreter Development ) + set(PYBIND11_PYTHON_VERSION ${Python3_VERSION} CACHE STRING "") + find_package( pybind11 REQUIRED ) + #if( TARGET Python3::Python ) + # message( STATUS "%%%%% Found Python::Python" ) + #else() + # message( STATUS "%%%%% Did NOT find Python::Python" ) + #endif() + include_directories( ${Python3_INCLUDE_DIRS} ) + list( APPEND PUBLIC_EXT_LIBS pybind11::module ) +endif( Dripline_BUILD_PYTHON ) + # Threads are required by: test_scheduler if( Dripline_ENABLE_TESTING ) find_package( Threads REQUIRED ) From 20722e249ba160d1cfb47604a61bba7c3e5a6a3e Mon Sep 17 00:00:00 2001 From: Noah Oblath Date: Mon, 22 Jan 2024 16:51:03 -0800 Subject: [PATCH 02/12] Updated Scarab. Hotfix 3.9.7 branch --- scarab | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scarab b/scarab index ed2e68f1..330adc3d 160000 --- a/scarab +++ b/scarab @@ -1 +1 @@ -Subproject commit ed2e68f1f9b36ea343801b674c0bb1139af4a99d +Subproject commit 330adc3d084bf3bd752c62e434b573b1943c2f68 From 54668e5547ef0bd1b0090f0044c2db1808505f70 Mon Sep 17 00:00:00 2001 From: Noah Oblath Date: Fri, 26 Jan 2024 11:19:25 -0800 Subject: [PATCH 03/12] Implement namespace and config file changes from scarab --- CMakeLists.txt | 7 ++++--- DriplineConfig.cmake.in | 4 ++++ executables/CMakeLists.txt | 1 + library/CMakeLists.txt | 1 + scarab | 2 +- 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 05e6e9e6..34c87ec8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -203,6 +203,7 @@ endif() # Package Config # ################## -configure_file( ${PROJECT_SOURCE_DIR}/DriplineConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/DriplineConfig.cmake @ONLY ) - -pbuilder_do_package_config() +pbuilder_do_package_config( + INPUT_FILE ${PROJECT_SOURCE_DIR}/DriplineConfig.cmake.in + OUTPUT_FILE DriplineConfig.cmake +) diff --git a/DriplineConfig.cmake.in b/DriplineConfig.cmake.in index e4a39500..4defc0f3 100644 --- a/DriplineConfig.cmake.in +++ b/DriplineConfig.cmake.in @@ -1,5 +1,7 @@ # DriplineConfig.cmake +@PACKAGE_INIT@ + get_filename_component( Dripline_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH ) include( CMakeFindDependencyMacro ) @@ -13,3 +15,5 @@ if( NOT TARGET Dripline::@Dripline_FULL_TARGET_NAME@ ) include("${Dripline_CMAKE_DIR}/Dripline_Library_Targets.cmake") endif() endif() + +check_required_components( Dripline ) diff --git a/executables/CMakeLists.txt b/executables/CMakeLists.txt index f9b402a2..1bbc8be0 100644 --- a/executables/CMakeLists.txt +++ b/executables/CMakeLists.txt @@ -26,4 +26,5 @@ pbuilder_executables( pbuilder_component_install_and_export( COMPONENT Executables EXETARGETS ${dripline_exe_PROGRAMS} + NAMESPACE Dripline:: ) diff --git a/library/CMakeLists.txt b/library/CMakeLists.txt index 7926f966..6cd4366b 100644 --- a/library/CMakeLists.txt +++ b/library/CMakeLists.txt @@ -95,6 +95,7 @@ pbuilder_library( pbuilder_component_install_and_export( COMPONENT Library LIBTARGETS Dripline + NAMESPACE Dripline:: ) pbuilder_install_headers( ${dripline_HEADERS} ) diff --git a/scarab b/scarab index 330adc3d..c02e065c 160000 --- a/scarab +++ b/scarab @@ -1 +1 @@ -Subproject commit 330adc3d084bf3bd752c62e434b573b1943c2f68 +Subproject commit c02e065c3d4f187e8f954337d4801c2c6b73f191 From a60f38ea72414f2dc7d3be1190851543f144b00a Mon Sep 17 00:00:00 2001 From: Noah Oblath Date: Fri, 26 Jan 2024 11:19:59 -0800 Subject: [PATCH 04/12] Insert a build stage in the Dockerfile --- Dockerfile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index ee5419a5..22dfcb99 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,7 @@ ARG img_repo=python ARG img_tag=3.8-buster -FROM ${img_repo}:${img_tag} +FROM ${img_repo}:${img_tag} as base ARG build_type=Release ARG build_examples=FALSE @@ -36,8 +36,11 @@ RUN cd /usr/local && \ mkdir build && \ cd build && \ cmake -DPYBIND11_TEST=FALSE .. && \ - make -j3 install + make -j3 install && \ + cd / && \ + rm -rf /usr/local/pybind11 +FROM base # note that the build dir is *not* in source, this is so that the source can me mounted onto the container without covering the build target From 1e1ded95ae0fab4399282ed6497325991a915320 Mon Sep 17 00:00:00 2001 From: Noah Oblath Date: Fri, 26 Jan 2024 16:53:06 -0800 Subject: [PATCH 05/12] [no ci] Cleanup --- CMakeLists.txt | 5 ----- 1 file changed, 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 34c87ec8..9ebce248 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -60,11 +60,6 @@ if( Dripline_BUILD_PYTHON ) find_package( Python3 REQUIRED COMPONENTS Interpreter Development ) set(PYBIND11_PYTHON_VERSION ${Python3_VERSION} CACHE STRING "") find_package( pybind11 REQUIRED ) - #if( TARGET Python3::Python ) - # message( STATUS "%%%%% Found Python::Python" ) - #else() - # message( STATUS "%%%%% Did NOT find Python::Python" ) - #endif() include_directories( ${Python3_INCLUDE_DIRS} ) list( APPEND PUBLIC_EXT_LIBS pybind11::module ) endif( Dripline_BUILD_PYTHON ) From 5a9fb9078505b8c336c26c7a7919f743cdc31194 Mon Sep 17 00:00:00 2001 From: Noah Oblath Date: Mon, 29 Jan 2024 10:37:37 -0800 Subject: [PATCH 06/12] Scarab set to new release v3.9.7 --- scarab | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scarab b/scarab index c02e065c..aa177cc0 160000 --- a/scarab +++ b/scarab @@ -1 +1 @@ -Subproject commit c02e065c3d4f187e8f954337d4801c2c6b73f191 +Subproject commit aa177cc0506431891cc0550999901837adb36d4d From bf18c6e8d2130c6de18daa4c713a6f7174884c6b Mon Sep 17 00:00:00 2001 From: Noah Oblath Date: Mon, 29 Jan 2024 11:01:18 -0800 Subject: [PATCH 07/12] [no ci] Added a comment and bumped version number --- CMakeLists.txt | 2 +- Dockerfile | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9ebce248..bf539181 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,7 +6,7 @@ cmake_minimum_required (VERSION 3.12) ######### cmake_policy( SET CMP0048 NEW ) # version in project() -project( Dripline VERSION 2.8.7 ) +project( Dripline VERSION 2.8.8 ) list( APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/scarab/cmake ) diff --git a/Dockerfile b/Dockerfile index 22dfcb99..55849607 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,7 @@ ARG img_repo=python ARG img_tag=3.8-buster +# This FROM line includes a label so that the dependencies can be built by themselves by using the `--target` argument of `docker build` FROM ${img_repo}:${img_tag} as base ARG build_type=Release From 49a2b93827dc0798cd1abf9ea040cf2f9f2458b2 Mon Sep 17 00:00:00 2001 From: Noah Oblath Date: Mon, 29 Jan 2024 11:01:40 -0800 Subject: [PATCH 08/12] Updated pybind11 version to 2.11.1 --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 55849607..a0450bd9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -29,7 +29,7 @@ RUN apt-get update && \ rm -rf /var/lib/apt/lists/* # use pybind11_checkout to specify a tag or branch name to checkout -ARG pybind11_checkout=v2.6.2 +ARG pybind11_checkout=v2.11.1 RUN cd /usr/local && \ git clone https://github.com/pybind/pybind11.git && \ cd pybind11 && \ From eb5f1fe9c98656c82887a450b8f481c59de604f8 Mon Sep 17 00:00:00 2001 From: Noah Oblath Date: Mon, 29 Jan 2024 11:14:15 -0800 Subject: [PATCH 09/12] Trying a jump in Python version to 3.12 with an update of the Debian version to Bookworm --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index a0450bd9..b09a7bad 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ ARG img_repo=python -ARG img_tag=3.8-buster +ARG img_tag=3.12-bookworm # This FROM line includes a label so that the dependencies can be built by themselves by using the `--target` argument of `docker build` FROM ${img_repo}:${img_tag} as base From d56dc66e2ff8931a95225a7672f7b868d7a58116 Mon Sep 17 00:00:00 2001 From: Noah Oblath Date: Mon, 29 Jan 2024 11:33:24 -0800 Subject: [PATCH 10/12] Added the pybind11::embed target to fix linking errors --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bf539181..5860d1a6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -61,7 +61,7 @@ if( Dripline_BUILD_PYTHON ) set(PYBIND11_PYTHON_VERSION ${Python3_VERSION} CACHE STRING "") find_package( pybind11 REQUIRED ) include_directories( ${Python3_INCLUDE_DIRS} ) - list( APPEND PUBLIC_EXT_LIBS pybind11::module ) + list( APPEND PUBLIC_EXT_LIBS pybind11::module pybind11::embed ) endif( Dripline_BUILD_PYTHON ) # Threads are required by: test_scheduler From 03c81d35d7bdf2ee3ae5a9f9e8f06804f86f8dc4 Mon Sep 17 00:00:00 2001 From: Noah Oblath Date: Mon, 29 Jan 2024 11:51:17 -0800 Subject: [PATCH 11/12] Switch to base image python:3.12.1-slim-bookworm, and remove a couple packages we don't need --- Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index b09a7bad..1b9be487 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ ARG img_repo=python -ARG img_tag=3.12-bookworm +ARG img_tag=3.12.1-slim-bookworm # This FROM line includes a label so that the dependencies can be built by themselves by using the `--target` argument of `docker build` FROM ${img_repo}:${img_tag} as base @@ -16,7 +16,7 @@ RUN apt-get update && \ apt-get --fix-missing -y install \ build-essential \ cmake \ - gdb \ +# gdb \ git \ libboost-chrono-dev \ libboost-filesystem-dev \ @@ -25,7 +25,7 @@ RUN apt-get update && \ libyaml-cpp-dev \ rapidjson-dev \ # pybind11-dev \ - wget && \ +# wget && \ rm -rf /var/lib/apt/lists/* # use pybind11_checkout to specify a tag or branch name to checkout From 0685774a056b627fc48710d5b276deef7b8fa62c Mon Sep 17 00:00:00 2001 From: Noah Oblath Date: Mon, 29 Jan 2024 11:52:53 -0800 Subject: [PATCH 12/12] Fixing the apt-get command --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 1b9be487..11a923e2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,7 +23,7 @@ RUN apt-get update && \ libboost-system-dev \ librabbitmq-dev \ libyaml-cpp-dev \ - rapidjson-dev \ + rapidjson-dev && \ # pybind11-dev \ # wget && \ rm -rf /var/lib/apt/lists/*