Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check for recursive symlinks by default before copying a folder #3784

Merged
merged 2 commits into from
Aug 23, 2021

Conversation

Flamefire
Copy link
Contributor

@Flamefire Flamefire commented Jul 23, 2021

Avoids endless loops and creating infinite length paths when symlinks=True is NOT also passed to copy_dir

This turned up when naively testing easybuilders/easybuild-easyconfigs#13469 without the keepsymlinks setting which ended up "hanging" in the install step until I eventually found out about the recursive symlink manually.
This PR should avoid such cases.

Downside: Traversing the whole source tree before a copy. Shouldn't be too bad as those are usually on fast, local disks and as the results of the traversal might even be cached it could make the actual copy happening later a bit faster reducing the impact of the check.
It will also follow symlinks to absolute paths and check there. Not fully sure about that but as the copy done afterwards does the same I don't think this is an additional problem.

Avoids endless loops and creating infinite length paths when
`symlinks=True` is NOT also passed to copy_dir
Copy link
Contributor

@akesandgren akesandgren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@akesandgren
Copy link
Contributor

Going in, thanks @Flamefire!

@akesandgren akesandgren merged commit af02665 into easybuilders:develop Aug 23, 2021
@Flamefire Flamefire deleted the avoid_recursive_copies branch August 30, 2021 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants