Open fuhailin opened 2 years ago
Hi fuhailin, I came across this issue as well.
I have a hunch that it's due to an additional application of escaping characters when ARROW_CXX_COMPILER_FLAGS
is interpolated in the Arrow build process: https://github.com/apache/arrow/blob/7a0ba80702ef63e63e346d2a9ca3137d8baca8bb/cpp/src/arrow/util/config.h.cmake#L30
Have you had any luck with this since?
Ah, ok -- so the template src/arrow/util/config.h.cmake
is being generated via:
configure_file("src/arrow/util/config.h.cmake" "src/arrow/util/config.h" ESCAPE_QUOTES)
That mucks up the handling of the special __DATE__
, __TIMESTAMP__
, and __TIME__
variables. Note: Bazel sets these to "redacted" to allow for reproducible builds.
I created an issue on the Apache Arrow Jira board: https://issues.apache.org/jira/browse/ARROW-17763
This issue seems to be related to an Arrow CMake project configuration, not an unexpected behavior in rules_foreign_cc
. @fuhailin -- do you think we could close this issue and keep an eye on the Arrow Jira ticket?
@fuhailin : I was able to get Arrow compiling with Bazel.
This can be done by applying a path like this:
--- cpp/cmake_modules/ThirdpartyToolchain.cmake
+++ cpp/cmake_modules/ThirdpartyToolchain.cmake
@@ -4871,6 +4871,6 @@ message(STATUS "All bundled static libraries: ${ARROW_BUNDLED_STATIC_LIBS}")
# Write out the package configurations.
-configure_file("src/arrow/util/config.h.cmake" "src/arrow/util/config.h" ESCAPE_QUOTES)
+configure_file("src/arrow/util/config.h.cmake" "src/arrow/util/config.h")
install(FILES "${ARROW_BINARY_DIR}/src/arrow/util/config.h"
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/arrow/util")
when downloading and extracting Arrow source:
http_archive(
name = "arrow",
build_file = "//third_party/github.com/apache/arrow:BUILD.bazel",
strip_prefix = "apache-arrow-9.0.0",
patches = ["//third_party/github.com/apache/arrow:ThirdpartyToolchain.cmake.patch"],
urls = [
"https://github.com/apache/arrow/archive/refs/tags/apache-arrow-9.0.0.tar.gz"
],
)
I shared the same finding with the Jira ticket as well.
Good luck and let me know if there's anything else I can help with!
Hey @stefan-novak-brt, any chance you could share your WORKSPACE
and BUILD
files? I was using a hacked up version of https://github.com/tensorflow/io/blob/master/third_party/arrow.BUILD
. My script worked fine for Arrow-8.0.0, but it's a real PITA to maintain as arrow's dependencies change... Would love to move to a rules_foreign_cc
based solution instead. Thanks in advance!
Ah nevermind. I think the files provided by fuhailin coupled with your patch should be a good starting point.
Hi, I would like to build the
apache arrow
lib using thecmake
rule. I have a wired issue with CXX_COMPILER_FLAGS but i'm confused how to configure it. I would like to know what is the right approach to set theARROW_CXX_COMPILER_FLAGS
in the cmake rule? thanksWORKSPACE:
third_party/arrow.BUILD
third_party/jemalloc.BUILD
BUILD
I am going to build this target:
bazel build build_test_arrow
error: