bazel-contrib / rules_foreign_cc

Build rules for interfacing with "foreign" (non-Bazel) build systems (CMake, configure-make, GNU Make, boost, ninja, Meson)
https://bazel-contrib.github.io/rules_foreign_cc
Apache License 2.0
680 stars 249 forks source link

Introduce a configure_in_place equivalent for cmake rule #1293

Closed rueteh closed 2 months ago

rueteh commented 2 months ago

cmake versions above 2.35.5 introduces an issue described at https://gitlab.kitware.com/cmake/cmake/-/issues/26293 which copies symlinks in the sandbox to the build directory.

When building with the --experimental_guard_against_concurrent_changes flag, outputs are not uploaded to the (remote) cache due to WARNING: skipping uploading outputs because of concurrent modifications with --experimental_guard_against_concurrent_changes.

This can be reproduced via: https://github.com/rueteh/rfcc_cmake_build/tree/main and running bazel build --disk_cache=/tmp/cache //:_cmake --sandbox_debug.

This MR aims to introduce a workaround until https://gitlab.kitware.com/utils/kwsys/-/merge_requests/303 is merged by copying the source files in the sandbox to the build directory, and performing an in-source cmake build, replicating the functionality of configure_in_place for the configure_make rule.