don't use PERL_MM_OPT and PERL_MB_OPT#1362
don't use PERL_MM_OPT and PERL_MB_OPT#1362boegel merged 4 commits intoeasybuilders:developfrom rug-cit-hpc:Perl-unset-envvars
Conversation
| """Install procedure for Perl modules: using either Makefile.Pl or Build.PL.""" | ||
| # Perl modules have two possible installation procedures: using Makefile.PL and Build.PL | ||
| # configure, build, test, install | ||
| unset_cmd = "unset PERL_MM_OPT PERL_MB_OPT" |
There was a problem hiding this comment.
You'll probably need to make this unset ... && to chain it with the Perl command? preconfigopts complicates this though...
There was a problem hiding this comment.
A better approach would be to use unset_env_vars(['PERL_MB_OPT', 'PERL_MM_OPT']), where unset_env_vars can be imported from easybuild.tools.environment.
This will result in proper logging for example, and since the environment in which commands are run via run_cmd is inherited, that should work.
There was a problem hiding this comment.
Do include a comment to explain why these environment variables need to be unset.
| unset_cmd = "unset PERL_MM_OPT PERL_MB_OPT" | ||
| if os.path.exists('Makefile.PL'): | ||
| run_cmd('%s perl Makefile.PL PREFIX=%s %s' % (self.cfg['preconfigopts'], self.installdir, self.cfg['configopts'])) | ||
| run_cmd('%s %s perl Makefile.PL PREFIX=%s %s' % (unset_cmd, self.cfg['preconfigopts'], self.installdir, self.cfg['configopts'])) |
There was a problem hiding this comment.
Line becomes too long, and this won't work especially in combination with preconfigopts, but you can just revert this change if you use unset_env_vars instead.
|
@RvDijk To test with a custom |
|
@boegel I agree with you a lot, I'll look into using |
This reverts commit 6fc3ad0.
|
@boegel I was able to build a simplified version of Perl, where one extension was used. The build succeeded succesfully, where the previous version of perlmodule.py would have failed. |
| """Initialize custom class variables.""" | ||
| super(PerlModule, self).__init__(*args, **kwargs) | ||
| self.testcmd = None | ||
| # Environment variables PERL_MM_OPT and PERL_MB_OPT cause installations to fail. |
There was a problem hiding this comment.
@RvDijk Let's move the extra line you added below this block to above this block? :)
Also, drop the WIP from the PR title, it looks good to go.
|
Thanks @RvDijk! |
Something like this should do the trick, however I was not able to test anything. Using e.g.
eb ~/Perl-5.26.1-test-foss-2018a.eb --include-easyblocks=./perlmodule.py,../p/perl.pydid not use my customperlmodule.py. It would be helpful to know how I can use a custom easyblock such as perlmodule.py for testing.