easybuilders / easybuild-framework

EasyBuild is a software installation framework in Python that allows you to install software in a structured and robust way.
https://easybuild.io
GNU General Public License v2.0
148 stars 201 forks source link

Don't copy symlinked folders #3787

Open Flamefire opened 3 years ago

Flamefire commented 3 years ago

filetools.copy_dir directly calls shutil.copytree with symlinks=False by default which means that symlinks will be followed and their contents copied instead of the symlinks

Also many EasyConfigs use the parameter keepsymlinks which is also set to False by default and often forgotten. E.g. for the EasyBlocks MakeCp and Tarball

I propose to switch the default to copy symlinks as symlinks instead and not resolve them. This has the following benefits:

As an alternative and extension to https://github.com/easybuilders/easybuild-framework/pull/3784 I'd propose that if the directory tree to be copied contains symlinks, then an explicit choice must be made. I.e.

This at least avoids mistakes by forgetting about that param and won't affect most installations.

boegel commented 3 years ago

@Flamefire I agree that we should switch to retaining symlinks rather than resolving them, but that's a change we can/should only make in EasyBuild 5.0 imho.