-
Notifications
You must be signed in to change notification settings - Fork 24
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
Standardize algorithm for directory hashing #100
base: main
Are you sure you want to change the base?
Conversation
cc @wolfv |
In pixi we often compute these hashes in a similar way. We also normalize line endings in text files because on windows git often normalizes these as well. |
Nice that you mentioned this because I think I just run into that very issue: https://github.com/conda/conda-build/actions/runs/11924575237/job/33235172020?pr=5277#step:11:424 |
cep-00??.md
Outdated
|
||
## Specification | ||
|
||
Given a directory, recursively scan all its contents (without following symlinks) and sort them by their full path. For each entry in the contents table, compute the hash for the concatenation of: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably need to better specify what "sort" means, and in particular, what collation ordering we want to use. Because:
$ echo -e "aa\na-a\nab\na-b" | LC_ALL=en_US.UTF-8 sort
a-a
aa
a-b
ab
$ echo -e "aa\na-a\nab\na-b" | LC_ALL=C.UTF-8 sort
a-a
a-b
aa
ab
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Like Python's sort([str, ...])
, it's locale agnostic. See 378d1fd
(#100)
Standardizes findings in conda/conda-build#5277.
🔎 Preview in Markdown