Skip to content

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

Merged
akesandgren merged 2 commits intoeasybuilders:developfrom
Flamefire:avoid_recursive_copies
Aug 23, 2021
Merged

Check for recursive symlinks by default before copying a folder #3784
akesandgren merged 2 commits intoeasybuilders:developfrom
Flamefire:avoid_recursive_copies

Conversation

@Flamefire
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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