From 75b887d7cb91cedb2d58c4ceb1a795b7ff287216 Mon Sep 17 00:00:00 2001 From: Thomas Gerbet Date: Mon, 3 Oct 2022 21:05:46 +0200 Subject: [PATCH 1/2] mysql57: use Protobuf 3.21 Part of #193370 --- pkgs/servers/sql/mysql/5.7.x.nix | 4 ++ .../mysql-5.7-add-protobuf-3.8+-support.patch | 66 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 1 - 3 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 pkgs/servers/sql/mysql/mysql-5.7-add-protobuf-3.8+-support.patch diff --git a/pkgs/servers/sql/mysql/5.7.x.nix b/pkgs/servers/sql/mysql/5.7.x.nix index 41fd1466fd35..ea8842c5695f 100644 --- a/pkgs/servers/sql/mysql/5.7.x.nix +++ b/pkgs/servers/sql/mysql/5.7.x.nix @@ -16,6 +16,10 @@ self = stdenv.mkDerivation rec { sha256 = "sha256-ERw6ypGJfkUwOds5GkdSZeAg/ZIcuXMHwACEqI5NYQQ="; }; + patches = [ + ./mysql-5.7-add-protobuf-3.8+-support.patch + ]; + preConfigure = lib.optionalString stdenv.isDarwin '' ln -s /bin/ps $TMPDIR/ps export PATH=$PATH:$TMPDIR diff --git a/pkgs/servers/sql/mysql/mysql-5.7-add-protobuf-3.8+-support.patch b/pkgs/servers/sql/mysql/mysql-5.7-add-protobuf-3.8+-support.patch new file mode 100644 index 000000000000..99c90ebd33bc --- /dev/null +++ b/pkgs/servers/sql/mysql/mysql-5.7-add-protobuf-3.8+-support.patch @@ -0,0 +1,66 @@ +diff --git a/cmake/build_configurations/compiler_options.cmake b/cmake/build_configurations/compiler_options.cmake +index a935227e523..b4ebd61c5c1 100644 +--- a/cmake/build_configurations/compiler_options.cmake ++++ b/cmake/build_configurations/compiler_options.cmake +@@ -43,7 +43,7 @@ IF(UNIX) + + # Default GCC flags + IF(CMAKE_COMPILER_IS_GNUCC) +- SET(COMMON_C_FLAGS "-fabi-version=2 -fno-omit-frame-pointer -fno-strict-aliasing") ++ SET(COMMON_C_FLAGS "-fno-omit-frame-pointer -fno-strict-aliasing") + # Disable inline optimizations for valgrind testing to avoid false positives + IF(WITH_VALGRIND) + STRING_PREPEND(COMMON_C_FLAGS "-fno-inline ") +@@ -68,7 +68,7 @@ IF(UNIX) + ENDIF() + ENDIF() + IF(CMAKE_COMPILER_IS_GNUCXX) +- SET(COMMON_CXX_FLAGS "-fabi-version=2 -fno-omit-frame-pointer -fno-strict-aliasing") ++ SET(COMMON_CXX_FLAGS "-fno-omit-frame-pointer -fno-strict-aliasing") + # GCC 6 has C++14 as default, set it explicitly to the old default. + EXECUTE_PROCESS(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion + OUTPUT_VARIABLE GXX_VERSION) +diff --git a/rapid/plugin/x/mysqlxtest_src/mysqlxtest.cc b/rapid/plugin/x/mysqlxtest_src/mysqlxtest.cc +index 5dc91ba269c..3a45284859f 100644 +--- a/rapid/plugin/x/mysqlxtest_src/mysqlxtest.cc ++++ b/rapid/plugin/x/mysqlxtest_src/mysqlxtest.cc +@@ -629,12 +629,12 @@ class ErrorDumper : public ::google::protobuf::io::ErrorCollector + std::stringstream m_out; + + public: +- virtual void AddError(int line, int column, const string & message) ++ virtual void AddError(int line, int column, const std::string & message) + { + m_out << "ERROR in message: line " << line+1 << ": column " << column << ": " << message<<"\n"; + } + +- virtual void AddWarning(int line, int column, const string & message) ++ virtual void AddWarning(int line, int column, const std::string & message) + { + m_out << "WARNING in message: line " << line+1 << ": column " << column << ": " << message<<"\n"; + } +diff --git a/rapid/plugin/x/ngs/include/ngs_common/protocol_protobuf.h b/rapid/plugin/x/ngs/include/ngs_common/protocol_protobuf.h +index 90f7cc77a39..cf6c607a818 100644 +--- a/rapid/plugin/x/ngs/include/ngs_common/protocol_protobuf.h ++++ b/rapid/plugin/x/ngs/include/ngs_common/protocol_protobuf.h +@@ -36,7 +36,6 @@ + #include + #include + #include +-#include + #include + + #include "mysqlx_connection.pb.h" +diff --git a/rapid/plugin/x/ngs/src/protocol_decoder.cc b/rapid/plugin/x/ngs/src/protocol_decoder.cc +index 298b6a6884c..fae21d18f78 100644 +--- a/rapid/plugin/x/ngs/src/protocol_decoder.cc ++++ b/rapid/plugin/x/ngs/src/protocol_decoder.cc +@@ -123,7 +123,7 @@ Error_code Message_decoder::parse(Request &request) + google::protobuf::io::CodedInputStream stream(reinterpret_cast(request.buffer()), + static_cast(request.buffer_size())); + // variable 'mysqlx_max_allowed_packet' has been checked when buffer was filling by data +- stream.SetTotalBytesLimit(static_cast(request.buffer_size()), -1 /*no warnings*/); ++ stream.SetTotalBytesLimit(static_cast(request.buffer_size())); + // Protobuf limits the number of nested objects when decoding messages + // lets set the value in explicit way (to ensure that is set accordingly with + // out stack size) \ No newline at end of file diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index aff908337054..1cd29f183836 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -23621,7 +23621,6 @@ with pkgs; inherit (darwin) cctools developer_cmds; inherit (darwin.apple_sdk.frameworks) CoreServices; boost = boost159; - protobuf = protobuf3_7; openssl = openssl_1_1; }; From 53e0aec6d39f41e118faec3ab7f97935e46f2f3f Mon Sep 17 00:00:00 2001 From: Thomas Gerbet Date: Mon, 3 Oct 2022 21:11:11 +0200 Subject: [PATCH 2/2] protobuf3_7: remove Part of #193370 --- pkgs/development/libraries/protobuf/3.7.nix | 6 ------ pkgs/top-level/aliases.nix | 1 + pkgs/top-level/all-packages.nix | 1 - 3 files changed, 1 insertion(+), 7 deletions(-) delete mode 100644 pkgs/development/libraries/protobuf/3.7.nix diff --git a/pkgs/development/libraries/protobuf/3.7.nix b/pkgs/development/libraries/protobuf/3.7.nix deleted file mode 100644 index 9bfb307e3286..000000000000 --- a/pkgs/development/libraries/protobuf/3.7.nix +++ /dev/null @@ -1,6 +0,0 @@ -{ callPackage, ... }: - -callPackage ./generic-v3.nix { - version = "3.7.1"; - sha256 = "00zkijvj80bmhlj8290x4bc416mng2dlbzwc4bkvfmbal1fx93m2"; -} diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index b2f6dc7f3781..34f0317b5d25 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -944,6 +944,7 @@ mapAliases ({ prometheus-dmarc-exporter = dmarc-metrics-exporter; # added 2022-05-31 prometheus-mesos-exporter = throw "prometheus-mesos-exporter is deprecated and archived by upstream"; # Added 2022-04-05 prometheus-unifi-exporter = throw "prometheus-unifi-exporter is deprecated and archived by upstream, use unifi-poller instead"; # Added 2022-06-03 + protobuf3_7 = throw "protobuf3_7 does not receive updates anymore and has been removed"; # Added 2022-10-03 protobuf3_11 = throw "protobuf3_11 does not receive updates anymore and has been removed"; # Added 2022-09-28 proxytunnel = throw "proxytunnel has been removed from nixpkgs, because it has not been update upstream since it was added to nixpkgs in 2008 and has therefore bitrotted."; # added 2021-12-15 pulseaudio-hsphfpd = throw "pulseaudio-hsphfpd upstream has been abandoned"; # Added 2022-03-23 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 1cd29f183836..10f70743cb1d 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -21351,7 +21351,6 @@ with pkgs; protobuf3_19 = callPackage ../development/libraries/protobuf/3.19.nix { }; protobuf3_17 = callPackage ../development/libraries/protobuf/3.17.nix { }; protobuf3_8 = callPackage ../development/libraries/protobuf/3.8.nix { }; - protobuf3_7 = callPackage ../development/libraries/protobuf/3.7.nix { }; protobufc = callPackage ../development/libraries/protobufc { };