spack / spack

A flexible package manager that supports multiple versions, configurations, platforms, and compilers.
https://spack.io
Other
4.21k stars 2.25k forks source link

Installation issue: xrootd cxxstd default is always 14 #38854

Open wdconinc opened 1 year ago

wdconinc commented 1 year ago

Steps to reproduce the issue

spack info xrootd

Error message

Error message
Variants:
    Name [Default]          When                              Allowed values          Description
    ====================    ==============================    ====================    ============================================

    build_system [cmake]    --                                cmake                   Build systems supported by the package
    build_type [Release]    [build_system=cmake]              Debug, Release,         CMake build type
                                                              RelWithDebInfo,         
                                                              MinSizeRel              
    client_only [off]       [@4.10.0:]                        on, off                 Build and install client only
    cxxstd [14]             [@5.2.0:, @4.6.0:5.1.99,          98, 11, 14, 17, 20      Use the specified C++ standard when building
                            @:4.5.99]                                                 
    davix [on]              --                                on, off                 Build with Davix
    generator [make]        [build_system=cmake]              ninja,make              the build system generator to use
    http [on]               --                                on, off                 Build with HTTP support
    ipo [off]               [build_system=cmake               on, off                 CMake interprocedural optimization
                            ^cmake@3.9:]                                              
    krb5 [off]              --                                on, off                 Build with KRB5 support
    python [off]            --                                on, off                 Build pyxroot Python extension
    readline [on]           --                                on, off                 Use readline
    scitokens-cpp [off]     [@5.1.0:]                         on, off                 Enable support for SciTokens

Information on your system

Additional information

Per https://spack.readthedocs.io/en/latest/packaging_guide.html#overriding-variants, the variant defaults for cxxstd are not actually taken into account. See example in the docs, in particular: "The default for this variant, when it is present, is always True, regardless of which condition of the variant is satisfied."

Maintainers: @gartung @greenc-FNAL @marcmengel @vitodb

General information

wdconinc commented 1 year ago

I think the way this could be handled is by adding a default value default, which doesn't override the default c++ standard in the build. See e.g. jsoncpp, xerces-c, and a few others. I guess another approach could be to use the value default to then pick an actual value to pass explicitly in cmake_args.