2

I'm trying to compile git 2.5.2 on RHEL6 into my home directory and it requires a perl module ExtUtils::MakeMaker. ExtUtils::MakeMaker isn't installed in the standard locations and installing packages (via yum) is impossible due to organizational limitations.

ExtUtils::MakeMaker requires Test::Harness, which also isn't installed. Test::Harness depends on ExtUtils::MakeMaker, is there a way to break this dependency or a way to compile git without depending on ExtUtils::MakeMaker?

Output when trying to install ExtUtils::MakeMaker:

Using included version of CPAN::Meta (2.120351) because it is not already installed.
Using included version of Parse::CPAN::Meta (1.4405) because it is not already installed.
Using included version of CPAN::Meta::YAML (0.008) because it is not already installed.
Using included version of ExtUtils::Manifest (1.65) because it is not already installed.
Using included version of JSON::PP (2.27203) because it is not already installed.
Using included version of ExtUtils::Install (1.54) because it is not already installed.
Using included version of CPAN::Meta::Requirements (2.127) because it is not already installed.
Generating a Unix-style Makefile
Writing Makefile for ExtUtils::MakeMaker
Writing MYMETA.yml and MYMETA.json
Can't locate Test/Harness.pm in @INC (@INC contains: bundled/CPAN-Meta bundled/JSON-PP-Compat5006 bundled/Parse-CPAN-Meta bundled/CPAN-Meta-YAML bundled/File-
Temp bundled/ExtUtils-Manifest bundled/JSON-PP bundled/ExtUtils-Install bundled/Scalar-List-Utils bundled/CPAN-Meta-Requirements lib . /usr/local/lib64/perl5
/usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5) at Makefile.PL line 143.

Output from git make:

    SUBDIR perl
/usr/bin/perl Makefile.PL PREFIX='/home/svc_rrtd/local' INSTALL_BASE='' --localedir='/home/svc_rrtd/local/share/locale'
Can't locate ExtUtils/MakeMaker.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at Makefile.PL line 3.
BEGIN failed--compilation aborted at Makefile.PL line 3.
make[1]: *** [perl.mak] Error 2
make: *** [perl/perl.mak] Error 2
Paul Johnson
  • 1,329
  • 1
  • 12
  • 25
  • 1
    how are you trying to install stuff? what error actually happens when you try installing EU::MM? Test::Harness should not be a dependency. – ysth Oct 02 '15 at 00:04
  • 1
    ExtUtils::MakeMaker is a core module; if you have Perl 5, you have ExtUtils::MakeMaker. Please show the commands you're running and show the exact message that says EU::MM can't be found. – ThisSuitIsBlackNot Oct 02 '15 at 01:24
  • use yum to install the missing perl dev tools like perl-CPAN etc ... – optional Oct 02 '15 at 01:38
  • Added output of commands. We don't have root and our support vendor is grossly incompetent, yum isn't an option. – Paul Johnson Oct 02 '15 at 01:46
  • Have you added to PERL5LIB ? If your vendor perl installation is crippled, and vendor isn't helping, install your own perl – optional Oct 02 '15 at 01:48
  • 1
    I've encountered broken system perls before, which might be part of the problem. Personally I'd try to use perlbrew or plenv to install a local version of perl (you don't have root - right?), then *hopefully* you have a stable base. That said, I'd check for the prerequisites first (expect, openssl etc) seeing as you don't have sudo. – ashley Oct 02 '15 at 12:38

2 Answers2

1

Compiling a more recent (2.17 Q2 2018, almost 3 years later) version of Git might prove easier, since the build procedure for perl/ part has been greatly simplified by weaning Git off of MakeMaker.

See commit 7a7bfc7 (02 Jan 2018) by Jonathan Nieder (artagnon).
See commit 805a378 (22 Dec 2017), and commit 20d2a30 (10 Dec 2017) by Ævar Arnfjörð Bjarmason (avar).
(Merged by Junio C Hamano -- gitster -- in commit ed1b87e, 13 Feb 2018)

Ævar explains:

Replace the perl/Makefile.PL and the fallback perl/Makefile used under NO_PERL_MAKEMAKER=NoThanks with a much simpler implementation heavily inspired by how the i18n infrastructure's build process works.
See commit 5e9637c from Git v1.7.9-rc0, Nov. 2011.

The reason for having the Makefile.PL in the first place is that it was initially building a Perl C binding to interface with libgit (commit b1edc53d0, Git v1.4.3-rc1, June 2006), this functionality, that was removed (commit 18b0fc1, Git v1.4.3-rc1, Sept. 2006) before Git.pm ever made it to the master branch.

We've since since started maintaining a fallback perl/Makefile, as MakeMaker wouldn't work on some platforms (commit f848718, Git v1.5.0-rc0, Dec. 2006).
That's just the tip of the iceberg. We have the PM.stamp hack in the top-level Makefile (commit ee9be06, Git v1.7.12-rc1, Jul. 2012) to detect whether we need to regenerate the perl/perl.mak, which I fixed just recently to deal with issues like the perl version changing from under us (commit c59c4939, Git v2.13.0-rc0, March 2017).

There is absolutely no reason for why this needs to be so complex anymore.
All we're getting out of this elaborate Rube Goldberg machine was copying perl/* to perl/blib/* as we do a string-replacement on the *.pm files to hard-code @@LOCALEDIR@@ in the source, as well as pod2man-ing Git.pm & friends.

So replace the whole thing with something that's pretty much a copy of how we generate po/build/**.mo from po/*.po, just with a small sed(1) command instead of msgfmt.
As that's being done, rename the files from *.pm to *.pmc just to indicate that they're generated (see "perldoc -f require").


With Git 2.32 (Q2 2021), build procedure gets cleaned-up.

See commit 8c55753 (12 May 2021), and commit 256c2dc, commit 368a50d, commit 3d49f72, commit 4070c9e (05 May 2021) by Ævar Arnfjörð Bjarmason (avar).
(Merged by Junio C Hamano -- gitster -- in commit 2e2ed74, 20 May 2021)

perl: use mock i18n functions under NO_GETTEXT=Y

Signed-off-by: Ævar Arnfjörð Bjarmason

Change the logic of the i18n functions I added in 5e9637c ("i18n: add infrastructure for translating Git with gettext", 2011-11-18, Git v1.7.9-rc0 -- merge) to use pass-through functions when NO_GETTEXT is defined.

This speeds up the compilation time of commands that use this library when NO_GETTEXT=Y is in effect.
Loading it and POSIX.pm is around 20ms on my machine, whereas it takes 2ms to just instantiate Perl itself.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
0

Where is it installed? Simply add that directory to PERL5LIB

export PERL5LIB=/home/user/stuff/lib/perl5:$PERL5LIB

update: try installing the prerequisites for git, something like

$ sudo yum install curl-devel expat-devel gettext-devel \
  openssl-devel perl-devel zlib-devel
$ sudo apt-get install libcurl4-gnutls-dev libexpat1-dev gettext \
  libz-dev libssl-dev

Thats a quote from http://git-scm.com/book/en/v2/Getting-Started-Installing-Git

optional
  • 2,061
  • 12
  • 16