threads / discuss / 21017

install does not obey DESTDIR or --prefix for perl modules

Subject: install does not obey DESTDIR or --prefix for perl modules

## tl;dr

22 messages between Sep 21, 2009 and Oct 9, 2009.

replies: 21people: 6as markdown or json

Craig Taylor· Sep 21, 2009, 16:05 UTC · lore
Hi all

I'm compiling/installing git in a Solaris environment without root. Using 'make DESTDIR=<some path> install' to stage an install to an alternate location. The perl module component of 'make DESTDIR=<some path> install' installs into the system perl lib path without prepending the forced install destination or my '--prefix'. This seems counter intuitive and I would consider a bug.

Regards CraigT

-- 
c^ [c%5e]

The bamboo-shadows move over the stone steps
as if to sweep them, but no dust is stirred;
The moon is reflected deep in the pool, but the
water shows no trace of its penetration.
Brandon Casey· Sep 21, 2009, 16:58 UTC · re: Craig Taylor · lore

Re: install does not obey DESTDIR or --prefix for perl modules

Craig Taylor wrote:
Show 9 quoted lines
> Hi all
> 
> I'm compiling/installing git in a Solaris environment without root.
> Using 'make DESTDIR=<some path> install' to stage an install to an
> alternate location.
> The perl module component of 'make DESTDIR=<some path> install' installs
> into the system perl lib path without prepending the forced install
> destination or my '--prefix'.
> This seems counter intuitive and I would consider a bug.
Try 'make prefix=<some path>'.
btw, this is in the first paragraph of the INSTALL document.
-brandon
Junio C Hamano· Sep 21, 2009, 17:58 UTC · re: Brandon Casey · lore

Re: install does not obey DESTDIR or --prefix for perl modules

Brandon Casey <brandon.casey.ctr@nrlssc.navy.mil> writes:
Show 14 quoted lines
> Craig Taylor wrote:
>> Hi all
>> 
>> I'm compiling/installing git in a Solaris environment without root.
>> Using 'make DESTDIR=<some path> install' to stage an install to an
>> alternate location.
>> The perl module component of 'make DESTDIR=<some path> install' installs
>> into the system perl lib path without prepending the forced install
>> destination or my '--prefix'.
>> This seems counter intuitive and I would consider a bug.
>
> Try 'make prefix=<some path>'.
>
> btw, this is in the first paragraph of the INSTALL document.
But is that what Craig is trying to do?

I think he wants to build git to be installed in /usr/bin/git or whatever, and he would say "prefix=/usr". He however wants "make install" to write into /var/tmp/g/usr/bin/git, not /usr/bin/git, so that he can for example make a tarball with "cd /var/tmp/g && tar cf ../git.tar .", and extract it as root under the real '/'. "make DESTDIR=/var/tmp/g" is exactly for that, and if it is not working I would say it is a bug.

Brandon Casey· Sep 21, 2009, 18:34 UTC · re: Junio C Hamano · lore

Re: install does not obey DESTDIR or --prefix for perl modules

Junio C Hamano wrote:
Show 24 quoted lines
> Brandon Casey <brandon.casey.ctr@nrlssc.navy.mil> writes:
> 
>> Craig Taylor wrote:
>>> Hi all
>>>
>>> I'm compiling/installing git in a Solaris environment without root.
>>> Using 'make DESTDIR=<some path> install' to stage an install to an
>>> alternate location.
>>> The perl module component of 'make DESTDIR=<some path> install' installs
>>> into the system perl lib path without prepending the forced install
>>> destination or my '--prefix'.
>>> This seems counter intuitive and I would consider a bug.
>> Try 'make prefix=<some path>'.
>>
>> btw, this is in the first paragraph of the INSTALL document.
> 
> But is that what Craig is trying to do?
> 
> I think he wants to build git to be installed in /usr/bin/git or whatever,
> and he would say "prefix=/usr".  He however wants "make install" to write
> into /var/tmp/g/usr/bin/git, not /usr/bin/git, so that he can for example
> make a tarball with "cd /var/tmp/g && tar cf ../git.tar .", and extract it
> as root under the real '/'.  "make DESTDIR=/var/tmp/g" is exactly for
> that, and if it is not working I would say it is a bug.
Ah.  I did not realize that that is what DESTDIR is for.
Thanks for the correction.
-brandon
Craig Taylor· Sep 21, 2009, 19:19 UTC · re: Junio C Hamano · lore

Re: install does not obey DESTDIR or --prefix for perl modules

On Mon, Sep 21, 2009 at 10:58:20AM -0700, Junio C Hamano wrote:
Show 25 quoted lines
> Brandon Casey <brandon.casey.ctr@nrlssc.navy.mil> writes:
> 
> > Craig Taylor wrote:
> >> Hi all
> >> 
> >> I'm compiling/installing git in a Solaris environment without root.
> >> Using 'make DESTDIR=<some path> install' to stage an install to an
> >> alternate location.
> >> The perl module component of 'make DESTDIR=<some path> install' installs
> >> into the system perl lib path without prepending the forced install
> >> destination or my '--prefix'.
> >> This seems counter intuitive and I would consider a bug.
> >
> > Try 'make prefix=<some path>'.
> >
> > btw, this is in the first paragraph of the INSTALL document.
> 
> But is that what Craig is trying to do?
> 
> I think he wants to build git to be installed in /usr/bin/git or whatever,
> and he would say "prefix=/usr".  He however wants "make install" to write
> into /var/tmp/g/usr/bin/git, not /usr/bin/git, so that he can for example
> make a tarball with "cd /var/tmp/g && tar cf ../git.tar .", and extract it
> as root under the real '/'.  "make DESTDIR=/var/tmp/g" is exactly for
> that, and if it is not working I would say it is a bug.

Exactly as you describe here, different paths but same goal. All binaries follow the DESTDIR path except the perl modules.

To register this as a bug do I need to do more than send this email?

Thanks CraigT

-- 
c^ [c%5e]

No think. No Talk. Train.
Ben Walton· Sep 21, 2009, 19:40 UTC · re: Craig Taylor · lore

Re: install does not obey DESTDIR or --prefix for perl modules

Excerpts from Craig Taylor's message of Mon Sep 21 15:19:43 -0400 2009:
> Exactly as you describe here, different paths but same goal.
> All binaries follow the DESTDIR path except the perl modules.

I haven't had this problem and I've been packaging git for solaris (8 or newer) since early 2009. If you're interested in my build notes, feel free to ping me.

Thanks -Ben

-- 
Ben Walton
Systems Programmer - CHASS
University of Toronto
C:416.407.5610 | W:416.978.4302

GPG Key Id: 8E89F6D2; Key Server: pgp.mit.edu
Contact me to arrange for a CAcert assurance meeting.
Craig Taylor· Sep 21, 2009, 19:46 UTC · re: Ben Walton · lore

Re: install does not obey DESTDIR or --prefix for perl modules

On Mon, Sep 21, 2009 at 03:40:04PM -0400, Ben Walton wrote:
Show 11 quoted lines
> Excerpts from Craig Taylor's message of Mon Sep 21 15:19:43 -0400 2009:
> 
> > Exactly as you describe here, different paths but same goal.
> > All binaries follow the DESTDIR path except the perl modules.
> 
> I haven't had this problem and I've been packaging git for solaris (8
> or newer) since early 2009.  If you're interested in my build notes,
> feel free to ping me.
> 
> Thanks
> -Ben
Will take you up on this. I'll re-raise this if they don't help.

Thanks CraigT

-- 
c^ [c%5e]

Even when you are standing in front of defeat, do it smiling.
Junio C Hamano· Sep 21, 2009, 19:44 UTC · re: Craig Taylor · lore

Re: install does not obey DESTDIR or --prefix for perl modules

Craig Taylor <c@gryning.com> writes:
> Exactly as you describe here, different paths but same goal.
> All binaries follow the DESTDIR path except the perl modules.
>
> To register this as a bug do I need to do more than send this email?
Do you use NO_PERL_MAKEMAKER in your build?

If not, we need to summon an expert on ExtUtils::MakeMaker to look into this issue, but if you do, perhaps you can try this patch and report how well it works for you.

---
 perl/Makefile |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/perl/Makefile b/perl/Makefile
index e3dd1a5..4ab21d6 100644
--- a/perl/Makefile
+++ b/perl/Makefile
@@ -29,11 +29,11 @@ $(makfile): ../GIT-CFLAGS Makefile
 	'$(PERL_PATH_SQ)' -MError -e 'exit($$Error::VERSION < 0.15009)' || \
 	echo '	cp private-Error.pm blib/lib/Error.pm' >> $@
 	echo install: >> $@
-	echo '	mkdir -p "$(instdir_SQ)"' >> $@
-	echo '	$(RM) "$(instdir_SQ)/Git.pm"; cp Git.pm "$(instdir_SQ)"' >> $@
-	echo '	$(RM) "$(instdir_SQ)/Error.pm"' >> $@
+	echo '	mkdir -p "$$(DESTDIR)$(instdir_SQ)"' >> $@
+	echo '	$(RM) "$$(DESTDIR)$(instdir_SQ)/Git.pm"; cp Git.pm "$$(DESTDIR)$(instdir_SQ)"' >> $@
+	echo '	$(RM) "$$(DESTDIR)$(instdir_SQ)/Error.pm"' >> $@
 	'$(PERL_PATH_SQ)' -MError -e 'exit($$Error::VERSION < 0.15009)' || \
-	echo '	cp private-Error.pm "$(instdir_SQ)/Error.pm"' >> $@
+	echo '	cp private-Error.pm "$$(DESTDIR)$(instdir_SQ)/Error.pm"' >> $@
 	echo instlibdir: >> $@
 	echo '	echo $(instdir_SQ)' >> $@
 else
Craig Taylor· Sep 21, 2009, 19:54 UTC · re: Junio C Hamano · lore

Re: install does not obey DESTDIR or --prefix for perl modules

On Mon, Sep 21, 2009 at 12:44:05PM -0700, Junio C Hamano wrote:
Show 37 quoted lines
> Craig Taylor <c@gryning.com> writes:
> 
> > Exactly as you describe here, different paths but same goal.
> > All binaries follow the DESTDIR path except the perl modules.
> >
> > To register this as a bug do I need to do more than send this email?
> 
> Do you use NO_PERL_MAKEMAKER in your build?
> 
> If not, we need to summon an expert on ExtUtils::MakeMaker to look into
> this issue, but if you do, perhaps you can try this patch and report how
> well it works for you.
> 
> ---
>  perl/Makefile |    8 ++++----
>  1 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/perl/Makefile b/perl/Makefile
> index e3dd1a5..4ab21d6 100644
> --- a/perl/Makefile
> +++ b/perl/Makefile
> @@ -29,11 +29,11 @@ $(makfile): ../GIT-CFLAGS Makefile
>  	'$(PERL_PATH_SQ)' -MError -e 'exit($$Error::VERSION < 0.15009)' || \
>  	echo '	cp private-Error.pm blib/lib/Error.pm' >> $@
>  	echo install: >> $@
> -	echo '	mkdir -p "$(instdir_SQ)"' >> $@
> -	echo '	$(RM) "$(instdir_SQ)/Git.pm"; cp Git.pm "$(instdir_SQ)"' >> $@
> -	echo '	$(RM) "$(instdir_SQ)/Error.pm"' >> $@
> +	echo '	mkdir -p "$$(DESTDIR)$(instdir_SQ)"' >> $@
> +	echo '	$(RM) "$$(DESTDIR)$(instdir_SQ)/Git.pm"; cp Git.pm "$$(DESTDIR)$(instdir_SQ)"' >> $@
> +	echo '	$(RM) "$$(DESTDIR)$(instdir_SQ)/Error.pm"' >> $@
>  	'$(PERL_PATH_SQ)' -MError -e 'exit($$Error::VERSION < 0.15009)' || \
> -	echo '	cp private-Error.pm "$(instdir_SQ)/Error.pm"' >> $@
> +	echo '	cp private-Error.pm "$$(DESTDIR)$(instdir_SQ)/Error.pm"' >> $@
>  	echo instlibdir: >> $@
>  	echo '	echo $(instdir_SQ)' >> $@
>  else

I have 2 perl environments available to me on the system (at home now so can't dig further). Both can pretty stripped which can make thing "challenging" it's possible ExtUtils::MakeMaker doesn't even exist.

Please everyone who is looking at this thread let it sleep for 24h and I shall test further/revive it tomorrow.

Many thanks CraigT

-- 
c^ [c%5e]

Learn first whatever hardship you may have to endure is but temporary
Craig Taylor· Sep 22, 2009, 11:13 UTC · re: Junio C Hamano · lore

Re: install does not obey DESTDIR or --prefix for perl modules

On Mon, Sep 21, 2009 at 12:44:05PM -0700, Junio C Hamano wrote:
Show 37 quoted lines
> Craig Taylor <c@gryning.com> writes:
> 
> > Exactly as you describe here, different paths but same goal.
> > All binaries follow the DESTDIR path except the perl modules.
> >
> > To register this as a bug do I need to do more than send this email?
> 
> Do you use NO_PERL_MAKEMAKER in your build?
> 
> If not, we need to summon an expert on ExtUtils::MakeMaker to look into
> this issue, but if you do, perhaps you can try this patch and report how
> well it works for you.
> 
> ---
>  perl/Makefile |    8 ++++----
>  1 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/perl/Makefile b/perl/Makefile
> index e3dd1a5..4ab21d6 100644
> --- a/perl/Makefile
> +++ b/perl/Makefile
> @@ -29,11 +29,11 @@ $(makfile): ../GIT-CFLAGS Makefile
>  	'$(PERL_PATH_SQ)' -MError -e 'exit($$Error::VERSION < 0.15009)' || \
>  	echo '	cp private-Error.pm blib/lib/Error.pm' >> $@
>  	echo install: >> $@
> -	echo '	mkdir -p "$(instdir_SQ)"' >> $@
> -	echo '	$(RM) "$(instdir_SQ)/Git.pm"; cp Git.pm "$(instdir_SQ)"' >> $@
> -	echo '	$(RM) "$(instdir_SQ)/Error.pm"' >> $@
> +	echo '	mkdir -p "$$(DESTDIR)$(instdir_SQ)"' >> $@
> +	echo '	$(RM) "$$(DESTDIR)$(instdir_SQ)/Git.pm"; cp Git.pm "$$(DESTDIR)$(instdir_SQ)"' >> $@
> +	echo '	$(RM) "$$(DESTDIR)$(instdir_SQ)/Error.pm"' >> $@
>  	'$(PERL_PATH_SQ)' -MError -e 'exit($$Error::VERSION < 0.15009)' || \
> -	echo '	cp private-Error.pm "$(instdir_SQ)/Error.pm"' >> $@
> +	echo '	cp private-Error.pm "$$(DESTDIR)$(instdir_SQ)/Error.pm"' >> $@
>  	echo instlibdir: >> $@
>  	echo '	echo $(instdir_SQ)' >> $@
>  else
ExtUtils::MakeMaker is available and I am using it.
The problem seems to be in the generated perl.mak.
On line 1652 of my git-1.6.4.3/Makefile
   $(MAKE) -C perl prefix='$(prefix_SQ)' DESTDIR='$(DESTDIR_SQ)' install

I see that it is passing DESTDIR to the makefile in git-1.6.4.3/perl. However, the DESTDIR variable is not seemingly included in perl/perl.mak for use by the perl/Makefile. It is all absolute paths which I think is the main cause.

I have manually manipulated the perl.mak file and install works fine. I'm just updating my build area to 1.6.4.4 and then will try something more permanent. However I am moving outside my knowldge of 'make' now so may request assistance later ;)

CraigT
-- 
c^ [c%5e]

Never talk about your knowledge, it might make it disappear.
Craig Taylor· Sep 22, 2009, 11:31 UTC · re: Junio C Hamano · lore

Re: install does not obey DESTDIR or --prefix for perl modules

On Mon, Sep 21, 2009 at 12:44:05PM -0700, Junio C Hamano wrote:
Show 37 quoted lines
> Craig Taylor <c@gryning.com> writes:
> 
> > Exactly as you describe here, different paths but same goal.
> > All binaries follow the DESTDIR path except the perl modules.
> >
> > To register this as a bug do I need to do more than send this email?
> 
> Do you use NO_PERL_MAKEMAKER in your build?
> 
> If not, we need to summon an expert on ExtUtils::MakeMaker to look into
> this issue, but if you do, perhaps you can try this patch and report how
> well it works for you.
> 
> ---
>  perl/Makefile |    8 ++++----
>  1 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/perl/Makefile b/perl/Makefile
> index e3dd1a5..4ab21d6 100644
> --- a/perl/Makefile
> +++ b/perl/Makefile
> @@ -29,11 +29,11 @@ $(makfile): ../GIT-CFLAGS Makefile
>  	'$(PERL_PATH_SQ)' -MError -e 'exit($$Error::VERSION < 0.15009)' || \
>  	echo '	cp private-Error.pm blib/lib/Error.pm' >> $@
>  	echo install: >> $@
> -	echo '	mkdir -p "$(instdir_SQ)"' >> $@
> -	echo '	$(RM) "$(instdir_SQ)/Git.pm"; cp Git.pm "$(instdir_SQ)"' >> $@
> -	echo '	$(RM) "$(instdir_SQ)/Error.pm"' >> $@
> +	echo '	mkdir -p "$$(DESTDIR)$(instdir_SQ)"' >> $@
> +	echo '	$(RM) "$$(DESTDIR)$(instdir_SQ)/Git.pm"; cp Git.pm "$$(DESTDIR)$(instdir_SQ)"' >> $@
> +	echo '	$(RM) "$$(DESTDIR)$(instdir_SQ)/Error.pm"' >> $@
>  	'$(PERL_PATH_SQ)' -MError -e 'exit($$Error::VERSION < 0.15009)' || \
> -	echo '	cp private-Error.pm "$(instdir_SQ)/Error.pm"' >> $@
> +	echo '	cp private-Error.pm "$$(DESTDIR)$(instdir_SQ)/Error.pm"' >> $@
>  	echo instlibdir: >> $@
>  	echo '	echo $(instdir_SQ)' >> $@
>  else

Further to my last email, modifying the perl.mak file as below resolves the problem for me to a satisfactory level. I will have to leave a more permanent solution to someone more familar with make/makemaker.

--- git-1.6.4.4/perl/perl.mak_to20090922 2009-09-22 12:07:18.000000000 +0100 +++ git-1.6.4.4/perl/perl.mak 2009-09-22 12:21:17.791887000 +0100

@@ -57,7 +57,7 @@
 INST_LIB = blib/lib
 INST_ARCHLIB = blib/arch
 INST_SCRIPT = blib/script
-PREFIX = /usr/local/git-1.6.4.4
+PREFIX = $(DESTDIR)/usr/local/git-1.6.4.4
 INSTALLDIRS = site
 INSTALLPRIVLIB = $(PREFIX)/lib/5.6.1
 INSTALLARCHLIB = $(PREFIX)/lib/5.6.1/sun4-solaris

Many thanks...
CraigT
-- 
c^ [c%5e]

Failure is natural.
Brandon Casey· Sep 22, 2009, 14:52 UTC · re: Craig Taylor · lore

Re: install does not obey DESTDIR or --prefix for perl modules

Craig Taylor wrote:
Show 55 quoted lines
> On Mon, Sep 21, 2009 at 12:44:05PM -0700, Junio C Hamano wrote:
>> Craig Taylor <c@gryning.com> writes:
>>
>>> Exactly as you describe here, different paths but same goal.
>>> All binaries follow the DESTDIR path except the perl modules.
>>>
>>> To register this as a bug do I need to do more than send this email?
>> Do you use NO_PERL_MAKEMAKER in your build?
>>
>> If not, we need to summon an expert on ExtUtils::MakeMaker to look into
>> this issue, but if you do, perhaps you can try this patch and report how
>> well it works for you.
>>
>> ---
>>  perl/Makefile |    8 ++++----
>>  1 files changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/perl/Makefile b/perl/Makefile
>> index e3dd1a5..4ab21d6 100644
>> --- a/perl/Makefile
>> +++ b/perl/Makefile
>> @@ -29,11 +29,11 @@ $(makfile): ../GIT-CFLAGS Makefile
>>  	'$(PERL_PATH_SQ)' -MError -e 'exit($$Error::VERSION < 0.15009)' || \
>>  	echo '	cp private-Error.pm blib/lib/Error.pm' >> $@
>>  	echo install: >> $@
>> -	echo '	mkdir -p "$(instdir_SQ)"' >> $@
>> -	echo '	$(RM) "$(instdir_SQ)/Git.pm"; cp Git.pm "$(instdir_SQ)"' >> $@
>> -	echo '	$(RM) "$(instdir_SQ)/Error.pm"' >> $@
>> +	echo '	mkdir -p "$$(DESTDIR)$(instdir_SQ)"' >> $@
>> +	echo '	$(RM) "$$(DESTDIR)$(instdir_SQ)/Git.pm"; cp Git.pm "$$(DESTDIR)$(instdir_SQ)"' >> $@
>> +	echo '	$(RM) "$$(DESTDIR)$(instdir_SQ)/Error.pm"' >> $@
>>  	'$(PERL_PATH_SQ)' -MError -e 'exit($$Error::VERSION < 0.15009)' || \
>> -	echo '	cp private-Error.pm "$(instdir_SQ)/Error.pm"' >> $@
>> +	echo '	cp private-Error.pm "$$(DESTDIR)$(instdir_SQ)/Error.pm"' >> $@
>>  	echo instlibdir: >> $@
>>  	echo '	echo $(instdir_SQ)' >> $@
>>  else
> 
> 
> Further to my last email, modifying the perl.mak file as below resolves
> the problem for me to a satisfactory level.
> I will have to leave a more permanent solution to someone more familar with
> make/makemaker.
> 
> --- git-1.6.4.4/perl/perl.mak_to20090922        2009-09-22 12:07:18.000000000 +0100
> +++ git-1.6.4.4/perl/perl.mak   2009-09-22 12:21:17.791887000 +0100
> @@ -57,7 +57,7 @@
>  INST_LIB = blib/lib
>  INST_ARCHLIB = blib/arch
>  INST_SCRIPT = blib/script
> -PREFIX = /usr/local/git-1.6.4.4
> +PREFIX = $(DESTDIR)/usr/local/git-1.6.4.4
>  INSTALLDIRS = site
>  INSTALLPRIVLIB = $(PREFIX)/lib/5.6.1
>  INSTALLARCHLIB = $(PREFIX)/lib/5.6.1/sun4-solaris

I have not been able to reproduce your problem on Solaris. The DESTDIR feature is working for me.

Possibly it is related to the version of MakeMaker? I am using version 6.17 (Revision: 1.133) along with Perl 5.8.4 on Solaris 10 x86. The MakeMaker version should be in the header at the top of the perl.mak file.

The perl.mak snippet that you provided above looks different than mine. In mine, in the vicinity of the 'PREFIX = ' line I also have a 'DESTDIR = ' line. The right hand side of 'DESTDIR = ' is empty even when I specify a DESTDIR on the make command line.

Here's a snippet from my perl.mak file:
   DESTDIR =
   PREFIX = /usr/local/git-1.6.4.4
   PERLPREFIX = $(PREFIX)
   SITEPREFIX = $(PREFIX)
   VENDORPREFIX = $(PREFIX)
   INSTALLPRIVLIB = $(PERLPREFIX)/lib
   DESTINSTALLPRIVLIB = $(DESTDIR)$(INSTALLPRIVLIB)
   INSTALLSITELIB = $(SITEPREFIX)/lib/site_perl
   DESTINSTALLSITELIB = $(DESTDIR)$(INSTALLSITELIB)
   INSTALLVENDORLIB = $(VENDORPREFIX)/lib
   DESTINSTALLVENDORLIB = $(DESTDIR)$(INSTALLVENDORLIB)
   INSTALLARCHLIB = $(PERLPREFIX)/lib/i86pc-solaris-64int
   DESTINSTALLARCHLIB = $(DESTDIR)$(INSTALLARCHLIB)

Notice the variable assignments that begin with 'DEST'. Does your perl.mak file have those? If not, then it seems MakeMaker is not producing them for some reason.

Did you try Junio's patch? If the version of MakeMaker is the problem, then perhaps setting NO_PERL_MAKER=1 on the make command line along with Junio's patch is the best way forward for you.

-brandon
Brandon Casey· Sep 22, 2009, 15:21 UTC · re: Brandon Casey · lore

Re: install does not obey DESTDIR or --prefix for perl modules

Brandon Casey wrote:
> Did you try Junio's patch?  If the version of MakeMaker is the problem,
> then perhaps setting NO_PERL_MAKER=1 on the make command line along
                       ^^^^^^^^^^^^^
Should be NO_PERL_MAKEMAKER=1
Junio C Hamano· Sep 22, 2009, 16:29 UTC · re: Brandon Casey · lore

Re: install does not obey DESTDIR or --prefix for perl modules

Brandon Casey <brandon.casey.ctr@nrlssc.navy.mil> writes:
> Possibly it is related to the version of MakeMaker?  I am using version
> 6.17 (Revision: 1.133) along with Perl 5.8.4 on Solaris 10 x86.  The
> MakeMaker version should be in the header at the top of the perl.mak
> file.

I think that is it. DESTDIR support in MakeMaker seems to be lacking in medieval versions of Perl. It appears that it started being usable at around its 6.11 (and 6.17 you have is fine).

    http://kobesearch.cpan.org/htdocs/ExtUtils-MakeMaker/Changes.html
    https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6131#c7
Brandon Casey· Sep 24, 2009, 18:02 UTC · re: Junio C Hamano · lore

[PATCH] perl/Makefile.PL: detect MakeMaker versions incompatible with DESTDIR

From: Brandon Casey <drafnel@gmail.com>

It appears that ExtUtils::MakeMaker versions older than 6.11 do not implement the DESTDIR mechanism. So add a test to the generated perl.mak to detect when DESTDIR is used along with a too old ExtUtils::MakeMaker and abort with a message suggesting the use of NO_PERL_MAKEMAKER.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
---
Junio C Hamano wrote:
Show 13 quoted lines
> Brandon Casey <brandon.casey.ctr@nrlssc.navy.mil> writes:
> 
>> Possibly it is related to the version of MakeMaker?  I am using version
>> 6.17 (Revision: 1.133) along with Perl 5.8.4 on Solaris 10 x86.  The
>> MakeMaker version should be in the header at the top of the perl.mak
>> file.
> 
> I think that is it.  DESTDIR support in MakeMaker seems to be lacking in
> medieval versions of Perl.  It appears that it started being usable at
> around its 6.11 (and 6.17 you have is fine).
> 
>     http://kobesearch.cpan.org/htdocs/ExtUtils-MakeMaker/Changes.html
>     https://issues.apache.org/SpamAssassin/show_bug.cgi?id=6131#c7
How about something like this?

Seems to work correctly for me on IRIX 6.5 and Solaris 7 with ExtUtils::MakeMaker 6.03.

-brandon
 perl/Makefile.PL |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/perl/Makefile.PL b/perl/Makefile.PL
index 320253e..8974015 100644
--- a/perl/Makefile.PL
+++ b/perl/Makefile.PL
@@ -5,6 +5,14 @@ sub MY::postamble {
 instlibdir:
 	@echo '$(INSTALLSITELIB)'
 
+ifneq (,$(DESTDIR))
+ifeq (1,$(shell expr '$(MM_VERSION)' '<' 6.11))
+$(error ExtUtils::MakeMaker version "$(MM_VERSION)" is older than 6.11 and so \
+	is likely incompatible with the DESTDIR mechanism.  Try setting \
+	NO_PERL_MAKEMAKER=1 instead)
+endif
+endif
+
 MAKE_FRAG
 }
 
-- 
1.6.4.3
Brandon Casey· Sep 24, 2009, 18:21 UTC · re: Brandon Casey · lore

[PATCH v2] perl/Makefile.PL: detect MakeMaker versions incompatible with DESTDIR

From: Brandon Casey <drafnel@gmail.com>

It appears that ExtUtils::MakeMaker versions older than 6.11 do not implement the DESTDIR mechanism. So add a test to the generated perl.mak to detect when DESTDIR is used along with a too old ExtUtils::MakeMaker and abort with a message suggesting the use of NO_PERL_MAKEMAKER.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
---

This just reverses the logic in the test on $(MM_VERSION) so that the test will also fail if MM_VERSION is unset. Who knows if ancient versions set it. Sorry for the quick v2.

-brandon
 perl/Makefile.PL |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/perl/Makefile.PL b/perl/Makefile.PL
index 320253e..0b9deca 100644
--- a/perl/Makefile.PL
+++ b/perl/Makefile.PL
@@ -5,6 +5,14 @@ sub MY::postamble {
 instlibdir:
 	@echo '$(INSTALLSITELIB)'
 
+ifneq (,$(DESTDIR))
+ifeq (0,$(shell expr '$(MM_VERSION)' '>' 6.10))
+$(error ExtUtils::MakeMaker version "$(MM_VERSION)" is older than 6.11 and so \
+	is likely incompatible with the DESTDIR mechanism.  Try setting \
+	NO_PERL_MAKEMAKER=1 instead)
+endif
+endif
+
 MAKE_FRAG
 }
 
-- 
1.6.4.3
Johannes Sixt· Oct 8, 2009, 13:21 UTC · re: Brandon Casey · lore

Re: [PATCH v2] perl/Makefile.PL: detect MakeMaker versions incompatible with DESTDIR

Brandon Casey schrieb:
Show 31 quoted lines
> From: Brandon Casey <drafnel@gmail.com>
> 
> It appears that ExtUtils::MakeMaker versions older than 6.11 do not
> implement the DESTDIR mechanism.  So add a test to the generated perl.mak
> to detect when DESTDIR is used along with a too old ExtUtils::MakeMaker and
> abort with a message suggesting the use of NO_PERL_MAKEMAKER.
> 
> Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
> ---
> 
> 
> This just reverses the logic in the test on $(MM_VERSION) so that the test
> will also fail if MM_VERSION is unset.  Who knows if ancient versions set
> it.  Sorry for the quick v2.
> 
> -brandon
> 
> 
>  perl/Makefile.PL |    8 ++++++++
>  1 files changed, 8 insertions(+), 0 deletions(-)
> 
> diff --git a/perl/Makefile.PL b/perl/Makefile.PL
> index 320253e..0b9deca 100644
> --- a/perl/Makefile.PL
> +++ b/perl/Makefile.PL
> @@ -5,6 +5,14 @@ sub MY::postamble {
>  instlibdir:
>  	@echo '$(INSTALLSITELIB)'
>  
> +ifneq (,$(DESTDIR))
> +ifeq (0,$(shell expr '$(MM_VERSION)' '>' 6.10))

I don't think the test works as intended, because 6.2 *is* greater than 6.10 (aka 6.1).

(Found while staring at git diff v1.6.5-rc2..v1.6.5-rc3 in a spare minute.)
Show 8 quoted lines
> +$(error ExtUtils::MakeMaker version "$(MM_VERSION)" is older than 6.11 and so \
> +	is likely incompatible with the DESTDIR mechanism.  Try setting \
> +	NO_PERL_MAKEMAKER=1 instead)
> +endif
> +endif
> +
>  MAKE_FRAG
>  }
-- Hannes
Brandon Casey· Oct 8, 2009, 13:34 UTC · re: Johannes Sixt · lore

Re: [PATCH v2] perl/Makefile.PL: detect MakeMaker versions incompatible with DESTDIR

Johannes Sixt wrote:
Show 35 quoted lines
> Brandon Casey schrieb:
>> From: Brandon Casey <drafnel@gmail.com>
>>
>> It appears that ExtUtils::MakeMaker versions older than 6.11 do not
>> implement the DESTDIR mechanism.  So add a test to the generated perl.mak
>> to detect when DESTDIR is used along with a too old ExtUtils::MakeMaker and
>> abort with a message suggesting the use of NO_PERL_MAKEMAKER.
>>
>> Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
>> ---
>>
>>
>> This just reverses the logic in the test on $(MM_VERSION) so that the test
>> will also fail if MM_VERSION is unset.  Who knows if ancient versions set
>> it.  Sorry for the quick v2.
>>
>> -brandon
>>
>>
>>  perl/Makefile.PL |    8 ++++++++
>>  1 files changed, 8 insertions(+), 0 deletions(-)
>>
>> diff --git a/perl/Makefile.PL b/perl/Makefile.PL
>> index 320253e..0b9deca 100644
>> --- a/perl/Makefile.PL
>> +++ b/perl/Makefile.PL
>> @@ -5,6 +5,14 @@ sub MY::postamble {
>>  instlibdir:
>>  	@echo '$(INSTALLSITELIB)'
>>  
>> +ifneq (,$(DESTDIR))
>> +ifeq (0,$(shell expr '$(MM_VERSION)' '>' 6.10))
> 
> I don't think the test works as intended, because 6.2 *is* greater than
> 6.10 (aka 6.1).
Hmm... I think you're right.
-brandon
Brandon Casey· Oct 8, 2009, 16:58 UTC · re: Brandon Casey · lore

Re: [PATCH v2] perl/Makefile.PL: detect MakeMaker versions incompatible with DESTDIR

Brandon Casey wrote:
> Johannes Sixt wrote:
>> Brandon Casey schrieb:
Show 14 quoted lines
>>> diff --git a/perl/Makefile.PL b/perl/Makefile.PL
>>> index 320253e..0b9deca 100644
>>> --- a/perl/Makefile.PL
>>> +++ b/perl/Makefile.PL
>>> @@ -5,6 +5,14 @@ sub MY::postamble {
>>>  instlibdir:
>>>  	@echo '$(INSTALLSITELIB)'
>>>  
>>> +ifneq (,$(DESTDIR))
>>> +ifeq (0,$(shell expr '$(MM_VERSION)' '>' 6.10))
>> I don't think the test works as intended, because 6.2 *is* greater than
>> 6.10 (aka 6.1).
> 
> Hmm... I think you're right.

I think we're safe. Looks like the MakeMaker folks have always used two digits for the minor number. So version 6.2 was written like 6.02.

Here's their repo:
   git://github.com/schwern/extutils-makemaker.git
git log -p -- lib/ExtUtils/MakeMaker.pm | grep -- '$VERSION = ' | less

I didn't search exhaustively, but I think all of 6.X has two digit minor numbers, which means all versions should compare correctly since 5.X will always compare less than 6.X and 7.X will be greater, etc.

-brandon
c^· Sep 22, 2009, 11:55 UTC · re: Junio C Hamano · lore

Re: install does not obey DESTDIR or --prefix for perl modules

On Mon, Sep 21, 2009 at 12:44:05PM -0700, Junio C Hamano wrote:
Show 37 quoted lines
> Craig Taylor <c@gryning.com> writes:
> 
> > Exactly as you describe here, different paths but same goal.
> > All binaries follow the DESTDIR path except the perl modules.
> >
> > To register this as a bug do I need to do more than send this email?
> 
> Do you use NO_PERL_MAKEMAKER in your build?
> 
> If not, we need to summon an expert on ExtUtils::MakeMaker to look into
> this issue, but if you do, perhaps you can try this patch and report how
> well it works for you.
> 
> ---
>  perl/Makefile |    8 ++++----
>  1 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/perl/Makefile b/perl/Makefile
> index e3dd1a5..4ab21d6 100644
> --- a/perl/Makefile
> +++ b/perl/Makefile
> @@ -29,11 +29,11 @@ $(makfile): ../GIT-CFLAGS Makefile
>  	'$(PERL_PATH_SQ)' -MError -e 'exit($$Error::VERSION < 0.15009)' || \
>  	echo '	cp private-Error.pm blib/lib/Error.pm' >> $@
>  	echo install: >> $@
> -	echo '	mkdir -p "$(instdir_SQ)"' >> $@
> -	echo '	$(RM) "$(instdir_SQ)/Git.pm"; cp Git.pm "$(instdir_SQ)"' >> $@
> -	echo '	$(RM) "$(instdir_SQ)/Error.pm"' >> $@
> +	echo '	mkdir -p "$$(DESTDIR)$(instdir_SQ)"' >> $@
> +	echo '	$(RM) "$$(DESTDIR)$(instdir_SQ)/Git.pm"; cp Git.pm "$$(DESTDIR)$(instdir_SQ)"' >> $@
> +	echo '	$(RM) "$$(DESTDIR)$(instdir_SQ)/Error.pm"' >> $@
>  	'$(PERL_PATH_SQ)' -MError -e 'exit($$Error::VERSION < 0.15009)' || \
> -	echo '	cp private-Error.pm "$(instdir_SQ)/Error.pm"' >> $@
> +	echo '	cp private-Error.pm "$$(DESTDIR)$(instdir_SQ)/Error.pm"' >> $@
>  	echo instlibdir: >> $@
>  	echo '	echo $(instdir_SQ)' >> $@
>  else

Frustratingly the last change forces the lib referenced in the perl scripts to include the DESTDIR. I will work around this for now, but would apprieciate it if someone more familair could fix for the future.

CraigT
-- 
c^ [c%5e]

Failure is natural.
Brandon Casey· Sep 22, 2009, 15:16 UTC · re: c^ · lore

Re: install does not obey DESTDIR or --prefix for perl modules

c^ wrote:
Show 42 quoted lines
> On Mon, Sep 21, 2009 at 12:44:05PM -0700, Junio C Hamano wrote:
>> Craig Taylor <c@gryning.com> writes:
>>
>>> Exactly as you describe here, different paths but same goal.
>>> All binaries follow the DESTDIR path except the perl modules.
>>>
>>> To register this as a bug do I need to do more than send this email?
>> Do you use NO_PERL_MAKEMAKER in your build?
>>
>> If not, we need to summon an expert on ExtUtils::MakeMaker to look into
>> this issue, but if you do, perhaps you can try this patch and report how
>> well it works for you.
>>
>> ---
>>  perl/Makefile |    8 ++++----
>>  1 files changed, 4 insertions(+), 4 deletions(-)
>>
>> diff --git a/perl/Makefile b/perl/Makefile
>> index e3dd1a5..4ab21d6 100644
>> --- a/perl/Makefile
>> +++ b/perl/Makefile
>> @@ -29,11 +29,11 @@ $(makfile): ../GIT-CFLAGS Makefile
>>  	'$(PERL_PATH_SQ)' -MError -e 'exit($$Error::VERSION < 0.15009)' || \
>>  	echo '	cp private-Error.pm blib/lib/Error.pm' >> $@
>>  	echo install: >> $@
>> -	echo '	mkdir -p "$(instdir_SQ)"' >> $@
>> -	echo '	$(RM) "$(instdir_SQ)/Git.pm"; cp Git.pm "$(instdir_SQ)"' >> $@
>> -	echo '	$(RM) "$(instdir_SQ)/Error.pm"' >> $@
>> +	echo '	mkdir -p "$$(DESTDIR)$(instdir_SQ)"' >> $@
>> +	echo '	$(RM) "$$(DESTDIR)$(instdir_SQ)/Git.pm"; cp Git.pm "$$(DESTDIR)$(instdir_SQ)"' >> $@
>> +	echo '	$(RM) "$$(DESTDIR)$(instdir_SQ)/Error.pm"' >> $@
>>  	'$(PERL_PATH_SQ)' -MError -e 'exit($$Error::VERSION < 0.15009)' || \
>> -	echo '	cp private-Error.pm "$(instdir_SQ)/Error.pm"' >> $@
>> +	echo '	cp private-Error.pm "$$(DESTDIR)$(instdir_SQ)/Error.pm"' >> $@
>>  	echo instlibdir: >> $@
>>  	echo '	echo $(instdir_SQ)' >> $@
>>  else
> 
> Frustratingly the last change forces the lib referenced in the perl
> scripts to include the DESTDIR.
> I will work around this for now, but would apprieciate it if someone
> more familair could fix for the future.

Craig, you're referring to _your_ last change where you hand modified the perl.mak file so that the 'PREFIX =' line contained $(DESTDIR) right? And not something in the above patch?

Junio, your patch looks good and seems to work for me.
-brandon
ps.  Craig, it's best to hit 'Reply-All' when replying so that everyone is kept
     in the cc list.  People often filter their mail based on the 'To:' and 'cc:'
     fields and are more likely to notice mail that includes their address in one
     of those fields.  I added Junio back to this reply.

← back to recent threads