Skip to content

Commit ef953f5

Browse files
committed
Make sure expected envvars have valid syntax
1 parent 541b40a commit ef953f5

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

.github/workflows/test-eb-hooks.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,14 @@ jobs:
6464
COMPATIBLE_EASYCONFIG: 'M4-1.4.19-GCCcore-13.2.0.eb'
6565
INCOMPATIBLE_EASYCONFIG: 'M4-1.4.19-GCCcore-14.2.0.eb'
6666
# Pick a site toolchain that will allow the incompatible easyconfig
67-
EESSI_SITE_TOP_LEVEL_TOOLCHAINS: '[{"name": "GCCcore", "version": "14.2.0"}]'
67+
# (the name will be modified when exported)
68+
SITE_TOP_LEVEL_TOOLCHAINS: '[{"name": "GCCcore", "version": "14.2.0"}]'
6869
- EESSI_VERSION: '2025.06'
6970
COMPATIBLE_EASYCONFIG: 'M4-1.4.19-GCCcore-14.2.0.eb'
7071
INCOMPATIBLE_EASYCONFIG: 'M4-1.4.19-GCCcore-13.2.0.eb'
7172
# Pick a site toolchain that will allow the incompatible easyconfig
72-
EESSI_SITE_TOP_LEVEL_TOOLCHAINS: '[{"name": "GCCcore", "version": "13.2.0"}]'
73+
# (the name will be modified when exported)
74+
SITE_TOP_LEVEL_TOOLCHAINS: '[{"name": "GCCcore", "version": "13.2.0"}]'
7375

7476
steps:
7577
- name: Check out software-layer repository
@@ -104,12 +106,13 @@ jobs:
104106
echo "Hook ignored via EESSI_OVERRIDE_TOOLCHAIN_CHECK with easyconfig $INCOMPATIBLE_EASYCONFIG and EESSI/${{matrix.EESSI_VERSION}}"
105107
106108
# Now check if we can set a site list of supported toolchains
107-
export EESSI_SITE_TOP_LEVEL_TOOLCHAINS_"${{matrix.EESSI_VERSION}}"='${{matrix.EESSI_SITE_TOP_LEVEL_TOOLCHAINS}}'
109+
export SANITIZED_EESSI_VERSION=$(echo "${{ matrix.EESSI_VERSION }}" | sed 's/\./_/g')
110+
export EESSI_SITE_TOP_LEVEL_TOOLCHAINS_"$SANITIZED_EESSI_VERSION"='${{matrix.SITE_TOP_LEVEL_TOOLCHAINS}}'
108111
eb --hooks=$PWD/eb_hooks.py "$INCOMPATIBLE_EASYCONFIG" --stop fetch
109112
echo "Site supported toolchain $EESSI_SITE_TOP_LEVEL_TOOLCHAINS successfully used with easyconfig $INCOMPATIBLE_EASYCONFIG and EESSI/${{matrix.EESSI_VERSION}}"
110113
111114
# Make sure an invalid list of dicts fails
112-
export EESSI_SITE_TOP_LEVEL_TOOLCHAINS_"${{matrix.EESSI_VERSION}}"="Not a list of dicts"
115+
export EESSI_SITE_TOP_LEVEL_TOOLCHAINS_"$SANITIZED_EESSI_VERSION"="Not a list of dicts"
113116
eb --hooks=$PWD/eb_hooks.py "$INCOMPATIBLE_EASYCONFIG" --stop fetch 2>&1 1>/dev/null | grep -q "does not contain a valid list of dictionaries"
114117
echo "Incorrect format for EESSI_SITE_TOP_LEVEL_TOOLCHAINS caught"
115118

eb_hooks.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,9 @@ def verify_toolchains_supported_by_eessi_version(easyconfigs):
165165
"""Each EESSI version supports a limited set of toolchains, sanity check the easyconfigs for toolchain support."""
166166
eessi_version = get_eessi_envvar('EESSI_VERSION')
167167
supported_eessi_toolchains = []
168-
site_top_level_toolchains = parse_list_of_dicts_env('EESSI_SITE_TOP_LEVEL_TOOLCHAINS_' + eessi_version)
168+
# Environment variable can't have a '.' so replace by '_'
169+
site_top_level_toolchains_envvar = 'EESSI_SITE_TOP_LEVEL_TOOLCHAINS_' + eessi_version.replace('.', '_')
170+
site_top_level_toolchains = parse_list_of_dicts_env(site_top_level_toolchains_envvar)
169171
for top_level_toolchain in EESSI_SUPPORTED_TOP_LEVEL_TOOLCHAINS[eessi_version] + site_top_level_toolchains:
170172
supported_eessi_toolchains += get_toolchain_hierarchy(top_level_toolchain)
171173
for ec in easyconfigs:

0 commit comments

Comments
 (0)