summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/spack/spack/bootstrap/environment.py35
-rw-r--r--lib/spack/spack/installer.py7
-rw-r--r--share/spack/templates/bootstrap/spack.yaml2
3 files changed, 12 insertions, 32 deletions
diff --git a/lib/spack/spack/bootstrap/environment.py b/lib/spack/spack/bootstrap/environment.py
index 71d54a8ad1..6a508109fc 100644
--- a/lib/spack/spack/bootstrap/environment.py
+++ b/lib/spack/spack/bootstrap/environment.py
@@ -19,7 +19,6 @@ import spack.environment
import spack.tengine
import spack.util.cpus
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
@@ -86,12 +85,9 @@ class BootstrapEnvironment(spack.environment.Environment):
super().__init__(self.environment_root())
def update_installations(self) -> None:
- """Update the installations of this environment.
-
- The update is done using a depfile on Linux and macOS, and using the ``install_all``
- method of environments on Windows.
- """
- with tty.SuppressOutput(msg_enabled=False, warn_enabled=False):
+ """Update the installations of this environment."""
+ log_enabled = tty.is_debug() or tty.is_verbose()
+ with tty.SuppressOutput(msg_enabled=log_enabled, warn_enabled=log_enabled):
specs = self.concretize()
if specs:
colorized_specs = [
@@ -100,11 +96,9 @@ class BootstrapEnvironment(spack.environment.Environment):
]
tty.msg(f"[BOOTSTRAPPING] Installing dependencies ({', '.join(colorized_specs)})")
self.write(regenerate=False)
- if sys.platform == "win32":
+ with tty.SuppressOutput(msg_enabled=log_enabled, warn_enabled=log_enabled):
self.install_all()
- else:
- self._install_with_depfile()
- self.write(regenerate=True)
+ self.write(regenerate=True)
def update_syspath_and_environ(self) -> None:
"""Update ``sys.path`` and the PATH, PYTHONPATH environment variables to point to
@@ -122,25 +116,6 @@ class BootstrapEnvironment(spack.environment.Environment):
+ [str(x) for x in self.pythonpaths()]
)
- def _install_with_depfile(self) -> None:
- 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():
- kwargs = {"output": os.devnull, "error": os.devnull}
- make(
- "-C",
- str(self.environment_root()),
- "-j",
- str(spack.util.cpus.determine_number_of_jobs(parallel=True)),
- **kwargs,
- )
-
def _write_spack_yaml_file(self) -> None:
tty.msg(
"[BOOTSTRAPPING] Spack has missing dependencies, creating a bootstrapping environment"
diff --git a/lib/spack/spack/installer.py b/lib/spack/spack/installer.py
index 51f7034176..ef0f1f3b8b 100644
--- a/lib/spack/spack/installer.py
+++ b/lib/spack/spack/installer.py
@@ -357,7 +357,8 @@ def _print_installed_pkg(message: str) -> None:
Args:
message (str): message to be output
"""
- print(colorize("@*g{[+]} ") + spack.util.path.debug_padded_filter(message))
+ if tty.msg_enabled():
+ print(colorize("@*g{[+]} ") + spack.util.path.debug_padded_filter(message))
def print_install_test_log(pkg: "spack.package_base.PackageBase") -> None:
@@ -2007,7 +2008,9 @@ class PackageInstaller:
# Only enable the terminal status line when we're in a tty without debug info
# enabled, so that the output does not get cluttered.
- term_status = TermStatusLine(enabled=sys.stdout.isatty() and not tty.is_debug())
+ term_status = TermStatusLine(
+ enabled=sys.stdout.isatty() and tty.msg_enabled() and not tty.is_debug()
+ )
while self.build_pq:
task = self._pop_task()
diff --git a/share/spack/templates/bootstrap/spack.yaml b/share/spack/templates/bootstrap/spack.yaml
index 251977d0c5..8a178d0362 100644
--- a/share/spack/templates/bootstrap/spack.yaml
+++ b/share/spack/templates/bootstrap/spack.yaml
@@ -17,6 +17,8 @@ spack:
root: {{ store_path }}
padded_length: 0
+ install_status: false
+
packages:
python:
buildable: false