diff --git a/var/spack/repos/builtin/packages/slurm/detection_test.yaml b/var/spack/repos/builtin/packages/slurm/detection_test.yaml new file mode 100644 index 00000000000..421c5be7c78 --- /dev/null +++ b/var/spack/repos/builtin/packages/slurm/detection_test.yaml @@ -0,0 +1,23 @@ +paths: +- layout: + # SLES: + - executables: + - "bin/srun" + script: | + echo "slurm 22.05.8" + - executables: + - "bin/salloc" + script: | + echo "slurm 22.05.8" + # Debian: + - executables: + - "bin/srun" + script: | + echo "slurm-wlm 22.05.8" + - executables: + - "bin/salloc" + script: | + echo "slurm-wlm 22.05.8" + platforms: ["linux"] + results: + - spec: "slurm@22.05.8" diff --git a/var/spack/repos/builtin/packages/slurm/package.py b/var/spack/repos/builtin/packages/slurm/package.py index 331fb7ce3bd..fe1e5e2446f 100644 --- a/var/spack/repos/builtin/packages/slurm/package.py +++ b/var/spack/repos/builtin/packages/slurm/package.py @@ -178,7 +178,7 @@ class Slurm(AutotoolsPackage): @classmethod def determine_version(cls, exe): output = Executable(exe)("--version", output=str).rstrip() - match = re.search(r"slurm\s*([0-9.]+)", output) + match = re.search(r"slurm(?:-wlm)?\s*([0-9.]+)", output) return match.group(1) if match else None def flag_handler(self, name, flags):