Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tools/build_perl_modules hardcodes the perl used #92

Closed
marksolaris opened this issue Jul 31, 2015 · 1 comment
Closed

tools/build_perl_modules hardcodes the perl used #92

marksolaris opened this issue Jul 31, 2015 · 1 comment
Assignees
Labels

Comments

@marksolaris
Copy link

A problem that snowballs is tools/build_perl_modules hardcodes the perl used.

   223              if ( -f "Build.PL" && $have_module_build ) {
   224                  open( CMD, "|-", "perl Build.PL $mb_destdir --install_base=$prefix --install_path lib=$prefix/lib  --install_path arch=$prefix/lib/
$Config{archname} --install_path bin=$prefix/bin --install_path script=$prefix/bin --install_path bindoc=$prefix/man/man1 --install_path libdoc=$prefix/man
/man3" ) || die "Can't run perl Build.PL";
   225                  $command = "./Build";
   226              }
   227              elsif ( -f 'Makefile.PL' ) {
   228                  open( CMD, "|-", "perl Makefile.PL $mm_destdir INSTALL_BASE=$prefix INSTALLDIRS=site INSTALLSITELIB=$prefix/lib INSTALLSITEARCH=$pr
efix/lib/$Config{archname} $extra_args" ) || die "Can't run perl Makefile.PL";
   229                  $command = "make";
   230              }

The tools/build_perl_modules script is not obeying the settings given to configure at the start of the build, specifically the '--with-perl=/usr/local/bin/perl' value. When the wrong perl is used to compile the modules, you get strange errors:

Making all in perlmods
gmake[2]: Entering directory `/var/tmp/nagios-plugins-2.0.3/perlmods'
../tools/build_perl_modules -d /nagios/perl -em .
Checking if Module::Build is available yet...
... no!
******************** Test-Simple-0.98.tar.gz
Checking if Module::Build is available yet...
... no!
******************** Perl-OSType-1.003.tar.gz

Working in: /var/tmp/nagios-plugins-2.0.3/perlmods/Perl-OSType-1.003

Using Makefile.PL
ExtUtils::MakeMaker version 6.3 required--this is only version 6.17 at Makefile.PL line 7.
BEGIN failed--compilation aborted at Makefile.PL line 7.
make: Fatal error: No arguments to build
Current working directory /var/tmp/nagios-plugins-2.0.3/perlmods/Perl-OSType-1.003
Can't run make. Please
        rm -rf /var/tmp/nagios-plugins-2.0.3/perlmods/Perl-OSType-1.003
to remake from this point) at ../tools/build_perl_modules line 235.
gmake[2]: *** [all-local] Error 1
gmake[2]: Leaving directory `/var/tmp/nagios-plugins-2.0.3/perlmods'
gmake[1]: *** [all-recursive] Error 1
gmake[1]: Leaving directory `/var/tmp/nagios-plugins-2.0.3'
gmake: *** [all] Error 2

A work-around I used is to manually change the perl used before configure is run.

    cd nagios-plugins-2.0.3
    perl -pe 's#"perl #"/usr/local/bin/perl #' -i tools/build_perl_modules
    ./configure \
        --enable-perl-modules \
        --with-perl=/usr/local/bin/perl \
        --with-trusted-path=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/etc:/usr/local/nagios/bin \
    [...]
@jfrickson jfrickson self-assigned this Aug 2, 2016
@jfrickson jfrickson added the Bug label Aug 2, 2016
jfrickson pushed a commit that referenced this issue Aug 2, 2016
@jfrickson
Copy link
Contributor

Fixed in the 'maint' branch. Will be in the next minor release.

quidome pushed a commit to bolcom/nagios-plugins that referenced this issue Oct 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants