From 20458b3e69029ff6d0dd4a02a16a59e34dbd08ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ra=C3=BAl=20Mar=C3=ADn?= Date: Wed, 10 Apr 2024 12:39:44 +0200 Subject: [PATCH] Completely disable rust build for FreeBSD --- rust/CMakeLists.txt | 18 ++++++++++++++++++ rust/workspace/CMakeLists.txt | 17 ----------------- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/rust/CMakeLists.txt b/rust/CMakeLists.txt index 0827d801cce..08085ee151a 100644 --- a/rust/CMakeLists.txt +++ b/rust/CMakeLists.txt @@ -1,3 +1,21 @@ +if (OS_FREEBSD) + # Right nix/libc requires fspacectl and it had been added only since FreeBSD14. + # And since sysroot has older libraries you will got undefined reference for clickhouse binary. + # + # But likely everything should work without this syscall, however it is not + # possible right now to gently override libraries versions for dependencies, + # and forking rust modules is a little bit too much for this thing. + # + # You can take a look at the details in the following issue [1]. + # + # [1]: https://github.com/rust-lang/cargo/issues/5640 + # + # Update 2024-04: Now prql also requires getrandom() via std::sys::pal::unix::rand::imp::getrandom_fill_bytes + message(STATUS "Rust build is disabled for FreeBSD because we use old sysroot files") + return() +endif() + + # NOTE: should be macro to export RUST_CXXFLAGS/RUST_CFLAGS for subfolders macro(configure_rustc) # NOTE: this can also be done by overriding rustc, but it not trivial with rustup. diff --git a/rust/workspace/CMakeLists.txt b/rust/workspace/CMakeLists.txt index dc214e81f8d..ab83ae6b2f2 100644 --- a/rust/workspace/CMakeLists.txt +++ b/rust/workspace/CMakeLists.txt @@ -37,23 +37,6 @@ clickhouse_import_crate(MANIFEST_PATH Cargo.toml) target_include_directories(_ch_rust_prql INTERFACE prql/include) add_library(ch_rust::prql ALIAS _ch_rust_prql) - -if (OS_FREEBSD) - # Right nix/libc requires fspacectl and it had been added only since FreeBSD14. - # And since sysroot has older libraries you will got undefined reference for clickhouse binary. - # - # But likely everything should work without this syscall, however it is not - # possible right now to gently override libraries versions for dependencies, - # and forking rust modules is a little bit too much for this thing. - # - # You can take a look at the details in the following issue [1]. - # - # [1]: https://github.com/rust-lang/cargo/issues/5640 - # - message(STATUS "skim is disabled for FreeBSD") - return() -endif() - target_include_directories(_ch_rust_skim_rust INTERFACE skim/include) add_library(ch_rust::skim ALIAS _ch_rust_skim_rust)