Skip to content

Commit

Permalink
License, conditional patching
Browse files Browse the repository at this point in the history
  • Loading branch information
jonkeane committed Dec 7, 2021
1 parent b141103 commit e1599d3
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 3 deletions.
17 changes: 17 additions & 0 deletions cpp/build-support/snappy-UBSAN.patch
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# 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.

diff --git a/snappy.cc b/snappy.cc
index 79dc0e8..2b5e662 100644
--- a/snappy.cc
Expand Down
8 changes: 5 additions & 3 deletions cpp/cmake_modules/ThirdpartyToolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -1026,9 +1026,11 @@ macro(build_snappy)
)

# This can be removed when https://github.com/google/snappy/pull/148 is released
set(SNAPPY_PATCH_COMMAND
"patch" "snappy.cc" "${CMAKE_SOURCE_DIR}/build-support/snappy-UBSAN.patch"
)
# Some platforms don't have patch, but this is probably ok to skip
find_program(patch "patch")
IF(patch)
set(SNAPPY_PATCH_COMMAND "patch" "snappy.cc" "${CMAKE_SOURCE_DIR}/build-support/snappy-UBSAN.patch")
ENDIF()

set(SNAPPY_CMAKE_ARGS
${EP_COMMON_CMAKE_ARGS}
Expand Down
1 change: 1 addition & 0 deletions cpp/thirdparty/versions.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ ARROW_RAPIDJSON_BUILD_VERSION=1a803826f1197b5e30703afe4b9c0e7dd48074f5
ARROW_RAPIDJSON_BUILD_SHA256_CHECKSUM=0b6b780b6c534bfb0b23d29910bfe361e486bcfeaf106db8bc8995792072905a
ARROW_RE2_BUILD_VERSION=2021-02-02
ARROW_RE2_BUILD_SHA256_CHECKSUM=1396ab50c06c1a8885fb68bf49a5ecfd989163015fd96699a180d6414937f33f
# 1.1.9 is patched to implement https://github.com/google/snappy/pull/148 if this is bumped, remove the patch
ARROW_SNAPPY_BUILD_VERSION=1.1.9
ARROW_SNAPPY_BUILD_SHA256_CHECKSUM=75c1fbb3d618dd3a0483bff0e26d0a92b495bbe5059c8b4f1c962b478b6e06e7
# There is a bug in GCC < 4.9 with Snappy 1.1.9, so revert to 1.1.8 for those (ARROW-14661)
Expand Down
6 changes: 6 additions & 0 deletions r/inst/build_arrow_static.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ else
ARROW_DEFAULT_PARAM="OFF"
fi

# Snappy 1.1.9 is patched to implement https://github.com/google/snappy/pull/148 but some platforms don't have
# patch available, so disable snappy in those cases. If the snappy version is bumped, we should remove this.
if [ ! $(command -v patch) ]; then
ARROW_WITH_SNAPPY=OFF
fi

mkdir -p "${BUILD_DIR}"
pushd "${BUILD_DIR}"
${CMAKE} -DARROW_BOOST_USE_SHARED=OFF \
Expand Down

0 comments on commit e1599d3

Please sign in to comment.