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.
This PR fixes some issues around symlink handling in the
create_input
function. I found this after finding a bug introduced by #115, but also found some other issues too.First, when calling
create_input
on a directory, if two files refer to the same resource path and that path is a symlink, then that resource would only get added to one of the files. This was due to some unsound memoization, which has now been removed.Second, the way that symlink resources were canonicalized meant that, in some situations,
create_input
could end up creating a directory structure that didn't match the input. I worked out two such cases:link1 -> link2
,link2 -> target
)link1 -> link2/file
,link2 -> dir
)For now, I made the call to just return an error if either of these two situations occur. I don't believe either case was used in practice (although, if it was, hopefully
brioche-packages
will make that pretty clear). I believe a proper implementation to support both cases would be very complicated and error-prone, so just throwing an error now will make it possible to revisit in the future