Skip to content

Commit d0d24e6

Browse files
committed
Merge branch 'develop' into fix-checksum-check
2 parents b81e37a + f1cd377 commit d0d24e6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1078
-207
lines changed

.github/workflows/container_tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ jobs:
1414
runs-on: ubuntu-22.04
1515
strategy:
1616
matrix:
17-
python: [2.7, 3.7]
17+
python: [3.7]
1818
fail-fast: false
1919
steps:
2020
- uses: actions/checkout@v3
2121

2222
- name: set up Python
23-
uses: actions/setup-python@v3
23+
uses: actions/setup-python@v4
2424
with:
2525
python-version: ${{matrix.python}}
2626
architecture: x64

.github/workflows/container_tests_apptainer.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ jobs:
1414
runs-on: ubuntu-22.04
1515
strategy:
1616
matrix:
17-
python: [2.7, 3.7]
17+
python: [3.7]
1818
apptainer: [1.0.0, 1.1.7]
1919
fail-fast: false
2020
steps:
21-
- uses: actions/checkout@v2
21+
- uses: actions/checkout@v3
2222

2323
- name: set up Python
24-
uses: actions/setup-python@v2
24+
uses: actions/setup-python@v3
2525
with:
2626
python-version: ${{matrix.python}}
2727
architecture: x64

.github/workflows/eb_command.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,13 @@ jobs:
1414
runs-on: ubuntu-20.04
1515
strategy:
1616
matrix:
17-
python: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9, '3.10', '3.11']
17+
python: [3.5, 3.6, 3.7, 3.8, 3.9, '3.10', '3.11']
1818
fail-fast: false
1919
steps:
2020
- uses: actions/checkout@v3
2121

2222
- name: set up Python
23-
uses: actions/setup-python@v3
23+
uses: actions/setup-python@v4
2424
with:
2525
python-version: ${{matrix.python}}
2626
architecture: x64

.github/workflows/end2end.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: End-to-end test of EasyBuild in different distros
2+
on: [push, pull_request]
3+
jobs:
4+
build_publish:
5+
name: End-to-end test
6+
runs-on: ubuntu-latest
7+
strategy:
8+
matrix:
9+
container:
10+
- centos-7.9
11+
- centos-8.5
12+
- fedora-36
13+
- opensuse-15.4
14+
- rockylinux-8.8
15+
- rockylinux-9.2
16+
- ubuntu-20.04
17+
- ubuntu-22.04
18+
fail-fast: false
19+
container:
20+
image: ghcr.io/easybuilders/${{ matrix.container }}-amd64
21+
steps:
22+
- name: Check out the repo
23+
uses: actions/checkout@v3
24+
25+
- name: download and unpack easyblocks and easyconfigs repositories
26+
run: |
27+
cd $HOME
28+
for pkg in easyblocks easyconfigs; do
29+
curl -OL https://github.com/easybuilders/easybuild-${pkg}/archive/develop.tar.gz
30+
tar xfz develop.tar.gz
31+
rm -f develop.tar.gz
32+
done
33+
34+
- name: Set up environment
35+
shell: bash
36+
run: |
37+
# collect environment variables to be set in subsequent steps in script that can be sourced
38+
echo "export PATH=$PWD:$PATH" > /tmp/eb_env
39+
echo "export PYTHONPATH=$PWD:$HOME/easybuild-easyblocks-develop:$HOME/easybuild-easyconfigs-develop" >> /tmp/eb_env
40+
41+
- name: Run commands to check test environment
42+
shell: bash
43+
run: |
44+
cmds=(
45+
"whoami"
46+
"pwd"
47+
"env | sort"
48+
"eb --version"
49+
"eb --show-system-info"
50+
"eb --check-eb-deps"
51+
"eb --show-config"
52+
)
53+
for cmd in "${cmds[@]}"; do
54+
echo ">>> $cmd"
55+
sudo -u easybuild bash -l -c "source /tmp/eb_env; $cmd"
56+
done
57+
58+
- name: End-to-end test of installing bzip2 with EasyBuild
59+
shell: bash
60+
run: |
61+
sudo -u easybuild bash -l -c "source /tmp/eb_env; eb bzip2-1.0.8.eb --trace --robot"

.github/workflows/linting.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ jobs:
1313
runs-on: ubuntu-20.04
1414
strategy:
1515
matrix:
16-
python-version: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9, '3.10', '3.11']
16+
python-version: [3.5, 3.6, 3.7, 3.8, 3.9, '3.10', '3.11']
1717

1818
steps:
1919
- uses: actions/checkout@v3
2020

2121
- name: set up Python
22-
uses: actions/setup-python@v3
22+
uses: actions/setup-python@v4
2323
with:
2424
python-version: ${{ matrix.python-version }}
2525

.github/workflows/unit_tests.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
runs-on: ubuntu-20.04
2626
strategy:
2727
matrix:
28-
python: [2.7, 3.6]
28+
python: [3.6]
2929
modules_tool:
3030
# use variables defined by 'setup' job above, see also
3131
# https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#needs-context
@@ -81,7 +81,7 @@ jobs:
8181
- uses: actions/checkout@v3
8282

8383
- name: set up Python
84-
uses: actions/setup-python@v3
84+
uses: actions/setup-python@v4
8585
with:
8686
python-version: ${{matrix.python}}
8787
architecture: x64
@@ -207,10 +207,6 @@ jobs:
207207
# create file owned by root but writable by anyone (used by test_copy_file)
208208
sudo touch /tmp/file_to_overwrite_for_easybuild_test_copy_file.txt
209209
sudo chmod o+w /tmp/file_to_overwrite_for_easybuild_test_copy_file.txt
210-
# silence deprecation warning when using Python 2, since it breaks a bunch of tests
211-
if [ "${{matrix.python}}" == '2.7' ]; then
212-
export TEST_EASYBUILD_SILENCE_DEPRECATION_WARNINGS=python2
213-
fi
214210
# run test suite
215211
python -O -m test.framework.suite 2>&1 | tee test_framework_suite.log
216212
# try and make sure output of running tests is clean (no printed messages/warnings)

RELEASE_NOTES

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,43 @@ For more detailed information, please see the git log.
44
These release notes can also be consulted at https://easybuild.readthedocs.io/en/latest/Release_notes.html.
55

66

7+
v4.8.0 (7 July 2023)
8+
--------------------
9+
10+
feature release
11+
12+
- various enhancements, including:
13+
- use version suffixes in PR title instead of Python versions when using --new-pr (#4253 + #4286)
14+
- add script to find updated ECs for installed module (#4271)
15+
- various bug fixes, including:
16+
- fix regex for extracting glibc version from output of '`ldd --version`' in Gentoo Linux (#4290)
17+
- allow versionsuffix to be set to None in `det_full_ec_version` (#4292)
18+
- other changes:
19+
- stop running tests with Python 2.7 since it is no longer supported in GitHub Action (#4267)
20+
- replace imp.load_source by leveraging importlib.util.module_from_spec when using Python 3 (#4280)
21+
22+
23+
v4.7.2 (27 May 2023)
24+
--------------------
25+
26+
update/bugfix release
27+
28+
- various enhancements, including:
29+
- extend (experimental) support for generating container images with Apptainer (#3975)
30+
- add default download timeout (#4226)
31+
- make the RPATH section check with `readelf -d` in sanity check optional (#4249)
32+
- various bug fixes, including:
33+
- add `make_extension_string` and `_make_extension_list` methods to `EasyBlock` class, so easyblocks can customize them (#3697)
34+
- fix typo in condition guarding installation of GitHub token in CI workflow to run unit tests + fix broken tests related to GitHub integration features (#4216)
35+
- fix --check-github as gist url now includes username (#4231)
36+
- switch to Ubuntu 22.04 in GitHub Actions workflow to run container tests (#4238)
37+
- use "/usr/bin/env python" in test_run_cmd_script (#4241)
38+
- other changes:
39+
- print potential errors after running a command only once (#4065)
40+
- change github_* template descriptions to be somewhat clearer (#4251)
41+
- remove workflow to test bootstrap script (#4255)
42+
43+
744
v4.7.1 (March 20th 2023)
845
------------------------
946

easybuild/framework/easyblock.py

Lines changed: 43 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -395,13 +395,13 @@ def get_checksums_from_json(self, always_read=False):
395395
:param always_read: always read the checksums.json file, even if it has been read before
396396
"""
397397
if always_read or self.json_checksums is None:
398-
try:
399-
path = self.obtain_file("checksums.json", no_download=True)
398+
path = self.obtain_file("checksums.json", no_download=True, warning_only=True)
399+
if path is not None:
400400
self.log.info("Loading checksums from file %s", path)
401401
json_txt = read_file(path)
402402
self.json_checksums = json.loads(json_txt)
403-
# if the file can't be found, return an empty dict
404-
except EasyBuildError:
403+
else:
404+
# if the file can't be found, return an empty dict
405405
self.json_checksums = {}
406406

407407
return self.json_checksums
@@ -736,7 +736,8 @@ def collect_exts_file_info(self, fetch_files=True, verify_checksums=True):
736736
return exts_sources
737737

738738
def obtain_file(self, filename, extension=False, urls=None, download_filename=None, force_download=False,
739-
git_config=None, no_download=False, download_instructions=None, alt_location=None):
739+
git_config=None, no_download=False, download_instructions=None, alt_location=None,
740+
warning_only=False):
740741
"""
741742
Locate the file with the given name
742743
- searches in different subdirectories of source path
@@ -789,7 +790,13 @@ def obtain_file(self, filename, extension=False, urls=None, download_filename=No
789790
return fullpath
790791

791792
except IOError as err:
792-
raise EasyBuildError("Downloading file %s from url %s to %s failed: %s", filename, url, fullpath, err)
793+
if not warning_only:
794+
raise EasyBuildError("Downloading file %s "
795+
"from url %s to %s failed: %s", filename, url, fullpath, err)
796+
else:
797+
self.log.warning("Downloading file %s "
798+
"from url %s to %s failed: %s", filename, url, fullpath, err)
799+
return None
793800

794801
else:
795802
# try and find file in various locations
@@ -866,8 +873,13 @@ def obtain_file(self, filename, extension=False, urls=None, download_filename=No
866873
self.dry_run_msg(" * %s (MISSING)", filename)
867874
return filename
868875
else:
869-
raise EasyBuildError("Couldn't find file %s anywhere, and downloading it is disabled... "
876+
if not warning_only:
877+
raise EasyBuildError("Couldn't find file %s anywhere, and downloading it is disabled... "
878+
"Paths attempted (in order): %s ", filename, ', '.join(failedpaths))
879+
else:
880+
self.log.warning("Couldn't find file %s anywhere, and downloading it is disabled... "
870881
"Paths attempted (in order): %s ", filename, ', '.join(failedpaths))
882+
return None
871883
elif git_config:
872884
return get_source_tarball_from_git(filename, targetdir, git_config)
873885
else:
@@ -959,7 +971,11 @@ def obtain_file(self, filename, extension=False, urls=None, download_filename=No
959971
error_msg += "and downloading it didn't work either... "
960972
error_msg += "Paths attempted (in order): %s " % failedpaths_msg
961973

962-
raise EasyBuildError(error_msg, filename)
974+
if not warning_only:
975+
raise EasyBuildError(error_msg, filename)
976+
else:
977+
self.log.warning(error_msg, filename)
978+
return None
963979

964980
#
965981
# GETTER/SETTER UTILITY FUNCTIONS
@@ -3087,7 +3103,7 @@ def _sanity_check_step_multi_deps(self, *args, **kwargs):
30873103
self.cfg['builddependencies'] = builddeps
30883104
self.cfg.iterating = False
30893105

3090-
def sanity_check_rpath(self, rpath_dirs=None):
3106+
def sanity_check_rpath(self, rpath_dirs=None, check_readelf_rpath=True):
30913107
"""Sanity check binaries/libraries w.r.t. RPATH linking."""
30923108

30933109
self.log.info("Checking RPATH linkage for binaries/libraries...")
@@ -3152,17 +3168,21 @@ def sanity_check_rpath(self, rpath_dirs=None):
31523168
self.log.debug("Output of 'ldd %s' checked, looks OK", path)
31533169

31543170
# check whether RPATH section in 'readelf -d' output is there
3155-
out, ec = run_cmd("readelf -d %s" % path, simple=False, trace=False)
3156-
if ec:
3157-
fail_msg = "Failed to run 'readelf %s': %s" % (path, out)
3158-
self.log.warning(fail_msg)
3159-
fails.append(fail_msg)
3160-
elif not readelf_rpath_regex.search(out):
3161-
fail_msg = "No '(RPATH)' found in 'readelf -d' output for %s: %s" % (path, out)
3162-
self.log.warning(fail_msg)
3163-
fails.append(fail_msg)
3171+
if check_readelf_rpath:
3172+
fail_msg = None
3173+
out, ec = run_cmd("readelf -d %s" % path, simple=False, trace=False)
3174+
if ec:
3175+
fail_msg = "Failed to run 'readelf %s': %s" % (path, out)
3176+
elif not readelf_rpath_regex.search(out):
3177+
fail_msg = "No '(RPATH)' found in 'readelf -d' output for %s: %s" % (path, out)
3178+
3179+
if fail_msg:
3180+
self.log.warning(fail_msg)
3181+
fails.append(fail_msg)
3182+
else:
3183+
self.log.debug("Output of 'readelf -d %s' checked, looks OK", path)
31643184
else:
3165-
self.log.debug("Output of 'readelf -d %s' checked, looks OK", path)
3185+
self.log.debug("Skipping the RPATH section check with 'readelf -d', as requested")
31663186
else:
31673187
self.log.debug("Not sanity checking files in non-existing directory %s", dirpath)
31683188

@@ -4170,6 +4190,10 @@ def build_and_install_one(ecdict, init_env):
41704190
dry_run_msg('', silent=silent)
41714191
print_msg("processing EasyBuild easyconfig %s" % spec, log=_log, silent=silent)
41724192

4193+
if ecdict['ec']['build_info_msg']:
4194+
msg = "This easyconfig provides the following build information:\n\n%s\n"
4195+
print_msg(msg % ecdict['ec']['build_info_msg'], log=_log, silent=silent)
4196+
41734197
if dry_run:
41744198
# print note on interpreting dry run output (argument is reference to location of dry run messages)
41754199
print_dry_run_note('below', silent=silent)

easybuild/framework/easyconfig/default.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,8 @@
228228
'buildstats': [None, "A list of dicts with build statistics", OTHER],
229229
'deprecated': [False, "String specifying reason why this easyconfig file is deprecated "
230230
"and will be archived in the next major release of EasyBuild", OTHER],
231+
'build_info_msg': [None, "String with information to be printed to stdout and logged during the building "
232+
"of the easyconfig", OTHER],
231233
}
232234

233235

easybuild/framework/easyconfig/easyconfig.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
from easybuild.tools.module_naming_scheme.mns import DEVEL_MODULE_SUFFIX
7474
from easybuild.tools.module_naming_scheme.utilities import avail_module_naming_schemes, det_full_ec_version
7575
from easybuild.tools.module_naming_scheme.utilities import det_hidden_modname, is_valid_module_name
76-
from easybuild.tools.modules import modules_tool
76+
from easybuild.tools.modules import modules_tool, NoModulesTool
7777
from easybuild.tools.py2vs3 import OrderedDict, create_base_metaclass, string_type
7878
from easybuild.tools.systemtools import check_os_dependency, pick_dep_version
7979
from easybuild.tools.toolchain.toolchain import SYSTEM_TOOLCHAIN_NAME, is_system_toolchain
@@ -1306,6 +1306,9 @@ def probe_external_module_metadata(self, mod_name, existing_metadata=None):
13061306
:param existing_metadata: already available metadata for this external module (if any)
13071307
"""
13081308
res = {}
1309+
if isinstance(self.modules_tool, NoModulesTool):
1310+
self.log.debug('Ignoring request for external module data for %s as no modules tool is active', mod_name)
1311+
return res
13091312

13101313
if existing_metadata is None:
13111314
existing_metadata = {}

0 commit comments

Comments
 (0)