Flatten the default store projection

This commit is contained in:
Massimiliano Culpo 2025-01-09 23:26:06 +01:00
parent ec8c6e565d
commit aa10284a0a
No known key found for this signature in database
GPG Key ID: 3E52BB992233066C
7 changed files with 8 additions and 8 deletions

View File

@ -19,7 +19,7 @@ config:
install_tree: install_tree:
root: $spack/opt/spack root: $spack/opt/spack
projections: projections:
all: "{architecture.platform}/{architecture.target}/{name}-{version}-{hash}" all: "{architecture.platform}-{architecture.target}/{name}-{version}-{hash}"
# install_tree can include an optional padded length (int or boolean) # install_tree can include an optional padded length (int or boolean)
# default is False (do not pad) # default is False (do not pad)
# if padded_length is True, Spack will pad as close to the system max path # if padded_length is True, Spack will pad as close to the system max path

View File

@ -330,7 +330,7 @@ that ``--tests`` is passed to ``spack ci rebuild`` as part of the
- spack --version - spack --version
- cd ${SPACK_CONCRETE_ENV_DIR} - cd ${SPACK_CONCRETE_ENV_DIR}
- spack env activate --without-view . - spack env activate --without-view .
- spack config add "config:install_tree:projections:${SPACK_JOB_SPEC_PKG_NAME}:'morepadding/{architecture.platform}/{architecture.target}/{name}-{version}-{hash}'" - spack config add "config:install_tree:projections:${SPACK_JOB_SPEC_PKG_NAME}:'morepadding/{architecture.platform}-{architecture.target}/{name}-{version}-{hash}'"
- mkdir -p ${SPACK_ARTIFACTS_ROOT}/user_data - mkdir -p ${SPACK_ARTIFACTS_ROOT}/user_data
- if [[ -r /mnt/key/intermediate_ci_signing_key.gpg ]]; then spack gpg trust /mnt/key/intermediate_ci_signing_key.gpg; fi - if [[ -r /mnt/key/intermediate_ci_signing_key.gpg ]]; then spack gpg trust /mnt/key/intermediate_ci_signing_key.gpg; fi
- if [[ -r /mnt/key/spack_public_key.gpg ]]; then spack gpg trust /mnt/key/spack_public_key.gpg; fi - if [[ -r /mnt/key/spack_public_key.gpg ]]; then spack gpg trust /mnt/key/spack_public_key.gpg; fi

View File

@ -21,7 +21,7 @@
from spack.error import SpackError from spack.error import SpackError
default_projections = { default_projections = {
"all": "{architecture.platform}/{architecture.target}/{name}-{version}-{hash}" "all": "{architecture.platform}-{architecture.target}/{name}-{version}-{hash}"
} }

View File

@ -1226,7 +1226,7 @@ def test_default_install_tree(monkeypatch, default_config):
s = spack.spec.Spec("nonexistent@x.y.z arch=foo-bar-baz") s = spack.spec.Spec("nonexistent@x.y.z arch=foo-bar-baz")
monkeypatch.setattr(s, "dag_hash", lambda length: "abc123") monkeypatch.setattr(s, "dag_hash", lambda length: "abc123")
_, _, projections = spack.store.parse_install_tree(spack.config.get("config")) _, _, projections = spack.store.parse_install_tree(spack.config.get("config"))
assert s.format(projections["all"]) == "foo/baz/nonexistent-x.y.z-abc123" assert s.format(projections["all"]) == "foo-baz/nonexistent-x.y.z-abc123"
def test_local_config_can_be_disabled(working_env): def test_local_config_can_be_disabled(working_env):

View File

@ -34,7 +34,7 @@ def test_yaml_directory_layout_parameters(tmpdir, default_mock_concretization):
layout_default = DirectoryLayout(str(tmpdir)) layout_default = DirectoryLayout(str(tmpdir))
path_default = layout_default.relative_path_for_spec(spec) path_default = layout_default.relative_path_for_spec(spec)
assert path_default == str( assert path_default == str(
Path(spec.format("{architecture.platform}/{architecture.target}/{name}-{version}-{hash}")) Path(spec.format("{architecture.platform}-{architecture.target}/{name}-{version}-{hash}"))
) )
# Test hash_length parameter works correctly # Test hash_length parameter works correctly
@ -47,7 +47,7 @@ def test_yaml_directory_layout_parameters(tmpdir, default_mock_concretization):
assert len(path_default) - len(path_7) == 25 assert len(path_default) - len(path_7) == 25
# Test path_scheme # Test path_scheme
arch, compiler, package7 = path_7.split(os.sep) arch, package7 = path_7.split(os.sep)
projections_package7 = {"all": "{name}-{version}-{hash:7}"} projections_package7 = {"all": "{name}-{version}-{hash:7}"}
layout_package7 = DirectoryLayout(str(tmpdir), projections=projections_package7) layout_package7 = DirectoryLayout(str(tmpdir), projections=projections_package7)
path_package7 = layout_package7.relative_path_for_spec(spec) path_package7 = layout_package7.relative_path_for_spec(spec)

View File

@ -6,4 +6,4 @@ config:
root: /home/software/spack root: /home/software/spack
padded_length: 256 padded_length: 256
projections: projections:
all: "{architecture.platform}/{architecture.target}/{name}-{version}-{hash}" all: "{architecture.platform}-{architecture.target}/{name}-{version}-{hash}"

View File

@ -4,7 +4,7 @@ ci:
before_script-: before_script-:
# Test package relocation on linux using a modified prefix # Test package relocation on linux using a modified prefix
# This is not well supported on MacOS (https://github.com/spack/spack/issues/37162) # This is not well supported on MacOS (https://github.com/spack/spack/issues/37162)
- - spack config add "config:install_tree:projections:${SPACK_JOB_SPEC_PKG_NAME}:'morepadding/{architecture.platform}/{architecture.target}/{name}-{version}-{hash}'" - - spack config add "config:install_tree:projections:${SPACK_JOB_SPEC_PKG_NAME}:'morepadding/{architecture.platform}-{architecture.target}/{name}-{version}-{hash}'"
- match_behavior: first - match_behavior: first
submapping: submapping:
- match: - match: