Use core API to create a Makefile during bootstrapping (#37023)

This commit is contained in:
Massimiliano Culpo 2023-04-20 15:11:56 +02:00 committed by GitHub
parent 01913d08e7
commit 1b7cf171ce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -19,6 +19,7 @@
import spack.environment
import spack.tengine
import spack.util.executable
from spack.environment import depfile
from ._common import _root_spec
from .config import root_path, spec_for_current_python, store_path
@ -121,15 +122,12 @@ def update_syspath_and_environ(self) -> None:
)
def _install_with_depfile(self) -> None:
spackcmd = spack.util.executable.which("spack")
spackcmd(
"-e",
str(self.environment_root()),
"env",
"depfile",
"-o",
str(self.environment_root().joinpath("Makefile")),
model = depfile.MakefileModel.from_env(self)
template = spack.tengine.make_environment().get_template(
os.path.join("depfile", "Makefile")
)
makefile = self.environment_root() / "Makefile"
makefile.write_text(template.render(model.to_dict()))
make = spack.util.executable.which("make")
kwargs = {}
if not tty.is_debug():