diff --git a/lib/spack/spack/binary_distribution.py b/lib/spack/spack/binary_distribution.py index 5fe399b8b7b..e563eb2175b 100644 --- a/lib/spack/spack/binary_distribution.py +++ b/lib/spack/spack/binary_distribution.py @@ -625,11 +625,13 @@ def tarball_directory_name(spec): Return name of the tarball directory according to the convention -//-/ """ - # FIXME (compiler as nodes): fix the naming scheme later to avoid using compiler - return spec.format_path( - f"{spec.architecture}/{spec.compiler_annotation.name}-{spec.compiler_annotation.version}/" - f"{spec.name}-{spec.version}" - ) + if not spec.compiler_as_nodes(): + return spec.format_path( + f"{spec.architecture}/{spec.compiler_annotation.name}" + f"-{spec.compiler_annotation.version}/{spec.name}-{spec.version}" + ) + + return spec.format_path(f"{spec.architecture.platform}/{spec.name}-{spec.version}") def tarball_name(spec, ext): @@ -637,12 +639,16 @@ def tarball_name(spec, ext): Return the name of the tarfile according to the convention --- """ - # FIXME (compiler as nodes): fix the naming scheme later to avoid using compiler - spec_formatted = ( - f"{spec.architecture}-{spec.compiler_annotation.name}" - f"-{spec.compiler_annotation.version}-{spec.name}" - f"-{spec.version}-{spec.dag_hash()}" - ) + if not spec.compiler_as_nodes(): + spec_formatted = ( + f"{spec.architecture}-{spec.compiler_annotation.name}" + f"-{spec.compiler_annotation.version}-{spec.name}" + f"-{spec.version}-{spec.dag_hash()}" + ) + else: + spec_formatted = ( + f"{spec.architecture.platform}-{spec.name}-{spec.version}-{spec.dag_hash()}" + ) return f"{spec_formatted}{ext}" diff --git a/lib/spack/spack/spec.py b/lib/spack/spack/spec.py index cbe48b6e28c..95d14279dc5 100644 --- a/lib/spack/spack/spec.py +++ b/lib/spack/spack/spec.py @@ -4493,6 +4493,10 @@ def attach_git_version_lookup(self): if isinstance(v, vn.GitVersion) and v._ref_version is None: v.attach_lookup(spack.version.git_ref_lookup.GitRefLookup(self.fullname)) + def compiler_as_nodes(self) -> bool: + """Returns True if compiler are treated as nodes""" + return not hasattr(self, "compiler_annotation") + class VariantMap(lang.HashableMap): """Map containing variant instances. New values can be added only