# [bug] 2.5.0 build with NO_PERL is broken

11 messages from 2015-08-14 to 2015-08-18. Participants: Renato Botelho, Junio C Hamano, Eric Sunshine.
Thread: https://gitlist.dev/t/40085

## Renato Botelho, 2015-08-14 15:41

Subject: [bug] 2.5.0 build with NO_PERL is broken
Message-ID: <loom.20150814T171757-901@post.gmane.org>
URL: https://gitlist.dev/e/loom.20150814T171757-901%40post.gmane.org

```
I was working on update git on FreeBSD ports tree to 2.5.0 and I noted 2.5.0
is trying to use perl even when it's being built with NO_PERL knob.

/bin/sh: /usr/bin/perl: not found
Makefile:1701: recipe for target 'common-cmds.h' failed
gmake[2]: *** [common-cmds.h] Error 127
gmake[2]: *** Waiting for unfinished jobs....
gmake[2]: Leaving directory '/freebsd/ports/head/devel/git/work/git-2.5.0'

After a quick search, looks like commit 527ec3980b is the culprit since it
removed generate-cmdlist.sh and introduced generate-cmdlist.perl.

I just would like to check if it's planned to add perl dependency during
build time or it happened by accident and will be fixed so NO_PERL can work
again.

Thanks

```

## Renato Botelho, 2015-08-14 16:46

Subject: Re: [bug] 2.5.0 build with NO_PERL is broken
Message-ID: <loom.20150814T184447-932@post.gmane.org>
URL: https://gitlist.dev/e/loom.20150814T184447-932%40post.gmane.org
In-Reply-To: <loom.20150814T171757-901@post.gmane.org>

```
Renato Botelho <garga <at> FreeBSD.org> writes:

> 
> I was working on update git on FreeBSD ports tree to 2.5.0 and I noted 2.5.0
> is trying to use perl even when it's being built with NO_PERL knob.
> 
> /bin/sh: /usr/bin/perl: not found
> Makefile:1701: recipe for target 'common-cmds.h' failed
> gmake[2]: *** [common-cmds.h] Error 127
> gmake[2]: *** Waiting for unfinished jobs....
> gmake[2]: Leaving directory '/freebsd/ports/head/devel/git/work/git-2.5.0'
> 
> After a quick search, looks like commit 527ec3980b is the culprit since it
> removed generate-cmdlist.sh and introduced generate-cmdlist.perl.
> 
> I just would like to check if it's planned to add perl dependency during
> build time or it happened by accident and will be fixed so NO_PERL can work
> again.

I also found that some commands require perl when NO_PERL is set:

git-submodule
git-request-pull
git-am

Definitely NO_PERL is not working as expected.

```

## Junio C Hamano, 2015-08-14 19:59

Subject: Re: [bug] 2.5.0 build with NO_PERL is broken
Message-ID: <xmqq7foxiqu6.fsf@gitster.dls.corp.google.com>
URL: https://gitlist.dev/e/xmqq7foxiqu6.fsf%40gitster.dls.corp.google.com
In-Reply-To: <loom.20150814T184447-932@post.gmane.org>

```
Renato Botelho <garga@FreeBSD.org> writes:

> I also found that some commands require perl when NO_PERL is set:
>
> git-submodule
> git-request-pull
> git-am
>
> Definitely NO_PERL is not working as expected.

NO_PERL merely means "I want to build a subset of Git that is meant
to be usable on a system without a working Perl installed".  These
scripts that do require Perl installed are indeed not expected to
work under NO_PERL (if you think about it, that would be natural and
the only sensible expectation---otherwise we would have coded them
without using Perl at all, in which case there will be no need for
NO_PERL in the first place).

```

## Eric Sunshine, 2015-08-14 20:49

Subject: Re: [bug] 2.5.0 build with NO_PERL is broken
Message-ID: <CAPig+cR77oFo6D3f8BjAB_yM-xPt+3EUGK4vZr3eYWJGTtksAQ@mail.gmail.com>
URL: https://gitlist.dev/e/CAPig%2BcR77oFo6D3f8BjAB_yM-xPt%2B3EUGK4vZr3eYWJGTtksAQ%40mail.gmail.com
In-Reply-To: <xmqq7foxiqu6.fsf@gitster.dls.corp.google.com>

```
On Fri, Aug 14, 2015 at 3:59 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Renato Botelho <garga@FreeBSD.org> writes:
>> I also found that some commands require perl when NO_PERL is set:
>
> NO_PERL merely means "I want to build a subset of Git that is meant
> to be usable on a system without a working Perl installed".  These
> scripts that do require Perl installed are indeed not expected to
> work under NO_PERL (if you think about it, that would be natural and
> the only sensible expectation---otherwise we would have coded them
> without using Perl at all, in which case there will be no need for
> NO_PERL in the first place).

Nevertheless, there's still the problem, due to 527ec39
(generate-cmdlist: parse common group commands, 2015-05-21), that git
doesn't build at all anymore when Perl is unavailable.

One option would be to go with the awk version of
'generate-cmdlist'[1], which restricts itself to POSIX and was tested
on Linux, FreeBSD, and Mac OS X[2], though I'm not sure we really want
to go there, particularly if you're uncomfortable[3] about introducing
awk into the toolchain.

Another option would be to rewrite the (more complex) generate-cmdlist
in shell, which I think should be possible, though it will be uglier
and more verbose.

[1]: http://article.gmane.org/gmane.comp.version-control.git/269307/
[2]: http://article.gmane.org/gmane.comp.version-control.git/269336/
[3]: http://article.gmane.org/gmane.comp.version-control.git/269324/

```

## Junio C Hamano, 2015-08-14 21:02

Subject: Re: [bug] 2.5.0 build with NO_PERL is broken
Message-ID: <xmqqoai9h9co.fsf@gitster.dls.corp.google.com>
URL: https://gitlist.dev/e/xmqqoai9h9co.fsf%40gitster.dls.corp.google.com
In-Reply-To: <CAPig+cR77oFo6D3f8BjAB_yM-xPt+3EUGK4vZr3eYWJGTtksAQ@mail.gmail.com>

```
Eric Sunshine <sunshine@sunshineco.com> writes:

> Nevertheless, there's still the problem, due to 527ec39
> (generate-cmdlist: parse common group commands, 2015-05-21), that git
> doesn't build at all anymore when Perl is unavailable.

I do not think that is anything new.  We always have assumed "some"
version of Perl available in order to run t/ scripts.

```

## Eric Sunshine, 2015-08-14 21:15

Subject: Re: [bug] 2.5.0 build with NO_PERL is broken
Message-ID: <CAPig+cR6iT=AC8zq-vHHTkXMzRmDA-o9JLi0h8gbR1tzbqNyKA@mail.gmail.com>
URL: https://gitlist.dev/e/CAPig%2BcR6iT%3DAC8zq-vHHTkXMzRmDA-o9JLi0h8gbR1tzbqNyKA%40mail.gmail.com
In-Reply-To: <xmqqoai9h9co.fsf@gitster.dls.corp.google.com>

```
On Fri, Aug 14, 2015 at 5:02 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Eric Sunshine <sunshine@sunshineco.com> writes:
>> Nevertheless, there's still the problem, due to 527ec39
>> (generate-cmdlist: parse common group commands, 2015-05-21), that git
>> doesn't build at all anymore when Perl is unavailable.
>
> I do not think that is anything new.  We always have assumed "some"
> version of Perl available in order to run t/ scripts.

True, but prior to 527ec39, without Perl available, git itself could
at least be built and used (with some commands unavailable), even if
it couldn't be fully tested. As of 527ec39, however, git won't even
build because common-cmds.h can't be generated.

```

## Junio C Hamano, 2015-08-14 22:22

Subject: Re: [bug] 2.5.0 build with NO_PERL is broken
Message-ID: <xmqqzj1tfr2g.fsf@gitster.dls.corp.google.com>
URL: https://gitlist.dev/e/xmqqzj1tfr2g.fsf%40gitster.dls.corp.google.com
In-Reply-To: <CAPig+cR6iT=AC8zq-vHHTkXMzRmDA-o9JLi0h8gbR1tzbqNyKA@mail.gmail.com>

```
Eric Sunshine <sunshine@sunshineco.com> writes:

> On Fri, Aug 14, 2015 at 5:02 PM, Junio C Hamano <gitster@pobox.com> wrote:
>> Eric Sunshine <sunshine@sunshineco.com> writes:
>>> Nevertheless, there's still the problem, due to 527ec39
>>> (generate-cmdlist: parse common group commands, 2015-05-21), that git
>>> doesn't build at all anymore when Perl is unavailable.
>>
>> I do not think that is anything new.  We always have assumed "some"
>> version of Perl available in order to run t/ scripts.
>
> True, but prior to 527ec39, without Perl available, git itself could
> at least be built and used (with some commands unavailable), even if
> it couldn't be fully tested. As of 527ec39, however, git won't even
> build because common-cmds.h can't be generated.

I wouldn't bother digging in the history myself, but I am reasonably
sure that the current genereate-common-cmds is not the sole instance
that we relied on Perl to build (not test) in the past, and that is
another reason why I do not think this is anything new.

```

## Eric Sunshine, 2015-08-14 22:25

Subject: Re: [bug] 2.5.0 build with NO_PERL is broken
Message-ID: <CAPig+cQkApWfZ6N159F-XFZk+nnzY-gAgLRfZXNitdd0CHpm2g@mail.gmail.com>
URL: https://gitlist.dev/e/CAPig%2BcQkApWfZ6N159F-XFZk%2BnnzY-gAgLRfZXNitdd0CHpm2g%40mail.gmail.com
In-Reply-To: <xmqqzj1tfr2g.fsf@gitster.dls.corp.google.com>

```
On Fri, Aug 14, 2015 at 6:22 PM, Junio C Hamano <gitster@pobox.com> wrote:
> Eric Sunshine <sunshine@sunshineco.com> writes:
>
>> On Fri, Aug 14, 2015 at 5:02 PM, Junio C Hamano <gitster@pobox.com> wrote:
>>> Eric Sunshine <sunshine@sunshineco.com> writes:
>>>> Nevertheless, there's still the problem, due to 527ec39
>>>> (generate-cmdlist: parse common group commands, 2015-05-21), that git
>>>> doesn't build at all anymore when Perl is unavailable.
>>>
>>> I do not think that is anything new.  We always have assumed "some"
>>> version of Perl available in order to run t/ scripts.
>>
>> True, but prior to 527ec39, without Perl available, git itself could
>> at least be built and used (with some commands unavailable), even if
>> it couldn't be fully tested. As of 527ec39, however, git won't even
>> build because common-cmds.h can't be generated.
>
> I wouldn't bother digging in the history myself, but I am reasonably
> sure that the current genereate-common-cmds is not the sole instance
> that we relied on Perl to build (not test) in the past, and that is
> another reason why I do not think this is anything new.

Hmm. In my tests by setting PERL_PATH to a bogus (non-existent)
command, prior to 527ec39, git builds successfully, whereas, following
527ec39, it does not build. But, perhaps I overlooked something...(?)

```

## Renato Botelho, 2015-08-18 11:05

Subject: Re: [bug] 2.5.0 build with NO_PERL is broken
Message-ID: <loom.20150818T130309-687@post.gmane.org>
URL: https://gitlist.dev/e/loom.20150818T130309-687%40post.gmane.org
In-Reply-To: <CAPig+cQkApWfZ6N159F-XFZk+nnzY-gAgLRfZXNitdd0CHpm2g@mail.gmail.com>

```
Eric Sunshine <sunshine <at> sunshineco.com> writes:

> 
> On Fri, Aug 14, 2015 at 6:22 PM, Junio C Hamano <gitster <at> pobox.com>
wrote:
> > Eric Sunshine <sunshine <at> sunshineco.com> writes:
> >
> >> On Fri, Aug 14, 2015 at 5:02 PM, Junio C Hamano <gitster <at>
pobox.com> wrote:
> >>> Eric Sunshine <sunshine <at> sunshineco.com> writes:
> >>>
> >>> I do not think that is anything new.  We always have assumed "some"
> >>> version of Perl available in order to run t/ scripts.
> >>
> >> True, but prior to 527ec39, without Perl available, git itself could
> >> at least be built and used (with some commands unavailable), even if
> >> it couldn't be fully tested. As of 527ec39, however, git won't even
> >> build because common-cmds.h can't be generated.
> >
> > I wouldn't bother digging in the history myself, but I am reasonably
> > sure that the current genereate-common-cmds is not the sole instance
> > that we relied on Perl to build (not test) in the past, and that is
> > another reason why I do not think this is anything new.
> 
> Hmm. In my tests by setting PERL_PATH to a bogus (non-existent)
> command, prior to 527ec39, git builds successfully, whereas, following
> 527ec39, it does not build. But, perhaps I overlooked something...(?)

It builds but there will be at least 3 commands that won't work:

git-submodule
git-request-pull
git-am

I'm considering to add perl dependency as mandatory on FreeBSD ports tree,
and maybe this NO_PERL option doesn't make more sense nowadays...

```

## Eric Sunshine, 2015-08-18 16:42

Subject: Re: [bug] 2.5.0 build with NO_PERL is broken
Message-ID: <CAPig+cTvNQ74G4T3McNd2JUXLvxe-yX+ApFrevXDi4GXsFQ_3g@mail.gmail.com>
URL: https://gitlist.dev/e/CAPig%2BcTvNQ74G4T3McNd2JUXLvxe-yX%2BApFrevXDi4GXsFQ_3g%40mail.gmail.com
In-Reply-To: <loom.20150818T130309-687@post.gmane.org>

```
On Tue, Aug 18, 2015 at 7:05 AM, Renato Botelho <garga@freebsd.org> wrote:
> Eric Sunshine <sunshine <at> sunshineco.com> writes:
>> On Fri, Aug 14, 2015 at 6:22 PM, Junio C Hamano <gitster <at> pobox.com>
> wrote:
>> > Eric Sunshine <sunshine <at> sunshineco.com> writes:
>> >> On Fri, Aug 14, 2015 at 5:02 PM, Junio C Hamano <gitster <at>
> pobox.com> wrote:
>> >>> Eric Sunshine <sunshine <at> sunshineco.com> writes:
>> >>> I do not think that is anything new.  We always have assumed "some"
>> >>> version of Perl available in order to run t/ scripts.
>> >>
>> >> True, but prior to 527ec39, without Perl available, git itself could
>> >> at least be built and used (with some commands unavailable), even if
>> >> it couldn't be fully tested. As of 527ec39, however, git won't even
>> >> build because common-cmds.h can't be generated.
>> >
>> > I wouldn't bother digging in the history myself, but I am reasonably
>> > sure that the current genereate-common-cmds is not the sole instance
>> > that we relied on Perl to build (not test) in the past, and that is
>> > another reason why I do not think this is anything new.
>>
>> Hmm. In my tests by setting PERL_PATH to a bogus (non-existent)
>> command, prior to 527ec39, git builds successfully, whereas, following
>> 527ec39, it does not build. But, perhaps I overlooked something...(?)
>
> It builds but there will be at least 3 commands that won't work:

Hmm, I was under the impression from your initial mail[1] that Git
wouldn't even build without Perl available:

    /bin/sh: /usr/bin/perl: not found
    Makefile:1701: recipe for target 'common-cmds.h' failed
    gmake[2]: *** [common-cmds.h] Error 127

Doesn't this failure prevent generation of the 'git' executable altogether?

> git-submodule
> git-request-pull
> git-am

Also...

git-add--interactive
git-archimport
git-cvsexportcommit
git-cvsimport
git-cvsserver
git-difftool
git-instaweb
git-relink
git-send-email
git-svn

A C rewrite of git-am has recently graduated to 'master'.

> I'm considering to add perl dependency as mandatory on FreeBSD ports tree,
> and maybe this NO_PERL option doesn't make more sense nowadays...

That might make sense. Although some of the above commands may not be
used widely, others, such as git-send-email, probably are used
regularly.

[1]: http://thread.gmane.org/gmane.comp.version-control.git/275905

```

## Renato Botelho, 2015-08-18 18:09

Subject: Re: [bug] 2.5.0 build with NO_PERL is broken
Message-ID: <loom.20150818T200305-434@post.gmane.org>
URL: https://gitlist.dev/e/loom.20150818T200305-434%40post.gmane.org
In-Reply-To: <CAPig+cTvNQ74G4T3McNd2JUXLvxe-yX+ApFrevXDi4GXsFQ_3g@mail.gmail.com>

```
> Eric Sunshine <sunshine <at> sunshineco.com> writes:
> 
> Hmm, I was under the impression from your initial mail[1] that Git
> wouldn't even build without Perl available:
> 
>     /bin/sh: /usr/bin/perl: not found
>     Makefile:1701: recipe for target 'common-cmds.h' failed
>     gmake[2]: *** [common-cmds.h] Error 127

This assumption is correct, current 2.5.0 doesn't build without perl.

> Doesn't this failure prevent generation of the 'git' executable altogether?
> 
> > git-submodule
> > git-request-pull
> > git-am
> 
> Also...
> 
> git-add--interactive
> git-archimport
> git-cvsexportcommit
> git-cvsimport
> git-cvsserver
> git-difftool
> git-instaweb
> git-relink
> git-send-email
> git-svn

When I build with NO_PERL=1, above files are a simple shell script saying
git was built without it:

#!/bin/sh

echo >&2 "fatal: git was built without support for `basename $0` (NO_PERL=1)."
exit 128

But the same doesn't happen with submodule, request-pull and am.

> A C rewrite of git-am has recently graduated to 'master'.

cool!

> That might make sense. Although some of the above commands may not be
> used widely, others, such as git-send-email, probably are used
> regularly.

There is a port called git-lite with few dependencies, sometimes people
install it on servers that only need to clone and update local copies of
repos. It's interesting to keep it working as expected with NO_PERL, since
it offers this option.

```
