From bb333144a4e0ae29e3283f4cf6dee39a160ac3b3 Mon Sep 17 00:00:00 2001 From: Neil Cook Date: Mon, 27 Nov 2023 14:39:11 +0100 Subject: [PATCH 1/6] Use explicit std::move() in json11.cpp --- ext/json11/json11.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/ext/json11/json11.cpp b/ext/json11/json11.cpp index f48833b1..764009b8 100644 --- a/ext/json11/json11.cpp +++ b/ext/json11/json11.cpp @@ -152,7 +152,7 @@ class Value : public JsonValue { // Constructors explicit Value(const T &value) : m_value(value) {} - explicit Value(T &&value) : m_value(move(value)) {} + explicit Value(T &&value) : m_value(std::move(value)) {} // Get type tag Json::Type type() const override { @@ -199,7 +199,7 @@ class JsonString final : public Value { const string &string_value() const override { return m_value; } public: explicit JsonString(const string &value) : Value(value) {} - explicit JsonString(string &&value) : Value(move(value)) {} + explicit JsonString(string &&value) : Value(std::move(value)) {} }; class JsonArray final : public Value { @@ -207,7 +207,7 @@ class JsonArray final : public Value { const Json & operator[](size_t i) const override; public: explicit JsonArray(const Json::array &value) : Value(value) {} - explicit JsonArray(Json::array &&value) : Value(move(value)) {} + explicit JsonArray(Json::array &&value) : Value(std::move(value)) {} }; class JsonObject final : public Value { @@ -215,7 +215,7 @@ class JsonObject final : public Value { const Json & operator[](const string &key) const override; public: explicit JsonObject(const Json::object &value) : Value(value) {} - explicit JsonObject(Json::object &&value) : Value(move(value)) {} + explicit JsonObject(Json::object &&value) : Value(std::move(value)) {} }; class JsonNull final : public Value { @@ -257,12 +257,12 @@ Json::Json(double value) : m_ptr(make_shared(value)) { Json::Json(int value) : m_ptr(make_shared(value)) {} Json::Json(bool value) : m_ptr(value ? statics().t : statics().f) {} Json::Json(const string &value) : m_ptr(make_shared(value)) {} -Json::Json(string &&value) : m_ptr(make_shared(move(value))) {} +Json::Json(string &&value) : m_ptr(make_shared(std::move(value))) {} Json::Json(const char * value) : m_ptr(make_shared(value)) {} Json::Json(const Json::array &values) : m_ptr(make_shared(values)) {} -Json::Json(Json::array &&values) : m_ptr(make_shared(move(values))) {} +Json::Json(Json::array &&values) : m_ptr(make_shared(std::move(values))) {} Json::Json(const Json::object &values) : m_ptr(make_shared(values)) {} -Json::Json(Json::object &&values) : m_ptr(make_shared(move(values))) {} +Json::Json(Json::object &&values) : m_ptr(make_shared(std::move(values))) {} /* * * * * * * * * * * * * * * * * * * * * Accessors @@ -356,7 +356,7 @@ struct JsonParser final { * Mark this parse as failed. */ Json fail(string &&msg) { - return fail(move(msg), Json()); + return fail(std::move(msg), Json()); } template From 3414c69ed2e67506362d8ed51baec9f6328f1862 Mon Sep 17 00:00:00 2001 From: Neil Cook Date: Tue, 28 Nov 2023 16:51:47 +0100 Subject: [PATCH 2/6] Modify the prometheus pkgconfig name --- m4/pdns_check_prometheus_cpp.m4 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/m4/pdns_check_prometheus_cpp.m4 b/m4/pdns_check_prometheus_cpp.m4 index b2a57b79..ada6e03e 100644 --- a/m4/pdns_check_prometheus_cpp.m4 +++ b/m4/pdns_check_prometheus_cpp.m4 @@ -50,10 +50,10 @@ AC_DEFUN([PDNS_CHECK_LIBPROMETHEUS], [ # then use that information and don't search promdirs AC_CHECK_TOOL([PKG_CONFIG], [pkg-config]) if test x"$PKG_CONFIG" != x""; then - LIBPROMETHEUS_LDFLAGS=`$PKG_CONFIG libprometheus-cpp-core --libs-only-L 2>/dev/null` + LIBPROMETHEUS_LDFLAGS=`$PKG_CONFIG prometheus-cpp-core --libs-only-L 2>/dev/null` if test $? = 0; then - LIBPROMETHEUS_LIBS=`$PKG_CONFIG libprometheus-cpp-core --libs-only-l 2>/dev/null` - LIBPROMETHEUS_INCLUDES=`$PKG_CONFIG libprometheus-cpp-core --cflags-only-I 2>/dev/null` + LIBPROMETHEUS_LIBS=`$PKG_CONFIG prometheus-cpp-core --libs-only-l 2>/dev/null` + LIBPROMETHEUS_INCLUDES=`$PKG_CONFIG prometheus-cpp-core --cflags-only-I 2>/dev/null` found=true fi fi From e432d79459c2eef89a19a9cfe7ea3833a7488a4e Mon Sep 17 00:00:00 2001 From: Neil Cook Date: Thu, 30 Nov 2023 16:54:06 +0000 Subject: [PATCH 3/6] Use drogon 1.9.1 to build packages, except amazon-2 and centos-7 which are too old --- builder-support/dockerfiles/Dockerfile.debbuild | 2 +- builder-support/dockerfiles/Dockerfile.rpmbuild | 14 +++++++++++++- .../dockerfiles/Dockerfile.target.amazon-2 | 2 ++ .../dockerfiles/Dockerfile.target.centos-7 | 2 ++ builder-support/dockerfiles/Dockerfile.target.ol-8 | 2 ++ builder-support/dockerfiles/Dockerfile.target.ol-9 | 2 ++ 6 files changed, 22 insertions(+), 2 deletions(-) diff --git a/builder-support/dockerfiles/Dockerfile.debbuild b/builder-support/dockerfiles/Dockerfile.debbuild index 28d007d9..d020ae58 100644 --- a/builder-support/dockerfiles/Dockerfile.debbuild +++ b/builder-support/dockerfiles/Dockerfile.debbuild @@ -27,7 +27,7 @@ RUN mv prometheus-cpp*Source prometheus-cpp RUN cd prometheus-cpp/_build && make install RUN git clone https://github.com/drogonframework/drogon.git -RUN cd drogon && git checkout tags/v1.7.4 -b v1.7.4 +RUN cd drogon && git checkout tags/v1.9.1 -b v1.9.1 RUN cd drogon && git submodule init && git submodule update && mkdir _build && cd _build && cmake .. -DBUILD_REDIS=OFF -DBUILD_ORM=OFF -DCMAKE_BUILD_TYPE=Release && make && make install RUN tar xvf /sdist/wforce-${BUILDER_VERSION}.tar.bz2 diff --git a/builder-support/dockerfiles/Dockerfile.rpmbuild b/builder-support/dockerfiles/Dockerfile.rpmbuild index 7d57f2a6..47766d54 100644 --- a/builder-support/dockerfiles/Dockerfile.rpmbuild +++ b/builder-support/dockerfiles/Dockerfile.rpmbuild @@ -39,8 +39,20 @@ RUN git clone https://github.com/open-source-parsers/jsoncpp RUN cd jsoncpp && git checkout tags/1.9.4 -b 1.9.4 RUN cd jsoncpp && mkdir _build && cd _build && cmake .. -DBUILD_SHARED_LIBS=OFF && make && make install +@IF [ "$BUILDER_RHEL_FLAVOUR" = "amazon" ] +ARG DROGON_VERSION=v1.7.4 +@ENDIF +@IF [ "$BUILDER_RHEL_FLAVOUR" != "amazon" ] +@IF [ "$BUILDER_RHEL_VERSION" = "7" ] +ARG DROGON_VERSION=v1.7.4 +@ENDIF +@IF [ "$BUILDER_RHEL_VERSION" != "7" ] +ARG DROGON_VERSION=v1.9.1 +@ENDIF +@ENDIF + RUN git clone https://github.com/drogonframework/drogon.git -RUN cd drogon && git checkout tags/v1.7.4 -b v1.7.4 +RUN cd drogon && git checkout tags/"$DROGON_VERSION" -b "$DROGON_VERSION" RUN cd drogon && git submodule init && git submodule update && mkdir _build && cd _build && cmake .. -DBUILD_REDIS=OFF -DBUILD_ORM=OFF -DCMAKE_BUILD_TYPE=Release && make && make install RUN wget https://github.com/maxmind/libmaxminddb/releases/download/1.7.1/libmaxminddb-1.7.1.tar.gz && tar xvf libmaxminddb-1.7.1.tar.gz diff --git a/builder-support/dockerfiles/Dockerfile.target.amazon-2 b/builder-support/dockerfiles/Dockerfile.target.amazon-2 index 3bd0344d..3049fbbe 100644 --- a/builder-support/dockerfiles/Dockerfile.target.amazon-2 +++ b/builder-support/dockerfiles/Dockerfile.target.amazon-2 @@ -1,3 +1,5 @@ +@EXEC export BUILDER_RHEL_VERSION=2 +@EXEC export BUILDER_RHEL_FLAVOUR=amazon # First do the source builds @INCLUDE Dockerfile.target.sdist diff --git a/builder-support/dockerfiles/Dockerfile.target.centos-7 b/builder-support/dockerfiles/Dockerfile.target.centos-7 index 97d45fe6..3b6b9874 100644 --- a/builder-support/dockerfiles/Dockerfile.target.centos-7 +++ b/builder-support/dockerfiles/Dockerfile.target.centos-7 @@ -1,3 +1,5 @@ +@EXEC export BUILDER_RHEL_VERSION=7 +@EXEC export BUILDER_RHEL_FLAVOUR=centos # First do the source builds @INCLUDE Dockerfile.target.sdist diff --git a/builder-support/dockerfiles/Dockerfile.target.ol-8 b/builder-support/dockerfiles/Dockerfile.target.ol-8 index 165d2424..efd430a8 100644 --- a/builder-support/dockerfiles/Dockerfile.target.ol-8 +++ b/builder-support/dockerfiles/Dockerfile.target.ol-8 @@ -1,3 +1,5 @@ +@EXEC export BUILDER_RHEL_VERSION=8 +@EXEC export BUILDER_RHEL_FLAVOUR=oracle # First do the source builds @INCLUDE Dockerfile.target.sdist diff --git a/builder-support/dockerfiles/Dockerfile.target.ol-9 b/builder-support/dockerfiles/Dockerfile.target.ol-9 index 85c62f03..6a9df095 100644 --- a/builder-support/dockerfiles/Dockerfile.target.ol-9 +++ b/builder-support/dockerfiles/Dockerfile.target.ol-9 @@ -1,3 +1,5 @@ +@EXEC export BUILDER_RHEL_VERSION=9 +@EXEC export BUILDER_RHEL_FLAVOUR=oracle # First do the source builds @INCLUDE Dockerfile.target.sdist From 0d6a54fba4a9f35bb439cb1d444e5f9984c1a9f5 Mon Sep 17 00:00:00 2001 From: Neil Cook Date: Thu, 30 Nov 2023 17:17:37 +0000 Subject: [PATCH 4/6] Use drogon 1.9.1 everywhere else but Dockerfile.rpmbuild --- .github/workflows/docker.yml | 2 +- .github/workflows/regression.yml | 2 +- builder-support/dockerfiles/Dockerfile.wforce | 2 +- docker/regression/Dockerfile | 2 +- docker/wforce_image/Dockerfile | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 2fe2a787..fef36e46 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -21,7 +21,7 @@ jobs: - name: Build and Install prometheus-cpp run: cd prometheus-cpp && mkdir _build && cd _build && cmake .. -DBUILD_SHARED_LIBS=off -DENABLE_PULL=off -DENABLE_PUSH=off -DENABLE_COMPRESSION=off -DENABLE_TESTING=off -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_POSITION_INDEPENDENT_CODE=ON && make && sudo make install - name: Download Drogon - run: git clone https://github.com/drogonframework/drogon.git && cd drogon && git checkout tags/v1.7.4 -b v1.7.4 + run: git clone https://github.com/drogonframework/drogon.git && cd drogon && git checkout tags/v1.9.1 -b v1.9.1 - name: Build and Install Drogon run: cd drogon && git submodule init && git submodule update && mkdir _build && cd _build && cmake .. -DBUILD_ORM=OFF -DCMAKE_BUILD_TYPE=Release && make && sudo make install - run: sudo sysctl -w vm.max_map_count=262144 diff --git a/.github/workflows/regression.yml b/.github/workflows/regression.yml index a478dfc6..d4540954 100644 --- a/.github/workflows/regression.yml +++ b/.github/workflows/regression.yml @@ -23,7 +23,7 @@ jobs: - name: Build and Install prometheus-cpp run: cd prometheus-cpp && git submodule init && git submodule update && mkdir _build && cd _build && cmake .. -DBUILD_SHARED_LIBS=off -DENABLE_PULL=off -DENABLE_PUSH=off -DENABLE_COMPRESSION=off -DENABLE_TESTING=off -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_POSITION_INDEPENDENT_CODE=ON && make && sudo make install - name: Download Drogon - run: git clone https://github.com/drogonframework/drogon.git && cd drogon && git checkout tags/v1.7.4 -b v1.7.4 + run: git clone https://github.com/drogonframework/drogon.git && cd drogon && git checkout tags/v1.9.1 -b v1.9.1 - name: Build and Install Drogon run: cd drogon && git submodule init && git submodule update && mkdir _build && cd _build && cmake .. -DBUILD_ORM=OFF -DCMAKE_BUILD_TYPE=Release && make && sudo make install - run: sudo sysctl -w vm.max_map_count=262144 diff --git a/builder-support/dockerfiles/Dockerfile.wforce b/builder-support/dockerfiles/Dockerfile.wforce index a00aaa64..4b4837c1 100644 --- a/builder-support/dockerfiles/Dockerfile.wforce +++ b/builder-support/dockerfiles/Dockerfile.wforce @@ -42,7 +42,7 @@ mkdir _build && cd _build && cmake .. -DBUILD_SHARED_LIBS=off -DENABLE_PULL=off RUN cd prometheus-cpp/_build && cp prometheus-cpp*Source.tar.gz /sdist/ RUN git clone https://github.com/drogonframework/drogon.git -RUN cd drogon && git checkout tags/v1.7.4 -b v1.7.4 +RUN cd drogon && git checkout tags/v1.9.1 -b v1.9.1 RUN cd drogon && git submodule init && git submodule update && mkdir _build && cd _build && cmake .. -DBUILD_REDIS=OFF -DCMAKE_BUILD_TYPE=Release -DBUILD_ORM=OFF && make && make install ADD CHANGELOG.md configure.ac ext LICENSE Makefile.am README.md NOTICE /wforce/ diff --git a/docker/regression/Dockerfile b/docker/regression/Dockerfile index d50a5d4b..90fa502c 100644 --- a/docker/regression/Dockerfile +++ b/docker/regression/Dockerfile @@ -62,7 +62,7 @@ RUN cd prometheus-cpp && git checkout tags/v1.0.1 -b v1.0.1 RUN cd prometheus-cpp && mkdir _build && cd _build && cmake .. -DBUILD_SHARED_LIBS=off -DENABLE_PULL=off -DENABLE_PUSH=off -DENABLE_COMPRESSION=off -DENABLE_TESTING=off && make && make install RUN git clone https://github.com/drogonframework/drogon.git -RUN cd drogon && git checkout tags/v1.7.4 -b v1.7.4 +RUN cd drogon && git checkout tags/v1.9.1 -b v1.9.1 RUN cd drogon && git submodule init && git submodule update && mkdir _build && cd _build && cmake .. -DBUILD_REDIS=OFF && make && make install ADD CHANGELOG.md configure.ac ext LICENSE Makefile.am README.md NOTICE /wforce/ diff --git a/docker/wforce_image/Dockerfile b/docker/wforce_image/Dockerfile index c5949b94..f89451a9 100644 --- a/docker/wforce_image/Dockerfile +++ b/docker/wforce_image/Dockerfile @@ -35,7 +35,7 @@ WORKDIR /wforce/ RUN mkdir /wforce/install RUN git clone https://github.com/drogonframework/drogon.git -RUN cd drogon && git checkout tags/v1.7.4 -b v1.7.4 +RUN cd drogon && git checkout tags/v1.9.1 -b v1.9.1 RUN cd drogon && git submodule init && git submodule update && mkdir _build && cd _build && cmake .. -DBUILD_REDIS=OFF -DCMAKE_BUILD_TYPE=Release -DBUILD_ORM=OFF && make && make install ADD CHANGELOG.md configure.ac ext LICENSE Makefile.am README.md NOTICE /wforce/ From 914741038f36a341112364752ca55f9eabf8e731 Mon Sep 17 00:00:00 2001 From: Neil Cook Date: Thu, 30 Nov 2023 17:29:45 +0000 Subject: [PATCH 5/6] Update yaml-cpp to 0.8.0 --- builder-support/dockerfiles/Dockerfile.rpmbuild | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/builder-support/dockerfiles/Dockerfile.rpmbuild b/builder-support/dockerfiles/Dockerfile.rpmbuild index 47766d54..6b481318 100644 --- a/builder-support/dockerfiles/Dockerfile.rpmbuild +++ b/builder-support/dockerfiles/Dockerfile.rpmbuild @@ -31,9 +31,9 @@ RUN tar xvf /sdist/prometheus-cpp*Source.tar.gz RUN mv prometheus-cpp*Source prometheus-cpp RUN cd prometheus-cpp/_build && make clean && make install -RUN wget https://github.com/jbeder/yaml-cpp/archive/yaml-cpp-0.6.3.tar.gz -RUN tar xvf yaml-cpp-0.6.3.tar.gz -RUN cd yaml-cpp-yaml-cpp* && mkdir build && cd build && cmake .. -DCMAKE_POSITION_INDEPENDENT_CODE=ON && make install +RUN wget https://github.com/jbeder/yaml-cpp/archive/0.8.0.tar.gz +RUN tar xvf 0.8.0.tar.gz +RUN cd yaml-cpp* && mkdir build && cd build && cmake .. -DCMAKE_POSITION_INDEPENDENT_CODE=ON && make install RUN git clone https://github.com/open-source-parsers/jsoncpp RUN cd jsoncpp && git checkout tags/1.9.4 -b 1.9.4 From 42fe8dfe6ea32ae3c918f7100fbb233672eb1c7c Mon Sep 17 00:00:00 2001 From: Neil Cook Date: Thu, 30 Nov 2023 17:56:22 +0000 Subject: [PATCH 6/6] Fix indentation in Dockerfile.rpmbuild IF statements --- builder-support/dockerfiles/Dockerfile.rpmbuild | 2 ++ 1 file changed, 2 insertions(+) diff --git a/builder-support/dockerfiles/Dockerfile.rpmbuild b/builder-support/dockerfiles/Dockerfile.rpmbuild index 6b481318..79a61ff7 100644 --- a/builder-support/dockerfiles/Dockerfile.rpmbuild +++ b/builder-support/dockerfiles/Dockerfile.rpmbuild @@ -46,6 +46,8 @@ ARG DROGON_VERSION=v1.7.4 @IF [ "$BUILDER_RHEL_VERSION" = "7" ] ARG DROGON_VERSION=v1.7.4 @ENDIF +@ENDIF +@IF [ "$BUILDER_RHEL_FLAVOUR" != "amazon" ] @IF [ "$BUILDER_RHEL_VERSION" != "7" ] ARG DROGON_VERSION=v1.9.1 @ENDIF