From 8c66a1699e6df585bc9f1d5a8628c904b5b0f186 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 | 11 ++++++----- 3 files changed, 17 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 d5c508372e8..5fe399b8b7b 100644 --- a/lib/spack/spack/binary_distribution.py +++ b/lib/spack/spack/binary_distribution.py @@ -625,7 +625,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): @@ -633,8 +637,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 e0120777415..f9063e027c2 100644 --- a/lib/spack/spack/bootstrap/_common.py +++ b/lib/spack/spack/bootstrap/_common.py @@ -226,12 +226,13 @@ 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": + # FIXME (compiler as nodes): recover the compiler for source bootstrapping + # if platform == "darwin": + # spec_str += " %apple-clang" + if platform == "windows": spec_str += " %msvc" - elif platform == "linux": - spec_str += " %gcc" + # elif platform == "linux": + # spec_str += " %gcc" elif platform == "freebsd": spec_str += " %clang" spec_str += f" platform={platform}"