From a0cae043020c7d0e0ac2efeb1bbe998569362b5a Mon Sep 17 00:00:00 2001 From: Massimiliano Culpo Date: Mon, 11 Nov 2024 13:14:43 +0100 Subject: [PATCH] (WIP) Recover bootstrapping from binaries on linux --- etc/spack/defaults/config.yaml | 2 +- lib/spack/spack/binary_distribution.py | 13 ++++++++++--- lib/spack/spack/bootstrap/_common.py | 6 +----- 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/etc/spack/defaults/config.yaml b/etc/spack/defaults/config.yaml index 14560372e62..094c5ef0f9f 100644 --- a/etc/spack/defaults/config.yaml +++ b/etc/spack/defaults/config.yaml @@ -19,7 +19,7 @@ config: install_tree: root: $spack/opt/spack projections: - all: "{architecture}/{compiler.name}-{compiler.version}/{name}-{version}-{hash}" + all: "{architecture.platform}/{architecture.target}/{name}-{version}-{hash}" # install_tree can include an optional padded length (int or boolean) # default is False (do not pad) # if padded_length is True, Spack will pad as close to the system max path diff --git a/lib/spack/spack/binary_distribution.py b/lib/spack/spack/binary_distribution.py index 53aaa764e6b..52e882c1b3e 100644 --- a/lib/spack/spack/binary_distribution.py +++ b/lib/spack/spack/binary_distribution.py @@ -629,7 +629,11 @@ def tarball_directory_name(spec): Return name of the tarball directory according to the convention -//-/ """ - return spec.format_path("{architecture}/{compiler.name}-{compiler.version}/{name}-{version}") + # 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}" + ) def tarball_name(spec, ext): @@ -637,8 +641,11 @@ def tarball_name(spec, ext): Return the name of the tarfile according to the convention --- """ - spec_formatted = spec.format_path( - "{architecture}-{compiler.name}-{compiler.version}-{name}-{version}-{hash}" + # 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()}" ) return f"{spec_formatted}{ext}" diff --git a/lib/spack/spack/bootstrap/_common.py b/lib/spack/spack/bootstrap/_common.py index 2002f51339e..1c1937ce6f1 100644 --- a/lib/spack/spack/bootstrap/_common.py +++ b/lib/spack/spack/bootstrap/_common.py @@ -234,12 +234,8 @@ def _root_spec(spec_str: str) -> str: # Add a compiler and platform requirement to the root spec. platform = str(spack.platforms.host()) - if platform == "darwin": - spec_str += " %apple-clang" - elif platform == "windows": + if platform == "windows": spec_str += " %msvc" - elif platform == "linux": - spec_str += " %gcc" elif platform == "freebsd": spec_str += " %clang" spec_str += f" platform={platform}"