internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: easybuilders/easybuild-framework

Issue:
Symbolic link lib64 to lib should be a relative link
This is a comment from 
https://github.com/easybuilders/easybuild-framework/pull/3401

The symlink created for lib64 is a symlink to the absolute path. It should be a symlink with the relative path.


Discussion:
In the event when someone rsync the installdir onto a different filesystem and attempts to change permissions/group, rsync will try to change permission/groups through the symlink, which points to the absolute path on the old filesystem.
We had this particular case:
`/stratum0/cvmfs/restricted.computecanada.ca/easybuild/software/2020/avx2/MPI/gcc9/openmpi4/maker/3.01.03/lib64 ->`
`/cvmfs/restricted.computecanada.ca/easybuild/software/2020/avx2/MPI/gcc9/openmpi4/maker/3.01.03/lib`
when we rsync from `/cvmfs` to `/stratum0/cvmfs`
FYI: Your issue for moving stuff might also occur with the default version files `.version` and maybe others

Resolving patch:
diff --git a/easybuild/framework/easyblock.py b/easybuild/framework/easyblock.py
--- a/easybuild/framework/easyblock.py
+++ b/easybuild/framework/easyblock.py
@@ -2405,7 +2405,9 @@ def post_install_step(self):
             lib_dir = os.path.join(self.installdir, 'lib')
             lib64_dir = os.path.join(self.installdir, 'lib64')
             if os.path.exists(lib_dir) and not os.path.exists(lib64_dir):
-                symlink(lib_dir, lib64_dir)
+                # create *relative* 'lib64' symlink to 'lib';
+                # see https://github.com/easybuilders/easybuild-framework/issues/3564
+                symlink('lib', lib64_dir, use_abspath_source=False)
 
     def sanity_check_step(self, *args, **kwargs):
         """


Test patch:
diff --git a/test/framework/toy_build.py b/test/framework/toy_build.py
--- a/test/framework/toy_build.py
+++ b/test/framework/toy_build.py
@@ -3151,6 +3151,8 @@ def test_test_toy_build_lib64_symlink(self):
         self.assertFalse(os.path.islink(lib_path))
         self.assertTrue(os.path.islink(lib64_path))
         self.assertTrue(os.path.samefile(lib_path, lib64_path))
+        # Need relative path: https://github.com/easybuilders/easybuild-framework/issues/3564
+        self.assertFalse(os.path.isabs(os.readlink(lib64_path)))
 
         # cleanup and try again with --disable-lib64-lib-symlink
         remove_dir(self.test_installpath)
Repository: easybuilders/easybuild-framework

Issue:
-lpthtread is missing from $LIBBLAS_MT
when building with the `foss` toolchain, I noticed that `$LIBBLAS_MT` is defined identical to `$LIBBLAS` as `-lopenblas -lgfortran`

we should make sure `-lpthread` is included as well.




Discussion:

Resolving patch:
diff --git a/easybuild/toolchains/linalg/openblas.py b/easybuild/toolchains/linalg/openblas.py
--- a/easybuild/toolchains/linalg/openblas.py
+++ b/easybuild/toolchains/linalg/openblas.py
@@ -40,6 +40,7 @@ class OpenBLAS(LinAlg):
     """
     BLAS_MODULE_NAME = ['OpenBLAS']
     BLAS_LIB = ['openblas']
+    BLAS_LIB_MT = ['openblas']
     BLAS_FAMILY = TC_CONSTANT_OPENBLAS
 
     LAPACK_MODULE_NAME = ['OpenBLAS']


Test patch:
diff --git a/test/framework/toolchain.py b/test/framework/toolchain.py
--- a/test/framework/toolchain.py
+++ b/test/framework/toolchain.py
@@ -1449,7 +1449,7 @@ def test_old_new_iccifort(self):
         libscalack_intel4 = "-lmkl_scalapack_lp64 -lmkl_blacs_intelmpi_lp64 -lmkl_intel_lp64 -lmkl_sequential "
         libscalack_intel4 += "-lmkl_core"
 
-        libblas_mt_fosscuda = "-lopenblas -lgfortran"
+        libblas_mt_fosscuda = "-lopenblas -lgfortran -lpthread"
         libscalack_fosscuda = "-lscalapack -lopenblas -lgfortran"
         libfft_mt_fosscuda = "-lfftw3_omp -lfftw3 -lpthread"
Repository: easybuilders/easybuild-framework

Issue:
Pushing easyconfigs to local git repo fails in 4.5.0
After we upgraded our EasyBuild installation to `4.5.0` we have noticed that the feature we use to send the easyconfigs and build logs to an internal git repo is no longer working. We have an ssh-key for our build user that works if we do a build with a previous EasyBuild version (`4.4.2` for example) but no longer works on `4.5.0`. At the end of the build we get:
```
/scicore/home/scicore/easybuil@bc2-gl.bc2.unibas.ch's password:
```
There seems to be some change in the way the `repositorypath` configuration option is processed, which in our config is:
```
repositorypath=git@bc2-gl.bc2.unibas.ch:easybuild/installed_easyconfigs_tests.git
```


@pescobar mentioned that this commit might be related https://github.com/easybuilders/easybuild-framework/commit/3252979f29b1b92a7223f5163cef02c7c03fa564


Discussion:
@i-mtz It looks like we're not taking into account that the `repositorypath` value may be something totally different than a simple path value...

Can you share the output of `eb --show-config` with both EasyBuild 4.4.2 and 4.5.0?

Resolving patch:
diff --git a/easybuild/tools/options.py b/easybuild/tools/options.py
--- a/easybuild/tools/options.py
+++ b/easybuild/tools/options.py
@@ -1067,7 +1067,7 @@ def _postprocess_checks(self):
 
     def get_cfg_opt_abs_path(self, opt_name, path):
         """Get path value of configuration option as absolute path."""
-        if os.path.isabs(path):
+        if os.path.isabs(path) or path.startswith('git@'):
             abs_path = path
         else:
             abs_path = os.path.abspath(path)


Test patch:
diff --git a/test/framework/options.py b/test/framework/options.py
--- a/test/framework/options.py
+++ b/test/framework/options.py
@@ -6361,6 +6361,25 @@ def test_config_abs_path(self):
             regex = re.compile(pattern, re.M)
             self.assertTrue(regex.search(txt), "Pattern '%s' should be found in: %s" % (pattern, txt))
 
+    def test_config_repositorypath(self):
+        """Test how special repositorypath values are handled."""
+
+        repositorypath = 'git@github.com:boegel/my_easyconfigs.git'
+        args = [
+            '--repositorypath=%s' % repositorypath,
+            '--show-config',
+        ]
+        txt, _ = self._run_mock_eb(args, do_build=True, raise_error=True, testing=False, strip=True)
+
+        regex = re.compile(r'repositorypath\s+\(C\) = %s' % repositorypath, re.M)
+        self.assertTrue(regex.search(txt), "Pattern '%s' should be found in: %s" % (regex.pattern, txt))
+
+        args[0] = '--repositorypath=%s,some/subdir' % repositorypath
+        txt, _ = self._run_mock_eb(args, do_build=True, raise_error=True, testing=False, strip=True)
+
+        regex = re.compile(r"repositorypath\s+\(C\) = \('%s', 'some/subdir'\)" % repositorypath, re.M)
+        self.assertTrue(regex.search(txt), "Pattern '%s' should be found in: %s" % (regex.pattern, txt))
+
     # end-to-end testing of unknown filename
     def test_easystack_wrong_read(self):
         """Test for --easystack <easystack.yaml> when wrong name is provided"""
Repository: easybuilders/easybuild-framework

Issue:
allow --copy-ec for installed modules without requiring --rebuild
Currently, trying to use `--copy-ec` when the module already exists gives the message:
```
== category/software/version is already installed (module found), skipping
== No easyconfigs left to be built.
```
since nothing is being (re)built when `--copy-ec` is passed, it seems unnecessary to require `--rebuild`


Discussion:

Resolving patch:
diff --git a/easybuild/main.py b/easybuild/main.py
--- a/easybuild/main.py
+++ b/easybuild/main.py
@@ -447,7 +447,7 @@ def main(args=None, logfile=None, do_build=None, testing=False, modtool=None):
     forced = options.force or options.rebuild
     dry_run_mode = options.dry_run or options.dry_run_short or options.missing_modules
 
-    keep_available_modules = forced or dry_run_mode or options.extended_dry_run or pr_options
+    keep_available_modules = forced or dry_run_mode or options.extended_dry_run or pr_options or options.copy_ec
     keep_available_modules = keep_available_modules or options.inject_checksums or options.sanity_check_only
 
     # skip modules that are already installed unless forced, or unless an option is used that warrants not skipping


Test patch:
Repository: easybuilders/easybuild-framework

Issue:
check_os_dependency wrongly succeeds using `locate` 
`locate --regexp "/nosuchosdependency$"` returns with an exit code of zero for me making the `check_os_dependency` wrongly return True

Maybe we can use `-c` and check the output.


Discussion:

Resolving patch:
diff --git a/easybuild/tools/systemtools.py b/easybuild/tools/systemtools.py
--- a/easybuild/tools/systemtools.py
+++ b/easybuild/tools/systemtools.py
@@ -873,9 +873,14 @@ def check_os_dependency(dep):
 
         # try locate if it's available
         if not found and which('locate'):
-            cmd = 'locate --regexp "/%s$"' % dep
-            found = run_cmd(cmd, simple=True, log_all=False, log_ok=False, force_in_dry_run=True, trace=False,
-                            stream_output=False)
+            cmd = 'locate -c --regexp "/%s$"' % dep
+            out, ec = run_cmd(cmd, simple=False, log_all=False, log_ok=False, force_in_dry_run=True, trace=False,
+                              stream_output=False)
+            try:
+                found = (ec == 0 and int(out.strip()) > 0)
+            except ValueError:
+                # Returned something else than an int -> Error
+                found = False
 
     return found
 


Test patch:
Repository: easybuilders/easybuild-framework

Issue:
Avoid adding extension statement in module files if there are none
I'm seeing modules with:
```lua
if convertToCanonical(LmodVersion()) >= convertToCanonical("8.2.8") then
    extensions("")
end
```

If the extension list is empty, it should simply not be present.


Discussion:
I'm regretting this already but:
in `make_extension_string` were are flatting a list to a string to convert it back to a list in `_generate_extensions_list` ...

The reason for the statement is because it returns `['']` which pass the if.

Resolving patch:
diff --git a/easybuild/tools/module_generator.py b/easybuild/tools/module_generator.py
--- a/easybuild/tools/module_generator.py
+++ b/easybuild/tools/module_generator.py
@@ -622,7 +622,8 @@ def _generate_extensions_list(self):
         """
         Generate a list of all extensions in name/version format
         """
-        return self.app.make_extension_string(name_version_sep='/', ext_sep=',').split(',')
+        exts_str = self.app.make_extension_string(name_version_sep='/', ext_sep=',')
+        return exts_str.split(',') if exts_str else []
 
     def _generate_help_text(self):
         """


Test patch:
diff --git a/test/framework/module_generator.py b/test/framework/module_generator.py
--- a/test/framework/module_generator.py
+++ b/test/framework/module_generator.py
@@ -756,6 +756,16 @@ def test_module_extensions(self):
             regex = re.compile(pattern, re.M)
             self.assertTrue(regex.search(desc), "Pattern '%s' found in: %s" % (regex.pattern, desc))
 
+        # check if the extensions is missing if there are no extensions
+        test_ec = os.path.join(test_dir, 'easyconfigs', 'test_ecs', 't', 'toy', 'toy-0.0-test.eb')
+
+        ec = EasyConfig(test_ec)
+        eb = EasyBlock(ec)
+        modgen = self.MODULE_GENERATOR_CLASS(eb)
+        desc = modgen.get_description()
+
+        self.assertFalse(re.search(r"\s*extensions\(", desc), "No extensions found in: %s" % desc)
+
     def test_prepend_paths(self):
         """Test generating prepend-paths statements."""
         # test prepend_paths
Repository: easybuilders/easybuild-framework

Issue:
OneAPI ifort: '-fiopenmp' not supported
I am using `intel-2022b` toolchain with the traditional `ifort` compiler. EasyBuild is adding the `-fiopenmp` flag which, according to [here](https://www.intel.com/content/www/us/en/docs/fortran-compiler/developer-guide-reference/2023-2/fiopenmp-qiopenmp.html) is only supported for `ifx` but not `ifort`. From discussions on Slack it appears that the problem is in `intel_compilers.py` and @bartoldeman  suggested this workaround in `toolchainopts`:
```
toolchainopts = {'openmp': False, 'extra_fflags': '-fopenmp' }
```
which seems to do the trick. Maybe that could be fixed for the upcoming 4.9 release?
Thanks.


Discussion:

Resolving patch:
diff --git a/easybuild/toolchains/compiler/intel_compilers.py b/easybuild/toolchains/compiler/intel_compilers.py
--- a/easybuild/toolchains/compiler/intel_compilers.py
+++ b/easybuild/toolchains/compiler/intel_compilers.py
@@ -109,8 +109,9 @@ def set_variables(self):
             self.options.options_map['loose'] = ['fp-model fast']
             # fp-model fast=2 gives "warning: overriding '-ffp-model=fast=2' option with '-ffp-model=fast'"
             self.options.options_map['veryloose'] = ['fp-model fast']
-            # recommended in porting guide
-            self.options.options_map['openmp'] = ['fiopenmp']
+            # recommended in porting guide: qopenmp, unlike fiopenmp, works for both classic and oneapi compilers
+            # https://www.intel.com/content/www/us/en/developer/articles/guide/porting-guide-for-ifort-to-ifx.html
+            self.options.options_map['openmp'] = ['qopenmp']
 
             # -xSSE2 is not supported by Intel oneAPI compilers,
             # so use -march=x86-64 -mtune=generic when using optarch=GENERIC


Test patch:
diff --git a/test/framework/toolchain.py b/test/framework/toolchain.py
--- a/test/framework/toolchain.py
+++ b/test/framework/toolchain.py
@@ -2036,7 +2036,7 @@ def test_independence(self):
             'CrayIntel': "-O2 -ftz -fp-speculation=safe -fp-model source -fopenmp -craype-verbose",
             'GCC': "-O2 -ftree-vectorize -test -fno-math-errno -fopenmp",
             'iccifort': "-O2 -test -ftz -fp-speculation=safe -fp-model source -fopenmp",
-            'intel-compilers': "-O2 -test -ftz -fp-speculation=safe -fp-model precise -fiopenmp",
+            'intel-compilers': "-O2 -test -ftz -fp-speculation=safe -fp-model precise -qopenmp",
         }
 
         toolchains = [
Repository: easybuilders/easybuild-framework

Issue:
Avoid hardcoding `/bin/bash`
There are a few cases (including the `eb` wrapper itself) where we hardcode the use of `/bin/bash`. There are some cases (like [EESSI](http://www.eessi.io/docs/)) where this is not ideal and it's better to ask the environment where to find `bash`.


Discussion:
There are perhaps even some indications in [an EESSI issue](https://github.com/EESSI/software-layer/issues/196#issuecomment-1335385366) that this leads to problems.
`/bin/bash` is hardcoded in:

* `eb` wrapper script
* in `run_shell_cmd`
* in RPATH wrapper script (`easybuild/scripts/rpath_wrapper_template.sh.in`)

We should use `/usr/bin/env bash` instead, or resolve path to `bash` (in `run_shell_cmd`)
> There are perhaps even some indications in [an EESSI issue](https://github.com/EESSI/software-layer/issues/196#issuecomment-1335385366) that this leads to problems.

We're indeed seeing issues with `at-spi2-core` in EESSI now, and one of the reasons is that the EB RPATH wrappers have a `/bin/bash` shebang (and because `LD_LIBRARY_PATH` is being set to some Gentoo Prefix directories, this doesn't work).

Resolving patch:
diff --git a/easybuild/tools/run.py b/easybuild/tools/run.py
--- a/easybuild/tools/run.py
+++ b/easybuild/tools/run.py
@@ -41,6 +41,7 @@
 import os
 import re
 import signal
+import shutil
 import subprocess
 import sys
 import tempfile
@@ -276,7 +277,9 @@ def to_cmd_str(cmd):
     # (which could be dash instead of bash, like on Ubuntu, see https://wiki.ubuntu.com/DashAsBinSh)
     # stick to None (default value) when not running command via a shell
     if use_bash:
-        executable, shell = '/bin/bash', True
+        bash = shutil.which('bash')
+        _log.info(f"Path to bash that will be used to run shell commands: {bash}")
+        executable, shell = bash, True
     else:
         executable, shell = None, False
 


Test patch:
diff --git a/test/framework/easyblock.py b/test/framework/easyblock.py
--- a/test/framework/easyblock.py
+++ b/test/framework/easyblock.py
@@ -2082,7 +2082,7 @@ def test_extensions_sanity_check(self):
         eb.silent = True
         error_pattern = r"Sanity check failed: extensions sanity check failed for 1 extensions: toy\n"
         error_pattern += r"failing sanity check for 'toy' extension: "
-        error_pattern += r'command "thisshouldfail" failed; output:\n/bin/bash:.* thisshouldfail: command not found'
+        error_pattern += r'command "thisshouldfail" failed; output:\n.* thisshouldfail: command not found'
         with self.mocked_stdout_stderr():
             self.assertErrorRegex(EasyBuildError, error_pattern, eb.run_all_steps, True)
Repository: fail2ban/fail2ban

Issue:
weak regex'es for apache
See email on fail2ban-users



Discussion:

Resolving patch:
diff --git a/common/version.py b/common/version.py
--- a/common/version.py
+++ b/common/version.py
@@ -24,4 +24,4 @@
 __copyright__ = "Copyright (c) 2004 Cyril Jaquier, 2011-2013 Yaroslav Halchenko"
 __license__ = "GPL"
 
-version = "0.8.9.dev"
+version = "0.8.10"


Test patch:
Repository: fail2ban/fail2ban

Issue:
reload in interactive mode shows some errors
If I start fail2ban-client in interactive mode (-i), I see some errors using reload (still I don't know is it only a info or not)...
I have it in upstream/master and all my branches (was found within #824).

``` bash
bin/fail2ban-client -c ... -v -i
```

```
fail2ban> reload
fail2ban> reload
ERROR  NOK: ('pam-generic',)
ERROR  NOK: ('Action iptables-allports already exists',)
```

Just added as issue (to not forget), will assign it to me...



Discussion:

Resolving patch:
diff --git a/fail2ban/client/jailsreader.py b/fail2ban/client/jailsreader.py
--- a/fail2ban/client/jailsreader.py
+++ b/fail2ban/client/jailsreader.py
@@ -50,6 +50,7 @@ def jails(self):
 		return self.__jails
 
 	def read(self):
+		self.__jails = list()
 		return ConfigReader.read(self, "jail")
 
 	def getOptions(self, section=None):
diff --git a/fail2ban/server/server.py b/fail2ban/server/server.py
--- a/fail2ban/server/server.py
+++ b/fail2ban/server/server.py
@@ -494,20 +494,24 @@ def flushLogs(self):
 			return "flushed"
 			
 	def setDatabase(self, filename):
-		if len(self.__jails) == 0:
-			if filename.lower() == "none":
-				self.__db = None
-			else:
-				if Fail2BanDb is not None:
-					self.__db = Fail2BanDb(filename)
-					self.__db.delAllJails()
-				else:
-					logSys.error(
-						"Unable to import fail2ban database module as sqlite "
-						"is not available.")
-		else:
+		# if not changed - nothing to do
+		if self.__db and self.__db.filename == filename:
+			return
+		if not self.__db and filename.lower() == 'none':
+			return
+		if len(self.__jails) != 0:
 			raise RuntimeError(
 				"Cannot change database when there are jails present")
+		if filename.lower() == "none":
+			self.__db = None
+		else:
+			if Fail2BanDb is not None:
+				self.__db = Fail2BanDb(filename)
+				self.__db.delAllJails()
+			else:
+				logSys.error(
+					"Unable to import fail2ban database module as sqlite "
+					"is not available.")
 	
 	def getDatabase(self):
 		return self.__db


Test patch:
diff --git a/fail2ban/tests/servertestcase.py b/fail2ban/tests/servertestcase.py
--- a/fail2ban/tests/servertestcase.py
+++ b/fail2ban/tests/servertestcase.py
@@ -173,8 +173,14 @@ def testDatabase(self):
 		self.setGetTestNOK("dbfile", tmpFilename)
 		self.server.delJail(self.jailName)
 		self.setGetTest("dbfile", tmpFilename)
+		# the same file name (again no jails / not changed):
+		self.setGetTest("dbfile", tmpFilename)
 		self.setGetTest("dbpurgeage", "600", 600)
 		self.setGetTestNOK("dbpurgeage", "LIZARD")
+		# the same file name (again with jails / not changed):
+		self.server.addJail(self.jailName, "auto")
+		self.setGetTest("dbfile", tmpFilename)
+		self.server.delJail(self.jailName)
 
 		# Disable database
 		self.assertEqual(self.transm.proceed(
@@ -189,6 +195,11 @@ def testDatabase(self):
 		self.assertEqual(self.transm.proceed(
 			["get", "dbpurgeage"]),
 			(0, None))
+		# the same (again with jails / not changed):
+		self.server.addJail(self.jailName, "auto")
+		self.assertEqual(self.transm.proceed(
+			["set", "dbfile", "None"]),
+			(0, None))
 		os.close(tmp)
 		os.unlink(tmpFilename)
Repository: fail2ban/fail2ban

Issue:
fail2ban crash with some fqdn
Hi,

When a attack come from a fqdn who has lot of ip-address we find fail2ban stuck. He don't really crash but until we remove the line inside the log file, fail2ban do nothing.

The fqdn is unassigned.infomir.com.ua, when you try a nslookup on this name you got...1362 ip-address.

Regards.



Discussion:

Resolving patch:
diff --git a/fail2ban/server/filter.py b/fail2ban/server/filter.py
--- a/fail2ban/server/filter.py
+++ b/fail2ban/server/filter.py
@@ -855,8 +855,9 @@ def dnsToIp(dns):
 		""" Convert a DNS into an IP address using the Python socket module.
 			Thanks to Kevin Drapel.
 		"""
+		# retrieve ip (todo: use AF_INET6 for IPv6)
 		try:
-			return set(socket.gethostbyname_ex(dns)[2])
+			return set([i[4][0] for i in socket.getaddrinfo(dns, None, socket.AF_INET, 0, socket.IPPROTO_TCP)])
 		except socket.error, e:
 			logSys.warning("Unable to find a corresponding IP address for %s: %s"
 						% (dns, e))


Test patch: