Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix builds on Fedora41 i686/aarch64 #4551

Open
wants to merge 3 commits into
base: v2.x
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions deps/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ clickhouse-cpp/clickhouse-cpp/clickhouse/libclickhouse-cpp-lib-static.a:
cd clickhouse-cpp && tar -zxf v2.3.0.tar.gz && sync
cd clickhouse-cpp && ln -fs clickhouse-cpp-*/ clickhouse-cpp
cd clickhouse-cpp/clickhouse-cpp && patch clickhouse/base/wire_format.h < ../wire_format.patch
patch -d clickhouse-cpp/clickhouse-cpp -p1 -i ../0001-fix-recv_timeout-and-send_timeout-initialization.patch
cd clickhouse-cpp/clickhouse-cpp && cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo .
cd clickhouse-cpp/clickhouse-cpp && CC=${CC} CXX=${CXX} ${MAKE}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
From cfb12800e698a0e7273a9cb007d0d1658c1689f2 Mon Sep 17 00:00:00 2001
From: Jia Yue Hua <[email protected]>
Date: Tue, 3 Oct 2023 15:24:35 +0800
Subject: [PATCH] fix recv_timeout and send_timeout initialization

---
clickhouse/base/socket.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/clickhouse/base/socket.cpp b/clickhouse/base/socket.cpp
index 28be7b6..3c86629 100644
--- a/clickhouse/base/socket.cpp
+++ b/clickhouse/base/socket.cpp
@@ -129,10 +129,10 @@ void SetNonBlock(SOCKET fd, bool value) {

void SetTimeout(SOCKET fd, const SocketTimeoutParams& timeout_params) {
#if defined(_unix_)
- timeval recv_timeout{ timeout_params.recv_timeout.count() / 1000, static_cast<int>(timeout_params.recv_timeout.count() % 1000 * 1000) };
+ timeval recv_timeout{ static_cast<time_t>(timeout_params.recv_timeout.count() / 1000), static_cast<suseconds_t>(timeout_params.recv_timeout.count() % 1000 * 1000) };
auto recv_ret = setsockopt(fd, SOL_SOCKET, SO_RCVTIMEO, &recv_timeout, sizeof(recv_timeout));

- timeval send_timeout{ timeout_params.send_timeout.count() / 1000, static_cast<int>(timeout_params.send_timeout.count() % 1000 * 1000) };
+ timeval send_timeout{ static_cast<time_t>(timeout_params.send_timeout.count() / 1000), static_cast<suseconds_t>(timeout_params.send_timeout.count() % 1000 * 1000) };
auto send_ret = setsockopt(fd, SOL_SOCKET, SO_SNDTIMEO, &send_timeout, sizeof(send_timeout));

if (recv_ret == -1 || send_ret == -1) {
--
2.45.0

24 changes: 24 additions & 0 deletions deps/coredumper/0001-Include-unistd.h-for-getpid.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
From cb0b6bcde64b3d108f5f9adb429af57890e0bcee Mon Sep 17 00:00:00 2001
From: Igor Raits <[email protected]>
Date: Sat, 18 May 2024 19:57:19 +0200
Subject: [PATCH] Include unistd.h for getpid()

---
src/thread_lister.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/src/thread_lister.c b/src/thread_lister.c
index 15fedac..48cb4e4 100644
--- a/src/thread_lister.c
+++ b/src/thread_lister.c
@@ -34,6 +34,7 @@
#include "thread_lister.h"

#include <stdio.h> /* needed for NULL on some powerpc platforms (?!) */
+#include <unistd.h> /* getpid() */
#include <sys/prctl.h>

#include "linuxthreads.h"
--
2.45.0