Skip to content

Concretization doesn't evaluate versions properly when the the packages preferred version isn't in package.py #36574

@Paul-Ferrell

Description

@Paul-Ferrell

Steps to reproduce

Add the following in var/repos/builtin/packages/conc-vers-bug/

from spack.package import *

class ConcVersBug(Package):
    """Show off how using a non-listed version breaks dependency checks in Clingo
    """
    homepage = "https://dev.null/"
    url = "https://example.com/some/tarball-1.0.tar.gz"
    version("1.0")
    depends_on("zlib", when="@1:")
spack env create test
spack env activate test

Edit the environment's spack.yaml file, so it specifies a default version that isn't in the package.py:

spack:
  specs: [conc-vers-bug]
  view: true
  concretizer:
    unify: true
  packages:
    conc-vers-bug:
      version: [1.0.3]

Then concretize:

spack concretize -f 
==> Concretized conc-vers-bug
 -   ojfttcd  conc-vers-bug@1.0.3%gcc@7.5.0 build_system=generic arch=linux-sles15-skylake_avx512

The zlib dependency won't be included.

This happens because the facts generated for concretization don't include a fact matching the package default version to the when clause version.

version_satisfies("conc-version-bug","1:","1.0.3").

Error message

See above.

Information on your system

  • Spack: 0.20.0.dev0 (7e06b5b)
  • Python: 3.6.15
  • Platform: linux-sles15-icelake
  • 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

No one assigned

    Labels

    bugSomething isn't workingconcretizationconcretizer-use-caseinteresting dependency hierarchy that would challenge the current concretizerimpact-medium

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions