From d31da28d362189a44cfd95e69d578e00a714b4d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20B=C3=A9raud?= <> Date: Mon, 22 Sep 2025 14:23:15 -0400 Subject: [PATCH 1/3] update version to 3.5.5 --- CMakeLists.txt | 10 +++++----- configure.ac | 3 ++- meson.build | 2 +- vcpkg.json | 2 +- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index dce30c70f..d706d2b82 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,16 +1,16 @@ cmake_minimum_required (VERSION 3.21..3.31) if(POLICY CMP0091) - cmake_policy(SET CMP0091 NEW) + cmake_policy(SET CMP0091 NEW) endif() if(POLICY CMP0135) - cmake_policy(SET CMP0135 NEW) + cmake_policy(SET CMP0135 NEW) endif() -if(NOT CMAKE_VERSION VERSION_LESS 3.30 AND NOT POLICY CMP0167) - cmake_policy(SET CMP0167 OLD) +if(POLICY CMP0167) + cmake_policy(SET CMP0167 NEW) endif() set (opendht_VERSION_MAJOR 3) -set (opendht_VERSION_MINOR 5.4) +set (opendht_VERSION_MINOR 5.5) set (opendht_VERSION ${opendht_VERSION_MAJOR}.${opendht_VERSION_MINOR}) set (PACKAGE_VERSION ${opendht_VERSION}) set (VERSION "${opendht_VERSION}") diff --git a/configure.ac b/configure.ac index e98dd3ecd..505035cbb 100644 --- a/configure.ac +++ b/configure.ac @@ -1,11 +1,12 @@ dnl define macros m4_define([opendht_major_version], 3) m4_define([opendht_minor_version], 5) -m4_define([opendht_patch_version], 4) +m4_define([opendht_patch_version], 5) m4_define([opendht_version], [opendht_major_version.opendht_minor_version.opendht_patch_version]) AC_INIT(opendht, [opendht_version]) +AC_MSG_WARN([The Autotools build system for OpenDHT is deprecated and will be removed in a future release. Please use the CMake or Meson build.]) AC_CONFIG_AUX_DIR(ac) AM_INIT_AUTOMAKE([foreign subdir-objects]) AC_CONFIG_HEADERS([config.h]) diff --git a/meson.build b/meson.build index f173e9cf7..88b745ac7 100644 --- a/meson.build +++ b/meson.build @@ -1,5 +1,5 @@ project('opendht', 'c', 'cpp', 'cython', - version: '3.5.4', + version: '3.5.5', meson_version: '>=1.1.0', default_options: [ 'cpp_std=c++17', diff --git a/vcpkg.json b/vcpkg.json index 0b6214846..d2a90587e 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -1,6 +1,6 @@ { "name": "opendht", - "version-string": "3.5.4", + "version-string": "3.5.5", "port-version": 1, "description": "OpenDHT: A lightweight C++17 Distributed Hash Table library.", "homepage": "https://opendht.net", From 2aee83f408eaa7029427cc9f1baffd2bb1e45998 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20B=C3=A9raud?= <> Date: Mon, 22 Sep 2025 14:23:37 -0400 Subject: [PATCH 2/3] docker: add alpine edge container --- docker/DockerfileAlpineEdge | 41 +++++++++++++++++++++++++++++++++ docker/DockerfileDepsAlpineEdge | 27 ++++++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 docker/DockerfileAlpineEdge create mode 100644 docker/DockerfileDepsAlpineEdge diff --git a/docker/DockerfileAlpineEdge b/docker/DockerfileAlpineEdge new file mode 100644 index 000000000..4b35da23c --- /dev/null +++ b/docker/DockerfileAlpineEdge @@ -0,0 +1,41 @@ +FROM opendht-alpine-edge-deps:latest AS build +LABEL maintainer="Adrien Béraud " +LABEL org.opencontainers.image.source=https://github.com/savoirfairelinux/opendht + +COPY . opendht + +RUN mkdir /install +ENV DESTDIR=/install + +RUN cd opendht && mkdir build && cd build \ + && cmake .. -DCMAKE_INSTALL_PREFIX=/usr \ + -DOPENDHT_DOWNLOAD_DEPS=Off \ + -DCMAKE_BUILD_TYPE=RelWithDebInfo \ + -DCMAKE_INTERPROCEDURAL_OPTIMIZATION=On \ + -DOPENDHT_C=On \ + -DOPENDHT_PEER_DISCOVERY=On \ + -DOPENDHT_PYTHON=On \ + -DOPENDHT_TOOLS=On \ + -DOPENDHT_PROXY_SERVER=On \ + -DOPENDHT_PROXY_CLIENT=On \ + -DOPENDHT_SYSTEMD=On \ + && make -j8 && make install + +FROM alpine:edge AS install +COPY --from=build /install / +RUN apk add --no-cache \ + libstdc++ \ + gnutls \ + nettle \ + openssl \ + argon2-dev \ + jsoncpp \ + llhttp \ + fmt \ + readline \ + ncurses \ + gdb +#CMD ["dhtnode", "-b", "bootstrap.jami.net", "-p", "4222", "--proxyserver", "8080"] +EXPOSE 4222/udp +EXPOSE 8080/tcp +CMD ["/bin/sh"] diff --git a/docker/DockerfileDepsAlpineEdge b/docker/DockerfileDepsAlpineEdge new file mode 100644 index 000000000..5c1b718c3 --- /dev/null +++ b/docker/DockerfileDepsAlpineEdge @@ -0,0 +1,27 @@ +FROM alpine:edge +LABEL maintainer="Adrien Béraud " +LABEL org.opencontainers.image.source=https://github.com/savoirfairelinux/opendht + +RUN apk add --no-cache \ + build-base cmake ninja git wget \ + cython python3-dev py3-setuptools \ + ncurses-dev readline-dev nettle-dev \ + cppunit-dev gnutls-dev jsoncpp-dev \ + argon2-dev openssl-dev fmt-dev \ + llhttp-dev asio-dev msgpack-cxx-dev \ + && rm -rf /var/cache/apk/* + +RUN mkdir /usr/include/nonstd \ + && wget https://raw.githubusercontent.com/martinmoene/expected-lite/master/include/nonstd/expected.hpp \ + -O /usr/include/nonstd/expected.hpp + +RUN echo "*** Downloading RESTinio ***" \ + && mkdir restinio && cd restinio \ + && wget https://github.com/Stiffstream/restinio/releases/download/v.0.7.3/restinio-0.7.3.tar.bz2 \ + && ls -l && tar -xjf restinio-0.7.3.tar.bz2 \ + && cd restinio-0.7.3/dev \ + && cmake -DCMAKE_INSTALL_PREFIX=/usr -DRESTINIO_TEST=Off -DRESTINIO_SAMPLE=Off -DRESTINIO_BENCHMARK=Off \ + -DRESTINIO_WITH_SOBJECTIZER=Off -DRESTINIO_DEP_STANDALONE_ASIO=system -DRESTINIO_DEP_LLHTTP=system \ + -DRESTINIO_DEP_FMT=system -DRESTINIO_DEP_EXPECTED_LITE=system . \ + && make -j2 && make install \ + && cd ../../ && rm -rf restinio* From 538c70184e162f8d6f68905a2ca6e89463156acd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20B=C3=A9raud?= <> Date: Mon, 22 Sep 2025 14:24:20 -0400 Subject: [PATCH 3/3] pht: use const reference for IndexEntry::TYPE Prevents static initialization order issue --- include/opendht/indexation/pht.h | 2 +- src/indexation/pht.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/opendht/indexation/pht.h b/include/opendht/indexation/pht.h index ba1cb3642..a1da0d781 100644 --- a/include/opendht/indexation/pht.h +++ b/include/opendht/indexation/pht.h @@ -266,7 +266,7 @@ ee * using Value = std::pair; struct OPENDHT_PUBLIC IndexEntry : public dht::Value::Serializable { - static const ValueType TYPE; + static const ValueType& TYPE; virtual void unpackValue(const dht::Value& v) { Serializable::unpackValue(v); diff --git a/src/indexation/pht.cpp b/src/indexation/pht.cpp index 67adbc791..b452bdf54 100644 --- a/src/indexation/pht.cpp +++ b/src/indexation/pht.cpp @@ -145,7 +145,7 @@ int Pht::Cache::lookup(const Prefix& p) { return pos; } -const ValueType IndexEntry::TYPE = ValueType::USER_DATA; +const ValueType& IndexEntry::TYPE = ValueType::USER_DATA; constexpr std::chrono::minutes Pht::Cache::NODE_EXPIRE_TIME; void Pht::lookupStep(Prefix p, std::shared_ptr lo, std::shared_ptr hi,