Skip to content

Make the full_hash look like the dag_hash#8911

Merged
tgamblin merged 1 commit intospack:developfrom
scottwittenburg:make-full-hash-like-dag-hash
Aug 9, 2018
Merged

Make the full_hash look like the dag_hash#8911
tgamblin merged 1 commit intospack:developfrom
scottwittenburg:make-full-hash-like-dag-hash

Conversation

@scottwittenburg
Copy link
Copy Markdown
Contributor

As requested in the review of #8718, this change makes the format/length of the full_hash match that of the dag_hash.

@adamjstewart
Copy link
Copy Markdown
Member

Somewhat off topic, but you wouldn't have any idea how to solve #7694 would you?

@scottwittenburg
Copy link
Copy Markdown
Contributor Author

Sorry, I shouldn't volunteer information when my understanding is so limited. But I'm curious, do you want to replace those long patch hashes with a unique hash prefix (like git does with commits), or are you thinking of using a different hashing algorithm which results in a shorter hash (e.g. 32 characters instead of 64) as this topic does with the spec full_hash?

While reviewing another topic I'm working on (#8718), @tgamblin mentioned that spack allows you to enter unique prefixes of hashes and have them work. So I wonder if that's an option here?

@adamjstewart
Copy link
Copy Markdown
Member

@scottwittenburg Let me update #7694 to be more specific so as not to derail your PR with a long off-topic conversation 😄

Copy link
Copy Markdown
Member

@tgamblin tgamblin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM except one minor change

if sys.version_info[0] >= 3:
b32_hash = b32_hash.decode('utf-8')

self._full_hash = b32_hash
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should only cache if the spec is concrete, like the dag_hash does. I suspect that in practice, it always will be, but why not make it mirror dag_hash?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, this function raises an exception immediately if the spec is not concrete, so your suspicion is correct 😄 and I think we could be good here.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point! Duh!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh let's not start pointing out all our "duh" moments or I'll start feeling bad.

Thanks for the review and merge!

@tgamblin tgamblin merged commit 2278c65 into spack:develop Aug 9, 2018
anderson2981 pushed a commit to anderson2981/spack that referenced this pull request Sep 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants