forked from apache/arrow
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ARROW-11340: [C++] Add vcpkg.json manifest to cpp project root
@kszucs could you review this please? My main purpose in adding this is to improve the experience for Arrow C++ devs using Windows, but I noticed it also relates to your [TODO in apache#9096](https://github.com/apache/arrow/pull/9096/files#diff-990134cce6657dbbcf95457cf1a56810a7efa1f6cd58ecc27557c7d6ff45b533R67-R68). vcpkg does not have any `requirements.txt`-style package enumeration mechanism, but it supports this JSON manifest as a mechanism of defining dependencies. In the `vcpkg install` command, you can specify the path to the directory containing this manifest file with `--x-manifest-root` which later will change to `--manifest-root`. See details at https://vcpkg.readthedocs.io/en/stable/specifications/manifests/. There are some differences between the packages listed in this manifest versus the packages you listed in the `vcpkg install` commands in apache#9096 - This installs `gtest` and `benchmark` - This installs `boost` instead of separate `boost-filesystem`, `boost-regex`, etc. - This does not explicitly include the `core` feature of `aws-sdk-cpp` because explicitly including it causes an error, and it gets installed anyway Closes apache#9287 from ianmcook/ARROW-11340 Lead-authored-by: Ian Cook <ianmcook@gmail.com> Co-authored-by: Sutou Kouhei <kou@clear-code.com> Signed-off-by: Krisztián Szűcs <szucs.krisztian@gmail.com>
- Loading branch information
Showing
11 changed files
with
261 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"configurations": [ | ||
{ | ||
"name": "x64-Debug (default)", | ||
"generator": "Ninja", | ||
"configurationType": "Debug", | ||
"inheritEnvironments": [ "msvc_x64_x64" ], | ||
"buildRoot": "${projectDir}\\out\\build\\${name}", | ||
"installRoot": "${projectDir}\\out\\install\\${name}", | ||
"cmakeCommandArgs": "", | ||
"buildCommandArgs": "", | ||
"ctestCommandArgs": "", | ||
"variables": [ | ||
{ | ||
"name":"VCPKG_MANIFEST_MODE", | ||
"value":"OFF" | ||
} | ||
] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ | ||
"name": "arrow", | ||
"version-string": "4.0.0-SNAPSHOT", | ||
"dependencies": [ | ||
"abseil", | ||
{ | ||
"name": "aws-sdk-cpp", | ||
"features": [ | ||
"config", | ||
"cognito-identity", | ||
"identity-management", | ||
"s3", | ||
"sts", | ||
"transfer" | ||
] | ||
}, | ||
"benchmark", | ||
"boost", | ||
"brotli", | ||
"bzip2", | ||
"c-ares", | ||
"curl", | ||
"flatbuffers", | ||
"gflags", | ||
"glog", | ||
"grpc", | ||
"gtest", | ||
"lz4", | ||
"openssl", | ||
"orc", | ||
"protobuf", | ||
"rapidjson", | ||
"re2", | ||
"snappy", | ||
"thrift", | ||
"utf8proc", | ||
"zlib", | ||
"zstd" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
@rem Licensed to the Apache Software Foundation (ASF) under one | ||
@rem or more contributor license agreements. See the NOTICE file | ||
@rem distributed with this work for additional information | ||
@rem regarding copyright ownership. The ASF licenses this file | ||
@rem to you under the Apache License, Version 2.0 (the | ||
@rem "License"); you may not use this file except in compliance | ||
@rem with the License. You may obtain a copy of the License at | ||
@rem | ||
@rem http://www.apache.org/licenses/LICENSE-2.0 | ||
@rem | ||
@rem Unless required by applicable law or agreed to in writing, | ||
@rem software distributed under the License is distributed on an | ||
@rem "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
@rem KIND, either express or implied. See the License for the | ||
@rem specific language governing permissions and limitations | ||
@rem under the License. | ||
|
||
@rem Run VsDevCmd.bat to set Visual Studio environment variables for building | ||
@rem on the command line. This is the path for Visual Studio Enterprise 2019 | ||
|
||
call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=amd64 | ||
|
||
|
||
@rem Install build dependencies with vcpkg | ||
|
||
@rem TODO(ianmcook): change --x-manifest-root to --manifest-root after it | ||
@rem changes in vcpkg | ||
|
||
vcpkg install ^ | ||
--triplet x64-windows ^ | ||
--x-manifest-root cpp ^ | ||
--clean-after-build ^ | ||
|| exit /B 1 | ||
|
||
|
||
@rem Set environment variables | ||
|
||
set ARROW_TEST_DATA=%cd%\testing\data | ||
set PARQUET_TEST_DATA=%cd%\cpp\submodules\parquet-testing\data | ||
set VCPKG_INSTALLED=%cd%\cpp\vcpkg_installed | ||
|
||
|
||
@rem Build Arrow C++ library | ||
|
||
mkdir cpp\build | ||
pushd cpp\build | ||
|
||
@rem TODO(ianmcook): test using --parallel %NUMBER_OF_PROCESSORS% with | ||
@rem cmake --build instead of specifying -DARROW_CXXFLAGS="/MP" here | ||
@rem (see https://gitlab.kitware.com/cmake/cmake/-/issues/20564) | ||
|
||
@rem TODO(ianmcook): Add -DARROW_BUILD_BENCHMARKS=ON after the issue described | ||
@rem at https://github.com/google/benchmark/issues/1046 is resolved | ||
|
||
cmake -G "Visual Studio 16 2019" -A x64 ^ | ||
-DARROW_BOOST_USE_SHARED=ON ^ | ||
-DARROW_BUILD_SHARED=ON ^ | ||
-DARROW_BUILD_STATIC=OFF ^ | ||
-DARROW_BUILD_TESTS=ON ^ | ||
-DARROW_CXXFLAGS="/MP" ^ | ||
-DARROW_DATASET=ON ^ | ||
-DARROW_DEPENDENCY_SOURCE=SYSTEM ^ | ||
-DARROW_FLIGHT=ON ^ | ||
-DARROW_MIMALLOC=ON ^ | ||
-DARROW_PACKAGE_PREFIX="%VCPKG_INSTALLED%\x64-windows" ^ | ||
-DARROW_PARQUET=ON ^ | ||
-DARROW_PYTHON=OFF ^ | ||
-DARROW_WITH_BROTLI=ON ^ | ||
-DARROW_WITH_BZ2=ON ^ | ||
-DARROW_WITH_LZ4=ON ^ | ||
-DARROW_WITH_SNAPPY=ON ^ | ||
-DARROW_WITH_ZLIB=ON ^ | ||
-DARROW_WITH_ZSTD=ON ^ | ||
-DCMAKE_BUILD_TYPE=release ^ | ||
-DCMAKE_TOOLCHAIN_FILE="C:\vcpkg\scripts\buildsystems\vcpkg.cmake" ^ | ||
-DCMAKE_UNITY_BUILD=ON ^ | ||
-DLZ4_MSVC_LIB_PREFIX="" ^ | ||
-DLZ4_MSVC_STATIC_LIB_SUFFIX="" ^ | ||
-D_VCPKG_INSTALLED_DIR="%VCPKG_INSTALLED%" ^ | ||
-DVCPKG_MANIFEST_MODE=ON ^ | ||
-DVCPKG_TARGET_TRIPLET="x64-windows" ^ | ||
-DZSTD_MSVC_LIB_PREFIX="" ^ | ||
.. || exit /B 1 | ||
|
||
cmake --build . --target INSTALL --config Release || exit /B 1 | ||
|
||
|
||
@rem Test Arrow C++ library | ||
|
||
@rem TODO(ianmcook): Troubleshoot two test failures: | ||
@rem - TestStatisticsSortOrder/0.MinMax | ||
@rem - TestStatistic.Int32Extremums | ||
|
||
ctest --output-on-failure ^ | ||
--parallel %NUMBER_OF_PROCESSORS% ^ | ||
--timeout 300 || exit /B 1 | ||
|
||
popd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# 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. | ||
|
||
# NOTE: must set "Crossbow" as name to have the badge links working in the | ||
# github comment reports! | ||
name: Crossbow | ||
|
||
on: | ||
push: | ||
branches: | ||
- "*-github-*" | ||
|
||
jobs: | ||
test-vcpkg-win: | ||
name: Install build deps with vcpkg and build Arrow C++ | ||
runs-on: windows-2019 | ||
steps: | ||
- name: Checkout Arrow | ||
run: | | ||
git clone --no-checkout {{ arrow.remote }} arrow | ||
git -C arrow fetch -t {{ arrow.remote }} {{ arrow.branch }} | ||
git -C arrow checkout FETCH_HEAD | ||
git -C arrow submodule update --init --recursive | ||
- name: Remove and Reinstall vcpkg | ||
# As of January 2021, the version of vcpkg that is preinstalled on the | ||
# Github Actions windows-2019 image is 2020.11.12, as noted at | ||
# https://github.com/actions/virtual-environments/blob/main/images/win/Windows2019-Readme.md | ||
# This version of vcpkg has a bug that causes the installation of | ||
# aws-cpp-sdk to fail. See details at | ||
# https://github.com/awslabs/aws-c-common/issues/734 | ||
# and https://github.com/microsoft/vcpkg/pull/14716. | ||
# When running vcpkg in Github Actions on Windows, remove the | ||
# preinstalled vcpkg and install the newest version from source. | ||
shell: cmd | ||
run: | | ||
CALL vcpkg integrate remove 2>NUL | ||
CALL C: | ||
CALL cd \ | ||
CALL rmdir /s /q vcpkg 2>NUL | ||
CALL git clone https://github.com/microsoft/vcpkg.git vcpkg | ||
CALL cd vcpkg | ||
CALL bootstrap-vcpkg.bat -win64 -disableMetrics | ||
CALL vcpkg integrate install | ||
CALL setx PATH "%PATH%;C:\vcpkg" | ||
- name: Install Dependencies with vcpkg and Build Arrow C++ | ||
shell: cmd | ||
run: | | ||
CALL cd arrow | ||
CALL dev\tasks\vcpkg-tests\cpp-build-vcpkg.bat |