From df4c20b47361fb817ebc9f5a87e71d429d936a4a Mon Sep 17 00:00:00 2001 From: Lucian Petrut Date: Tue, 2 Mar 2021 10:44:19 +0200 Subject: [PATCH] ceph-dev-new-build: cross-compile Windows targets using pbuilder The Windows builds that are generated right now are unusable due to known Mingw runtime bugs. We need Ubuntu Focal or later, for which reason we're going to use pbuilder. Signed-off-by: Lucian Petrut --- ceph-dev-new-build/build/build_mingw | 19 +++++++++++++++++++ ceph-dev-new-build/build/setup_mingw | 8 ++++++++ ceph-dev-new-build/build/validate_mingw | 6 +----- 3 files changed, 28 insertions(+), 5 deletions(-) diff --git a/ceph-dev-new-build/build/build_mingw b/ceph-dev-new-build/build/build_mingw index 4741e985..23b96803 100644 --- a/ceph-dev-new-build/build/build_mingw +++ b/ceph-dev-new-build/build/build_mingw @@ -1,7 +1,26 @@ #!/bin/bash set -ex +# We need Ubuntu Focal to cross-compile Ceph for Windows. +# Previous versions provide broken Mingw packages. +# "DIST" will be set to "windows", so we're currently overriding it with +# a hardcoded value. +tmp_pbuild_script=$(mktemp /tmp/build_mingw_pbuild.XXXXXX) +cat << EOF > $tmp_pbuild_script +#!/bin/sh +# Used by the build script +apt-get install -y sudo git automake wget + +cd /mnt/ceph CMAKE_BUILD_TYPE=Release BUILD_ZIP=1 CLEAN_BUILD=1 timeout 3h ./win32_build.sh +EOF +chmod a+x $tmp_pbuild_script +sudo pbuilder execute \ + --bindmounts "$(pwd):/mnt/ceph" \ + --distribution "focal" \ + --basetgz $basedir/focal.tgz \ + -- $tmp_pbuild_script +rm $tmp_pbuild_script if [ "$THROWAWAY" = false ]; then # push binaries to chacra diff --git a/ceph-dev-new-build/build/setup_mingw b/ceph-dev-new-build/build/setup_mingw index aa0e221d..307c3ed6 100644 --- a/ceph-dev-new-build/build/setup_mingw +++ b/ceph-dev-new-build/build/setup_mingw @@ -65,3 +65,11 @@ if [ "$THROWAWAY" = false ] ; then # TODO if this exits we need to post to shaman a success check_binary_existence $chacra_check_url fi + +# We need Ubuntu Focal to cross-compile Ceph for Windows. +# Previous versions provide broken Mingw packages. +# "DIST" will be set to "windows", so we're currently overriding it with +# a hardcoded value. +DIST="focal" +setup_pbuilder use_gcc +DIST="$NORMAL_DISTRO" diff --git a/ceph-dev-new-build/build/validate_mingw b/ceph-dev-new-build/build/validate_mingw index d9414d25..c6174dfb 100644 --- a/ceph-dev-new-build/build/validate_mingw +++ b/ceph-dev-new-build/build/validate_mingw @@ -1,13 +1,9 @@ #!/bin/bash set -ex -# At the moment, we only support cross compiling Windows binaries using -# Ubuntu or SUSE distros. +# We're currently using pbuilder. ( source /etc/os-release case $ID in - opensuse*|suse|sles) - exit 0 - ;; ubuntu) exit 0 ;; -- 2.39.5