Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions ci/scripts/install_vcpkg.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/usr/bin/env bash
#
# 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.

set -e

if [ "$#" -ne 2 ]; then
echo "Usage: $0 <vcpkg version> <target directory>"
exit 1
fi

vcpkg_version=$1
vcpkg_destination=$2
vcpkg_patch=$(realpath $(dirname "${0}")/../vcpkg/ports.patch)

git clone --depth 1 --branch ${vcpkg_version} https://github.com/microsoft/vcpkg ${vcpkg_destination}

pushd ${vcpkg_destination}

./bootstrap-vcpkg.sh -useSystemBinaries -disableMetrics
git apply --ignore-whitespace ${vcpkg_patch}
echo "Patch successfully applied!"

popd
46 changes: 15 additions & 31 deletions dev/tasks/python-wheels/github.osx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ env:
VCPKG_DEFAULT_TRIPLET: x64-osx-static-release
VCPKG_FEATURE_FLAGS: "-manifests"
VCPKG_OVERLAY_TRIPLETS: {{ "${{ github.workspace }}/arrow/ci/vcpkg" }}
ARROW_VCPKG_PATCH_FILE: {{ "${{ github.workspace }}/arrow/ci/vcpkg/ports.patch" }}
VCPKG_ROOT: {{ "${{ github.workspace }}/vcpkg" }}

jobs:
build:
Expand All @@ -40,34 +40,20 @@ jobs:
{{ macros.github_checkout_arrow()|indent }}

- name: Install System Dependencies
run: brew install bison ninja

# Restore from cache the previously built ports.
# If cache-miss, download and build vcpkg (aka "bootstrap vcpkg").
- name: Restore from Cache and Install Vcpkg
# Download and build vcpkg, without installing any port.
# If content is cached already, it is a no-op.
uses: kszucs/run-vcpkg@main
run: brew install bison coreutils ninja cmake

- uses: actions/cache@v2
id: vcpkg-cache
with:
# Required to prevent cache eviction on crossbow's main branch
# where we build pre-build the vcpkg packages
setupOnly: true
doNotSaveCache: true
appendedCacheKey: "-macos-{{ macos_deployment_target }}-2021-06-25"
vcpkgDirectory: {{ "${{ github.workspace }}/vcpkg" }}
vcpkgGitCommitId: "2021.04.30"

- name: Patch Vcpkg Ports
run: |
set -ex
cd $VCPKG_ROOT
if ! git apply --reverse --check --ignore-whitespace ${ARROW_VCPKG_PATCH_FILE}; then
git apply --ignore-whitespace ${ARROW_VCPKG_PATCH_FILE}
echo "Patch successfully applied!"
fi

# Now that vcpkg is installed, it is being used to run with the desired arguments.
- name: Install Vcpkg Dependencies
path: vcpkg
key: vcpkg-{{ macos_deployment_target }}-{{ vcpkg_version }}-{{ "${{ hashFiles('arrow/ci/vcpkg/**') }}" }}

- name: Install Vcpkg
if: steps.vcpkg-cache.outputs.cache-hit != 'true'
shell: bash
run: arrow/ci/scripts/install_vcpkg.sh $VCPKG_VERSION $VCPKG_ROOT

- name: Install Packages
run: |
$VCPKG_ROOT/vcpkg install \
abseil \
Expand All @@ -94,9 +80,7 @@ jobs:

{% if arrow_s3 == "ON" %}
- name: Install AWS SDK C++
run: |
$VCPKG_ROOT/vcpkg install \
aws-sdk-cpp[config,cognito-identity,core,identity-management,s3,sts,transfer]
run: $VCPKG_ROOT/vcpkg install aws-sdk-cpp[config,cognito-identity,core,identity-management,s3,sts,transfer]
{% endif %}

- name: Setup Multibuild
Expand Down
1 change: 1 addition & 0 deletions dev/tasks/tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,7 @@ tasks:
ci: github
template: python-wheels/github.osx.yml
params:
vcpkg_version: "2021.04.30"
python_version: {{ python_version }}
macos_deployment_target: {{ macos_version }}
arrow_s3: {{ arrow_s3 }}
Expand Down