How can I specify a custom CMake version for a Bazel project (bzlmod)? #1209
-
Hello, I'd like to integrate a CMake library into my Bazel project (bzlmod) and I'm having a few problems. Note: I'm trying to integrate Intel's CIB (https://github.com/intel/compile-time-init-build/tree/main) This third-party project requires I'm trying to specify the CMake version I need by adding the following to my tools = use_extension("@rules_foreign_cc//foreign_cc:extensions.bzl", "tools")
tools.cmake(version = "3.29.1") # Latest registered in `rules_foreign_cc/toolchains/prebuilt_toolchains.bzl`
# use_repo(tools) # Trying that as well but same result. However, I can see that this has no effect, it retains the default value. __________________________
+ /tmp/bazel-working-directory/_main/external/rules_foreign_cc~~tools~cmake-3.23.2-linux-x86_64/bin/cmake -DCMAKE_INSTALL_LOCALSTATEDIR=. -DCMAKE_INSTALL_SYSCONFDIR=. -DPROJECT_BINARY_DIR=. -DCMAKE_TOOLCHAIN_FILE=/tmp/bazel-working-directory/_main/bazel-out/k8-fastbuild/bin/external/_main~_repo_rules~com_intel_cib/cib.build_tmpdir/crosstool_bazel.cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/tmp/bazel-working-directory/_main/bazel-out/k8-fastbuild/bin/external/_main~_repo_rules~com_intel_cib/cib -DCMAKE_PREFIX_PATH=/tmp/bazel-working-directory/_main/bazel-out/k8-fastbuild/bin/external/_main~_repo_rules~com_intel_cib/cib.ext_build_deps -DCMAKE_RANLIB= -G 'Unix Makefiles' /tmp/bazel-working-directory/_main/external/_main~_repo_rules~com_intel_cib
CMake Error at CMakeLists.txt:1 (cmake_minimum_required):
CMake 3.25 or higher is required. You are running version 3.23.2
-- Configuring incomplete, errors occurred!
_____ END BUILD LOGS _____ Am I missing something or is this a bzlmod limitation? We seem to be more limited compared to the old Bazel |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Yep #1157 found the bug that was preventing this. The changes in #1158 are a more complete fix as this adds support for configuring all the tools that rules_foreign_cc makes use of but I don't currently have a way to resolve the issue with the meson toolchain to be able to land this as is. |
Beta Was this translation helpful? Give feedback.
Yep #1157 found the bug that was preventing this. The changes in #1158 are a more complete fix as this adds support for configuring all the tools that rules_foreign_cc makes use of but I don't currently have a way to resolve the issue with the meson toolchain to be able to land this as is.