-
Notifications
You must be signed in to change notification settings - Fork 690
Fix hashing of asset directories #6113
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
base: master
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for nextflow-docs-staging canceled.
|
Hi everybody! Can I get some feedback from the Seqera team on this issue + PR? 🙇 |
b4b321e
to
069653d
Compare
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.
Thanks for reporting this, very tricky. Let a comment to improve the implementation
Co-authored-by: Dries Schaumont <[email protected]> Signed-off-by: Robrecht Cannoodt <[email protected]>
Signed-off-by: Robrecht Cannoodt <[email protected]>
Signed-off-by: Robrecht Cannoodt <[email protected]>
Signed-off-by: Robrecht Cannoodt <[email protected]>
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.
Thanks for the feedback, @pditommaso ! I swapped the ArrayList for a TreeMap, which makes more sense.
Regarding the potential NullPointerException in preVisitDirectory, which solution would you prefer?
Signed-off-by: Robrecht Cannoodt <[email protected]>
Signed-off-by: Robrecht Cannoodt <[email protected]>
I think this function can be simplified by simply applying |
Signed-off-by: Ben Sherman <[email protected]>
@rcannood let me know if my changes work for you |
Signed-off-by: Ben Sherman <[email protected]>
Thanks @bentsherman ! I'll run it on my other partition when I'm back at my PC. |
Files.walkFileTree
does not guarantee any specific order for iterating over files within a directory:-- source
This causes the sha of
HashBuilder.hashDirSha256
to be different in certain situations (#6112).This PR fixes the issue by storing all of the (path, sha256) in an array list, sorting by path, and then passing them to the hasher.
Notes:
preVisitDirectory
seems like it would cause a null pointer exception if the condition (base != null
) is false -- so maybebase
is always not null? What should happen in this code chuck if base does happen to be null?