Return {0, -1} for missing files in last_modified_and_size/1#15259
Open
emancu wants to merge 1 commit intoelixir-lang:mainfrom
Open
Return {0, -1} for missing files in last_modified_and_size/1#15259emancu wants to merge 1 commit intoelixir-lang:mainfrom
emancu wants to merge 1 commit intoelixir-lang:mainfrom
Conversation
Member
|
Let’s change the size to be -1 instead. This way it cannot conflict with disk entries. |
Author
|
@josevalim Don't you think that will be worse? I mean, it changes a public interface Mix.Utils.last_modified_and_size/1 I will prepare a separate PR, in case you prefer to add this as a quick fix now, and change the interface in a bigger release. |
Member
|
Mix.Utils module is private. We can change it as we prefer. |
Author
|
@josevalim Ok, I will work on that fix then, and update the descriptions. |
1732588 to
5323767
Compare
Author
|
@josevalim Thanks, it looks even simpler :) |
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.
Closes #15258.
last_modified_and_size/1returns{0, 0}for both missing files and existing 0-byte files with epoch-0 mtime. The{0, 0}branch instale_external?assumed the file was missing, causing perpetual recompilation.This changes the sentinel for missing files to
{0, -1}, which cannot conflict with any real disk entry, and updates the pattern match instale_external?accordingly.