Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use multihash for cache filenames #584

Merged
merged 1 commit into from
Jun 9, 2019

Conversation

philandstuff
Copy link
Collaborator

PR #549 adopted the use of multihash for binary encoding of semantic
hashes; this commit extends that to the filenames of cache files on
disk.

@singpolyma
Copy link
Collaborator

singpolyma commented Jun 8, 2019 via email

@philandstuff
Copy link
Collaborator Author

My goal is mainly a) consistency and b) implementation simplicity. If I have to encode things as multihash in the binary format, but as bare hash in a filename, that just feels arbitrary and special-casey. If we just use multihash everywhere, we don't need to have special cases.

I agree that we're not super concerned about hash collisions or hash extensibility in the context of the cache, since cache files are by pretty much by definition ephemeral and disposable.

I wasn't aware of multibase; i'd be happy to go with that.

@Gabriella439
Copy link
Contributor

The multi-hash is supposed to begin with \x12\x20, not 1220. It seems like the multi-hash standard was designed for a binary representation, not a textual representation like a path.

@singpolyma
Copy link
Collaborator

singpolyma commented Jun 9, 2019 via email

PR #549 adopted the use of multihash for binary encoding of semantic
hashes; this commit extends that to the filenames of cache files on
disk.
@philandstuff philandstuff force-pushed the philandstuff/multihash-for-cache-filenames branch from 3a1eb61 to 1089dc9 Compare June 9, 2019 10:11
@philandstuff philandstuff merged commit 0396b67 into master Jun 9, 2019
@philandstuff philandstuff deleted the philandstuff/multihash-for-cache-filenames branch June 9, 2019 10:12
TristanCacqueray pushed a commit to TristanCacqueray/dhall-lang that referenced this pull request Jan 4, 2025
Fixes dhall-lang#582

This introduces a new `exprToImport` utility that is used to cache the
fully-resolved import
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.

4 participants