diff options
author | scheibelp <scheibel1@llnl.gov> | 2018-01-28 16:58:08 -0800 |
---|---|---|
committer | Todd Gamblin <tgamblin@llnl.gov> | 2018-01-28 16:58:08 -0800 |
commit | f27c5e74ed64260407c342f297cd60488304b8bf (patch) | |
tree | 4fe13a1a578bfedd8f27c22d5483a1a55bdab95d /pytest.ini | |
parent | f7f4bae154c83f43274c717036a4c38277b24bb3 (diff) | |
download | spack-f27c5e74ed64260407c342f297cd60488304b8bf.tar.gz spack-f27c5e74ed64260407c342f297cd60488304b8bf.tar.bz2 spack-f27c5e74ed64260407c342f297cd60488304b8bf.tar.xz spack-f27c5e74ed64260407c342f297cd60488304b8bf.zip |
Remove Package instance caching in Repo (#6367)
This attempts to address one of the complaints at #5996 (comment):
> Repo currently caches package instances by Spec, and those Package instances have a Spec.
> This is unnecessary and causes confusion. I think I thought that we'd need to cache instances
> after loading package classes, but really just caching the classes is fine.
With this update, Repo's package cache is removed and Specs cache the package reference themselves. One consequence is that Specs which compare as equal will store separate instances of a Package class (not doing this creates issues for #4595 (comment)).
There were several references to Spec.package that could be replaced with Spec.package_class without any additional modifications. There are still a couple remaining references to Spec.package in Spec that would require adding functionality before replacing (e.g. calling Package.provides and Package.installed).
Note this makes it difficult to mock fetchers for tests which invokes code that reconstructs specs. test_packaging was one example of this where the updates caused a failure (in that case the error was avoided by not making an unnecessary call).
Details:
* Replace instances of spec.package with spec.package_class where a class method is being called
* Remove instances of Repo.get where Spec.package_class can be used in its place
* remove Repo.get caching instances of Package class for specs
* remove redundant check (which is also incorrect now that each spec stores its own copy of its package)
* avoid creating mirror with specs because it copies specs and those copies dont refer to the mocked fetcher (and it is also not required for the test)
* remove checks that are no longer necessary since repo doesn't cache specs
Diffstat (limited to 'pytest.ini')
0 files changed, 0 insertions, 0 deletions