2019-10-03 08:33:31 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
2023-09-04 10:01:48 +00:00
|
|
|
set -eu
|
2019-10-03 08:33:31 +00:00
|
|
|
|
|
|
|
SCRIPT_DIR="$(dirname "$BASH_SOURCE")"
|
|
|
|
SCRIPT_DIR="$(realpath "$SCRIPT_DIR")"
|
|
|
|
|
|
|
|
depsSrcDir="$DEPS_DIR/src"
|
|
|
|
depsToolsetDir="$DEPS_DIR/mingw"
|
|
|
|
|
|
|
|
lz4SrcDir="${depsSrcDir}/lz4"
|
|
|
|
lz4Dir="${depsToolsetDir}/lz4"
|
|
|
|
lz4Tag="v1.9.2"
|
2020-04-02 07:40:38 +00:00
|
|
|
sslTag="OpenSSL_1_1_1c"
|
2019-10-03 08:33:31 +00:00
|
|
|
sslDir="${depsToolsetDir}/openssl"
|
2020-04-02 07:40:38 +00:00
|
|
|
sslSrcDir="${depsSrcDir}/openssl"
|
2019-10-03 08:33:31 +00:00
|
|
|
|
|
|
|
# For now, we'll keep the version number within the file path when not using git.
|
2024-01-09 08:15:34 +00:00
|
|
|
boostUrl="https://download.ceph.com/qa/boost_1_82_0.tar.bz2"
|
|
|
|
boostSha256Sum="a6e1ab9b0860e6a2881dd7b21fe9f737a095e5f33a3a874afc6a345228597ee6"
|
2023-05-15 22:31:38 +00:00
|
|
|
boostSrcDir="${depsSrcDir}/boost_1_82_0"
|
2019-10-03 08:33:31 +00:00
|
|
|
boostDir="${depsToolsetDir}/boost"
|
|
|
|
zlibDir="${depsToolsetDir}/zlib"
|
|
|
|
zlibSrcDir="${depsSrcDir}/zlib"
|
2020-03-24 02:16:28 +00:00
|
|
|
backtraceDir="${depsToolsetDir}/libbacktrace"
|
|
|
|
backtraceSrcDir="${depsSrcDir}/libbacktrace"
|
2019-10-03 08:33:31 +00:00
|
|
|
snappySrcDir="${depsSrcDir}/snappy"
|
|
|
|
snappyDir="${depsToolsetDir}/snappy"
|
win32_deps_build.sh: bump snappy version to 1.1.9
in snappy, the commit of 26102a0c66175bc39edbf484c994a21902e986dc
fixes the SNAPPY_VERSION generation. and this commit was included by
v1.1.8 and v1.1.9.
also, in v1.1.9, a change was introduced, where the function signature
was changed, and more importantly, this change is not backward
compatible:
< bool GetUncompressedLength(Source* source, uint32_t* result);
---
> bool GetUncompressedLength(Source* source, uint32* result);
see also, https://tracker.ceph.com/issues/50934
so we check SNAPPY_VERSION to tell if we should use `uint32_t` or
`uint32`.
in this change, snappy version used to build win32 client is bumped
to the latest stable version, v1.1.9, to include the fix of
SNAPPY_VERSION. this paves the road to fix of https://tracker.ceph.com/issues/50934
Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-07-28 09:01:06 +00:00
|
|
|
snappyTag="1.1.9"
|
2019-10-03 08:33:31 +00:00
|
|
|
# Additional Windows libraries, which aren't provided by Mingw
|
|
|
|
winLibDir="${depsToolsetDir}/windows/lib"
|
|
|
|
|
rbd: allow mounting images on Windows
This change will allow mapping rbd images on Windows, leveraging the
WNBD[1] Virtual Storport Miniport driver [2].
The behavior and CLI is similar to the Linux rbd-nbd, with a few
notable differences:
* device paths cannot be requested. The disk number and path will
be picked by Windows. If a device path is provided by the user
when mapping an image, it will be used as an identifier, which
can also be used when unmapping the image.
* the "show" command was added, which describes a specific mapping.
This can be used for retrieving the disk path.
* the "service" command was added, allowing rbd-wnbd to run as a
Windows service. All mappings are currently perisistent, being
recreated when the service stops, unless explicitly unmapped.
The service disconnects the mappings when being stopped.
* the "list" command also includes a "status" column.
The purpose of the "service" mode is to ensure that mappings survive
reboots and that the Windows service start order can be adjusted so
that rbd images can be mapped before starting services that may depend
on it, such as VMMS.
The mapped images can either be consumed by the host directly or exposed
to Hyper-V VMs.
While at it, we'll skip building rbd-mirror as it's quite unlikely that
this daemon is going to be used on Windows for now.
[1] https://github.com/cloudbase/wnbd
[2] https://docs.microsoft.com/en-us/windows-hardware/drivers/storage/overview-of-storage-virtual-miniport-drivers
Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
2020-07-30 11:40:31 +00:00
|
|
|
wnbdUrl="https://github.com/cloudbase/wnbd"
|
2022-06-20 20:23:27 +00:00
|
|
|
wnbdTag="main"
|
rbd: allow mounting images on Windows
This change will allow mapping rbd images on Windows, leveraging the
WNBD[1] Virtual Storport Miniport driver [2].
The behavior and CLI is similar to the Linux rbd-nbd, with a few
notable differences:
* device paths cannot be requested. The disk number and path will
be picked by Windows. If a device path is provided by the user
when mapping an image, it will be used as an identifier, which
can also be used when unmapping the image.
* the "show" command was added, which describes a specific mapping.
This can be used for retrieving the disk path.
* the "service" command was added, allowing rbd-wnbd to run as a
Windows service. All mappings are currently perisistent, being
recreated when the service stops, unless explicitly unmapped.
The service disconnects the mappings when being stopped.
* the "list" command also includes a "status" column.
The purpose of the "service" mode is to ensure that mappings survive
reboots and that the Windows service start order can be adjusted so
that rbd images can be mapped before starting services that may depend
on it, such as VMMS.
The mapped images can either be consumed by the host directly or exposed
to Hyper-V VMs.
While at it, we'll skip building rbd-mirror as it's quite unlikely that
this daemon is going to be used on Windows for now.
[1] https://github.com/cloudbase/wnbd
[2] https://docs.microsoft.com/en-us/windows-hardware/drivers/storage/overview-of-storage-virtual-miniport-drivers
Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
Signed-off-by: Alin Gabriel Serdean <aserdean@cloudbasesolutions.com>
2020-07-30 11:40:31 +00:00
|
|
|
wnbdSrcDir="${depsSrcDir}/wnbd"
|
|
|
|
wnbdLibDir="${depsToolsetDir}/wnbd/lib"
|
2019-10-03 08:33:31 +00:00
|
|
|
|
cephfs: Add ceph-dokan, providing Windows support
In order to expose ceph filesystems to Windows hosts, we propose
including ceph-dokan[1][2] in the Ceph tree, while updating it to
work with the latest CephFS and Dokany APIs.
Dokany is a well maintained project (fork of the original Dokan
project), allowing filesystems to be implemented in userspace,
even providing a Fuse compatibility layer.
One reason for not using the FUSE compatibility layer is that it's
only covering the high level API while Ceph is using the low level
FUSE API, which among other things is inode centric.
Changes made by this patch compared to the upstream ceph-dokan:
* support latest stable Dokany API. The upstream version relies on
the legacy unmaintained Dokan API
* return proper error codes, converting standard errno.h values to
NTSTATUS
* minor changes to support latest cephfs API
* drop duplicated ceph code, no longer needed if we're to include it
in tree. This makes it much easier to maintain.
* drop redundant permission checks, leaving it up to libcephfs
* use ceph argparse helpers
* use ceph logging and daemon initialization
* fixed unicode handling
* switched to ceph coding style
* made ceph.conf param optional, using the default path if available
* enabled setting file timestamps
* append support
* configurable timeouts set once per mount
* ensure that the error code is always logged
* various cleanups (removed unused entry points, checks that have
been moved to dokany, simplified conditional statements,
unnecessary conversions in the hot path, etc).
[1] https://github.com/ketor/ceph-dokan
[2] https://github.com/ceph/ceph-dokan
Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
2020-08-07 12:07:20 +00:00
|
|
|
dokanUrl="https://github.com/dokan-dev/dokany"
|
2022-08-29 14:18:58 +00:00
|
|
|
dokanTag="v2.0.5.1000"
|
cephfs: Add ceph-dokan, providing Windows support
In order to expose ceph filesystems to Windows hosts, we propose
including ceph-dokan[1][2] in the Ceph tree, while updating it to
work with the latest CephFS and Dokany APIs.
Dokany is a well maintained project (fork of the original Dokan
project), allowing filesystems to be implemented in userspace,
even providing a Fuse compatibility layer.
One reason for not using the FUSE compatibility layer is that it's
only covering the high level API while Ceph is using the low level
FUSE API, which among other things is inode centric.
Changes made by this patch compared to the upstream ceph-dokan:
* support latest stable Dokany API. The upstream version relies on
the legacy unmaintained Dokan API
* return proper error codes, converting standard errno.h values to
NTSTATUS
* minor changes to support latest cephfs API
* drop duplicated ceph code, no longer needed if we're to include it
in tree. This makes it much easier to maintain.
* drop redundant permission checks, leaving it up to libcephfs
* use ceph argparse helpers
* use ceph logging and daemon initialization
* fixed unicode handling
* switched to ceph coding style
* made ceph.conf param optional, using the default path if available
* enabled setting file timestamps
* append support
* configurable timeouts set once per mount
* ensure that the error code is always logged
* various cleanups (removed unused entry points, checks that have
been moved to dokany, simplified conditional statements,
unnecessary conversions in the hot path, etc).
[1] https://github.com/ketor/ceph-dokan
[2] https://github.com/ceph/ceph-dokan
Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
2020-08-07 12:07:20 +00:00
|
|
|
dokanSrcDir="${depsSrcDir}/dokany"
|
|
|
|
dokanLibDir="${depsToolsetDir}/dokany/lib"
|
|
|
|
|
2023-08-18 12:25:52 +00:00
|
|
|
mingwLlvmUrl="https://github.com/mstorsjo/llvm-mingw/releases/download/20230320/llvm-mingw-20230320-ucrt-ubuntu-18.04-x86_64.tar.xz"
|
|
|
|
mingwLlvmSha256Sum="bc367753dea829d219be32e2e64e2d15d03158ce8e700ae5210ca3d78e6a07ea"
|
2023-04-07 10:39:59 +00:00
|
|
|
mingwLlvmDir="${DEPS_DIR}/mingw-llvm"
|
|
|
|
|
2019-10-03 08:33:31 +00:00
|
|
|
function _make() {
|
|
|
|
make -j $NUM_WORKERS $@
|
|
|
|
}
|
|
|
|
|
2020-05-27 10:23:45 +00:00
|
|
|
if [[ -d $DEPS_DIR ]]; then
|
|
|
|
echo "Cleaning up dependency build dir: $DEPS_DIR"
|
|
|
|
rm -rf $DEPS_DIR
|
|
|
|
fi
|
|
|
|
|
2019-10-03 08:33:31 +00:00
|
|
|
mkdir -p $DEPS_DIR
|
|
|
|
mkdir -p $depsToolsetDir
|
|
|
|
mkdir -p $depsSrcDir
|
|
|
|
|
2021-05-06 07:18:56 +00:00
|
|
|
echo "Installing required packages."
|
2020-03-27 02:43:22 +00:00
|
|
|
case "$OS" in
|
2022-09-09 17:37:16 +00:00
|
|
|
rhel)
|
|
|
|
# pkgconf needs https://bugzilla.redhat.com/show_bug.cgi?id=1975416
|
|
|
|
sudo yum -y --setopt=skip_missing_names_on_install=False install \
|
|
|
|
mingw64-gcc-c++ \
|
|
|
|
cmake \
|
|
|
|
pkgconf \
|
|
|
|
python3-devel \
|
|
|
|
autoconf \
|
|
|
|
libtool \
|
|
|
|
ninja-build \
|
|
|
|
zip \
|
2024-01-09 08:15:34 +00:00
|
|
|
bzip2 \
|
|
|
|
xz \
|
2022-09-09 17:37:16 +00:00
|
|
|
python3-PyYAML \
|
|
|
|
gcc \
|
|
|
|
diffutils \
|
|
|
|
patch \
|
|
|
|
wget \
|
|
|
|
perl \
|
|
|
|
git-core
|
|
|
|
;;
|
2020-03-27 02:43:22 +00:00
|
|
|
ubuntu)
|
|
|
|
sudo apt-get update
|
2022-09-13 16:44:05 +00:00
|
|
|
sudo env DEBIAN_FRONTEND=noninteractive apt-get -y install \
|
2023-04-06 11:05:47 +00:00
|
|
|
mingw-w64 g++ cmake pkg-config \
|
|
|
|
python3-dev python3-yaml \
|
2024-01-09 08:15:34 +00:00
|
|
|
autoconf libtool ninja-build wget xz-utils zip bzip2 \
|
2023-04-06 11:05:47 +00:00
|
|
|
git
|
2020-03-27 02:43:22 +00:00
|
|
|
;;
|
|
|
|
suse)
|
|
|
|
for PKG in mingw64-cross-gcc-c++ mingw64-libgcc_s_seh1 mingw64-libstdc++6 \
|
2024-01-09 08:15:34 +00:00
|
|
|
cmake pkgconf python3-devel autoconf libtool ninja xz zip bzip2 \
|
2023-04-06 11:05:47 +00:00
|
|
|
python3-PyYAML \
|
2021-04-09 10:54:46 +00:00
|
|
|
gcc patch wget git; do
|
2020-03-27 02:43:22 +00:00
|
|
|
rpm -q $PKG >/dev/null || zypper -n install $PKG
|
|
|
|
done
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2023-04-07 10:39:59 +00:00
|
|
|
if [[ -n $USE_MINGW_LLVM && ! -d $mingwLlvmDir ]]; then
|
|
|
|
echo "Fetching mingw-llvm"
|
|
|
|
cd $DEPS_DIR
|
|
|
|
wget -q -O mingw-llvm.tar.xz $mingwLlvmUrl
|
|
|
|
checksum=`sha256sum mingw-llvm.tar.xz | cut -d ' ' -f 1`
|
|
|
|
if [[ "$mingwLlvmSha256Sum" != "$checksum" ]]; then
|
|
|
|
echo "Invalid mingw-llvm checksum: $checksum" >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
tar xJf mingw-llvm.tar.xz
|
|
|
|
rm mingw-llvm.tar.xz
|
|
|
|
# Remove the version from the mingw-llvm dirname, making it easier to locate
|
|
|
|
# and avoiding MAX_PATH issues with WSL.
|
|
|
|
mv `basename $mingwLlvmUrl | sed 's/\.tar\..*//g'` $mingwLlvmDir
|
|
|
|
fi
|
|
|
|
|
2020-03-27 02:43:22 +00:00
|
|
|
MINGW_CMAKE_FILE="$DEPS_DIR/mingw.cmake"
|
|
|
|
source "$SCRIPT_DIR/mingw_conf.sh"
|
2019-10-03 08:33:31 +00:00
|
|
|
|
2021-05-06 07:18:56 +00:00
|
|
|
echo "Building zlib."
|
2019-10-03 08:33:31 +00:00
|
|
|
cd $depsSrcDir
|
2020-03-24 02:16:28 +00:00
|
|
|
if [[ ! -d $zlibSrcDir ]]; then
|
2022-09-30 20:56:35 +00:00
|
|
|
git clone --depth 1 https://github.com/madler/zlib
|
2019-10-03 08:33:31 +00:00
|
|
|
fi
|
2020-03-24 02:16:28 +00:00
|
|
|
cd $zlibSrcDir
|
2019-10-03 08:33:31 +00:00
|
|
|
# Apparently the configure script is broken...
|
2020-03-27 02:43:22 +00:00
|
|
|
sed -e s/"PREFIX = *$"/"PREFIX = ${MINGW_PREFIX}"/ -i win32/Makefile.gcc
|
2019-10-03 08:33:31 +00:00
|
|
|
_make -f win32/Makefile.gcc
|
|
|
|
_make BINARY_PATH=$zlibDir \
|
|
|
|
INCLUDE_PATH=$zlibDir/include \
|
|
|
|
LIBRARY_PATH=$zlibDir/lib \
|
|
|
|
SHARED_MODE=1 \
|
|
|
|
-f win32/Makefile.gcc install
|
|
|
|
|
2021-05-06 07:18:56 +00:00
|
|
|
echo "Building lz4."
|
2019-10-03 08:33:31 +00:00
|
|
|
cd $depsToolsetDir
|
|
|
|
if [[ ! -d $lz4Dir ]]; then
|
2021-07-28 09:12:33 +00:00
|
|
|
git clone --branch $lz4Tag --depth 1 https://github.com/lz4/lz4
|
|
|
|
cd $lz4Dir
|
2019-10-03 08:33:31 +00:00
|
|
|
fi
|
2020-03-24 02:16:28 +00:00
|
|
|
cd $lz4Dir
|
2020-03-27 02:43:22 +00:00
|
|
|
_make BUILD_STATIC=no CC=${MINGW_CC%-posix*} \
|
|
|
|
DLLTOOL=${MINGW_DLLTOOL} \
|
|
|
|
WINDRES=${MINGW_WINDRES} \
|
2020-03-23 13:34:37 +00:00
|
|
|
TARGET_OS=Windows_NT
|
2019-10-03 08:33:31 +00:00
|
|
|
|
2021-05-06 07:18:56 +00:00
|
|
|
echo "Building OpenSSL."
|
2019-10-03 08:33:31 +00:00
|
|
|
cd $depsSrcDir
|
|
|
|
if [[ ! -d $sslSrcDir ]]; then
|
2021-07-28 09:12:33 +00:00
|
|
|
git clone --branch $sslTag --depth 1 https://github.com/openssl/openssl
|
|
|
|
cd $sslSrcDir
|
2019-10-03 08:33:31 +00:00
|
|
|
fi
|
|
|
|
cd $sslSrcDir
|
|
|
|
mkdir -p $sslDir
|
2020-03-27 02:43:22 +00:00
|
|
|
CROSS_COMPILE="${MINGW_PREFIX}" ./Configure \
|
2020-04-02 15:45:44 +00:00
|
|
|
mingw64 shared --prefix=$sslDir --libdir="$sslDir/lib"
|
2019-10-03 08:33:31 +00:00
|
|
|
_make depend
|
|
|
|
_make
|
2022-09-09 17:38:29 +00:00
|
|
|
_make install_sw
|
2019-10-03 08:33:31 +00:00
|
|
|
|
2021-05-06 07:18:56 +00:00
|
|
|
echo "Building boost."
|
2019-10-03 08:33:31 +00:00
|
|
|
cd $depsSrcDir
|
|
|
|
if [[ ! -d $boostSrcDir ]]; then
|
2021-05-06 07:18:56 +00:00
|
|
|
echo "Downloading boost."
|
2024-01-09 08:15:34 +00:00
|
|
|
wget -q -O boost.tar.bz2 $boostUrl
|
|
|
|
checksum=`sha256sum boost.tar.bz2 | cut -d ' ' -f 1`
|
2023-04-07 10:39:59 +00:00
|
|
|
if [[ "$boostSha256Sum" != "$checksum" ]]; then
|
|
|
|
echo "Invalid boost checksum: $checksum" >&2
|
|
|
|
exit 1
|
|
|
|
fi
|
2024-01-09 08:15:34 +00:00
|
|
|
tar -xf boost.tar.bz2
|
|
|
|
rm boost.tar.bz2
|
2019-10-03 08:33:31 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
cd $boostSrcDir
|
2023-04-07 10:39:59 +00:00
|
|
|
|
|
|
|
if [[ -n $USE_MINGW_LLVM ]]; then
|
|
|
|
b2toolset="clang"
|
|
|
|
echo "using clang : : ${MINGW_CXX} ;" > user-config.jam
|
|
|
|
else
|
|
|
|
b2toolset="gcc-mingw32"
|
|
|
|
echo "using gcc : mingw32 : ${MINGW_CXX} ;" > user-config.jam
|
|
|
|
fi
|
2019-10-03 08:33:31 +00:00
|
|
|
|
|
|
|
# Workaround for https://github.com/boostorg/thread/issues/156
|
|
|
|
# Older versions of mingw provided a different pthread lib.
|
|
|
|
sed -i 's/lib$(libname)GC2.a/lib$(libname).a/g' ./libs/thread/build/Jamfile.v2
|
2023-04-07 10:39:59 +00:00
|
|
|
if [[ -z $USE_MINGW_LLVM ]]; then
|
|
|
|
sed -i 's/mthreads/pthreads/g' ./tools/build/src/tools/gcc.jam
|
|
|
|
sed -i 's/pthreads/mthreads/g' ./tools/build/src/tools/gcc.jam
|
|
|
|
fi
|
2019-10-03 08:33:31 +00:00
|
|
|
|
2020-03-27 02:43:22 +00:00
|
|
|
export PTW32_INCLUDE=${PTW32Include}
|
|
|
|
export PTW32_LIB=${PTW32Lib}
|
2019-10-03 08:33:31 +00:00
|
|
|
|
2021-05-06 07:18:56 +00:00
|
|
|
echo "Patching boost."
|
2019-10-03 08:33:31 +00:00
|
|
|
# Fix getting Windows page size
|
|
|
|
# TODO: send this upstream and maybe use a fork until it merges.
|
|
|
|
# Meanwhile, we might consider moving those to ceph/cmake/modules/BuildBoost.cmake.
|
|
|
|
# This cmake module will first have to be updated to support Mingw though.
|
2020-03-06 11:05:18 +00:00
|
|
|
patch -N boost/thread/pthread/thread_data.hpp <<EOL
|
2019-10-03 08:33:31 +00:00
|
|
|
--- boost/thread/pthread/thread_data.hpp 2019-10-11 15:26:15.678703586 +0300
|
|
|
|
+++ boost/thread/pthread/thread_data.hpp.new 2019-10-11 15:26:07.321463698 +0300
|
|
|
|
@@ -32,6 +32,10 @@
|
|
|
|
# endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
+#if defined(_WIN32)
|
|
|
|
+#include <windows.h>
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
#include <pthread.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
|
|
|
|
@@ -54,6 +58,10 @@
|
|
|
|
if (size==0) return;
|
|
|
|
#ifdef BOOST_THREAD_USES_GETPAGESIZE
|
|
|
|
std::size_t page_size = getpagesize();
|
|
|
|
+#elif _WIN32
|
|
|
|
+ SYSTEM_INFO system_info;
|
|
|
|
+ ::GetSystemInfo (&system_info);
|
|
|
|
+ std::size_t page_size = system_info.dwPageSize;
|
|
|
|
#else
|
|
|
|
std::size_t page_size = ::sysconf( _SC_PAGESIZE);
|
|
|
|
#endif
|
|
|
|
EOL
|
|
|
|
|
2023-08-18 13:10:59 +00:00
|
|
|
# https://github.com/boostorg/stacktrace/pull/140
|
|
|
|
# https://github.com/boostorg/stacktrace/issues/133
|
|
|
|
patch -N boost/stacktrace/detail/frame_msvc.ipp <<'EOL'
|
|
|
|
--- boost/stacktrace/detail/frame_msvc.ipp 2023-08-18 12:29:37.127229733 +0000
|
|
|
|
+++ boost/stacktrace/detail/frame_msvc.ipp.new 2023-08-18 12:28:23.713294554 +0000
|
|
|
|
@@ -28,9 +28,13 @@
|
|
|
|
|
|
|
|
|
|
|
|
#ifdef __CRT_UUID_DECL // for __MINGW32__
|
|
|
|
+#if !defined(__MINGW32__) || \
|
|
|
|
+ (!defined(__clang__) && __GNUC__ < 12) || \
|
|
|
|
+ (defined(__clang__) && __clang_major__ < 16)
|
|
|
|
__CRT_UUID_DECL(IDebugClient,0x27fe5639,0x8407,0x4f47,0x83,0x64,0xee,0x11,0x8f,0xb0,0x8a,0xc8)
|
|
|
|
__CRT_UUID_DECL(IDebugControl,0x5182e668,0x105e,0x416e,0xad,0x92,0x24,0xef,0x80,0x04,0x24,0xba)
|
|
|
|
__CRT_UUID_DECL(IDebugSymbols,0x8c31e98c,0x983a,0x48a5,0x90,0x16,0x6f,0xe5,0xd6,0x67,0xa9,0x50)
|
|
|
|
+#endif
|
|
|
|
#elif defined(DEFINE_GUID) && !defined(BOOST_MSVC)
|
|
|
|
DEFINE_GUID(IID_IDebugClient,0x27fe5639,0x8407,0x4f47,0x83,0x64,0xee,0x11,0x8f,0xb0,0x8a,0xc8);
|
|
|
|
DEFINE_GUID(IID_IDebugControl,0x5182e668,0x105e,0x416e,0xad,0x92,0x24,0xef,0x80,0x04,0x24,0xba);
|
|
|
|
EOL
|
|
|
|
|
2019-10-03 08:33:31 +00:00
|
|
|
./bootstrap.sh
|
|
|
|
|
2023-08-23 14:21:12 +00:00
|
|
|
if [[ $ENABLE_SHARED == "ON" ]]; then
|
|
|
|
b2_link="shared"
|
|
|
|
else
|
|
|
|
b2_link="static"
|
|
|
|
fi
|
|
|
|
|
2023-04-07 10:39:59 +00:00
|
|
|
./b2 install --user-config=user-config.jam toolset=$b2toolset \
|
2019-10-03 08:33:31 +00:00
|
|
|
target-os=windows release \
|
2023-08-23 14:21:12 +00:00
|
|
|
link=$b2_link \
|
2022-07-04 13:59:46 +00:00
|
|
|
threadapi=win32 --prefix=$boostDir \
|
2019-10-03 08:33:31 +00:00
|
|
|
address-model=64 architecture=x86 \
|
|
|
|
binary-format=pe abi=ms -j $NUM_WORKERS \
|
|
|
|
-sZLIB_INCLUDE=$zlibDir/include -sZLIB_LIBRARY_PATH=$zlibDir/lib \
|
2021-01-07 13:14:00 +00:00
|
|
|
--without-python --without-mpi --without-log --without-wave
|
2019-10-03 08:33:31 +00:00
|
|
|
|
2023-08-23 14:21:12 +00:00
|
|
|
if [[ -n $USE_MINGW_LLVM && $ENABLE_SHARED == "ON" ]]; then
|
|
|
|
# b2 doesn't generate import libs when using mingw-llvm. We'll tell cmake
|
|
|
|
# to use the dlls instead of import libs, which mingw is capable of.
|
|
|
|
#
|
|
|
|
# TODO: consider dropping this if we get to fix Boost's clang-linux.jam
|
|
|
|
# file. Worth mentioning that Boost might drop the import libs altogether:
|
|
|
|
# https://github.com/bfgroup/b2/issues/278
|
|
|
|
find $boostDir/lib/cmake -name "*.cmake" \
|
|
|
|
-exec sed -i 's/IMPORTED_LOCATION_RELEASE/IMPORTED_IMPLIB_RELEASE/g' {} \;
|
|
|
|
fi
|
|
|
|
|
2021-05-06 07:18:56 +00:00
|
|
|
echo "Building libbacktrace."
|
2019-10-03 08:33:31 +00:00
|
|
|
cd $depsSrcDir
|
|
|
|
if [[ ! -d $backtraceSrcDir ]]; then
|
2022-09-30 20:56:35 +00:00
|
|
|
git clone --depth 1 https://github.com/ianlancetaylor/libbacktrace
|
2019-10-03 08:33:31 +00:00
|
|
|
fi
|
2020-03-24 02:16:28 +00:00
|
|
|
mkdir -p $backtraceSrcDir/build
|
|
|
|
cd $backtraceSrcDir/build
|
2019-10-03 08:33:31 +00:00
|
|
|
../configure --prefix=$backtraceDir --exec-prefix=$backtraceDir \
|
2020-04-02 15:45:44 +00:00
|
|
|
--host ${MINGW_BASE} --enable-host-shared \
|
|
|
|
--libdir="$backtraceDir/lib"
|
2019-10-03 08:33:31 +00:00
|
|
|
_make LDFLAGS="-no-undefined"
|
|
|
|
_make install
|
|
|
|
|
2021-05-06 07:18:56 +00:00
|
|
|
echo "Building snappy."
|
2019-10-03 08:33:31 +00:00
|
|
|
cd $depsSrcDir
|
|
|
|
if [[ ! -d $snappySrcDir ]]; then
|
2021-07-28 09:12:33 +00:00
|
|
|
git clone --branch $snappyTag --depth 1 https://github.com/google/snappy
|
|
|
|
cd $snappySrcDir
|
2019-10-03 08:33:31 +00:00
|
|
|
fi
|
2020-03-24 02:16:28 +00:00
|
|
|
mkdir -p $snappySrcDir/build
|
|
|
|
cd $snappySrcDir/build
|
2019-10-03 08:33:31 +00:00
|
|
|
|
|
|
|
cmake -DCMAKE_INSTALL_PREFIX=$snappyDir \
|
|
|
|
-DCMAKE_BUILD_TYPE=Release \
|
|
|
|
-DBUILD_SHARED_LIBS=ON \
|
|
|
|
-DSNAPPY_BUILD_TESTS=OFF \
|
win32_deps_build.sh: bump snappy version to 1.1.9
in snappy, the commit of 26102a0c66175bc39edbf484c994a21902e986dc
fixes the SNAPPY_VERSION generation. and this commit was included by
v1.1.8 and v1.1.9.
also, in v1.1.9, a change was introduced, where the function signature
was changed, and more importantly, this change is not backward
compatible:
< bool GetUncompressedLength(Source* source, uint32_t* result);
---
> bool GetUncompressedLength(Source* source, uint32* result);
see also, https://tracker.ceph.com/issues/50934
so we check SNAPPY_VERSION to tell if we should use `uint32_t` or
`uint32`.
in this change, snappy version used to build win32 client is bumped
to the latest stable version, v1.1.9, to include the fix of
SNAPPY_VERSION. this paves the road to fix of https://tracker.ceph.com/issues/50934
Signed-off-by: Kefu Chai <kchai@redhat.com>
2021-07-28 09:01:06 +00:00
|
|
|
-DSNAPPY_BUILD_BENCHMARKS=OFF \
|
2019-10-03 08:33:31 +00:00
|
|
|
-DCMAKE_TOOLCHAIN_FILE=$MINGW_CMAKE_FILE \
|
|
|
|
../
|
|
|
|
_make
|
|
|
|
_make install
|
|
|
|
|
|
|
|
cmake -DCMAKE_INSTALL_PREFIX=$snappyDir \
|
|
|
|
-DCMAKE_BUILD_TYPE=Release \
|
|
|
|
-DBUILD_SHARED_LIBS=OFF \
|
|
|
|
-DSNAPPY_BUILD_TESTS=OFF \
|
|
|
|
-DCMAKE_TOOLCHAIN_FILE=$MINGW_CMAKE_FILE \
|
|
|
|
../
|
|
|
|
_make
|
|
|
|
_make install
|
|
|
|
|
2021-05-06 07:18:56 +00:00
|
|
|
echo "Generating mswsock.lib."
|
2019-10-03 08:33:31 +00:00
|
|
|
# mswsock.lib is not provided by mingw, so we'll have to generate
|
|
|
|
# it.
|
|
|
|
mkdir -p $winLibDir
|
|
|
|
cat > $winLibDir/mswsock.def <<EOF
|
|
|
|
LIBRARY MSWSOCK.DLL
|
|
|
|
EXPORTS
|
|
|
|
AcceptEx@32
|
|
|
|
EnumProtocolsA@12
|
|
|
|
EnumProtocolsW@12
|
|
|
|
GetAcceptExSockaddrs@32
|
|
|
|
GetAddressByNameA@40
|
|
|
|
GetAddressByNameW@40
|
|
|
|
GetNameByTypeA@12
|
|
|
|
GetNameByTypeW@12
|
|
|
|
GetServiceA@28
|
|
|
|
GetServiceW@28
|
|
|
|
GetTypeByNameA@8
|
|
|
|
GetTypeByNameW@8
|
|
|
|
MigrateWinsockConfiguration@12
|
|
|
|
NPLoadNameSpaces@12
|
|
|
|
SetServiceA@24
|
|
|
|
SetServiceW@24
|
|
|
|
TransmitFile@28
|
|
|
|
WSARecvEx@16
|
|
|
|
dn_expand@20
|
|
|
|
getnetbyname@4
|
|
|
|
inet_network@4
|
|
|
|
rcmd@24
|
|
|
|
rexec@24rresvport@4
|
|
|
|
s_perror@8sethostname@8
|
|
|
|
EOF
|
|
|
|
|
2020-03-27 02:43:22 +00:00
|
|
|
$MINGW_DLLTOOL -d $winLibDir/mswsock.def \
|
|
|
|
-l $winLibDir/libmswsock.a
|
2020-03-24 03:13:36 +00:00
|
|
|
|
2021-05-06 07:18:56 +00:00
|
|
|
echo "Fetching libwnbd."
|
2020-12-02 09:27:00 +00:00
|
|
|
cd $depsSrcDir
|
|
|
|
if [[ ! -d $wnbdSrcDir ]]; then
|
2022-09-30 20:56:35 +00:00
|
|
|
git clone --branch $wnbdTag --depth 1 $wnbdUrl
|
2020-12-02 09:27:00 +00:00
|
|
|
fi
|
|
|
|
cd $wnbdSrcDir
|
|
|
|
mkdir -p $wnbdLibDir
|
|
|
|
$MINGW_DLLTOOL -d $wnbdSrcDir/libwnbd/libwnbd.def \
|
|
|
|
-D libwnbd.dll \
|
|
|
|
-l $wnbdLibDir/libwnbd.a
|
|
|
|
|
2021-05-06 07:18:56 +00:00
|
|
|
echo "Fetching dokany."
|
cephfs: Add ceph-dokan, providing Windows support
In order to expose ceph filesystems to Windows hosts, we propose
including ceph-dokan[1][2] in the Ceph tree, while updating it to
work with the latest CephFS and Dokany APIs.
Dokany is a well maintained project (fork of the original Dokan
project), allowing filesystems to be implemented in userspace,
even providing a Fuse compatibility layer.
One reason for not using the FUSE compatibility layer is that it's
only covering the high level API while Ceph is using the low level
FUSE API, which among other things is inode centric.
Changes made by this patch compared to the upstream ceph-dokan:
* support latest stable Dokany API. The upstream version relies on
the legacy unmaintained Dokan API
* return proper error codes, converting standard errno.h values to
NTSTATUS
* minor changes to support latest cephfs API
* drop duplicated ceph code, no longer needed if we're to include it
in tree. This makes it much easier to maintain.
* drop redundant permission checks, leaving it up to libcephfs
* use ceph argparse helpers
* use ceph logging and daemon initialization
* fixed unicode handling
* switched to ceph coding style
* made ceph.conf param optional, using the default path if available
* enabled setting file timestamps
* append support
* configurable timeouts set once per mount
* ensure that the error code is always logged
* various cleanups (removed unused entry points, checks that have
been moved to dokany, simplified conditional statements,
unnecessary conversions in the hot path, etc).
[1] https://github.com/ketor/ceph-dokan
[2] https://github.com/ceph/ceph-dokan
Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
2020-08-07 12:07:20 +00:00
|
|
|
cd $depsSrcDir
|
|
|
|
if [[ ! -d $dokanSrcDir ]]; then
|
2022-09-30 20:56:35 +00:00
|
|
|
git clone --branch $dokanTag --depth 1 $dokanUrl
|
cephfs: Add ceph-dokan, providing Windows support
In order to expose ceph filesystems to Windows hosts, we propose
including ceph-dokan[1][2] in the Ceph tree, while updating it to
work with the latest CephFS and Dokany APIs.
Dokany is a well maintained project (fork of the original Dokan
project), allowing filesystems to be implemented in userspace,
even providing a Fuse compatibility layer.
One reason for not using the FUSE compatibility layer is that it's
only covering the high level API while Ceph is using the low level
FUSE API, which among other things is inode centric.
Changes made by this patch compared to the upstream ceph-dokan:
* support latest stable Dokany API. The upstream version relies on
the legacy unmaintained Dokan API
* return proper error codes, converting standard errno.h values to
NTSTATUS
* minor changes to support latest cephfs API
* drop duplicated ceph code, no longer needed if we're to include it
in tree. This makes it much easier to maintain.
* drop redundant permission checks, leaving it up to libcephfs
* use ceph argparse helpers
* use ceph logging and daemon initialization
* fixed unicode handling
* switched to ceph coding style
* made ceph.conf param optional, using the default path if available
* enabled setting file timestamps
* append support
* configurable timeouts set once per mount
* ensure that the error code is always logged
* various cleanups (removed unused entry points, checks that have
been moved to dokany, simplified conditional statements,
unnecessary conversions in the hot path, etc).
[1] https://github.com/ketor/ceph-dokan
[2] https://github.com/ceph/ceph-dokan
Signed-off-by: Lucian Petrut <lpetrut@cloudbasesolutions.com>
2020-08-07 12:07:20 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
mkdir -p $dokanLibDir
|
|
|
|
$MINGW_DLLTOOL -d $dokanSrcDir/dokan/dokan.def \
|
|
|
|
-l $dokanLibDir/libdokan.a
|
|
|
|
|
|
|
|
# That's probably the easiest way to deal with the dokan imports.
|
|
|
|
# dokan.h is defined in both ./dokan and ./sys while both are using
|
|
|
|
# sys/public.h without the "sys" prefix.
|
|
|
|
cp $dokanSrcDir/sys/public.h $dokanSrcDir/dokan
|
2020-12-02 09:27:00 +00:00
|
|
|
|
2021-05-06 07:18:56 +00:00
|
|
|
echo "Finished building Ceph dependencies."
|
2020-03-24 03:13:36 +00:00
|
|
|
touch $depsToolsetDir/completed
|