Skip to content

Commit 0550fc0

Browse files
committed
Merge branch 'develop' into easystack_easyconfigs
2 parents 6a12a44 + 541a645 commit 0550fc0

33 files changed

+627
-258
lines changed

.github/workflows/bootstrap_script.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: test EasyBuild bootstrap script
33
on: [push, pull_request]
44
jobs:
55
setup:
6-
runs-on: ubuntu-latest
6+
runs-on: ubuntu-20.04
77
outputs:
88
lmod7: Lmod-7.8.22
99
lmod8: Lmod-8.7.6
@@ -14,7 +14,7 @@ jobs:
1414
- run: "true"
1515
build:
1616
needs: setup
17-
runs-on: ubuntu-18.04
17+
runs-on: ubuntu-20.04
1818
strategy:
1919
matrix:
2020
# Don't run for Python 3.8, 3.9 , people should just use `pip install easybuild`
@@ -64,11 +64,11 @@ jobs:
6464

6565
- name: install OS & Python packages
6666
run: |
67-
# disable apt-get update, we don't really need it,
67+
# disable apt update, we don't really need it,
6868
# and it does more harm than good (it's fairly expensive, and it results in flaky test runs)
69-
# sudo apt-get update
69+
# sudo apt update
7070
# for modules tool
71-
sudo apt-get install lua5.2 liblua5.2-dev lua-filesystem lua-posix tcl tcl-dev
71+
sudo apt install lua5.2 liblua5.2-dev lua-filesystem lua-posix tcl tcl-dev
7272
# fix for lua-posix packaging issue, see https://bugs.launchpad.net/ubuntu/+source/lua-posix/+bug/1752082
7373
# needed for Ubuntu 18.04, but not for Ubuntu 20.04, so skipping symlinking if posix.so already exists
7474
if [ ! -e /usr/lib/x86_64-linux-gnu/lua/5.2/posix.so ] ; then

.github/workflows/container_tests.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Tests for container support
33
on: [push, pull_request]
44
jobs:
55
build:
6-
# stick to Ubuntu 18.04, where we can still easily install yum via 'apt-get install'
6+
# stick to Ubuntu 18.04, where we can still easily install yum via 'apt install'
77
runs-on: ubuntu-18.04
88
strategy:
99
matrix:
@@ -21,12 +21,12 @@ jobs:
2121
- name: install OS & Python packages
2222
run: |
2323
# ensure package list is up to date to avoid 404's for old packages
24-
sudo apt-get update -yqq
24+
sudo apt update -yqq
2525
# for building Singularity images
26-
sudo apt-get install rpm
27-
sudo apt-get install yum
26+
sudo apt install rpm
27+
sudo apt install yum
2828
# for modules tool
29-
sudo apt-get install lua5.2 liblua5.2-dev lua-filesystem lua-posix tcl tcl-dev
29+
sudo apt install lua5.2 liblua5.2-dev lua-filesystem lua-posix tcl tcl-dev
3030
# fix for lua-posix packaging issue, see https://bugs.launchpad.net/ubuntu/+source/lua-posix/+bug/1752082
3131
# needed for Ubuntu 18.04, but not for Ubuntu 20.04, so skipping symlinking if posix.so already exists
3232
if [ ! -e /usr/lib/x86_64-linux-gnu/lua/5.2/posix.so ] ; then
@@ -49,7 +49,7 @@ jobs:
4949
- name: install Singularity
5050
run: |
5151
# install alien, which can be used to convert RPMs to Debian packages
52-
sudo apt-get install alien
52+
sudo apt install alien
5353
alien --version
5454
# determine latest version of Singularity available in EPEL, and download RPM
5555
singularity_rpm=$(curl -sL https://dl.fedoraproject.org/pub/epel/8/Everything/x86_64/Packages/s/ | grep singularity | sed 's/.*singularity/singularity/g' | sed 's/rpm.*/rpm/g')

.github/workflows/eb_command.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Tests for the 'eb' command
33
on: [push, pull_request]
44
jobs:
55
test-eb:
6-
runs-on: ubuntu-18.04
6+
runs-on: ubuntu-20.04
77
strategy:
88
matrix:
99
python: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9, '3.10']
@@ -25,7 +25,7 @@ jobs:
2525
pip install --upgrade pip
2626
pip --version
2727
# install packages required for modules tool
28-
sudo apt-get install lua5.2 liblua5.2-dev lua-filesystem lua-posix tcl tcl-dev
28+
sudo apt install lua5.2 liblua5.2-dev lua-filesystem lua-posix tcl tcl-dev
2929
# fix for lua-posix packaging issue, see https://bugs.launchpad.net/ubuntu/+source/lua-posix/+bug/1752082
3030
# needed for Ubuntu 18.04, but not for Ubuntu 20.04, so skipping symlinking if posix.so already exists
3131
if [ ! -e /usr/lib/x86_64-linux-gnu/lua/5.2/posix.so ] ; then
@@ -77,6 +77,10 @@ jobs:
7777
echo "Looking for pattern \"${pattern}\" in eb_version.out..."
7878
grep "$pattern" eb_version.out
7979
done
80+
if grep -q "Considering ''" eb_version.out; then
81+
echo '`eb` did wrongly consider an empty command'
82+
false
83+
fi
8084
# also check when specifying Python command via $EB_PYTHON
8185
for eb_python in "python${pymajver}" "python${pymajminver}"; do
8286
export EB_PYTHON="${eb_python}"

.github/workflows/linting.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Static Analysis
22
on: [push, pull_request]
33
jobs:
44
python-linting:
5-
runs-on: ubuntu-18.04
5+
runs-on: ubuntu-20.04
66
strategy:
77
matrix:
88
python-version: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9, '3.10']

.github/workflows/unit_tests.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: EasyBuild framework unit tests
33
on: [push, pull_request]
44
jobs:
55
setup:
6-
runs-on: ubuntu-latest
6+
runs-on: ubuntu-20.04
77
outputs:
88
lmod7: Lmod-7.8.22
99
lmod8: Lmod-8.7.6
@@ -14,7 +14,7 @@ jobs:
1414
- run: "true"
1515
build:
1616
needs: setup
17-
runs-on: ubuntu-18.04
17+
runs-on: ubuntu-20.04
1818
strategy:
1919
matrix:
2020
python: [2.7, 3.6]
@@ -86,20 +86,20 @@ jobs:
8686

8787
- name: install OS & Python packages
8888
run: |
89-
# disable apt-get update, we don't really need it,
89+
# disable apt update, we don't really need it,
9090
# and it does more harm than good (it's fairly expensive, and it results in flaky test runs)
91-
# sudo apt-get update
91+
# sudo apt update
9292
# for modules tool
93-
sudo apt-get install lua5.2 liblua5.2-dev lua-filesystem lua-posix tcl tcl-dev
93+
sudo apt install lua5.2 liblua5.2-dev lua-filesystem lua-posix tcl tcl-dev
9494
# fix for lua-posix packaging issue, see https://bugs.launchpad.net/ubuntu/+source/lua-posix/+bug/1752082
9595
# needed for Ubuntu 18.04, but not for Ubuntu 20.04, so skipping symlinking if posix.so already exists
9696
if [ ! -e /usr/lib/x86_64-linux-gnu/lua/5.2/posix.so ] ; then
9797
sudo ln -s /usr/lib/x86_64-linux-gnu/lua/5.2/posix_c.so /usr/lib/x86_64-linux-gnu/lua/5.2/posix.so
9898
fi
9999
# for GitPython, python-hglib
100-
sudo apt-get install git mercurial
100+
sudo apt install git mercurial
101101
# dep for GC3Pie
102-
sudo apt-get install time
102+
sudo apt install time
103103
# Python packages
104104
pip --version
105105
pip install --upgrade pip

RELEASE_NOTES

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,29 @@ 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.6.1 (September 12th 2022)
8+
----------------------------
9+
10+
update/bugfix release
11+
12+
- various enhancements, including:
13+
- add script to find dependencies of Python packages (#3839)
14+
- add 'ai' default module class (#4053)
15+
- various bug fixes, including:
16+
- fix code style issues reported by recent flake8 linter (#4049)
17+
- stick to autopep8 < 1.7.0 with Python 2.7 (#4055)
18+
- ensure we call EasyBlock.patch_step for postinstallpatches (#4063)
19+
- fix leaked handles in set_columns, complete_cmd, run_cmd_qa, det_terminal_size functions + tests (#4066)
20+
- fix `quote_str` when string with both ' and " ends with a double quote (#4068)
21+
- fix type-checking of patches to allow dict values + correctly handle patches specified as dict values in --new-pr (#4070)
22+
- relax toolchain test by accepting both -march=native (x86_64) and -mcpu=native (aarch64) (#4071)
23+
- other changes:
24+
- run python in the same process as `eb` wrapper script by using `exec` (#4048)
25+
- add get_linked_libs_raw function, and use it from both check_linked_shared_libs and sanity_check_rpath (#4051)
26+
- update CI workflows (except container tests) to use Ubuntu 20.04, since Ubuntu 18.04 is deprecated (#4064)
27+
- use SYSTEM constant for dependency that uses system toolchain in dumped easyconfig (#4069)
28+
29+
730
v4.6.0 (July 8th 2022)
831
----------------------
932

easybuild/base/generaloption.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343

4444
from easybuild.base.fancylogger import getLogger, setroot, setLogLevel, getDetailsLogLevels
4545
from easybuild.base.optcomplete import autocomplete, CompleterOption
46-
from easybuild.tools.py2vs3 import StringIO, configparser, string_type
46+
from easybuild.tools.py2vs3 import StringIO, configparser, string_type, subprocess_popen_text
4747
from easybuild.tools.utilities import mk_rst_table, nub, shell_quote
4848

4949
try:
@@ -80,7 +80,9 @@ def set_columns(cols=None):
8080
stty = '/usr/bin/stty'
8181
if os.path.exists(stty):
8282
try:
83-
cols = int(os.popen('%s size 2>/dev/null' % stty).read().strip().split(' ')[1])
83+
with open(os.devnull, 'w') as devnull:
84+
proc = subprocess_popen_text([stty, "size"], stderr=devnull)
85+
cols = int(proc.communicate()[0].strip().split(' ')[1])
8486
except (AttributeError, IndexError, OSError, ValueError):
8587
# do nothing
8688
pass

easybuild/framework/easyblock.py

Lines changed: 38 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@
9696
from easybuild.tools.package.utilities import package
9797
from easybuild.tools.py2vs3 import extract_method_name, string_type
9898
from easybuild.tools.repository.repository import init_repository
99-
from easybuild.tools.systemtools import check_linked_shared_libs, det_parallelism, get_shared_lib_ext, use_group
99+
from easybuild.tools.systemtools import check_linked_shared_libs, det_parallelism, get_linked_libs_raw
100+
from easybuild.tools.systemtools import get_shared_lib_ext, use_group
100101
from easybuild.tools.utilities import INDENT_4SPACES, get_class_for, nub, quote_str
101102
from easybuild.tools.utilities import remove_unwanted_chars, time2str, trace_msg
102103
from easybuild.tools.version import this_is_easybuild, VERBOSE_VERSION, VERSION
@@ -2374,33 +2375,34 @@ def check_checksums_for(self, ent, sub='', source_cnt=None):
23742375
checksum_issues.append(msg)
23752376

23762377
for fn, checksum in zip(sources + patches, checksums):
2378+
2379+
# a checksum may be specified as a dictionary which maps filename to actual checksum
2380+
# for example when different source files are used for different CPU architectures
23772381
if isinstance(checksum, dict):
2378-
# sources entry may be a dictionary rather than just a string value with filename
2379-
if isinstance(fn, dict):
2380-
filename = fn['filename']
2381-
else:
2382-
filename = fn
2383-
checksum = checksum.get(filename)
2384-
2385-
# take into account that we may encounter a tuple of valid SHA256 checksums
2386-
# (see https://github.com/easybuilders/easybuild-framework/pull/2958)
2387-
if isinstance(checksum, tuple):
2388-
# 1st tuple item may indicate checksum type, must be SHA256 or else it's blatently ignored here
2389-
if len(checksum) == 2 and checksum[0] == CHECKSUM_TYPE_SHA256:
2390-
valid_checksums = (checksum[1],)
2391-
else:
2392-
valid_checksums = checksum
2382+
checksums_to_check = checksum.values()
23932383
else:
2394-
valid_checksums = (checksum,)
2395-
2396-
non_sha256_checksums = [c for c in valid_checksums if not is_sha256_checksum(c)]
2397-
if non_sha256_checksums:
2398-
if all(c is None for c in non_sha256_checksums):
2399-
print_warning("Found %d None checksum value(s), please make sure this is intended!" %
2400-
len(non_sha256_checksums))
2384+
checksums_to_check = [checksum]
2385+
2386+
for checksum in checksums_to_check:
2387+
# take into account that we may encounter a tuple of valid SHA256 checksums
2388+
# (see https://github.com/easybuilders/easybuild-framework/pull/2958)
2389+
if isinstance(checksum, tuple):
2390+
# 1st tuple item may indicate checksum type, must be SHA256 or else it's blatently ignored here
2391+
if len(checksum) == 2 and checksum[0] == CHECKSUM_TYPE_SHA256:
2392+
valid_checksums = (checksum[1],)
2393+
else:
2394+
valid_checksums = checksum
24012395
else:
2402-
msg = "Non-SHA256 checksum(s) found for %s: %s" % (fn, valid_checksums)
2403-
checksum_issues.append(msg)
2396+
valid_checksums = (checksum,)
2397+
2398+
non_sha256_checksums = [c for c in valid_checksums if not is_sha256_checksum(c)]
2399+
if non_sha256_checksums:
2400+
if all(c is None for c in non_sha256_checksums):
2401+
print_warning("Found %d None checksum value(s), please make sure this is intended!" %
2402+
len(non_sha256_checksums))
2403+
else:
2404+
msg = "Non-SHA256 checksum(s) found for %s: %s" % (fn, valid_checksums)
2405+
checksum_issues.append(msg)
24042406

24052407
return checksum_issues
24062408

@@ -2875,7 +2877,9 @@ def apply_post_install_patches(self, patches=None):
28752877

28762878
self.log.debug("Post-install patches to apply: %s", patches)
28772879
if patches:
2878-
self.patch_step(beginpath=self.installdir, patches=patches)
2880+
# self may be inherited from the Bundle easyblock and that patch_step is a no-op
2881+
# To allow postinstallpatches for Bundle, and derived, easyblocks we directly call EasyBlock.patch_step
2882+
EasyBlock.patch_step(self, beginpath=self.installdir, patches=patches)
28792883

28802884
def post_install_step(self):
28812885
"""
@@ -2994,24 +2998,15 @@ def sanity_check_rpath(self, rpath_dirs=None):
29942998
for path in [os.path.join(dirpath, x) for x in os.listdir(dirpath)]:
29952999
self.log.debug("Sanity checking RPATH for %s", path)
29963000

2997-
out, ec = run_cmd("file %s" % path, simple=False, trace=False)
2998-
if ec:
2999-
fail_msg = "Failed to run 'file %s': %s" % (path, out)
3000-
self.log.warning(fail_msg)
3001-
fails.append(fail_msg)
3002-
3003-
# only run ldd/readelf on dynamically linked executables/libraries
3004-
# example output:
3005-
# ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), ...
3006-
# ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, not stripped
3007-
if "dynamically linked" in out:
3001+
out = get_linked_libs_raw(path)
3002+
3003+
if out is None:
3004+
msg = "Failed to determine dynamically linked libraries for %s, "
3005+
msg += "so skipping it in RPATH sanity check"
3006+
self.log.debug(msg, path)
3007+
else:
30083008
# check whether all required libraries are found via 'ldd'
3009-
out, ec = run_cmd("ldd %s" % path, simple=False, trace=False)
3010-
if ec:
3011-
fail_msg = "Failed to run 'ldd %s': %s" % (path, out)
3012-
self.log.warning(fail_msg)
3013-
fails.append(fail_msg)
3014-
elif not_found_regex.search(out):
3009+
if not_found_regex.search(out):
30153010
fail_msg = "One or more required libraries not found for %s: %s" % (path, out)
30163011
self.log.warning(fail_msg)
30173012
fails.append(fail_msg)
@@ -3030,9 +3025,6 @@ def sanity_check_rpath(self, rpath_dirs=None):
30303025
fails.append(fail_msg)
30313026
else:
30323027
self.log.debug("Output of 'readelf -d %s' checked, looks OK", path)
3033-
3034-
else:
3035-
self.log.debug("%s is not dynamically linked, so skipping it in RPATH sanity check", path)
30363028
else:
30373029
self.log.debug("Not sanity checking files in non-existing directory %s", dirpath)
30383030

easybuild/framework/easyconfig/easyconfig.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
import easybuild.tools.filetools as filetools
5151
from easybuild.base import fancylogger
5252
from easybuild.framework.easyconfig import MANDATORY
53-
from easybuild.framework.easyconfig.constants import EXTERNAL_MODULE_MARKER
53+
from easybuild.framework.easyconfig.constants import EASYCONFIG_CONSTANTS, EXTERNAL_MODULE_MARKER
5454
from easybuild.framework.easyconfig.default import DEFAULT_CONFIG
5555
from easybuild.framework.easyconfig.format.convert import Dependency
5656
from easybuild.framework.easyconfig.format.format import DEPENDENCY_PARAMETERS
@@ -1589,7 +1589,7 @@ def _parse_dependency(self, dep, hidden=False, build_only=False):
15891589

15901590
# (true) boolean value simply indicates that a system toolchain is used
15911591
elif isinstance(tc_spec, bool) and tc_spec:
1592-
tc = {'name': SYSTEM_TOOLCHAIN_NAME, 'version': ''}
1592+
tc = EASYCONFIG_CONSTANTS['SYSTEM'][0]
15931593

15941594
# two-element list/tuple value indicates custom toolchain specification
15951595
elif isinstance(tc_spec, (list, tuple,)):

easybuild/framework/easyconfig/format/one.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,16 +76,19 @@ def dump_dependency(dep, toolchain, toolchain_hierarchy=None):
7676
else:
7777
# minimal spec: (name, version)
7878
tup = (dep['name'], dep['version'])
79+
res = None
7980
if all(dep['toolchain'] != subtoolchain for subtoolchain in toolchain_hierarchy):
8081
if dep[SYSTEM_TOOLCHAIN_NAME]:
81-
tup += (dep['versionsuffix'], True)
82+
# use SYSTEM constant to indicate that system toolchain should be used for this dependency
83+
res = re.sub(r'\)$', ', SYSTEM)', str(tup + (dep['versionsuffix'],)))
8284
else:
8385
tup += (dep['versionsuffix'], (dep['toolchain']['name'], dep['toolchain']['version']))
8486

8587
elif dep['versionsuffix']:
8688
tup += (dep['versionsuffix'],)
8789

88-
res = str(tup)
90+
if res is None:
91+
res = str(tup)
8992
return res
9093

9194

0 commit comments

Comments
 (0)