From 8e50a981a13af7a22d677adb116baa083cffb409 Mon Sep 17 00:00:00 2001 From: Konstantin Bogdanov Date: Mon, 16 Dec 2024 00:01:26 +0100 Subject: [PATCH] Fix chcache build --- cmake/ccache.cmake | 14 +-------- contrib/rust_vendor | 2 +- rust/CMakeLists.txt | 1 + rust/chcache/.cargo/config.toml.in | 9 ++++++ {utils => rust}/chcache/.gitignore | 0 {utils => rust}/chcache/Cargo.lock | 47 ++++++++++++++--------------- {utils => rust}/chcache/Cargo.toml | 6 ++-- {utils => rust}/chcache/src/main.rs | 0 8 files changed, 38 insertions(+), 41 deletions(-) create mode 100644 rust/chcache/.cargo/config.toml.in rename {utils => rust}/chcache/.gitignore (100%) rename {utils => rust}/chcache/Cargo.lock (97%) rename {utils => rust}/chcache/Cargo.toml (67%) rename {utils => rust}/chcache/src/main.rs (100%) diff --git a/cmake/ccache.cmake b/cmake/ccache.cmake index 06537b2b572..6c0a89df4a0 100644 --- a/cmake/ccache.cmake +++ b/cmake/ccache.cmake @@ -18,19 +18,7 @@ elseif (COMPILER_CACHE STREQUAL "ccache") elseif(COMPILER_CACHE STREQUAL "sccache") find_program (CCACHE_EXECUTABLE sccache) elseif(COMPILER_CACHE STREQUAL "chcache") - list (APPEND CMAKE_MODULE_PATH "${ClickHouse_SOURCE_DIR}/contrib/corrosion/cmake") - find_package(Rust REQUIRED) - - include ("${ClickHouse_SOURCE_DIR}/contrib/corrosion/cmake/Corrosion.cmake") - corrosion_import_crate( - MANIFEST_PATH ${CMAKE_CURRENT_SOURCE_DIR}/utils/chcache/Cargo.toml - PROFILE release - LOCKED - FLAGS --offline - ) - set_target_properties(chcache PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/programs/) - - set(CCACHE_EXECUTABLE ${CMAKE_CURRENT_BINARY_DIR}/programs/chcache) + set(CCACHE_EXECUTABLE ${CMAKE_CURRENT_BINARY_DIR}/rust/chcache/chcache) elseif(COMPILER_CACHE STREQUAL "disabled") message(STATUS "Using *ccache: no (disabled via configuration)") return() diff --git a/contrib/rust_vendor b/contrib/rust_vendor index b25b16b0b10..4214a61e00b 160000 --- a/contrib/rust_vendor +++ b/contrib/rust_vendor @@ -1 +1 @@ -Subproject commit b25b16b0b10a1cbb33eb0922f77aeedb72119792 +Subproject commit 4214a61e00b17eefd18c9540a43610918347816b diff --git a/rust/CMakeLists.txt b/rust/CMakeLists.txt index 08085ee151a..c3e982c0b3b 100644 --- a/rust/CMakeLists.txt +++ b/rust/CMakeLists.txt @@ -98,3 +98,4 @@ function(add_rust_subdirectory src) endfunction() add_rust_subdirectory (workspace) +add_rust_subdirectory (chcache) diff --git a/rust/chcache/.cargo/config.toml.in b/rust/chcache/.cargo/config.toml.in new file mode 100644 index 00000000000..d805530fe03 --- /dev/null +++ b/rust/chcache/.cargo/config.toml.in @@ -0,0 +1,9 @@ +[unstable] +@RUST_CARGO_BUILD_STD@ + +[source.crates-io] +registry = 'sparse+https://index.crates.io/' +replace-with = 'local-registry' + +[source.local-registry] +local-registry = "@RUST_VENDOR_DIR@" diff --git a/utils/chcache/.gitignore b/rust/chcache/.gitignore similarity index 100% rename from utils/chcache/.gitignore rename to rust/chcache/.gitignore diff --git a/utils/chcache/Cargo.lock b/rust/chcache/Cargo.lock similarity index 97% rename from utils/chcache/Cargo.lock rename to rust/chcache/Cargo.lock index b5005631276..72e3d11ca41 100644 --- a/utils/chcache/Cargo.lock +++ b/rust/chcache/Cargo.lock @@ -129,9 +129,9 @@ dependencies = [ [[package]] name = "bstr" -version = "1.11.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a68f1f47cdf0ec8ee4b941b2eee2a80cb796db73118c0dd09ac63fbe405be22" +checksum = "786a307d683a5bf92e6fd5fd69a7eb613751668d1d8d67d802846dfe367c62c8" dependencies = [ "memchr", ] @@ -144,9 +144,9 @@ checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b" [[package]] name = "cc" -version = "1.2.2" +version = "1.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f34d93e62b03caf570cccc334cbc6c2fceca82f39211051345108adcba3eebdc" +checksum = "9157bbaa6b165880c27a4293a474c91cdcf265cc68cc829bf10be0964a391caf" dependencies = [ "jobserver", "libc", @@ -462,9 +462,9 @@ dependencies = [ [[package]] name = "http" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" +checksum = "f16ca2af56261c99fba8bac40a10251ce8188205a4c448fbb745a2e4daa76fea" dependencies = [ "bytes", "fnv", @@ -743,9 +743,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.167" +version = "0.2.168" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09d6582e104315a817dff97f75133544b2e094ee22447d2acf4a74e189ba06fc" +checksum = "5aaeb2981e0606ca11d79718f8bb01164f1d6ed75080182d3abf017e6d244b6d" [[package]] name = "libloading" @@ -954,22 +954,22 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustix" -version = "0.38.41" +version = "0.38.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7f649912bc1495e167a6edee79151c84b1bad49748cb4f1f1167f459f6224f6" +checksum = "f93dc38ecbab2eb790ff964bb77fa94faf256fd3e73285fd7ba0903b76bedb85" dependencies = [ "bitflags", "errno", "libc", "linux-raw-sys", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "rustls" -version = "0.23.19" +version = "0.23.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "934b404430bb06b3fae2cba809eb45a1ab1aecd64491213d7c3301b88393f8d1" +checksum = "5065c3f250cbd332cd894be57c40fa52387247659b14a2d6041d121547903b1b" dependencies = [ "aws-lc-rs", "once_cell", @@ -981,9 +981,9 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.10.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16f1201b3c9a7ee8039bcadc17b7e605e2945b27eee7631788c1bd2b0643674b" +checksum = "d2bf47e6ff922db3825eb750c4e2ff784c6ff8fb9e13046ef6a1d1c5401b0b37" [[package]] name = "rustls-webpki" @@ -1010,9 +1010,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.215" +version = "1.0.216" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f" +checksum = "0b9781016e935a97e8beecf0c933758c97a5520d32930e460142b4cd80c6338e" dependencies = [ "serde_derive", ] @@ -1028,9 +1028,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.215" +version = "1.0.216" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" +checksum = "46f859dbbf73865c6627ed570e78961cd3ac92407a2d117204c49232485da55e" dependencies = [ "proc-macro2", "quote", @@ -1166,9 +1166,9 @@ dependencies = [ [[package]] name = "tokio" -version = "1.41.1" +version = "1.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22cfb5bee7a6a52939ca9224d6ac897bb669134078daa8735560897f69de4d33" +checksum = "5cec9b21b0450273377fc97bd4c33a8acffc8c996c987a7c5b319a0083707551" dependencies = [ "backtrace", "libc", @@ -1192,12 +1192,11 @@ dependencies = [ [[package]] name = "tokio-rustls" -version = "0.26.0" +version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" +checksum = "5f6d0975eaace0cf0fcadee4e4aaa5da15b5c079146f2cffb67c113be122bf37" dependencies = [ "rustls", - "rustls-pki-types", "tokio", ] diff --git a/utils/chcache/Cargo.toml b/rust/chcache/Cargo.toml similarity index 67% rename from utils/chcache/Cargo.toml rename to rust/chcache/Cargo.toml index 33ac0e4f79d..72eb9458b4f 100644 --- a/utils/chcache/Cargo.toml +++ b/rust/chcache/Cargo.toml @@ -8,12 +8,12 @@ blake3 = "1.5.4" clickhouse = { version = "0.13.1", features = ["rustls-tls"] } env_logger = { version = "0.11.5", default-features = false } log = "0.4.22" -serde = { version = "1.0.210", features = ["serde_derive"] } +serde = { version = "1.0.215", features = ["serde_derive"] } serde_bytes = "0.11.15" -tokio = { version = "1.40.0", features = ["rt-multi-thread"] } +tokio = { version = "1.42.0", features = ["rt-multi-thread"] } toml = "0.8.19" xdg = "2.5.2" [[bin]] name = "chcache" -path = "src/main.rs" # FIXME +path = "src/main.rs" diff --git a/utils/chcache/src/main.rs b/rust/chcache/src/main.rs similarity index 100% rename from utils/chcache/src/main.rs rename to rust/chcache/src/main.rs