Allow use of start_dir in extensions#2353
Conversation
| # name and version properties of EasyBlock are used, so make sure name and version are correct | ||
| self.cfg['name'] = self.ext.get('name', None) | ||
| self.cfg['version'] = self.ext.get('version', None) | ||
| self.cfg['start_dir'] = self.ext.get('options', {}).get('start_dir', None) |
There was a problem hiding this comment.
Do you have an example easyconfig where you'd like to use this?
Since #2194, I don't think this is actually needed?
There was a problem hiding this comment.
Why would it work? The prepare_step is never called if you install an extension under the extensions_step?
Current use case: arrow. It has the main C++ library in a subdirectory that needs to be build and installed first. Afterwards you go to the python subdirectory to build the python extensions.
See: easybuilders/easybuild-easyconfigs#5416
There was a problem hiding this comment.
OK, now I understand better what the issue is here, you need to prevent that the start_dir value is inherited from the parent, where it's usually defined...
Can you clarify that with a comment above this line?
| targetdir = os.path.join(self.master.builddir, remove_unwanted_chars(self.name)) | ||
| self.ext_dir = extract_file("%s" % self.src, targetdir, extra_options=self.unpack_options) | ||
|
|
||
| if self.cfg['start_dir'] and os.path.isdir(self.cfg['start_dir']): |
There was a problem hiding this comment.
use self.start_dir rather than self.cfg['start_dir'] when just reading the value, cfr. #2339 (we should do a cleanup sweep in framework & easyblocks for this)
| self.cfg['name'] = self.ext.get('name', None) | ||
| self.cfg['version'] = self.ext.get('version', None) | ||
| # We cannot inherit the start_dir from the easyconfig. It should be specified in the extension | ||
| # itself or be empty. |
There was a problem hiding this comment.
Do you mind rephrasing this to:
# We can't inherit the 'start_dir' value from the parent (which will be set, and will most likely be wrong).
# It should be specified for the extension specifically, or be empty (so it is auto-derived).
It's really annoying that symmetric between an
EasyBlockandExtensionEasyBlockis so broken. Why does an extension use a different extractor method than the generalextractor_step? It should use the same function so we can use the same parameters (likestart_dir).This PR is a dirty hack to fix it.