Hardens the interface of OpamUrl.local_{file,dir} #5975
Closed
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.
Would help to debug #5971
This change is done to be able to show an error message instead of a raw assert failure when an expected local file does not exist.
This is a breaking API change and will require a change in ocaml-opam/opam-publish#138. While not strictly necessary, i believe this change is an overall improvement and will help track similar issues in the future.
One related issue i'm seeing with how these functions are used at the moment, is that if you have a url like
file+git://<your-git-repo>/some/file/possibly/modified/or/untracked/since/HEAD
this function would happily return the file in question, which it seems like it should not do. I'm not sure if this behaviour is exploited in the wild or in our code but i think this issue is separate and can be tracked in a later issue.