From 02a0ff1a75bd026705208efb7bf72f08b9e7a79e Mon Sep 17 00:00:00 2001 From: Antoine Pitrou Date: Tue, 4 Oct 2022 11:37:44 +0200 Subject: [PATCH 1/2] ARROW-17860: [C++] Deprecate Plasma --- cpp/src/plasma/common.h | 2 ++ docs/source/cpp/build_system.rst | 3 +++ docs/source/developers/cpp/building.rst | 3 +++ 3 files changed, 8 insertions(+) diff --git a/cpp/src/plasma/common.h b/cpp/src/plasma/common.h index 071e55ea30e..d3193bf5c6e 100644 --- a/cpp/src/plasma/common.h +++ b/cpp/src/plasma/common.h @@ -36,6 +36,8 @@ #include "arrow/gpu/cuda_api.h" #endif +#warning "Plasma is deprecated since Arrow 10.0.0. It will be removed in 12.0.0 or so." + namespace plasma { enum class ObjectLocation : int32_t { Local, Remote, NotFound }; diff --git a/docs/source/cpp/build_system.rst b/docs/source/cpp/build_system.rst index 131d7b6f855..d5f63e67f6a 100644 --- a/docs/source/cpp/build_system.rst +++ b/docs/source/cpp/build_system.rst @@ -141,6 +141,9 @@ This is the list of available ones and the respective targets created: CMake is case-sensitive. The names and variables listed above have to be spelt exactly that way! +.. warning:: + Plasma is deprecated as of Arrow 10.0.0, and will be removed in 12.0.0 or so. + .. seealso:: A Docker-based :doc:`minimal build example `. diff --git a/docs/source/developers/cpp/building.rst b/docs/source/developers/cpp/building.rst index 595c3bfcb4d..b99894d97a0 100644 --- a/docs/source/developers/cpp/building.rst +++ b/docs/source/developers/cpp/building.rst @@ -365,6 +365,9 @@ build times if they are not required for your application: * ``-DARROW_IPC=ON``: build the IPC extensions +.. warning:: + Plasma is deprecated as of Arrow 10.0.0, and will be removed in 12.0.0 or so. + Optional Targets ~~~~~~~~~~~~~~~~ From 08b9d0f362bc858051e89a08c144c9156af77793 Mon Sep 17 00:00:00 2001 From: Antoine Pitrou Date: Tue, 4 Oct 2022 12:14:39 +0200 Subject: [PATCH 2/2] Silence warnings when building Plasma --- cpp/cmake_modules/BuildUtils.cmake | 19 ++++++++++++++++++- cpp/src/plasma/CMakeLists.txt | 10 ++++++---- cpp/src/plasma/common.h | 2 ++ 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/cpp/cmake_modules/BuildUtils.cmake b/cpp/cmake_modules/BuildUtils.cmake index 250aadeb331..479b20b7a05 100644 --- a/cpp/cmake_modules/BuildUtils.cmake +++ b/cpp/cmake_modules/BuildUtils.cmake @@ -189,6 +189,7 @@ function(ADD_ARROW_LIB LIB_NAME) EXTRA_INCLUDES PRIVATE_INCLUDES DEPENDENCIES + DEFINITIONS SHARED_INSTALL_INTERFACE_LIBS STATIC_INSTALL_INTERFACE_LIBS OUTPUT_PATH) @@ -247,6 +248,9 @@ function(ADD_ARROW_LIB LIB_NAME) if(ARG_DEPENDENCIES) add_dependencies(${LIB_NAME}_objlib ${ARG_DEPENDENCIES}) endif() + if(ARG_DEFINITIONS) + target_compile_definitions(${LIB_NAME}_objlib PRIVATE ${ARG_DEFINITIONS}) + endif() if(ARG_PRECOMPILED_HEADER_LIB) reuse_precompiled_header_lib(${LIB_NAME}_objlib ${ARG_PRECOMPILED_HEADER_LIB}) endif() @@ -297,6 +301,10 @@ function(ADD_ARROW_LIB LIB_NAME) add_dependencies(${LIB_NAME}_shared ${EXTRA_DEPS}) endif() + if(ARG_DEFINITIONS) + target_compile_definitions(${LIB_NAME}_shared PRIVATE ${ARG_DEFINITIONS}) + endif() + if(ARG_PRECOMPILED_HEADER_LIB) reuse_precompiled_header_lib(${LIB_NAME}_shared ${ARG_PRECOMPILED_HEADER_LIB}) endif() @@ -387,6 +395,10 @@ function(ADD_ARROW_LIB LIB_NAME) add_dependencies(${LIB_NAME}_static ${EXTRA_DEPS}) endif() + if(ARG_DEFINITIONS) + target_compile_definitions(${LIB_NAME}_static PRIVATE ${ARG_DEFINITIONS}) + endif() + if(ARG_PRECOMPILED_HEADER_LIB) reuse_precompiled_header_lib(${LIB_NAME}_static ${ARG_PRECOMPILED_HEADER_LIB}) endif() @@ -632,7 +644,8 @@ function(ADD_TEST_CASE REL_TEST_NAME) LABELS EXTRA_LABELS TEST_ARGUMENTS - PREFIX) + PREFIX + DEFINITIONS) cmake_parse_arguments(ARG "${options}" "${one_value_args}" @@ -703,6 +716,10 @@ function(ADD_TEST_CASE REL_TEST_NAME) add_dependencies(${TEST_NAME} ${ARG_EXTRA_DEPENDENCIES}) endif() + if(ARG_DEFINITIONS) + target_compile_definitions(${TEST_NAME} PRIVATE ${ARG_DEFINITIONS}) + endif() + if(ARROW_TEST_MEMCHECK AND NOT ARG_NO_VALGRIND) add_test(${TEST_NAME} bash diff --git a/cpp/src/plasma/CMakeLists.txt b/cpp/src/plasma/CMakeLists.txt index 7f05d5bcdc6..68f1c5ffa91 100644 --- a/cpp/src/plasma/CMakeLists.txt +++ b/cpp/src/plasma/CMakeLists.txt @@ -83,6 +83,9 @@ add_arrow_lib(plasma plasma SOURCES ${PLASMA_SRCS} + DEFINITIONS + "ARROW_EXPORTING" + "_PLASMA_NO_DEPRECATE" OUTPUTS PLASMA_LIBRARIES SHARED_LINK_FLAGS @@ -98,10 +101,6 @@ add_arrow_lib(plasma add_dependencies(plasma ${PLASMA_LIBRARIES}) -foreach(LIB_TARGET ${PLASMA_LIBRARIES}) - target_compile_definitions(${LIB_TARGET} PRIVATE ARROW_EXPORTING) -endforeach() - # The optimization flag -O3 is suggested by dlmalloc.c, which is #included in # malloc.cc; we set it here regardless of whether we do a debug or release build. set_source_files_properties(dlmalloc.cc PROPERTIES COMPILE_FLAGS "-O3") @@ -134,6 +133,7 @@ else() target_link_libraries(plasma-store-server plasma_shared ${PLASMA_LINK_LIBS}) endif() target_link_libraries(plasma-store-server ${GFLAGS_LIBRARIES}) +target_compile_definitions(plasma-store-server PRIVATE _PLASMA_NO_DEPRECATE) add_dependencies(plasma plasma-store-server) if(ARROW_RPATH_ORIGIN) @@ -190,6 +190,8 @@ function(ADD_PLASMA_TEST REL_TEST_NAME) "plasma" LABELS "plasma-tests" + DEFINITIONS + _PLASMA_NO_DEPRECATE ${ARG_UNPARSED_ARGUMENTS}) endfunction() diff --git a/cpp/src/plasma/common.h b/cpp/src/plasma/common.h index d3193bf5c6e..e09737ceccd 100644 --- a/cpp/src/plasma/common.h +++ b/cpp/src/plasma/common.h @@ -36,7 +36,9 @@ #include "arrow/gpu/cuda_api.h" #endif +#ifndef _PLASMA_NO_DEPRECATE #warning "Plasma is deprecated since Arrow 10.0.0. It will be removed in 12.0.0 or so." +#endif namespace plasma {