Fix mount path resolving in example_wrapper.sh #22
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 pull request resolves the following issue, where mounting a symlink using the example wrapper results in unexpected bahaviour.
If I have a symlink
/path/to/symlink/
that points to directory/path/to/dir/
and try to mount it into the container by addingto the MOUNTS variable, I would assume that the path inside container will be
/path/to/symlink/
. However, the symlink is resolved and it is placed into/path/to/dir/
instead.This problem is even more strange, when the target corresponds to a random symlink inside the host system - the symlink is resolved and as a result, the mount is placed into a seemingly random location.
My fix disables resolving of symlinks for the target mount point as they are not relevant to the file system inside of the container. (Symlinks for the source directory are still resolved.)
This also fixes problems with X11 apps not working under some versions of WSL2, where
/tmp/.X11-unix/
is symlink.