Skip to content
Merged
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
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,7 @@ repos:
?^ci/scripts/r_sanitize\.sh$|
?^ci/scripts/r_test\.sh$|
?^ci/scripts/r_valgrind\.sh$|
?^ci/scripts/r_windows_build\.sh$|
?^ci/scripts/release_test\.sh$|
?^ci/scripts/ruby_test\.sh$|
?^ci/scripts/rust_build\.sh$|
Expand Down
49 changes: 24 additions & 25 deletions ci/scripts/r_windows_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,21 @@

set -ex

: ${ARROW_HOME:=$(pwd)}
: "${ARROW_HOME:=$(pwd)}"
# Make sure it is absolute and exported
export ARROW_HOME="$(cd "${ARROW_HOME}" && pwd)"
ARROW_HOME="$(cd "${ARROW_HOME}" && pwd)"
export ARROW_HOME

pacman --noconfirm -Syy

RWINLIB_LIB_DIR="lib"
: ${MINGW_ARCH:="mingw32 mingw64 ucrt64"}

: "${MINGW_ARCH:=mingw32 mingw64 ucrt64}"
export MINGW_ARCH

cp $ARROW_HOME/ci/scripts/PKGBUILD .
cp "${ARROW_HOME}/ci/scripts/PKGBUILD" .
printenv
makepkg-mingw --noconfirm --noprogressbar --skippgpcheck --nocheck --syncdeps --cleanbuild

VERSION=$(grep Version $ARROW_HOME/r/DESCRIPTION | cut -d " " -f 2)
VERSION="$(grep Version "${ARROW_HOME}/r/DESCRIPTION" | cut -d " " -f 2)"
DST_DIR="r-libarrow-windows-x86_64-$VERSION"

# Collect the build artifacts and make the shape of zip file that rwinlib expects
Expand All @@ -47,47 +46,47 @@ cd build
MSYS_LIB_DIR="/c/rtools${RTOOLS_VERSION}"

# Untar the builds we made
ls *.xz | xargs -n 1 tar -xJf
mkdir -p $DST_DIR
find . -maxdepth 1 -type f -name '*.xz' -print0 | xargs -0 -n1 tar -xJf
mkdir -p "${DST_DIR}"
# Grab the headers from one, either one is fine
# (if we're building twice to combine old and new toolchains, this may already exist)
if [ ! -d $DST_DIR/include ]; then
mv $(echo $MINGW_ARCH | cut -d ' ' -f 1)/include $DST_DIR
if [ ! -d "${DST_DIR}/include" ]; then
mv "$(echo "${MINGW_ARCH}" | cut -d ' ' -f 1)/include" "${DST_DIR}"
fi

# mingw64 -> x64
# mingw32 -> i386
# ucrt64 -> x64-ucrt

if [ -d mingw64/lib/ ]; then
ls $MSYS_LIB_DIR/mingw64/lib/
ls "${MSYS_LIB_DIR}/mingw64/lib/"
# Make the rest of the directory structure
mkdir -p $DST_DIR/lib/x64
mkdir -p "${DST_DIR}/lib/x64"
# Move the 64-bit versions of libarrow into the expected location
mv mingw64/lib/*.a $DST_DIR/lib/x64
mv mingw64/lib/*.a "${DST_DIR}/lib/x64"
# These are from https://dl.bintray.com/rtools/mingw{32,64}/
cp $MSYS_LIB_DIR/mingw64/lib/lib{snappy,zstd,lz4,brotli*,bz2,crypto,curl,ss*,utf8proc,re2,nghttp2}.a $DST_DIR/lib/x64
cp "${MSYS_LIB_DIR}"/mingw64/lib/lib{snappy,zstd,lz4,brotli*,bz2,crypto,curl,ss*,utf8proc,re2,nghttp2}.a "${DST_DIR}/lib/x64"
fi

# Same for the 32-bit versions
if [ -d mingw32/lib/ ]; then
ls $MSYS_LIB_DIR/mingw32/lib/
mkdir -p $DST_DIR/lib/i386
mv mingw32/lib/*.a $DST_DIR/lib/i386
cp $MSYS_LIB_DIR/mingw32/lib/lib{snappy,zstd,lz4,brotli*,bz2,crypto,curl,ss*,utf8proc,re2,nghttp2}.a $DST_DIR/lib/i386
ls "${MSYS_LIB_DIR}/mingw32/lib/"
mkdir -p "${DST_DIR}/lib/i386"
mv mingw32/lib/*.a "${DST_DIR}/lib/i386"
cp "${MSYS_LIB_DIR}"/mingw32/lib/lib{snappy,zstd,lz4,brotli*,bz2,crypto,curl,ss*,utf8proc,re2,nghttp2}.a "${DST_DIR}/lib/i386"
fi

# Do the same also for ucrt64
if [ -d ucrt64/lib/ ]; then
ls $MSYS_LIB_DIR/ucrt64/lib/
mkdir -p $DST_DIR/lib/x64-ucrt
mv ucrt64/lib/*.a $DST_DIR/lib/x64-ucrt
cp $MSYS_LIB_DIR/ucrt64/lib/lib{snappy,zstd,lz4,brotli*,bz2,crypto,curl,ss*,utf8proc,re2,nghttp2}.a $DST_DIR/lib/x64-ucrt
ls "${MSYS_LIB_DIR}/ucrt64/lib/"
mkdir -p "${DST_DIR}/lib/x64-ucrt"
mv ucrt64/lib/*.a "${DST_DIR}/lib/x64-ucrt"
cp "${MSYS_LIB_DIR}"/ucrt64/lib/lib{snappy,zstd,lz4,brotli*,bz2,crypto,curl,ss*,utf8proc,re2,nghttp2}.a "$DST_DIR"/lib/x64-ucrt
fi

# Create build artifact
zip -r ${DST_DIR}.zip $DST_DIR
zip -r "${DST_DIR}.zip" "$DST_DIR"

# Copy that to a file name/path that does not vary by version number so we
# can easily find it in the R package tests on CI
cp ${DST_DIR}.zip ../libarrow.zip
cp "${DST_DIR}.zip" ../libarrow.zip
Loading