From 9b0e79fcab1d4cc88db9d298b114d8ebc8da666f Mon Sep 17 00:00:00 2001 From: Sam Grayson Date: Wed, 7 Dec 2022 12:05:22 -0700 Subject: [PATCH] Fix Apptainer (#34329) * Fix Apptainer * Add comments --- .../repos/builtin/packages/apptainer/package.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/var/spack/repos/builtin/packages/apptainer/package.py b/var/spack/repos/builtin/packages/apptainer/package.py index 39c3d7019f..c2ee2dc2de 100644 --- a/var/spack/repos/builtin/packages/apptainer/package.py +++ b/var/spack/repos/builtin/packages/apptainer/package.py @@ -27,6 +27,8 @@ class Apptainer(SingularityBase): git = "https://github.com/apptainer/apptainer.git" version("main", branch="main") + + version("1.1.3", sha256="c7bf7f4d5955e1868739627928238d02f94ca9fd0caf110b0243d65548427899") version("1.0.2", sha256="2d7a9d0a76d5574459d249c3415e21423980d9154ce85e8c34b0600782a7dfd3") singularity_org = "apptainer" @@ -35,3 +37,16 @@ class Apptainer(SingularityBase): "https://apptainer.org/docs/admin/main/security.html", "https://apptainer.org/docs/admin/main/admin_quickstart.html#apptainer-security", ) + + # This overrides SingularityBase (found in ../singularityce/package.py) + # Because Apptainer's mconfig has no option `--without-conmon` + # https://github.com/apptainer/apptainer/blob/v1.0.2/mconfig + def edit(self, spec, prefix): + with working_dir(self.build_directory): + confstring = "./mconfig --prefix=%s" % prefix + if "~suid" in spec: + confstring += " --without-suid" + if "~network" in spec: + confstring += " --without-network" + configure = Executable(confstring) + configure()