Skip to content

Commit

Permalink
ARROW-17872: [C++][CI] Reduce macOS CI dependencies (apache#14310)
Browse files Browse the repository at this point in the history
Pin LLVM and Clang-format version to 14 because it's pre-installed on the runner image.

Authored-by: Jin Shang <[email protected]>
Signed-off-by: Sutou Kouhei <[email protected]>
  • Loading branch information
js8544 authored Oct 8, 2022
1 parent 12667cd commit 48c6738
Show file tree
Hide file tree
Showing 12 changed files with 38 additions and 54 deletions.
4 changes: 2 additions & 2 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ FEDORA=35
UBUNTU=20.04

# Default versions for various dependencies
CLANG_TOOLS=12
CLANG_TOOLS=14
CUDA=11.0.3
DASK=latest
DOTNET=6.0
Expand All @@ -64,7 +64,7 @@ HDFS=3.2.1
JDK=8
KARTOTHEK=latest
# LLVM 12 and GCC 11 reports -Wmismatched-new-delete.
LLVM=13
LLVM=14
MAVEN=3.5.4
NODE=16
NUMBA=latest
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,7 @@ jobs:
key: cpp-ccache-macos-${{ hashFiles('cpp/**') }}
restore-keys: cpp-ccache-macos-
- name: Build
# use brew version of clang, to be consistent with LLVM lib, see ARROW-17790.
run: |
export CC=$(brew --prefix llvm)/bin/clang
export CXX=$(brew --prefix llvm)/bin/clang++
ci/scripts/cpp_build.sh $(pwd) $(pwd)/build
- name: Test
shell: bash
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,7 @@ jobs:
-r python/requirements-test.txt
- name: Build
shell: bash
# use brew version of clang, to be consistent with LLVM lib, see ARROW-17790.
run: |
export CC=$(brew --prefix llvm)/bin/clang
export CXX=$(brew --prefix llvm)/bin/clang++
export PYTHON=python3
ci/scripts/cpp_build.sh $(pwd) $(pwd)/build
ci/scripts/python_build.sh $(pwd) $(pwd)/build
Expand Down
3 changes: 0 additions & 3 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -169,10 +169,7 @@ jobs:
key: ruby-ccache-macos-${{ hashFiles('cpp/**') }}
restore-keys: ruby-ccache-macos-
- name: Build C++
# use brew version of clang, to be consistent with LLVM lib, see ARROW-17790.
run: |
export CC=$(brew --prefix llvm)/bin/clang
export CXX=$(brew --prefix llvm)/bin/clang++
ci/scripts/cpp_build.sh $(pwd) $(pwd)/build
- name: Build GLib
run: |
Expand Down
3 changes: 1 addition & 2 deletions cpp/Brewfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ brew "git"
brew "glog"
brew "googletest"
brew "grpc"
brew "llvm"
brew "llvm@12"
brew "llvm@14"
brew "lz4"
brew "ninja"
brew "numpy"
Expand Down
3 changes: 0 additions & 3 deletions cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,6 @@ set(ARROW_LLVM_VERSIONS
"9"
"8"
"7")
list(GET ARROW_LLVM_VERSIONS 0 ARROW_LLVM_VERSION_PRIMARY)
string(REGEX REPLACE "^([0-9]+)(\\..+)?" "\\1" ARROW_LLVM_VERSION_PRIMARY_MAJOR
"${ARROW_LLVM_VERSION_PRIMARY}")

file(READ ${CMAKE_CURRENT_SOURCE_DIR}/../.env ARROW_ENV)
string(REGEX MATCH "CLANG_TOOLS=[^\n]+" ARROW_ENV_CLANG_TOOLS_VERSION "${ARROW_ENV}")
Expand Down
41 changes: 18 additions & 23 deletions cpp/cmake_modules/FindLLVMAlt.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -40,35 +40,30 @@ if(DEFINED LLVM_ROOT)
endif()

if(NOT LLVM_FOUND)
set(LLVM_HINTS ${LLVM_ROOT} ${LLVM_DIR} /usr/lib /usr/share)
if(APPLE)
find_program(BREW brew)
if(BREW)
execute_process(COMMAND ${BREW} --prefix "llvm@${ARROW_LLVM_VERSION_PRIMARY_MAJOR}"
OUTPUT_VARIABLE LLVM_BREW_PREFIX
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(NOT LLVM_BREW_PREFIX)
execute_process(COMMAND ${BREW} --prefix llvm
foreach(ARROW_LLVM_VERSION ${ARROW_LLVM_VERSIONS})
set(LLVM_HINTS ${LLVM_ROOT} ${LLVM_DIR} /usr/lib /usr/share)

if(APPLE)
find_program(BREW brew)
if(BREW)
string(REGEX REPLACE "^([0-9]+)(\\..+)?" "\\1" ARROW_LLVM_VERSION_MAJOR
"${ARROW_LLVM_VERSION}")
execute_process(COMMAND ${BREW} --prefix "llvm@${ARROW_LLVM_VERSION_MAJOR}"
OUTPUT_VARIABLE LLVM_BREW_PREFIX
OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()
if(LLVM_BREW_PREFIX)
list(APPEND LLVM_HINTS ${LLVM_BREW_PREFIX})
endif()
endif()
endif()

foreach(HINT ${LLVM_HINTS})
foreach(ARROW_LLVM_VERSION ${ARROW_LLVM_VERSIONS})
find_package(LLVM
${ARROW_LLVM_VERSION}
CONFIG
HINTS
${HINT})
if(LLVM_FOUND)
break()
endif()
endforeach()
find_package(LLVM
${ARROW_LLVM_VERSION}
CONFIG
HINTS
${LLVM_HINTS})

if(LLVM_FOUND)
break()
endif()
endforeach()
endif()

Expand Down
9 changes: 5 additions & 4 deletions cpp/src/arrow/util/bpacking.cc
Original file line number Diff line number Diff line change
Expand Up @@ -153,13 +153,14 @@ struct Unpack32DynamicFunction {
using FunctionType = decltype(&unpack32_default);

static std::vector<std::pair<DispatchLevel, FunctionType>> implementations() {
return {
{ DispatchLevel::NONE, unpack32_default }
return {{DispatchLevel::NONE, unpack32_default}
#if defined(ARROW_HAVE_RUNTIME_AVX2)
, { DispatchLevel::AVX2, unpack32_avx2 }
,
{DispatchLevel::AVX2, unpack32_avx2}
#endif
#if defined(ARROW_HAVE_RUNTIME_AVX512)
, { DispatchLevel::AVX512, unpack32_avx512 }
,
{DispatchLevel::AVX512, unpack32_avx512}
#endif
};
}
Expand Down
1 change: 0 additions & 1 deletion cpp/src/gandiva/GandivaConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
@PACKAGE_INIT@

set(ARROW_LLVM_VERSIONS "@ARROW_LLVM_VERSIONS@")
set(ARROW_LLVM_VERSION_PRIMARY_MAJOR "@ARROW_LLVM_VERSION_PRIMARY_MAJOR@")

include(CMakeFindDependencyMacro)
find_dependency(Arrow)
Expand Down
12 changes: 6 additions & 6 deletions cpp/src/parquet/level_comparison.cc
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ struct GreaterThanDynamicFunction {
using FunctionType = decltype(&GreaterThanBitmap);

static std::vector<std::pair<DispatchLevel, FunctionType>> implementations() {
return {
{ DispatchLevel::NONE, standard::GreaterThanBitmapImpl }
return {{DispatchLevel::NONE, standard::GreaterThanBitmapImpl}
#if defined(ARROW_HAVE_RUNTIME_AVX2)
, { DispatchLevel::AVX2, GreaterThanBitmapAvx2 }
,
{DispatchLevel::AVX2, GreaterThanBitmapAvx2}
#endif
};
}
Expand All @@ -57,10 +57,10 @@ struct MinMaxDynamicFunction {
using FunctionType = decltype(&FindMinMax);

static std::vector<std::pair<DispatchLevel, FunctionType>> implementations() {
return {
{ DispatchLevel::NONE, standard::FindMinMaxImpl }
return {{DispatchLevel::NONE, standard::FindMinMaxImpl}
#if defined(ARROW_HAVE_RUNTIME_AVX2)
, { DispatchLevel::AVX2, FindMinMaxAvx2 }
,
{DispatchLevel::AVX2, FindMinMaxAvx2}
#endif
};
}
Expand Down
4 changes: 0 additions & 4 deletions dev/tasks/verify-rc/github.macos.amd64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,4 @@ jobs:
USE_CONDA: 1
{% endif %}
run: |
{% if not use_conda %}
export CC=$(brew --prefix llvm)/bin/clang
export CXX=$(brew --prefix llvm)/bin/clang++
{% endif %}
arrow/dev/release/verify-release-candidate.sh {{ release|default("") }} {{ rc|default("") }}
6 changes: 6 additions & 0 deletions python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ include(CMakeParseArguments)
# https://www.cmake.org/cmake/help/latest/policy/CMP0054.html
cmake_policy(SET CMP0054 NEW)

# find_package() uses <PackageName>_ROOT variables.
# https://cmake.org/cmake/help/latest/policy/CMP0074.html
if(POLICY CMP0074)
cmake_policy(SET CMP0074 NEW)
endif()

# Use the first Python installation on PATH, not the newest one
set(Python3_FIND_STRATEGY "LOCATION")
# On Windows, use registry last, not first
Expand Down

0 comments on commit 48c6738

Please sign in to comment.