title: "Can't locate ExtUtils/MakeMaker.pm in @INC" during git build
body: <p>I'm building <code>git</code> on a pretty minimal system (Ubuntu 16.04 docker image) without using the package manager (except for <code>wget</code>, <code>xz-utils</code>, <code>make</code> and <code>gcc</code>). I thus installed prerequisistes as follows:</p>
  
  <pre><code>apt-get update &amp;&amp; apt-get install --yes wget xz-utils make gcc
  wget http://www.cpan.org/src/5.0/perl-5.26.1.tar.gz &amp;&amp; tar xf perl-5.26.1.tar.gz &amp;&amp; cd perl-5.26.1 &amp;&amp; ./configure.gnu &amp;&amp; make -j16 &amp;&amp; make install &amp;&amp; cd ..
  wget https://ftp.gnu.org/pub/gnu/gettext/gettext-0.19.8.1.tar.xz &amp;&amp; tar xf gettext-0.19.8.1.tar.xz &amp;&amp; cd gettext-0.19.8.1 &amp;&amp; ./configure &amp;&amp; make -j16 &amp;&amp; make install &amp;&amp; cd ..
  wget https://www.zlib.net/zlib-1.2.11.tar.gz &amp;&amp; tar xf zlib-1.2.11.tar.gz &amp;&amp; cd zlib-1.2.11 &amp;&amp; ./configure &amp;&amp; make -j16 &amp;&amp; make install &amp;&amp; cd ..
  cpan install ExtUtils::MakeMaker
  wget https://www.kernel.org/pub/software/scm/git/git-2.13.3.tar.gz &amp;&amp; tar xf git-2.13.3.tar.gz &amp;&amp; cd git-2.13.3 &amp;&amp; ./configure &amp;&amp; make -j16 &amp;&amp; make install &amp;&amp; cd ..
  </code></pre>
  
  <p>However, <code>make</code> in the <code>git</code> source root fails due to</p>
  
  <pre><code>Can't locate ExtUtils/MakeMaker.pm in @INC (you may need to install the ExtUtils::MakeMaker module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.22.1 /usr/local/share/perl/5.22.1 /usr/lib/x86_64-linux-gnu/perl5/5.22 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.22 /usr/share/perl/5.22 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base .) at Makefile.PL line 3.
  BEGIN failed--compilation aborted at Makefile.PL line 3.
  make[1]: *** [perl.mak] Error 2
  Makefile:83: recipe for target 'perl.mak' failed
  make: *** [perl/perl.mak] Error 2
  make: *** Waiting for unfinished jobs....
  Makefile:1870: recipe for target 'perl/perl.mak' failed
  </code></pre>
  
  <p>I'm aware that there're a lot of solutions regarding <code>Can't locate [module].pm in @INC</code> for perl projects, <a href="https://stackoverflow.com/questions/898782/how-do-i-tell-cpan-to-install-all-dependencies">How do I tell CPAN to install all dependencies?</a>. However, <code>git</code> uses GNU autotools and options which could fix the issue are probably read from environment variables which I couldn't figure out so far.</p>
  
  <p>The Ubuntu 16.04 provides a <code>perl</code>, but no <code>cpan</code> command (which is why I added the <code>perl</code> source installation). After the <code>perl</code> source installation is recognized, but doesn't seem to be used:</p>
  
  <pre><code>$ which -a perl
  /usr/local/bin/perl
  /usr/bin/perl
  $ which -a cpan
  /usr/local/bin/cpan
  </code></pre>
  
  <p>After <code>cpan</code> I get</p>
  
  <pre><code>$ find / -name MakeMaker.pm
  /builds/project-0/perl-5.26.1/lib/ExtUtils/MakeMaker.pm
  /builds/project-0/perl-5.26.1/cpan/ExtUtils-MakeMaker/lib/ExtUtils/MakeMaker.pm
  /root/.cpan/build/ExtUtils-MakeMaker-7.32-0/lib/ExtUtils/MakeMaker.pm
  /root/.cpan/build/ExtUtils-MakeMaker-7.32-0/blib/lib/ExtUtils/MakeMaker.pm
  /usr/local/lib/perl5/5.26.1/ExtUtils/MakeMaker.pm
  /usr/local/lib/perl5/site_perl/5.26.1/ExtUtils/MakeMaker.pm
  $ perl -E 'say for @INC'
  /usr/local/lib/perl5/site_perl/5.26.1/x86_64-linux
  /usr/local/lib/perl5/site_perl/5.26.1
  /usr/local/lib/perl5/5.26.1/x86_64-linux
  /usr/local/lib/perl5/5.26.1
  </code></pre>
  
  <p>The setup is abstracted from a bootstrapping script, so using the package manager is really no option.</p>
  
  <p>You can use <code>docker run -i -t ubuntu:latest</code> in case you care to investigate the environment.</p>
  
  <p>I provided a reproducible build at <a href="https://gitlab.com/krichter/git-docker-build" rel="noreferrer">https://gitlab.com/krichter/git-docker-build</a> and example output of the GitLab CI runner can be found at <a href="https://gitlab.com/krichter/git-docker-build/-/jobs/53888412" rel="noreferrer">https://gitlab.com/krichter/git-docker-build/-/jobs/53888412</a>.</p>