Skip to content

Commit

Permalink
eicrecon: variant +lsan, LSAN_OPTIONS, lsan.supp
Browse files Browse the repository at this point in the history
  • Loading branch information
wdconinc authored Jan 22, 2025
1 parent 8de0726 commit 279e374
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions packages/eicrecon/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ class Eicrecon(CMakePackage):
)

variant("asan", default=False, description="Enable address sanitizer")
variant("lsan", default=False, description="Enable leak sanitizer", when="+asan")
variant("tsan", default=False, description="Enable thread sanitizer")
variant("ubsan", default=False, description="Enable undefined behavior sanitizer")

Expand Down Expand Up @@ -272,6 +273,12 @@ def install_asan_supp(self):
mkdirp(self.prefix.share.EICrecon)
install(".github/asan.supp", self.prefix.share.EICrecon)

@when("+lsan")
@run_after("install")
def install_lsan_supp(self):
mkdirp(self.prefix.share.EICrecon)
install(".github/lsan.supp", self.prefix.share.EICrecon)

@when("+ubsan")
@run_after("install")
def install_ubsan_supp(self):
Expand All @@ -294,6 +301,14 @@ def setup_run_environment(self, env):
),
)

if self.spec.satisfies("+lsan"):
env.set(
"LSAN_OPTIONS",
(
f"suppressions={self.prefix}/share/EICrecon/lsan.supp:"
),
)

if self.spec.satisfies("+ubsan"):
env.set(
"UBSAN_OPTIONS",
Expand Down

0 comments on commit 279e374

Please sign in to comment.