From 1874f95a0eba3479dcd51faf7e8cd44b12446b6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20=C5=A0?= Date: Sat, 1 Jul 2023 19:10:17 +0200 Subject: [PATCH] Update Cinder errors and warnings --- .../share/python-build/cinder-3.10-dev | 60 +++++++++++-------- .../share/python-build/cinder-3.8-dev | 60 +++++++++++-------- 2 files changed, 72 insertions(+), 48 deletions(-) diff --git a/plugins/python-build/share/python-build/cinder-3.10-dev b/plugins/python-build/share/python-build/cinder-3.10-dev index f41ee2b7..7d83cd65 100644 --- a/plugins/python-build/share/python-build/cinder-3.10-dev +++ b/plugins/python-build/share/python-build/cinder-3.10-dev @@ -1,28 +1,40 @@ -require_distro Fedora 32 &>/dev/null || \ -{ echo - colorize 1 "WARNING" - cat >&2 <&2 +fi -[[ $(${CC:-gcc} -dumpversion 2>/dev/null) == 10 ]] || \ -{ command -v "gcc-10" >/dev/null && \ - export CC="gcc-10" && \ - echo "python-build: setting the compiler to \`gcc-10'"; } || \ -{ - echo - colorize 1 WARNING - cat >&2 </dev/null) != 10 ]] && + (command -v "gcc-10" >/dev/null) && + (command -v "g++-10" >/dev/null); then + echo "python-build: setting the compiler to GCC 10" + export CC="gcc-10" + export CXX="g++-10" +fi + +if [[ $(awk -F. '{print $1}' <<< "$(${CC:-gcc} -dumpversion)") -lt 10 ]]; then + { + echo + colorize 1 "ERROR" + echo ": Cinder requires at least GCC 10." + echo + return 1 + } >&2 +fi + +require_distro Fedora 32 &> /dev/null || + { + echo + colorize 1 "WARNING" + echo ": Cinder officially only supports Facebook's Docker" + echo "images which are based on Fedora 32. It may fail to build" + echo "on a system with a different GCC and/or Glibc version." + echo + } >&2 prefer_openssl11 export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1 diff --git a/plugins/python-build/share/python-build/cinder-3.8-dev b/plugins/python-build/share/python-build/cinder-3.8-dev index 5a3c8a82..4d8a8a7a 100644 --- a/plugins/python-build/share/python-build/cinder-3.8-dev +++ b/plugins/python-build/share/python-build/cinder-3.8-dev @@ -1,28 +1,40 @@ -require_distro Fedora 32 &>/dev/null || \ -{ echo - colorize 1 "WARNING" - cat >&2 <&2 +fi -[[ $(${CC:-gcc} -dumpversion 2>/dev/null) == 10 ]] || \ -{ command -v "gcc-10" >/dev/null && \ - export CC="gcc-10" && \ - echo "python-build: setting the compiler to \`gcc-10'"; } || \ -{ - echo - colorize 1 WARNING - cat >&2 </dev/null) != 10 ]] && + (command -v "gcc-10" >/dev/null) && + (command -v "g++-10" >/dev/null); then + echo "python-build: setting the compiler to GCC 10" + export CC="gcc-10" + export CXX="g++-10" +fi + +if [[ $(awk -F. '{print $1}' <<< "$(${CC:-gcc} -dumpversion)") -lt 10 ]]; then + { + echo + colorize 1 "ERROR" + echo ": Cinder requires at least GCC 10." + echo + return 1 + } >&2 +fi + +require_distro Fedora 32 &> /dev/null || + { + echo + colorize 1 "WARNING" + echo ": Cinder officially only supports Facebook's Docker" + echo "images which are based on Fedora 32. It may fail to build" + echo "on a system with a different GCC and/or Glibc version." + echo + } >&2 prefer_openssl11 export PYTHON_BUILD_CONFIGURE_WITH_OPENSSL=1