diff --git a/.github/workflows/bootstrap_script.yml b/.github/workflows/bootstrap_script.yml deleted file mode 100644 index d8e4f52f95..0000000000 --- a/.github/workflows/bootstrap_script.yml +++ /dev/null @@ -1,137 +0,0 @@ -# documentation: https://help.github.com/en/articles/workflow-syntax-for-github-actions -name: test EasyBuild bootstrap script -on: [push, pull_request] - -permissions: - contents: read # to fetch code (actions/checkout) - -concurrency: - group: ${{format('{0}:{1}:{2}', github.repository, github.ref, github.workflow)}} - cancel-in-progress: true - -jobs: - setup: - runs-on: ubuntu-20.04 - outputs: - lmod7: Lmod-7.8.22 - lmod8: Lmod-8.7.6 - modulesTcl: modules-tcl-1.147 - modules3: modules-3.2.10 - modules4: modules-4.1.4 - steps: - - run: "true" - build: - needs: setup - runs-on: ubuntu-20.04 - strategy: - matrix: - # Don't run for Python 3.8, 3.9 , people should just use `pip install easybuild` - python: [2.7, 3.6, 3.7] - modules_tool: - # use variables defined by 'setup' job above, see also - # https://docs.github.com/en/actions/reference/context-and-expression-syntax-for-github-actions#needs-context - - ${{needs.setup.outputs.lmod7}} - - ${{needs.setup.outputs.lmod8}} - module_syntax: [Lua] - lc_all: [""] - include: - # also test with module tools other than Lmod (only Tcl syntax) - - modules_tool: ${{needs.setup.outputs.modulesTcl}} - module_syntax: Tcl - python: 2.7 - - modules_tool: ${{needs.setup.outputs.modulesTcl}} - module_syntax: Tcl - python: 3.6 - - modules_tool: ${{needs.setup.outputs.modules3}} - module_syntax: Tcl - python: 2.7 - - modules_tool: ${{needs.setup.outputs.modules3}} - module_syntax: Tcl - python: 3.6 - - modules_tool: ${{needs.setup.outputs.modules4}} - module_syntax: Tcl - python: 2.7 - - modules_tool: ${{needs.setup.outputs.modules4}} - module_syntax: Tcl - python: 3.6 - # There may be encoding errors in Python 3 which are hidden when an UTF-8 encoding is set - # Hence run the tests (again) with LC_ALL=C and Python 3.6 (or any < 3.7) - - python: 3.6 - modules_tool: ${{needs.setup.outputs.lmod8}} - module_syntax: Lua - lc_all: C - fail-fast: false - steps: - - uses: actions/checkout@v3 - - - name: set up Python - uses: actions/setup-python@v3 - with: - python-version: ${{matrix.python}} - architecture: x64 - - - name: install OS & Python packages - run: | - # for modules tool - APT_PKGS="lua5.2 liblua5.2-dev lua-filesystem lua-posix tcl tcl-dev" - - # Avoid apt-get update, as we don't really need it, - # and it does more harm than good (it's fairly expensive, and it results in flaky test runs) - if ! sudo apt-get install $APT_PKGS; then - # Try to update cache, then try again to resolve 404s of old packages - sudo apt-get update -yqq || true - sudo apt-get install $APT_PKGS - fi - - # fix for lua-posix packaging issue, see https://bugs.launchpad.net/ubuntu/+source/lua-posix/+bug/1752082 - # needed for Ubuntu 18.04, but not for Ubuntu 20.04, so skipping symlinking if posix.so already exists - if [ ! -e /usr/lib/x86_64-linux-gnu/lua/5.2/posix.so ] ; then - 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 - fi - - - name: install modules tool - run: | - # avoid downloading modules tool sources into easybuild-framework dir - cd $HOME - export INSTALL_DEP=$GITHUB_WORKSPACE/easybuild/scripts/install_eb_dep.sh - # install Lmod - source $INSTALL_DEP ${{matrix.modules_tool}} $HOME - # changes in environment are not passed to other steps, so need to create files... - echo $MOD_INIT > mod_init - echo $PATH > path - if [ ! -z $MODULESHOME ]; then echo $MODULESHOME > moduleshome; fi - - - name: test bootstrap script - run: | - # (re)initialize environment for modules tool - if [ -f $HOME/moduleshome ]; then export MODULESHOME=$(cat $HOME/moduleshome); fi - source $(cat $HOME/mod_init); type module - # also pick up changes to $PATH set by sourcing $HOME/mod_init - export PATH=$(cat $HOME/path) - - # define $EASYBUILD_MODULES_TOOL only for oldest module tools - # (for Lmod and EnvironmentModules 4.x the bootstrap script should correctly auto-detect the modules tool) - if [[ ${{matrix.modules_tool}} =~ ^modules-tcl- ]]; then - export EASYBUILD_MODULES_TOOL=EnvironmentModulesTcl - elif [[ ${{matrix.modules_tool}} =~ ^modules-3 ]]; then - export EASYBUILD_MODULES_TOOL=EnvironmentModulesC - fi - - # version and SHA256 checksum are hardcoded below to avoid forgetting to update the version in the script along with contents - EB_BOOTSTRAP_VERSION=$(grep '^EB_BOOTSTRAP_VERSION' easybuild/scripts/bootstrap_eb.py | sed 's/[^0-9.]//g') - EB_BOOTSTRAP_SHA256SUM=$(sha256sum easybuild/scripts/bootstrap_eb.py | cut -f1 -d' ') - EB_BOOTSTRAP_FOUND="$EB_BOOTSTRAP_VERSION $EB_BOOTSTRAP_SHA256SUM" - EB_BOOTSTRAP_EXPECTED="20210715.01 935979de3a4c30b24c3617ff7cd7c40cbd4d815cee5be0c99810cc21f21182f1" - test "$EB_BOOTSTRAP_FOUND" = "$EB_BOOTSTRAP_EXPECTED" || (echo "Version check on bootstrap script failed $EB_BOOTSTRAP_FOUND" && exit 1) - - # test bootstrap script - export PREFIX=/tmp/$USER/$GITHUB_SHA/eb_bootstrap - export EASYBUILD_BOOTSTRAP_DEPRECATED=1 - python easybuild/scripts/bootstrap_eb.py $PREFIX - unset EASYBUILD_BOOTSTRAP_DEPRECATED - # unset $PYTHONPATH to avoid mixing two EasyBuild 'installations' when testing bootstrapped EasyBuild module - unset PYTHONPATH - # simple sanity check on bootstrapped EasyBuild module - module use $PREFIX/modules/all - module load EasyBuild - eb --version diff --git a/easybuild/framework/easyconfig/templates.py b/easybuild/framework/easyconfig/templates.py index 603423c20b..d0a209c192 100644 --- a/easybuild/framework/easyconfig/templates.py +++ b/easybuild/framework/easyconfig/templates.py @@ -114,13 +114,15 @@ ('FTPGNOME_SOURCE', 'https://ftp.gnome.org/pub/GNOME/sources/%(namelower)s/%(version_major_minor)s', 'http download for gnome ftp server'), ('GITHUB_SOURCE', 'https://github.com/%(github_account)s/%(name)s/archive', - 'GitHub source URL (namelower is used if github_account easyconfig parameter is not specified)'), + 'GitHub source URL (if github_account easyconfig parameter is not specified, namelower is used in its place)'), ('GITHUB_LOWER_SOURCE', 'https://github.com/%(github_account)s/%(namelower)s/archive', - 'GitHub source URL (lowercase name, namelower is used if github_account easyconfig parameter is not specified)'), + 'GitHub source URL with lowercase name (if github_account easyconfig ' + 'parameter is not specified, namelower is used in its place)'), ('GITHUB_RELEASE', 'https://github.com/%(github_account)s/%(name)s/releases/download/v%(version)s', - 'GitHub release URL (namelower is used if github_account easyconfig parameter is not specified)'), + 'GitHub release URL (if github_account easyconfig parameter is not specified, namelower is used in its place)'), ('GITHUB_LOWER_RELEASE', 'https://github.com/%(github_account)s/%(namelower)s/releases/download/v%(version)s', - 'GitHub release URL (namelower is used if github_account easyconfig parameter is not specified)'), + 'GitHub release URL with lowercase name (if github_account easyconfig ' + 'parameter is not specified, namelower is used in its place)'), ('GNU_SAVANNAH_SOURCE', 'https://download-mirror.savannah.gnu.org/releases/%(namelower)s', 'download.savannah.gnu.org source url'), ('GNU_SOURCE', 'https://ftpmirror.gnu.org/gnu/%(namelower)s', diff --git a/easybuild/tools/run.py b/easybuild/tools/run.py index c87caec419..1b8c385563 100644 --- a/easybuild/tools/run.py +++ b/easybuild/tools/run.py @@ -623,19 +623,19 @@ def parse_cmd_output(cmd, stdouterr, ec, simple, log_all, log_ok, regexp): """ if strictness == IGNORE: check_ec = False - use_regexp = False + fail_on_error_match = False elif strictness == WARN: check_ec = True - use_regexp = False + fail_on_error_match = False elif strictness == ERROR: check_ec = True - use_regexp = True + fail_on_error_match = True else: raise EasyBuildError("invalid strictness setting: %s", strictness) # allow for overriding the regexp setting if not regexp: - use_regexp = False + fail_on_error_match = False if ec and (log_all or log_ok): # We don't want to error if the user doesn't care @@ -650,14 +650,16 @@ def parse_cmd_output(cmd, stdouterr, ec, simple, log_all, log_ok, regexp): _log.debug('cmd "%s" exited with exit code %s and output:\n%s' % (cmd, ec, stdouterr)) # parse the stdout/stderr for errors when strictness dictates this or when regexp is passed in - if use_regexp or regexp: - res = parse_log_for_error(stdouterr, regexp, msg="Command used: %s" % cmd) - if len(res) > 0: - message = "Found %s errors in command output (output: %s)" % (len(res), "\n\t".join([r[0] for r in res])) - if use_regexp: - raise EasyBuildError(message) + if fail_on_error_match or regexp: + res = parse_log_for_error(stdouterr, regexp, stdout=False) + if res: + errors = "\n\t" + "\n\t".join([r[0] for r in res]) + error_str = "error" if len(res) == 1 else "errors" + if fail_on_error_match: + raise EasyBuildError("Found %s %s in output of %s:%s", len(res), error_str, cmd, errors) else: - _log.warning(message) + _log.warning("Found %s potential %s (some may be harmless) in output of %s:%s", + len(res), error_str, cmd, errors) if simple: if ec: