-
Notifications
You must be signed in to change notification settings - Fork 4.2k
GH-50194: [C++] Move S3 and AWS-SDK to its own libarrow_s3.so #50195
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
608723b
bf162b6
f7d7f58
2f065c9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, | ||
| # software distributed under the License is distributed on an | ||
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| # KIND, either express or implied. See the License for the | ||
| # specific language governing permissions and limitations | ||
| # under the License. | ||
| # | ||
| # This config sets the following variables in your project:: | ||
| # | ||
| # ArrowS3_FOUND - true if Arrow S3 found on the system | ||
| # | ||
| # This config sets the following targets in your project:: | ||
| # | ||
| # ArrowS3::arrow_s3_shared - for linked as shared library if shared library is built | ||
| # ArrowS3::arrow_s3_static - for linked as static library if static library is built | ||
|
|
||
| @PACKAGE_INIT@ | ||
|
|
||
| include(CMakeFindDependencyMacro) | ||
| find_dependency(Arrow CONFIG) | ||
|
|
||
| include("${CMAKE_CURRENT_LIST_DIR}/ArrowS3Targets.cmake") | ||
|
|
||
| arrow_keep_backward_compatibility(ArrowS3 arrow_s3) | ||
|
|
||
| check_required_components(ArrowS3) | ||
|
|
||
| arrow_show_details(ArrowS3 ARROW_S3) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -960,11 +960,6 @@ if(ARROW_FILESYSTEM) | |
| if(ARROW_HDFS) | ||
| list(APPEND ARROW_FILESYSTEM_SRCS filesystem/hdfs.cc) | ||
| endif() | ||
| if(ARROW_S3) | ||
| list(APPEND ARROW_FILESYSTEM_SRCS filesystem/s3fs.cc) | ||
| set_source_files_properties(filesystem/s3fs.cc PROPERTIES SKIP_UNITY_BUILD_INCLUSION | ||
| ON) | ||
| endif() | ||
|
|
||
| arrow_add_object_library(ARROW_FILESYSTEM ${ARROW_FILESYSTEM_SRCS}) | ||
| if(ARROW_AZURE) | ||
|
|
@@ -984,21 +979,38 @@ if(ARROW_FILESYSTEM) | |
| endforeach() | ||
| endif() | ||
| if(ARROW_S3) | ||
| foreach(ARROW_FILESYSTEM_TARGET ${ARROW_FILESYSTEM_TARGETS}) | ||
| target_link_libraries(${ARROW_FILESYSTEM_TARGET} PRIVATE ${AWSSDK_LINK_LIBRARIES}) | ||
| if(NOT ARROW_BUILD_SHARED AND ARROW_BUILD_STATIC) | ||
| string(APPEND ARROW_S3_PC_CFLAGS "${ARROW_S3_PC_CFLAGS_PRIVATE}") | ||
| set(ARROW_S3_PC_CFLAGS_PRIVATE "") | ||
| endif() | ||
| list(APPEND ARROW_S3_LIB_SRCS filesystem/s3fs_module.cc filesystem/s3fs.cc) | ||
| add_arrow_lib(arrow_s3 | ||
| CMAKE_PACKAGE_NAME | ||
| ArrowS3 | ||
| PKG_CONFIG_NAME | ||
| arrow-s3 | ||
| SOURCES | ||
| ${ARROW_S3_LIB_SRCS} | ||
| SHARED_LINK_LIBS | ||
| arrow_shared | ||
| SHARED_PRIVATE_LINK_LIBS | ||
| ${AWSSDK_LINK_LIBRARIES} | ||
| SHARED_INSTALL_INTERFACE_LIBS | ||
| ${ARROW_S3_SHARED_INSTALL_INTERFACE_LIBS} | ||
| STATIC_LINK_LIBS | ||
| arrow_static | ||
| ${AWSSDK_LINK_LIBRARIES} | ||
| OUTPUTS | ||
| ARROW_S3_LIBRARIES) | ||
| foreach(LIB_TARGET ${ARROW_S3_LIBRARIES}) | ||
| target_compile_definitions(${LIB_TARGET} PRIVATE ARROW_S3_EXPORTING) | ||
| endforeach() | ||
|
|
||
| if(ARROW_S3_MODULE) | ||
| if(NOT ARROW_BUILD_SHARED) | ||
| message(FATAL_ERROR "ARROW_S3_MODULE without shared libarrow (-DARROW_BUILD_SHARED=ON) is not supported" | ||
| ) | ||
| endif() | ||
|
|
||
| add_library(arrow_s3fs MODULE filesystem/s3fs_module.cc filesystem/s3fs.cc) | ||
| target_link_libraries(arrow_s3fs PRIVATE ${AWSSDK_LINK_LIBRARIES} arrow_shared) | ||
| set_source_files_properties(filesystem/s3fs.cc filesystem/s3fs_module.cc | ||
| PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON) | ||
| if(ARROW_BUILD_STATIC AND WIN32) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We use the same pattern on other places: or Taking a look at the definition on visibility.h of So it will only be used on WIN32, it does not seem necessary on others so I would say the |
||
| target_compile_definitions(arrow_s3_static PUBLIC ARROW_S3_STATIC) | ||
| endif() | ||
|
|
||
| set_source_files_properties(filesystem/s3fs.cc filesystem/s3fs_module.cc | ||
| PROPERTIES SKIP_UNITY_BUILD_INCLUSION ON) | ||
| endif() | ||
|
|
||
| list(APPEND ARROW_TESTING_SHARED_LINK_LIBS ${ARROW_GTEST_GMOCK}) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, | ||
| # software distributed under the License is distributed on an | ||
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| # KIND, either express or implied. See the License for the | ||
| # specific language governing permissions and limitations | ||
| # under the License. | ||
|
|
||
| prefix=@CMAKE_INSTALL_PREFIX@ | ||
| includedir=@ARROW_PKG_CONFIG_INCLUDEDIR@ | ||
| libdir=@ARROW_PKG_CONFIG_LIBDIR@ | ||
|
|
||
| Name: Apache Arrow S3 | ||
| Description: Apache Arrow's S3 filesystem implementation. | ||
| Version: @ARROW_VERSION@ | ||
| Requires: arrow | ||
| Libs: -L${libdir} -larrow_s3 | ||
| Cflags:@ARROW_S3_PC_CFLAGS@ | ||
| Cflags.private:@ARROW_S3_PC_CFLAGS_PRIVATE@ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| // Licensed to the Apache Software Foundation (ASF) under one | ||
| // or more contributor license agreements. See the NOTICE file | ||
| // distributed with this work for additional information | ||
| // regarding copyright ownership. The ASF licenses this file | ||
| // to you under the Apache License, Version 2.0 (the | ||
| // "License"); you may not use this file except in compliance | ||
| // with the License. You may obtain a copy of the License at | ||
| // | ||
| // http://www.apache.org/licenses/LICENSE-2.0 | ||
| // | ||
| // Unless required by applicable law or agreed to in writing, | ||
| // software distributed under the License is distributed on an | ||
| // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| // KIND, either express or implied. See the License for the | ||
| // specific language governing permissions and limitations | ||
| // under the License. | ||
|
|
||
| #pragma once | ||
|
|
||
| #if defined(_WIN32) || defined(__CYGWIN__) | ||
| # if defined(_MSC_VER) | ||
| # pragma warning(push) | ||
| # pragma warning(disable : 4251) | ||
| # else | ||
| # pragma GCC diagnostic ignored "-Wattributes" | ||
| # endif | ||
|
|
||
| # ifdef ARROW_S3_STATIC | ||
| # define ARROW_S3_EXPORT | ||
| # elif defined(ARROW_S3_EXPORTING) | ||
| # define ARROW_S3_EXPORT __declspec(dllexport) | ||
| # else | ||
| # define ARROW_S3_EXPORT __declspec(dllimport) | ||
| # endif | ||
|
|
||
| # define ARROW_S3_NO_EXPORT | ||
|
|
||
| # if defined(_MSC_VER) | ||
| # pragma warning(pop) | ||
| # endif | ||
|
|
||
| #else // Not Windows | ||
| # ifndef ARROW_S3_EXPORT | ||
| # define ARROW_S3_EXPORT __attribute__((visibility("default"))) | ||
| # endif | ||
| # ifndef ARROW_S3_NO_EXPORT | ||
| # define ARROW_S3_NO_EXPORT __attribute__((visibility("hidden"))) | ||
| # endif | ||
| #endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the purpose of this? It doesn't seem used below?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From what I remember, this is used to populate the following:
on
arrow/cpp/src/arrow/arrow-s3.pc.inthis is using the same mechanism we introduced for other libraries here:3351aeb
Something to do with pkg-config and static builds, @kou might share some light on why this was necessary I hardly remember but can re-explore again.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general,
Cflags.privateis used only for static build (pkgconf --static ...). If we build only static library,pkgconf ...(no--static) doesn't work. It's inconvenient.This is for making
pkgconf ...(no--static) workable with static library only build. (It's a R package case.)