Fix bug getting specs from build caches#9600
Merged
gartung merged 1 commit intospack:developfrom Feb 15, 2019
Merged
Conversation
gartung
approved these changes
Oct 22, 2018
Member
|
@JavierCVilla #8451 might be of iterest. |
Member
I think we should pin down the root cause of this, otherwise we would just be curing the symptom... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Use
listrather thansetwhen getting specs from YAML file (spec.yaml)Context
Currently there seems to be cases where two specs, with different
dag-hashes, share the same internal hash - returned byhash(spec). This produces some problems when installing from binaries and using the hash to specify the package to be installed, example:Let's say there are two YAML files with the same name, version and compiler but different hashes such as:
I don't fully understand how this is even possible, but there are cases where the
specsproduced out of these two YAML files can have the same internalhash.As a consequence, using a
setin the implementation ofget_specswill consider only one of the twospecswith the same internal hash but different dag-hash, thus leading to a problem when the user tries to install the excludedspec.This could be also solved by implementing a
__hash__method inSpec(which would call todag_hash()in order to use the same hash employed to concretize the spec), however this commit warns not to use such implementation due to inefficient side-effects.I have tried to implement this
__hash__method and it certainly slows down the performance of thespack speccommand, although not as much as before:With
__hash__implemented onSpecWithout:
The impact might be bigger on other packages so I would just use a
listhere rather than adding ahashmethod to theSpecclass.@tgamblin @gartung