From f1a8044f1da0f7171ee189b1c0c5f1e519694777 Mon Sep 17 00:00:00 2001 From: Lucian Petrut Date: Thu, 6 May 2021 07:10:36 +0000 Subject: [PATCH 1/3] win32*.sh: fix boost url The boost download location has changed, breaking the Windows build. Ths commit updates the boost download url. Signed-off-by: Lucian Petrut --- win32_deps_build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/win32_deps_build.sh b/win32_deps_build.sh index 8083e1be9c5..e779d2685f1 100755 --- a/win32_deps_build.sh +++ b/win32_deps_build.sh @@ -24,7 +24,7 @@ curlSrcDir="${depsSrcDir}/curl" curlDir="${depsToolsetDir}/curl" # For now, we'll keep the version number within the file path when not using git. -boostUrl="https://dl.bintray.com/boostorg/release/1.73.0/source/boost_1_73_0.tar.gz" +boostUrl="https://boostorg.jfrog.io/artifactory/main/release/1.73.0/source/boost_1_73_0.tar.gz" boostSrcDir="${depsSrcDir}/boost_1_73_0" boostDir="${depsToolsetDir}/boost" zlibDir="${depsToolsetDir}/zlib" From 9cad7db13a1176ac3b3fee89983d6d21420f5429 Mon Sep 17 00:00:00 2001 From: Lucian Petrut Date: Thu, 6 May 2021 07:18:56 +0000 Subject: [PATCH 2/3] win32*.sh: improve logging We'll use a log file when building the Ceph dependencies. Also, we'll log some details about the operation that's about to be performed. Signed-off-by: Lucian Petrut --- win32_build.sh | 4 ++-- win32_deps_build.sh | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/win32_build.sh b/win32_build.sh index 0f6db56371c..4e887cef30b 100755 --- a/win32_build.sh +++ b/win32_build.sh @@ -112,9 +112,9 @@ if [[ -z $SKIP_BINDIR_CLEAN ]]; then fi if [[ ! -f ${depsToolsetDir}/completed ]]; then - echo "Preparing dependencies: $DEPS_DIR" + echo "Preparing dependencies: $DEPS_DIR. Log: ${BUILD_DIR}/build_deps.log" NUM_WORKERS=$NUM_WORKERS DEPS_DIR=$DEPS_DIR OS="$OS"\ - "$SCRIPT_DIR/win32_deps_build.sh" + "$SCRIPT_DIR/win32_deps_build.sh" | tee "${BUILD_DIR}/build_deps.log" fi mkdir -p $BUILD_DIR diff --git a/win32_deps_build.sh b/win32_deps_build.sh index e779d2685f1..cc04bc5444f 100755 --- a/win32_deps_build.sh +++ b/win32_deps_build.sh @@ -65,6 +65,7 @@ mkdir -p $DEPS_DIR mkdir -p $depsToolsetDir mkdir -p $depsSrcDir +echo "Installing required packages." case "$OS" in ubuntu) sudo apt-get update @@ -86,6 +87,7 @@ esac MINGW_CMAKE_FILE="$DEPS_DIR/mingw.cmake" source "$SCRIPT_DIR/mingw_conf.sh" +echo "Building zlib." cd $depsSrcDir if [[ ! -d $zlibSrcDir ]]; then git clone https://github.com/madler/zlib @@ -100,6 +102,7 @@ _make BINARY_PATH=$zlibDir \ SHARED_MODE=1 \ -f win32/Makefile.gcc install +echo "Building lz4." cd $depsToolsetDir if [[ ! -d $lz4Dir ]]; then git clone https://github.com/lz4/lz4 @@ -111,6 +114,7 @@ _make BUILD_STATIC=no CC=${MINGW_CC%-posix*} \ WINDRES=${MINGW_WINDRES} \ TARGET_OS=Windows_NT +echo "Building OpenSSL." cd $depsSrcDir if [[ ! -d $sslSrcDir ]]; then git clone https://github.com/openssl/openssl @@ -124,6 +128,7 @@ _make depend _make _make install +echo "Building libcurl." cd $depsSrcDir if [[ ! -d $curlSrcDir ]]; then git clone https://github.com/curl/curl @@ -137,8 +142,10 @@ _make _make install +echo "Building boost." cd $depsSrcDir if [[ ! -d $boostSrcDir ]]; then + echo "Downloading boost." wget -qO- $boostUrl | tar xz fi @@ -157,6 +164,7 @@ sed -i 's/pthreads/mthreads/g' ./tools/build/src/tools/gcc.jam export PTW32_INCLUDE=${PTW32Include} export PTW32_LIB=${PTW32Lib} +echo "Patching boost." # 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. @@ -315,6 +323,7 @@ EOL -sZLIB_INCLUDE=$zlibDir/include -sZLIB_LIBRARY_PATH=$zlibDir/lib \ --without-python --without-mpi --without-log --without-wave +echo "Building libbacktrace." cd $depsSrcDir if [[ ! -d $backtraceSrcDir ]]; then git clone https://github.com/ianlancetaylor/libbacktrace @@ -327,6 +336,7 @@ cd $backtraceSrcDir/build _make LDFLAGS="-no-undefined" _make install +echo "Building snappy." cd $depsSrcDir if [[ ! -d $snappySrcDir ]]; then git clone https://github.com/google/snappy @@ -353,6 +363,7 @@ cmake -DCMAKE_INSTALL_PREFIX=$snappyDir \ _make _make install +echo "Generating mswsock.lib." # mswsock.lib is not provided by mingw, so we'll have to generate # it. mkdir -p $winLibDir @@ -388,6 +399,7 @@ EOF $MINGW_DLLTOOL -d $winLibDir/mswsock.def \ -l $winLibDir/libmswsock.a +echo "Fetching libwnbd." cd $depsSrcDir if [[ ! -d $wnbdSrcDir ]]; then git clone $wnbdUrl @@ -399,6 +411,7 @@ $MINGW_DLLTOOL -d $wnbdSrcDir/libwnbd/libwnbd.def \ -D libwnbd.dll \ -l $wnbdLibDir/libwnbd.a +echo "Fetching dokany." cd $depsSrcDir if [[ ! -d $dokanSrcDir ]]; then git clone $dokanUrl @@ -415,4 +428,5 @@ $MINGW_DLLTOOL -d $dokanSrcDir/dokan/dokan.def \ # sys/public.h without the "sys" prefix. cp $dokanSrcDir/sys/public.h $dokanSrcDir/dokan +echo "Finished building Ceph dependencies." touch $depsToolsetDir/completed From b683c55283f79fef2de349d08736fe1781e8f6b0 Mon Sep 17 00:00:00 2001 From: Lucian Petrut Date: Thu, 6 May 2021 12:39:00 +0000 Subject: [PATCH 3/3] win32*.sh: bump boost version to 1.75 We're updating the Windows build scripts to use Boost 1.75, the same as the Linux build. We can now drop the custom Boost patches that were needed in order to use mingw. Those have been merged upstream in the meantime. Signed-off-by: Lucian Petrut --- win32_deps_build.sh | 120 +------------------------------------------- 1 file changed, 2 insertions(+), 118 deletions(-) diff --git a/win32_deps_build.sh b/win32_deps_build.sh index cc04bc5444f..5942e9cda12 100755 --- a/win32_deps_build.sh +++ b/win32_deps_build.sh @@ -24,8 +24,8 @@ curlSrcDir="${depsSrcDir}/curl" curlDir="${depsToolsetDir}/curl" # For now, we'll keep the version number within the file path when not using git. -boostUrl="https://boostorg.jfrog.io/artifactory/main/release/1.73.0/source/boost_1_73_0.tar.gz" -boostSrcDir="${depsSrcDir}/boost_1_73_0" +boostUrl="https://boostorg.jfrog.io/artifactory/main/release/1.75.0/source/boost_1_75_0.tar.gz" +boostSrcDir="${depsSrcDir}/boost_1_75_0" boostDir="${depsToolsetDir}/boost" zlibDir="${depsToolsetDir}/zlib" zlibSrcDir="${depsSrcDir}/zlib" @@ -196,122 +196,6 @@ patch -N boost/thread/pthread/thread_data.hpp < -+#elif defined(BOOST_ASIO_HAS_PTHREADS) -+# include - #elif defined(BOOST_ASIO_WINDOWS) - # if defined(UNDER_CE) - # include -@@ -27,8 +29,6 @@ - # else - # include - # endif --#elif defined(BOOST_ASIO_HAS_PTHREADS) --# include - #elif defined(BOOST_ASIO_HAS_STD_THREAD) - # include - #else -@@ -41,6 +41,8 @@ - - #if !defined(BOOST_ASIO_HAS_THREADS) - typedef null_thread thread; -+#elif defined(BOOST_ASIO_HAS_PTHREADS) -+typedef posix_thread thread; - #elif defined(BOOST_ASIO_WINDOWS) - # if defined(UNDER_CE) - typedef wince_thread thread; -@@ -49,8 +51,6 @@ - # else - typedef win_thread thread; - # endif --#elif defined(BOOST_ASIO_HAS_PTHREADS) --typedef posix_thread thread; - #elif defined(BOOST_ASIO_HAS_STD_THREAD) - typedef std_thread thread; - #endif -EOL - -# Unix socket support for Windows is currently disabled by Boost. -# https://github.com/huangqinjin/asio/commit/d27a8ad1870 -patch -N boost/asio/detail/socket_types.hpp <=1.75, it's unreleased as of 1.74. -patch -N boost/process/detail/windows/handle_workaround.hpp <