diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0a4dc39e595..3d9501d3051 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -173,7 +173,7 @@ jobs: container: centos:7 steps: - # python2-pip is broken on CentOS so can't upgrade pip or setuptools + # python2-pip is broken on CentOS so can't upgrade pip, setuptools, or wheel - name: Install external dependencies with yum run: | yum update -y @@ -195,7 +195,6 @@ jobs: git \ cppunit-devel yum clean all - python2 -m pip --no-cache-dir install --upgrade wheel # Need to use v1 of action as image Git is too old - name: Clone repository now that Git is available @@ -334,10 +333,10 @@ jobs: run: | cd .. cmake \ + -DCMAKE_C_COMPILER=clang \ + -DCMAKE_CXX_COMPILER=clang++ \ -DCMAKE_INSTALL_PREFIX=/usr/local/ \ - -DOPENSSL_SSL_LIBRARY=$(find $(find $(brew --cellar openssl) -type d -iname "lib") -type f -iname "libssl*.dylib") \ - -DOPENSSL_CRYPTO_LIBRARY=$(find $(find $(brew --cellar openssl) -type d -iname "lib") -type f -iname "libcrypto*.dylib") \ - -DOPENSSL_INCLUDE_DIR=$(find $(brew --cellar openssl) -type d -iname "include") \ + -DCMAKE_PREFIX_PATH=/usr/local/opt/openssl@3 \ -DPYTHON_EXECUTABLE=$(command -v python3) \ -DENABLE_TESTS=ON \ -DPIP_OPTIONS="--verbose" \ @@ -349,6 +348,7 @@ jobs: --clean-first \ --parallel $(($(sysctl -n hw.ncpu) - 1)) cmake --build build --target install + python3 -m pip install --user build/bindings/python python3 -m pip list - name: Verify install @@ -358,6 +358,7 @@ jobs: - name: Verify Python bindings run: | + export DYLD_LIBRARY_PATH=/usr/local/lib python3 --version --version python3 -m pip list python3 -m pip show xrootd diff --git a/CMakeLists.txt b/CMakeLists.txt index 104b497ba0b..f338a68e126 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,11 +9,6 @@ set( CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/src ${PROJECT_SOURCE_DIR}/cmake ) -if(NOT (CMAKE_VERSION VERSION_LESS "3.1")) - cmake_policy(SET CMP0054 OLD) -endif() - - #------------------------------------------------------------------------------- # A 'plugins' phony target to simplify building build-tree binaries. # Plugins are responsible for adding themselves to this target, where diff --git a/cmake/FindCPPUnit.cmake b/cmake/FindCppUnit.cmake similarity index 90% rename from cmake/FindCPPUnit.cmake rename to cmake/FindCppUnit.cmake index 9b015db1b96..cc6e7400191 100644 --- a/cmake/FindCPPUnit.cmake +++ b/cmake/FindCppUnit.cmake @@ -27,4 +27,4 @@ set(CPPUNIT_INCLUDE_DIRS ${CPPUNIT_INCLUDE_DIR}) set(CPPUNIT_LIBRARIES ${CPPUNIT_LIBRARY}) include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(cppunit DEFAULT_MSG CPPUNIT_INCLUDE_DIRS CPPUNIT_LIBRARIES) +find_package_handle_standard_args(CppUnit DEFAULT_MSG CPPUNIT_INCLUDE_DIRS CPPUNIT_LIBRARIES) diff --git a/cmake/FindKerberos5.cmake b/cmake/FindKerberos5.cmake index 345c3729d3e..eae4dd3dba7 100644 --- a/cmake/FindKerberos5.cmake +++ b/cmake/FindKerberos5.cmake @@ -32,7 +32,7 @@ else() set( KERBEROS5_LIBRARIES ${KERBEROS5_LIBRARY} ${COM_ERR_LIBRARY} ) find_package_handle_standard_args( - KERBEROS5 + Kerberos5 DEFAULT_MSG KERBEROS5_LIBRARIES KERBEROS5_INCLUDE_DIR ) diff --git a/cmake/FindOpenSSL.cmake b/cmake/FindOpenSSL.cmake deleted file mode 100644 index 847e78141e9..00000000000 --- a/cmake/FindOpenSSL.cmake +++ /dev/null @@ -1,136 +0,0 @@ -include( FindPackageHandleStandardArgs ) - -set( OPENSSL_GOOD_VERSION TRUE ) -if( OPENSSL_INCLUDE_DIR AND OPENSSL_LIBRARIES ) - set( OPENSSL_FOUND TRUE ) -else() - find_path( - OPENSSL_INCLUDE_DIR - NAMES openssl/ssl.h - HINTS - ${OPENSSL_ROOT_DIR} - PATH_SUFFIXES - include ) - - file(STRINGS ${OPENSSL_INCLUDE_DIR}/openssl/opensslv.h opensslvers REGEX "^# define OPENSSL_VERSION_NUMBER") - string(REGEX REPLACE "# define[ ]+OPENSSL_VERSION_NUMBER[ ]+" "" opensslvers ${opensslvers}) - - set( LIBSSLNAME ssl ) - set( LIBCRYPTONAME crypto ) - - if ( OPENSSL_GOOD_VERSION ) - - find_library( - OPENSSL_SSL_LIBRARY - NAMES ${LIBSSLNAME} - HINTS - ${OPENSSL_ROOT_DIR} - PATH_SUFFIXES - ${LIBRARY_PATH_PREFIX} - ${LIB_SEARCH_OPTIONS}) - - string(FIND ${OPENSSL_SSL_LIBRARY} ".a" hasstaticext) - if (NOT ${hasstaticext} EQUAL -1) - if ( ${opensslvers} LESS "0x1000201fL" ) - set( OPENSSL_GOOD_VERSION FALSE ) - message(WARNING " >>> Cannot build XRootD crypto modules: static openssl build version is < 1.0.2") - else() - set(OPENSSL_USE_STATIC TRUE) - set( LIBCRYPTONAME libcrypto.a ) - endif() - message("-- Using OpenSSL static libraries (version: " ${opensslvers} ")") - endif() - - endif() - - if ( OPENSSL_GOOD_VERSION ) - find_library( - OPENSSL_CRYPTO_LIBRARY - NAMES ${LIBCRYPTONAME} - HINTS - ${OPENSSL_ROOT_DIR} - PATH_SUFFIXES - ${LIBRARY_PATH_PREFIX} - ${LIB_SEARCH_OPTIONS}) - - set( OPENSSL_LIBRARIES ${OPENSSL_SSL_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY} ) - - find_package_handle_standard_args( - OpenSSL - DEFAULT_MSG - OPENSSL_LIBRARIES) - - mark_as_advanced( OPENSSL_INCLUDE_DIR OPENSSL_LIBRARIES ) - - endif() -endif() - - -#------------------------------------------------------------------------------- -# Check for the TLS support in the OpenSSL version that is available -# (assume available if use of static libs is detected and the openssl version -# is at least 1.0.2) -#------------------------------------------------------------------------------- - -if ( OPENSSL_FOUND ) - - if( OPENSSL_USE_STATIC AND OPENSSL_GOOD_VERSION ) - - add_definitions( -DHAVE_TLS -DHAVE_TLS12 -DHAVE_TLS11 -DHAVE_TLS1 -DHAVE_DH_PADDED -DHAVE_DH_PADDED_FUNC ) - - else() - - set( CMAKE_REQUIRED_LIBRARIES ${OPENSSL_LIBRARIES} ) - set( CMAKE_REQUIRED_QUIET FALSE) - - check_function_exists(TLS_method HAVE_TLS_FUNC) - check_symbol_exists( - TLS_method - ${OPENSSL_INCLUDE_DIR}/openssl/ssl.h - HAVE_TLS_SYMB) - if( HAVE_TLS_FUNC AND HAVE_TLS_SYMB ) - add_definitions( -DHAVE_TLS ) - endif() - - check_function_exists(TLSv1_2_method HAVE_TLS12_FUNC) - check_symbol_exists( - TLSv1_2_method - ${OPENSSL_INCLUDE_DIR}/openssl/ssl.h - HAVE_TLS12_SYMB) - if( HAVE_TLS12_FUNC AND HAVE_TLS12_SYMB ) - add_definitions( -DHAVE_TLS12 ) - endif() - - check_function_exists(TLSv1_1_method HAVE_TLS11_FUNC) - check_symbol_exists( - TLSv1_1_method - ${OPENSSL_INCLUDE_DIR}/openssl/ssl.h - HAVE_TLS11_SYMB) - if( HAVE_TLS11_FUNC AND HAVE_TLS11_SYMB ) - add_definitions( -DHAVE_TLS11 ) - endif() - - check_function_exists(TLSv1_method HAVE_TLS1_FUNC) - check_symbol_exists( - TLSv1_method - ${OPENSSL_INCLUDE_DIR}/openssl/ssl.h - HAVE_TLS1_SYMB) - if( HAVE_TLS1_FUNC AND HAVE_TLS1_SYMB ) - add_definitions( -DHAVE_TLS1 ) - endif() - - check_function_exists(DH_compute_key_padded HAVE_DH_PADDED_FUNC) - check_symbol_exists( - DH_compute_key_padded - ${OPENSSL_INCLUDE_DIR}/openssl/dh.h - HAVE_DH_PADDED_SYMB) - if( HAVE_DH_PADDED_FUNC) - if( HAVE_DH_PADDED_SYMB ) - add_definitions( -DHAVE_DH_PADDED ) - else() - add_definitions( -DHAVE_DH_PADDED_FUNC ) - endif() - endif() - - endif() -endif() diff --git a/cmake/FindReadline.cmake b/cmake/FindReadline.cmake index 99dfa442187..d79cfb36b4d 100644 --- a/cmake/FindReadline.cmake +++ b/cmake/FindReadline.cmake @@ -56,7 +56,7 @@ else( READLINE_INCLUDE_DIR AND READLINE_LIBRARY ) endif() find_package_handle_standard_args( - READLINE + Readline DEFAULT_MSG READLINE_LIBRARY READLINE_INCLUDE_DIR ) diff --git a/cmake/FindLibUuid.cmake b/cmake/Findlibuuid.cmake similarity index 94% rename from cmake/FindLibUuid.cmake rename to cmake/Findlibuuid.cmake index 94b97a9e786..f18268e5e40 100644 --- a/cmake/FindLibUuid.cmake +++ b/cmake/Findlibuuid.cmake @@ -1,5 +1,5 @@ #.rst: -# Finduuid +# Findlibuuid # ----------- # # Find libuuid, DCE compatible Universally Unique Identifier library. @@ -52,5 +52,5 @@ unset(CMAKE_REQUIRED_INCLUDES) unset(_uuid_header_only) unset(_have_libuuid) -find_package_handle_standard_args(uuid DEFAULT_MSG UUID_INCLUDE_DIR) +find_package_handle_standard_args(libuuid DEFAULT_MSG UUID_INCLUDE_DIR) mark_as_advanced(UUID_INCLUDE_DIR UUID_LIBRARY) diff --git a/cmake/FindSystemd.cmake b/cmake/Findsystemd.cmake similarity index 100% rename from cmake/FindSystemd.cmake rename to cmake/Findsystemd.cmake diff --git a/cmake/XRootDDefaults.cmake b/cmake/XRootDDefaults.cmake index bbee8a275b5..5c25975bb29 100644 --- a/cmake/XRootDDefaults.cmake +++ b/cmake/XRootDDefaults.cmake @@ -9,6 +9,8 @@ if( "${CMAKE_BUILD_TYPE}" STREQUAL "" ) endif() endif() +include( CMakeDependentOption ) + define_default( PLUGIN_VERSION 5 ) option( ENABLE_FUSE "Enable the fuse filesystem driver if possible." TRUE ) option( ENABLE_CRYPTO "Enable the OpenSSL cryprography support." TRUE ) @@ -28,7 +30,7 @@ option( ENABLE_XRDEC "Enable erasure coding component." option( ENABLE_ASAN "Enable adress sanitizer." FALSE ) option( ENABLE_TSAN "Enable thread sanitizer." FALSE ) option( ENABLE_XRDCLHTTP "Enable xrdcl-http plugin." TRUE ) -option( ENABLE_SCITOKENS "Enable SciTokens plugin." TRUE ) -option( ENABLE_MACAROONS "Enable Macaroons plugin." TRUE ) +cmake_dependent_option( ENABLE_SCITOKENS "Enable SciTokens plugin." TRUE "NOT XRDCL_ONLY" FALSE ) +cmake_dependent_option( ENABLE_MACAROONS "Enable Macaroons plugin." TRUE "NOT XRDCL_ONLY" FALSE ) option( FORCE_ENABLED "Fail build if enabled components cannot be built." FALSE ) define_default( XRD_PYTHON_REQ_VERSION 3 ) diff --git a/cmake/XRootDFindLibs.cmake b/cmake/XRootDFindLibs.cmake index 333a5d06865..d9bb661ae3d 100644 --- a/cmake/XRootDFindLibs.cmake +++ b/cmake/XRootDFindLibs.cmake @@ -3,7 +3,7 @@ #------------------------------------------------------------------------------- find_package( ZLIB REQUIRED) -find_package( LibUuid REQUIRED ) +find_package( libuuid REQUIRED ) if( ENABLE_READLINE ) if( FORCE_ENABLED ) @@ -30,7 +30,7 @@ if( LIBXML2_FOUND ) add_definitions( -DHAVE_XML2 ) endif() -find_package( Systemd ) +find_package( systemd ) if( SYSTEMD_FOUND ) add_definitions( -DHAVE_SYSTEMD ) endif() @@ -39,11 +39,12 @@ find_package( CURL ) if( ENABLE_CRYPTO ) if( FORCE_ENABLED ) - find_package( OpenSSL REQUIRED ) + find_package( OpenSSL 1.0.2 REQUIRED ) else() - find_package( OpenSSL ) + find_package( OpenSSL 1.0.2 ) endif() if( OPENSSL_FOUND ) + add_definitions( -DHAVE_DH_PADDED ) add_definitions( -DHAVE_XRDCRYPTO ) add_definitions( -DHAVE_SSL ) set( BUILD_CRYPTO TRUE ) @@ -82,9 +83,9 @@ endif() if( ENABLE_TESTS ) if( FORCE_ENABLED ) - find_package( CPPUnit REQUIRED ) + find_package( CppUnit REQUIRED ) else() - find_package( CPPUnit ) + find_package( CppUnit ) endif() if( CPPUNIT_FOUND ) set( BUILD_TESTS TRUE ) diff --git a/genversion.sh b/genversion.sh index 8f1bf6df0bd..f609e64020b 100755 --- a/genversion.sh +++ b/genversion.sh @@ -13,7 +13,7 @@ EXP3='^v[0-9]+\.[0-9]+\.[0-9]+\-rc.*$' function getNumericVersion() { VERSION=$1 - if test x`echo $VERSION | egrep $EXP2` == x; then + if test x`echo $VERSION | grep -E $EXP2` == x; then echo "1000000"; return; fi @@ -37,16 +37,16 @@ function getVersionFromRefs() VERSION="unknown" for i in ${REFS[@]}; do - if test x`echo $i | egrep $EXP2` != x; then + if test x`echo $i | grep -E $EXP2` != x; then echo "$i" return 0 fi - if test x`echo $i | egrep $EXP1` != x; then + if test x`echo $i | grep -E $EXP1` != x; then VERSION="$i" fi - if test x`echo $i | egrep $EXP3` != x; then + if test x`echo $i | grep -E $EXP3` != x; then VERSION="$i" fi diff --git a/packaging/makesrpm.sh b/packaging/makesrpm.sh index 143a726d61c..817ffdd2f1f 100755 --- a/packaging/makesrpm.sh +++ b/packaging/makesrpm.sh @@ -150,7 +150,7 @@ fi # Deal with release candidates #------------------------------------------------------------------------------- RELEASE=1 -if test x`echo $VERSION | egrep $RCEXP` != x; then +if test x`echo $VERSION | grep -E $RCEXP` != x; then RELEASE=0.`echo $VERSION | sed 's/.*-rc/rc/'` VERSION=`echo $VERSION | sed 's/-rc.*//'` fi @@ -158,7 +158,7 @@ fi #------------------------------------------------------------------------------- # Deal with CERN releases #------------------------------------------------------------------------------- -if test x`echo $VERSION | egrep $CERNEXP` != x; then +if test x`echo $VERSION | grep -E $CERNEXP` != x; then RELEASE=`echo $VERSION | sed 's/.*-//'` VERSION=`echo $VERSION | sed 's/-.*\.CERN//'` fi @@ -281,7 +281,7 @@ gzip -9fn $RPMSOURCES/xrootd.tar # Check if we need some other versions #------------------------------------------------------------------------------- OTHER_VERSIONS=`cat $TEMPDIR/xrootd.spec | \ - egrep '^Source[0-9]+:[[:space:]]*xrootd-.*.gz$' |\ + grep -E '^Source[0-9]+:[[:space:]]*xrootd-.*.gz$' |\ awk '{ print $2; }'` for VER in $OTHER_VERSIONS; do diff --git a/src/XrdTls/XrdTlsContext.cc b/src/XrdTls/XrdTlsContext.cc index 0a9454f9568..2dfd12b06d2 100644 --- a/src/XrdTls/XrdTlsContext.cc +++ b/src/XrdTls/XrdTlsContext.cc @@ -21,6 +21,7 @@ #include #include #include +#include #include #include "XrdOuc/XrdOucUtils.hh" @@ -429,7 +430,7 @@ void Fatal(std::string *eMsg, const char *msg, bool sslmsg=false) const char *GetTlsMethod(const SSL_METHOD *&meth) { -#ifdef HAVE_TLS +#if OPENSSL_VERSION_NUMBER > 0x1010000fL /* v1.1.0 */ meth = TLS_method(); #else meth = SSLv23_method();