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.
I have a package that uses RelocatableFolders. Currently, (I suspect that) if I run two versions of the package (say, a release, and then a local clone from
Pkg.develop
) with the same (hash of the) contents of the relocatable folder, then both versions will point to the same folder, in the first version that ran. This is because we the key toget_scratch!
is just the content hash.Besides a wrong stacktrace, this is not really a problem in most cases (because the two folders have the same contents), but it does cause a problem when the contents of the local clone change (e.g. when switching branches) after the package was loaded.
This came up here: fonsp/Pluto.jl#1965 (comment) , where I suspect this happened, although we did not test it. I think that the result from
@path
in the local clone points to the path in the release (because at load time, their contents were equal).The solution in this PR is based on /~https://github.com/JuliaPackaging/Scratch.jl/tree/v1.1.0#can-i-create-a-scratch-space-that-is-not-shared-across-versions-of-my-package . (Which surprised me, I assumed this was the default.) The path is hashed to avoid illegal characters in the key.