Skip to content

Commit

Permalink
Use NuGet
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Nov 6, 2024
1 parent 8b4f8ab commit 2b174f8
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 16 deletions.
13 changes: 6 additions & 7 deletions ci/docker/python-wheel-manylinux.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,8 @@ COPY ci/scripts/install_ccache.sh arrow/ci/scripts/
RUN /arrow/ci/scripts/install_ccache.sh ${ccache} /usr/local

# Install vcpkg
ARG ACTIONS_CACHE_URL
ARG ACTIONS_RUNTIME_TOKEN
ARG VCPKG_BINARY_SOURCES
ARG GITHUB_ACTOR
ARG GITHUB_TOKEN
ARG vcpkg
COPY ci/vcpkg/*.patch \
ci/vcpkg/*linux*.cmake \
Expand All @@ -77,10 +76,10 @@ COPY ci/scripts/install_vcpkg.sh \
arrow/ci/scripts/
ENV VCPKG_ROOT=/opt/vcpkg
ARG build_type=release
ENV ACTIONS_CACHE_URL="${ACTIONS_CACHE_URL}" \
ACTIONS_RUNTIME_TOKEN="${ACTIONS_RUNTIME_TOKEN}" \
CMAKE_BUILD_TYPE=${build_type} \
VCPKG_BINARY_SOURCES="${VCPKG_BINARY_SOURCES}" \
ENV CMAKE_BUILD_TYPE=${build_type} \
GITHUB_ACTOR="${GITHUB_ACTOR}" \
GITHUB_TOKEN="${GITHUB_TOKEN}" \
VCPKG_BINARY_SOURCES="clear;nugetconfig,${VCPKG_ROOT}/nuget.config" \
VCPKG_DEFAULT_TRIPLET=${arch_short}-linux-static-${build_type} \
VCPKG_FEATURE_FLAGS="manifests" \
VCPKG_FORCE_SYSTEM_BINARIES=1 \
Expand Down
38 changes: 38 additions & 0 deletions ci/scripts/install_vcpkg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,42 @@ if [ -f "${vcpkg_ports_patch}" ]; then
echo "Patch successfully applied to the VCPKG port files!"
fi

if [ -n "${GITHUB_TOKEN:-}" ] && [ -n "${GITHUB_ACTOR:-}" ]; then
if type dnf 2>/dev/null; then
dnf install -y epel-release
dnf install -y mono-complete
wget https://dist.nuget.org/win-x86-commandline/v6.10.0/nuget.exe
mv nuget.exe /usr/libexec/
cat <<NUGET > /usr/bin/nuget
#!/bin/sh
exec mono /usr/libexec/nuget.exe "$@"
NUGET
chmod +x /usr/bin/nuget
fi
nuget help
nuget_url="https://nuget.pkg.github.com/${GITHUB_ACTOR}/index.json"
cat <<NUGET_CONFIG > "${VCPKG_ROOT}/nuget.config"
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<config>
<add key="defaultPushSource" value="${nuget_url}" />
</config>
<apikeys>
<add key="${nuget_url}" value="${GITHUB_TOKEN}" />
</apikeys>
<packageSources>
<clear />
<add key="GitHubPackages" value="${nuget_url}" />
</packageSources>
<packageSourcesCredentials>
<GitHubPackages>
<add key="Username" value="${GITHUB_ACTOR}" />
<add key="Password" value="${GITHUB_TOKEN}" />
</GitHubPackages>
</packageSourcesCredentials>
</configuration>
NUGET_CONFIG
fi

popd
11 changes: 2 additions & 9 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,8 @@ x-sccache: &sccache

x-vcpkg-build-args: &vcpkg-build-args
vcpkg: ${VCPKG}
ACTIONS_CACHE_URL:
ACTIONS_RUNTIME_TOKEN:
VCPKG_BINARY_SOURCES: clear;x-gha,rw;files,/vcpkg-cache,rw
GITHUB_ACTOR:
GITHUB_TOKEN:

# CPU/memory limit presets to pass to Docker.
#
Expand Down Expand Up @@ -200,12 +199,8 @@ volumes:
name: maven-cache
python-wheel-manylinux2014-ccache:
name: python-wheel-manylinux2014-ccache
python-wheel-manylinux2014-vcpkg-cache:
name: python-wheel-manylinux2014-vcpkg-cache
python-wheel-manylinux-2-28-ccache:
name: python-wheel-manylinux-2-28-ccache
python-wheel-manylinux-2-28-vcpkg-cache:
name: python-wheel-manylinux-2-28-vcpkg-ccache
python-wheel-windows-clcache:
name: python-wheel-windows-clcache
ubuntu-ccache:
Expand Down Expand Up @@ -1146,7 +1141,6 @@ services:
volumes:
- .:/arrow:delegated
- ${DOCKER_VOLUME_PREFIX}python-wheel-manylinux2014-ccache:/ccache:delegated
- ${DOCKER_VOLUME_PREFIX}python-wheel-manylinux2014-vcpkg-cache:/vcpkg-cache:delegated
command: /arrow/ci/scripts/python_wheel_manylinux_build.sh

# See available versions at:
Expand All @@ -1171,7 +1165,6 @@ services:
volumes:
- .:/arrow:delegated
- ${DOCKER_VOLUME_PREFIX}python-wheel-manylinux-2-28-ccache:/ccache:delegated
- ${DOCKER_VOLUME_PREFIX}python-wheel-manylinux-2-28-vcpkg-cache:/vcpkg-ccache:delegated
command: /arrow/ci/scripts/python_wheel_manylinux_build.sh

python-wheel-manylinux-test-imports:
Expand Down

0 comments on commit 2b174f8

Please sign in to comment.