Fix start_dir for components of Bundle easyblock #3769
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.