From 5dbbb525796cc1f01be77d679ab0d4cfaf8adced Mon Sep 17 00:00:00 2001 From: Massimiliano Culpo Date: Sat, 22 Feb 2025 14:24:11 +0100 Subject: [PATCH] spec: remove {%compiler} in default format --- lib/spack/spack/spec.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/lib/spack/spack/spec.py b/lib/spack/spack/spec.py index eb453bc7ef8..154a22035c7 100644 --- a/lib/spack/spack/spec.py +++ b/lib/spack/spack/spec.py @@ -2116,14 +2116,12 @@ def long_spec(self): def short_spec(self): """Returns a version of the spec with the dependencies hashed instead of completely enumerated.""" - return self.format("{name}{@version} {variants}{ arch=architecture}{/hash:7}") + return self.format("{name}{@version}{variants}{ arch=architecture}{/hash:7}") @property def cshort_spec(self): """Returns an auto-colorized version of ``self.short_spec``.""" - spec_format = "{name}{@version}{%compiler.name}{@compiler.version}" - spec_format += "{variants}{ arch=architecture}{/hash:7}" - return self.cformat(spec_format) + return self.cformat("{name}{@version}{variants}{ arch=architecture}{/hash:7}") @property def prefix(self) -> spack.util.prefix.Prefix: @@ -5330,8 +5328,7 @@ def __init__(self, spec): class AmbiguousHashError(spack.error.SpecError): def __init__(self, msg, *specs): - spec_fmt = "{namespace}.{name}{@version}{%compiler}{compiler_flags}" - spec_fmt += "{variants}{ arch=architecture}{/hash:7}" + spec_fmt = "{namespace}.{name}{@version}{variants}{ arch=architecture}{/hash:7}" specs_str = "\n " + "\n ".join(spec.format(spec_fmt) for spec in specs) super().__init__(msg + specs_str)