Use core API to create a Makefile during bootstrapping (#37023)
This commit is contained in:
parent
01913d08e7
commit
1b7cf171ce
@ -19,6 +19,7 @@
|
|||||||
import spack.environment
|
import spack.environment
|
||||||
import spack.tengine
|
import spack.tengine
|
||||||
import spack.util.executable
|
import spack.util.executable
|
||||||
|
from spack.environment import depfile
|
||||||
|
|
||||||
from ._common import _root_spec
|
from ._common import _root_spec
|
||||||
from .config import root_path, spec_for_current_python, store_path
|
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:
|
def _install_with_depfile(self) -> None:
|
||||||
spackcmd = spack.util.executable.which("spack")
|
model = depfile.MakefileModel.from_env(self)
|
||||||
spackcmd(
|
template = spack.tengine.make_environment().get_template(
|
||||||
"-e",
|
os.path.join("depfile", "Makefile")
|
||||||
str(self.environment_root()),
|
|
||||||
"env",
|
|
||||||
"depfile",
|
|
||||||
"-o",
|
|
||||||
str(self.environment_root().joinpath("Makefile")),
|
|
||||||
)
|
)
|
||||||
|
makefile = self.environment_root() / "Makefile"
|
||||||
|
makefile.write_text(template.render(model.to_dict()))
|
||||||
make = spack.util.executable.which("make")
|
make = spack.util.executable.which("make")
|
||||||
kwargs = {}
|
kwargs = {}
|
||||||
if not tty.is_debug():
|
if not tty.is_debug():
|
||||||
|
Loading…
Reference in New Issue
Block a user