Skip to content

Commit af10718

Browse files
committed
fix(meson): use system OpenSSL for bundled SDK on Linux
1 parent 9a18646 commit af10718

4 files changed

Lines changed: 41 additions & 0 deletions

File tree

‎README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ Arrow, Avro, CRoaring, and sqlpp23 source fallbacks use upstream CMake. Use
123123

124124
Enable S3 with `-Ds3=enabled`. System Arrow must include S3 support; the Arrow
125125
source fallback bundles AWS SDK by default.
126+
On Linux, the bundled SDK uses system OpenSSL for s2n TLS support.
126127
Use `-Dbundle_awssdk=false` to use an installed AWS SDK in the Arrow source build.
127128
When S3 bundles AWS SDK, `-Dsigv4=enabled` reuses it for REST authentication;
128129
SigV4 without S3 requires an installed AWS SDK.

‎mkdocs/docs/getting-started.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ Arrow, Avro, CRoaring, and sqlpp23 source fallbacks use upstream CMake. Use
100100

101101
Enable S3 with `-Ds3=enabled`. System Arrow must include S3 support; the Arrow
102102
source fallback bundles AWS SDK by default.
103+
On Linux, the bundled SDK uses system OpenSSL for s2n TLS support.
103104
Use `-Dbundle_awssdk=false` to use an installed AWS SDK in the Arrow source build.
104105
When S3 bundles AWS SDK, `-Dsigv4=enabled` reuses it for REST authentication;
105106
SigV4 without S3 requires an installed AWS SDK.

‎subprojects/packagefiles/arrow/CMakeLists.txt‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,22 @@ if(NOT DEFINED ENV{ARROW_THRIFT_URL})
4848
set(ENV{ARROW_THRIFT_URL}
4949
"https://archive.apache.org/dist/thrift/0.22.0/thrift-0.22.0.tar.gz")
5050
endif()
51+
52+
if(CMAKE_SYSTEM_NAME STREQUAL "Linux"
53+
AND ARROW_S3
54+
AND AWSSDK_SOURCE STREQUAL "BUNDLED")
55+
# Meson cannot translate s2n's libcrypto symbol rewriting commands. Use the
56+
# same system OpenSSL as Arrow and aws-c-cal instead of embedding AWS-LC.
57+
set(FETCHCONTENT_SOURCE_DIR_AWS-LC "${CMAKE_CURRENT_LIST_DIR}/openssl")
58+
include(FetchContent)
59+
macro(FetchContent_MakeAvailable)
60+
if("${ARGV0}" STREQUAL "s2n-tls")
61+
set(S2N_INTERN_LIBCRYPTO OFF)
62+
set(ADDITIONAL_FLAGS "-DCOMPILE_DEFINITIONS=-I${OPENSSL_INCLUDE_DIR}")
63+
endif()
64+
_fetchcontent_makeavailable(${ARGV})
65+
endmacro()
66+
endif()
5167
add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/cpp" upstream)
5268

5369
# Meson needs compile flags to recognize PIC on archives of object libraries.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
18+
cmake_minimum_required(VERSION 3.25)
19+
20+
# Provide s2n's expected target without introducing a second libcrypto.
21+
find_package(OpenSSL REQUIRED GLOBAL)
22+
add_library(crypto INTERFACE IMPORTED GLOBAL)
23+
target_link_libraries(crypto INTERFACE OpenSSL::Crypto)

0 commit comments

Comments
 (0)