summaryrefslogtreecommitdiff
path: root/var/spack/repos/builtin/packages/dd4hep
diff options
context:
space:
mode:
authorWouter Deconinck <wdconinc@gmail.com>2023-11-14 02:25:56 -0600
committerGitHub <noreply@github.com>2023-11-14 09:25:56 +0100
commitc264cf12a21c44358739fbe1fa674d2cb497ab5d (patch)
tree98dde6baee1b8b290bca7743111728a4e1d6c07c /var/spack/repos/builtin/packages/dd4hep
parent769474fcb0875759a5e6fa37b2b624b6c368a278 (diff)
downloadspack-c264cf12a21c44358739fbe1fa674d2cb497ab5d.tar.gz
spack-c264cf12a21c44358739fbe1fa674d2cb497ab5d.tar.bz2
spack-c264cf12a21c44358739fbe1fa674d2cb497ab5d.tar.xz
spack-c264cf12a21c44358739fbe1fa674d2cb497ab5d.zip
dd4hep: avoid IndexError in setup_run_environment (#41051)
Some environments may have `dd4hep` as a concretized package without having it installed (yet). For those environments, `dd4hep` has property `libs` that is an empty list. Nevertheless, it can be added to a run environment (for example in case `dd4hep` is part of an environment). This results in an IndexError: ``` ==> Warning: couldn't load runtime environment due to IndexError: list index out of range ``` To avoid the IndexError, only prepend the `dd4hep` libs if there are actually libs found.
Diffstat (limited to 'var/spack/repos/builtin/packages/dd4hep')
-rw-r--r--var/spack/repos/builtin/packages/dd4hep/package.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/var/spack/repos/builtin/packages/dd4hep/package.py b/var/spack/repos/builtin/packages/dd4hep/package.py
index 77c3934bdf..a9ca9fe12d 100644
--- a/var/spack/repos/builtin/packages/dd4hep/package.py
+++ b/var/spack/repos/builtin/packages/dd4hep/package.py
@@ -254,7 +254,8 @@ class Dd4hep(CMakePackage):
env.set("DD4HEP", self.prefix.examples)
env.set("DD4hep_DIR", self.prefix)
env.set("DD4hep_ROOT", self.prefix)
- env.prepend_path("LD_LIBRARY_PATH", self.libs.directories[0])
+ if len(self.libs.directories) > 0:
+ env.prepend_path("LD_LIBRARY_PATH", self.libs.directories[0])
def url_for_version(self, version):
# dd4hep releases are dashes and padded with a leading zero