You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried using a patch for a bunde component but it failed because the start_dir is wrong. It will always use build_dir (or a path relative to it if set in start_dir EC parameter) because at the point of guess_startdir there are no sources in self.src hence it can't be relative to the unpacked source.
The comment and code don't add up too:
# location of first unpacked source is used to determine where to apply patch(es)
comp.src[-1]['finalpath'] = comp.cfg['start_dir']
Why does it set the last sources final path to the start_dir?
So I'd say the only correct way would be to set comp.src correctly and call guess_start_dir afterwards. Touching a sources finalpath can never be right ever, can it?
Edit: Further investigation shows that finalpath isn't set correctly for multiple sources. What happens for bundles of multiple components with a single source:
Start with an empty builddir
Extract source of 1st component -> Only folder -> finalpath set to that folder
Extract source of 2nd component -> 2 folders -> Parent folder (builddir) is used as finalpath
When setting component2.src = src2 and then calling guess_start_dir it will find the source and use its finalpath as the start_dir, hence wrongly using the builddir
If start_dir is manually set in the easyconfig it will still find the correct start_dir
However apply_patches uses the finalpath of the source at an index given in the patch spec, defaulting to 0
Hence it will try to apply the patch in the build dir instead of the component dir
So this requires either easybuilders/easybuild-framework#4922 or comp.src[0]['finalpath'] = comp.start_dir after the comp.guess_start_dir so that patches work correctly.
Turns out the Bundle easyblock has multiple issues and quite a few easyconfigs & easyblocks already rely on the broken behavior.
E.g. Clang-AOMP does a configure-step in the Bundle-level using the directories that would be the correct finalpath for src_dir, e.g. src_dir = 'omp-1.2.3/llvm'.
With this fix this results in starting at omp-1.2.3 where the subfolder omp-1.2.3 does not exist (it tries <builddir>/omp-1.2.3/omp-1.2.3/llvm)
The confusing behavior of the code contradicting the comment is fixed in #3778, the rest needs further discussion.
@boegel I ran into this again when using the Tarball easyblock in a bundle. Due to this issue that is (almost) unusable in a Bundle: It will always copy the whole build dir into the installation dir.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
(created using
eb --new-pr)I tried using a patch for a bunde component but it failed because the start_dir is wrong. It will always use
build_dir(or a path relative to it if set instart_dirEC parameter) because at the point ofguess_startdirthere are no sources inself.srchence it can't be relative to the unpacked source.The comment and code don't add up too:
Why does it set the last sources final path to the start_dir?
So I'd say the only correct way would be to set
comp.srccorrectly and callguess_start_dirafterwards. Touching a sourcesfinalpathcan never be right ever, can it?Edit: Further investigation shows that
finalpathisn't set correctly for multiple sources. What happens for bundles of multiple components with a single source:finalpathset to that folderfinalpathcomponent2.src = src2and then callingguess_start_dirit will find the source and use itsfinalpathas the start_dir, hence wrongly using the builddirstart_diris manually set in the easyconfig it will still find the correct start_dirapply_patchesuses thefinalpathof the source at an index given in the patch spec, defaulting to 0So this requires either easybuilders/easybuild-framework#4922 or
comp.src[0]['finalpath'] = comp.start_dirafter thecomp.guess_start_dirso that patches work correctly.