bazelbuild / rules_foreign_cc

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

cmake broken after switching Bazel from 6.4.0 to 7.0.0 #1155

Closed thx123 closed 5 months ago

thx123 commented 6 months ago

I have two simple cmake build targets that build in Bazel 6.4.0, but start breaking in Bazel 7.0.0. Here are the steps to reproduce:

git clone //github.com/thx123/bazel_cross_compile.git
cd 05_platforms_bzlmod
bazel build third_party:cppzmq

Error message:

ERROR: /home/htie/coding/bazel/bazel_cross_compile/05_platforms_bzlmod/third_party/BUILD:7:6: Error while validating output TreeArtifact File:[[<execution_root>]bazel-out/k8-fastbuild/bin]third_party/ZeroMQ/include : Failed to resolve relative path zmq_utils.h inside TreeArtifact /home/htie/.cache/bazel/_bazel_htie/8cb34b741b2ecdf83f32e4ccc004345a/execroot/_main/bazel-out/k8-fastbuild/bin/third_party/ZeroMQ/include. The associated file is either missing or is an invalid symlink.
ERROR: /home/htie/coding/bazel/bazel_cross_compile/05_platforms_bzlmod/third_party/BUILD:7:6: Foreign Cc - CMake: Building ZeroMQ failed: not all outputs were created or valid

If version in .bazelrc were switched back from 7.0.0 to 6.4.0, the same cmake targets would build successfully. I'd appreciate it if someone could fix this for Bazel 7.0.0. Thanks!

dieortin commented 5 months ago

I'm running into the same error with Bazel 7.0.0

adzenith commented 5 months ago

Duplicate of https://github.com/bazelbuild/rules_foreign_cc/issues/1129

jsharpe commented 5 months ago

Closing as duplicate as noted above