singularity, apptainer: --without-conmon into @property config_options (#34474)
Per https://github.com/spack/spack/issues/34192, apptainer does not support `--without-conmon`, so we introduce a base class `config_options` property that can be overridden in the `apptainer` package.
This commit is contained in:
parent
18438c395d
commit
9d936a2a75
@ -39,15 +39,7 @@ class Apptainer(SingularityBase):
|
|||||||
"https://apptainer.org/docs/admin/main/admin_quickstart.html#apptainer-security",
|
"https://apptainer.org/docs/admin/main/admin_quickstart.html#apptainer-security",
|
||||||
)
|
)
|
||||||
|
|
||||||
# This overrides SingularityBase (found in ../singularityce/package.py)
|
# Override config options from SingularityBase
|
||||||
# Because Apptainer's mconfig has no option `--without-conmon`
|
@property
|
||||||
# https://github.com/apptainer/apptainer/blob/v1.0.2/mconfig
|
def config_options(self):
|
||||||
def edit(self, spec, prefix):
|
return []
|
||||||
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()
|
|
||||||
|
@ -70,12 +70,17 @@ def do_stage(self, mirror_only=False):
|
|||||||
def build_directory(self):
|
def build_directory(self):
|
||||||
return self.singularity_gopath_dir
|
return self.singularity_gopath_dir
|
||||||
|
|
||||||
|
# Allow overriding config options
|
||||||
|
@property
|
||||||
|
def config_options(self):
|
||||||
|
# Using conmon from spack
|
||||||
|
return ["--without-conmon"]
|
||||||
|
|
||||||
# Hijack the edit stage to run mconfig.
|
# Hijack the edit stage to run mconfig.
|
||||||
def edit(self, spec, prefix):
|
def edit(self, spec, prefix):
|
||||||
with working_dir(self.build_directory):
|
with working_dir(self.build_directory):
|
||||||
confstring = "./mconfig --prefix=%s" % prefix
|
confstring = "./mconfig --prefix=%s" % prefix
|
||||||
# Using conmon from spack
|
confstring += " ".join(config_options)
|
||||||
confstring += " --without-conmon"
|
|
||||||
if "~suid" in spec:
|
if "~suid" in spec:
|
||||||
confstring += " --without-suid"
|
confstring += " --without-suid"
|
||||||
if "~network" in spec:
|
if "~network" in spec:
|
||||||
|
Loading…
Reference in New Issue
Block a user