Skip to content

Commit 0a506aa

Browse files
Merge pull request #4077 from easybuilders/4.6.x
release EasyBuild 4.6.1
2 parents d278319 + 5074c43 commit 0a506aa

34 files changed

+777
-239
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: 2 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

.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/fancylogger.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -380,9 +380,9 @@ def streamLog(self, levelno, data):
380380

381381
def write_and_flush_stream(hdlr, data=None):
382382
"""Write to stream and flush the handler"""
383-
if (not hasattr(hdlr, 'stream')) or hdlr.stream is None:
383+
if getattr(hdlr, 'stream', None) is None:
384384
# no stream or not initialised.
385-
raise("write_and_flush_stream failed. No active stream attribute.")
385+
raise ValueError("write_and_flush_stream failed. No active stream attribute.")
386386
if data is not None:
387387
hdlr.stream.write(data)
388388
hdlr.flush()

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: 14 additions & 23 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
@@ -973,7 +974,7 @@ def gen_builddir(self):
973974
if not self.cfg.get('cleanupoldbuild', False):
974975
uniq_builddir = builddir
975976
suff = 0
976-
while(os.path.isdir(uniq_builddir)):
977+
while os.path.isdir(uniq_builddir):
977978
uniq_builddir = "%s.%d" % (builddir, suff)
978979
suff += 1
979980
builddir = uniq_builddir
@@ -2875,7 +2876,9 @@ def apply_post_install_patches(self, patches=None):
28752876

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

28802883
def post_install_step(self):
28812884
"""
@@ -2994,24 +2997,15 @@ def sanity_check_rpath(self, rpath_dirs=None):
29942997
for path in [os.path.join(dirpath, x) for x in os.listdir(dirpath)]:
29952998
self.log.debug("Sanity checking RPATH for %s", path)
29962999

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:
3000+
out = get_linked_libs_raw(path)
3001+
3002+
if out is None:
3003+
msg = "Failed to determine dynamically linked libraries for %s, "
3004+
msg += "so skipping it in RPATH sanity check"
3005+
self.log.debug(msg, path)
3006+
else:
30083007
# 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):
3008+
if not_found_regex.search(out):
30153009
fail_msg = "One or more required libraries not found for %s: %s" % (path, out)
30163010
self.log.warning(fail_msg)
30173011
fails.append(fail_msg)
@@ -3030,9 +3024,6 @@ def sanity_check_rpath(self, rpath_dirs=None):
30303024
fails.append(fail_msg)
30313025
else:
30323026
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)
30363027
else:
30373028
self.log.debug("Not sanity checking files in non-existing directory %s", dirpath)
30383029

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,)):

0 commit comments

Comments
 (0)