From f07fd8567f1154cb8b4f0ab338979caff4dbfcce Mon Sep 17 00:00:00 2001 From: torri Date: Wed, 26 Jun 2024 14:03:51 +0200 Subject: [PATCH 1/4] fix for broken curl installation --- init/eessi_environment_variables | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/init/eessi_environment_variables b/init/eessi_environment_variables index 78851a9c95..d6e5b75dce 100644 --- a/init/eessi_environment_variables +++ b/init/eessi_environment_variables @@ -15,6 +15,20 @@ function show_msg { fi } +function check_rhel_ca { + + os=$(grep -oP '(?<=^ID_LIKE=).+' /etc/os-release | tr -d '"') + + version_id=$(grep -oP '(?<=^VERSION_ID=).+' /etc/os-release | tr -d '"') + version_major=${version_id%\.*} + + if [[ $os =~ "rhel" ]] && [ $version_major -gt 7 ] + then + export CURL_CA_BUNDLE=/etc/pki/tls/certs/ca-bundle.crt + fi +} + + # set up minimal environment: $EESSI_PREFIX, $EESSI_VERSION, $EESSI_OS_TYPE, $EESSI_CPU_FAMILY, $EPREFIX source $EESSI_INIT_DIR_PATH/minimal_eessi_env @@ -106,6 +120,8 @@ if [ -d $EESSI_PREFIX ]; then false fi + # Fix wrong path for RHEL >=8 libcurl + check_rhel_ca else error "EESSI software layer at $EESSI_SOFTWARE_PATH not found!" From 9747ee497161f23dd999094e78bae6c863c5a9fb Mon Sep 17 00:00:00 2001 From: torri Date: Mon, 1 Jul 2024 16:31:37 +0200 Subject: [PATCH 2/4] simplified the implementation --- init/eessi_environment_variables | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/init/eessi_environment_variables b/init/eessi_environment_variables index d6e5b75dce..c28ddb45d9 100644 --- a/init/eessi_environment_variables +++ b/init/eessi_environment_variables @@ -15,20 +15,6 @@ function show_msg { fi } -function check_rhel_ca { - - os=$(grep -oP '(?<=^ID_LIKE=).+' /etc/os-release | tr -d '"') - - version_id=$(grep -oP '(?<=^VERSION_ID=).+' /etc/os-release | tr -d '"') - version_major=${version_id%\.*} - - if [[ $os =~ "rhel" ]] && [ $version_major -gt 7 ] - then - export CURL_CA_BUNDLE=/etc/pki/tls/certs/ca-bundle.crt - fi -} - - # set up minimal environment: $EESSI_PREFIX, $EESSI_VERSION, $EESSI_OS_TYPE, $EESSI_CPU_FAMILY, $EPREFIX source $EESSI_INIT_DIR_PATH/minimal_eessi_env @@ -121,7 +107,11 @@ if [ -d $EESSI_PREFIX ]; then fi # Fix wrong path for RHEL >=8 libcurl - check_rhel_ca + rhel_libcurl_file="/etc/pki/tls/certs/ca-bundle.crt" + if [ -f $rhel_libcurl_file ]; then + show_msg "Found libcurl CAs file at RHEL location, setting CURL_CA_BUNDLE" + export CURL_CA_BUNDLE=$rhel_libcurl_file + fi else error "EESSI software layer at $EESSI_SOFTWARE_PATH not found!" From 51c6b1c998a69d8dd4a75f4f83b101b5ba81f1b4 Mon Sep 17 00:00:00 2001 From: Kenneth Hoste Date: Wed, 3 Jul 2024 10:51:41 +0200 Subject: [PATCH 3/4] improve comment that explains setting of `$CURL_CA_BUNDLE` on RHEL-based systems Co-authored-by: ocaisa --- init/eessi_environment_variables | 3 +++ 1 file changed, 3 insertions(+) diff --git a/init/eessi_environment_variables b/init/eessi_environment_variables index c28ddb45d9..f5bb387955 100644 --- a/init/eessi_environment_variables +++ b/init/eessi_environment_variables @@ -107,6 +107,9 @@ if [ -d $EESSI_PREFIX ]; then fi # Fix wrong path for RHEL >=8 libcurl + # This is required here because we ship curl in our compat layer. If we only provided + # curl as a module file we could instead do this via a `modluafooter` in an EasyBuild + # hook (or via an Lmod hook) rhel_libcurl_file="/etc/pki/tls/certs/ca-bundle.crt" if [ -f $rhel_libcurl_file ]; then show_msg "Found libcurl CAs file at RHEL location, setting CURL_CA_BUNDLE" From d6d5a2bb5c2eead7cd931ea307ea4cd3b44bf9db Mon Sep 17 00:00:00 2001 From: Helena Vela Beltran <47674829+hvelab@users.noreply.github.com> Date: Mon, 8 Jul 2024 17:18:02 +0200 Subject: [PATCH 4/4] Update init/eessi_environment_variables Add bigger comment Co-authored-by: ocaisa --- init/eessi_environment_variables | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/init/eessi_environment_variables b/init/eessi_environment_variables index f5bb387955..9417d5b2a2 100644 --- a/init/eessi_environment_variables +++ b/init/eessi_environment_variables @@ -106,15 +106,15 @@ if [ -d $EESSI_PREFIX ]; then false fi - # Fix wrong path for RHEL >=8 libcurl - # This is required here because we ship curl in our compat layer. If we only provided - # curl as a module file we could instead do this via a `modluafooter` in an EasyBuild - # hook (or via an Lmod hook) - rhel_libcurl_file="/etc/pki/tls/certs/ca-bundle.crt" - if [ -f $rhel_libcurl_file ]; then - show_msg "Found libcurl CAs file at RHEL location, setting CURL_CA_BUNDLE" - export CURL_CA_BUNDLE=$rhel_libcurl_file - fi + # Fix wrong path for RHEL >=8 libcurl + # This is required here because we ship curl in our compat layer. If we only provided + # curl as a module file we could instead do this via a `modluafooter` in an EasyBuild + # hook (or via an Lmod hook) + rhel_libcurl_file="/etc/pki/tls/certs/ca-bundle.crt" + if [ -f $rhel_libcurl_file ]; then + show_msg "Found libcurl CAs file at RHEL location, setting CURL_CA_BUNDLE" + export CURL_CA_BUNDLE=$rhel_libcurl_file + fi else error "EESSI software layer at $EESSI_SOFTWARE_PATH not found!"