Skip to content

Variant when=: Change of Default for Single/Multi-Variant Transition #38302

@ax3l

Description

@ax3l

Steps to reproduce

In #37695, I introduced that a variant becomes a multi-variant for a certain version and later.

This does not work: Spack tries to always apply the new multi-variant defaults, even for older versions excluded by then variant when condition.

    variant(
        "dimensions",
        default="3",
        values=("1", "2", "3"),
        multi=False,
        description="Dimensionality",
        when="@:23.05",
    )
    variant(
        "dimensions",
        default="1,2,3",
        values=("1", "2", "3"),
        multi=True,
        description="Dimensionality",
        when="@23.06:",
    )

Error message

spack spec amrex  # >= 23.06
# all great!

But:

...
[email protected]%[email protected]~amrdata~cuda~eb~fortran~hdf5~hypre~ipo+linear_solvers+mpi~openmp~particles~petsc~pic~plotfile_tools~rocm~shared~sundials~sycl~tiny_profile build_system=cmake build_type=Release dimensions=1,2,3 generator=make precision=double arch=linux-ubuntu22.04-skylake
...

(should be dimensions=3)

spack install [email protected]
...
==> Installing amrex-23.05-5crixpvv3zbjvxrdyqkxc7lsqngbcmuv
==> No binary for amrex-23.05-5crixpvv3zbjvxrdyqkxc7lsqngbcmuv found: installing from source
==> Using cached archive: /home/axel/src/spack/var/spack/cache/_source-cache/archive/a4/a4bf5ad5322e706b9fae46ff52043e2cca5ddba81479647816251e9ab21c0027.tar.gz
==> No patches needed for amrex
==> amrex: Executing phase: 'cmake'
==> Error: ProcessError: Command exited with status 1:
    '/home/axel/src/spack/opt/spack/linux-ubuntu22.04-skylake/gcc-12.1.0/cmake-3.25.2-54fooma2lakox5es5ucus5kzpbn7xosy/bin/cmake' ... '-DAMReX_SPACEDIM:STRING=1;2;3' ...
...
(expected CMake configure-time error follows)

(should be -DAMReX_SPACEDIM=3)

Information on your system

  • Spack: 0.21.0.dev0 (2cdc902)
  • Python: 3.10.6
  • Platform: linux-ubuntu22.04-skylake
  • Concretizer: clingo

General information

  • I have run spack debug report and reported the version of Spack/Python/Platform
  • I have searched the issues of this repo and believe this is not a duplicate
  • I have run the failing commands in debug mode and reported the output

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions