Skip to content

concretizer: reuse + lookup cause two instances of dag-hash equivalent spec in link-run subdag #39570

@haampie

Description

@haampie

Steps to reproduce

To reproduce:

$ cd $(mktemp -d)
$ spack -c config:install_tree:root:./here install py-setuptools
$ spack -c config:install_tree:root:./here spec py-joblib ^/hash-of-just-installed-python

This somehow causes python to appear twice with a different Spec instance (different object id) in the same link-run subdag, once through the path:

py-joblib -[br]-> py-setuptools -[br]-> python

and once directly

py-joblib -[br]-> python

this confuses Spack internals that rely on id instead of dag_hash as a key.

It would be better though to ensure that id(s) == id(t) for any s and t in the link/run subdag where s.dag_hash() == t.dag_hash(), instead of duplicating the instance.

This causes problems, such as the assertion here, which doesn't traverse with dag_hash as a key:

assert len(deps) == 1

  • Spack: 0.21.0.dev0 (0e27f05)
  • Python: 3.11.4
  • Platform: linux-ubuntu23.04-zen2
  • 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

Labels

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions