threads / discuss / 4687

Quick merge status updates.

Subject: Quick merge status updates.

## tl;dr

21 messages between Jun 28, 2006 and Jul 8, 2006.

replies: 20people: 5as markdown or json

Junio C Hamano· Jun 28, 2006, 00:23 UTC · lore

I'm planning to do 1.4.1 soonish from what's currently in "next" (fixes already in "master" plus format-patch updates and some more tests). I am waiting for a confirmation that Johannes's cvsimport fix posted earlier on the list does work, or maybe Martin would come up with an alternative. I think then we are good for a release.

Immediately after 1.4.1 happens, I would like to pull in "Git.xs/Git.pm" series by Pasky into "next". After that settles I'd pull in the diff options rewrite by Timo.

For some time, "pu" was left in the state that does not to pass the testsuite, but I've fixed what's minimally needed (the breakage was mostly from the diff options rewrite). People who regularly follow "next" on platforms other than i386 or x86-64 Linux might want to try out tonight's "pu" to make sure "Git.xs/Git.pm" series works on their box before it hits "next". Breakage there would stop your "git pull" working, so this is somewhat important.

Thanks.
Pavel Roskin· Jun 28, 2006, 05:04 UTC · re: Junio C Hamano · lore

Re: Quick merge status updates.

On Tue, 2006-06-27 at 17:23 -0700, Junio C Hamano wrote:
Show 8 quoted lines
> For some time, "pu" was left in the state that does not to pass
> the testsuite, but I've fixed what's minimally needed (the
> breakage was mostly from the diff options rewrite).  People who
> regularly follow "next" on platforms other than i386 or x86-64
> Linux might want to try out tonight's "pu" to make sure
> "Git.xs/Git.pm" series works on their box before it hits "next".
> Breakage there would stop your "git pull" working, so this is
> somewhat important.

PowerPC 32-bit, G3, Fedora Core 5, gcc 4.1.1, perl 5.8.8, pu branch (f5d33e0b4eaa4083b455118a7be473defb61f137)

Warnings:
quote.c: In function 'sq_quote_buf':
quote.c:34: warning: value computed is not used
quote.c:37: warning: value computed is not used
combine-diff.c: In function 'diff_tree_combined':
combine-diff.c:844: warning: assignment makes integer from pointer
without a cast
In file included
from /usr/lib/perl5/5.8.8/ppc-linux-thread-multi/CORE/perl.h:756,
                 from Git.xs:15:
/usr/lib/perl5/5.8.8/ppc-linux-thread-multi/CORE/embed.h:4195:1:
warning: "die" redefined
Git.xs:11:1: warning: this is the location of the previous definition

I'm very concerned about the combine-diff.c warning. The warning seems to be legitimate and I don't see an obvious fix. The offending line comes from 3969cf7db1a13a78f3b7a36d8c1084bbe0a53459 ("Fix some more diff options changes"):

show_log_first = rev->loginfo;
The testsuite passes, but "git-pull" is indeed broken:
$ git-pull
Can't locate Git.pm in @INC (@INC
contains: /usr/lib/perl5/site_perl/5.8.8/ppc-linux-thread-multi /usr/lib/perl5/site_perl/5.8.7/ppc-linux-thread-multi /usr/lib/perl5/site_perl/5.8.6/ppc-linux-thread-multi /usr/lib/perl5/site_perl/5.8.5/ppc-linux-thread-multi /usr/lib/perl5/site_perl/5.8.4/ppc-linux-thread-multi /usr/lib/perl5/site_perl/5.8.3/ppc-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl/5.8.7 /usr/lib/perl5/site_perl/5.8.6 /usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl/5.8.4 /usr/lib/perl5/site_perl/5.8.3 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.8/ppc-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.7/ppc-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.6/ppc-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.5/ppc-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.4/ppc-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.3/ppc-linux-thread-multi /usr/lib/perl5/vend
 or_perl/5.8.8 /usr/lib/perl5/vendor_perl/5.8.7 /usr/lib/perl5/vendor_perl/5.8.6 /usr/lib/perl5/vendor_perl/5.8.5 /usr/lib/perl5/vendor_perl/5.8.4 /usr/lib/perl5/vendor_perl/5.8.3 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.8/ppc-linux-thread-multi /usr/lib/perl5/5.8.8 .) at /home/proski/bin/git-fmt-merge-msg line 10.
BEGIN failed--compilation aborted at /home/proski/bin/git-fmt-merge-msg
line 10.

Git.pm is installed into /home/proski/lib/perl5/site_perl/5.8.8/ppc-linux-thread-multi/

Speaking of x86_64 (also Fedora Core 5, gcc 4.1.1, perl 5.8.8), git doesn't even build:

In file included
from /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE/perl.h:756,
                 from Git.xs:15:
/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE/embed.h:4195:1:
warning: "die" redefined
Git.xs:11:1: warning: this is the location of the previous definition
Running Mkbootstrap for Git ()
chmod 644 Git.bs
rm -f blib/arch/auto/Git/Git.so
gcc  -shared Git.o  -o blib/arch/auto/Git/Git.so ../libgit.a    \
   -lz -lcrypto         \
  
/usr/bin/ld: ../libgit.a(exec_cmd.o): relocation R_X86_64_32 against `a
local symbol' can not be used when making a shared object; recompile
with -fPIC
../libgit.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[1]: *** [blib/arch/auto/Git/Git.so] Error 1
make[1]: Leaving directory `/usr/local/src/git/perl'
make: *** [all] Error 2

The build succeeds if I use following: make CFLAGS='-g -O2 -Wall -fPIC'

The testsuite passes. git-pull is also broken with a similar error message. Git.pm is installed into /home/proski/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/

-- 
Regards,
Pavel Roskin
Junio C Hamano· Jun 28, 2006, 08:49 UTC · re: Pavel Roskin · lore

Re: Quick merge status updates.

Pavel Roskin <proski@gnu.org> writes:
> PowerPC 32-bit, G3, Fedora Core 5, gcc 4.1.1, perl 5.8.8, pu branch
> (f5d33e0b4eaa4083b455118a7be473defb61f137)
Thanks.
Show 5 quoted lines
> Warnings:
>
> quote.c: In function 'sq_quote_buf':
> quote.c:34: warning: value computed is not used
> quote.c:37: warning: value computed is not used
Thanks.  I think these are dealt with Jeff King's patches.
> combine-diff.c: In function 'diff_tree_combined':
> combine-diff.c:844: warning: assignment makes integer from pointer
> without a cast
Thanks.  The fix is actually simple (two paragraphs below).
Show 6 quoted lines
> In file included
> from /usr/lib/perl5/5.8.8/ppc-linux-thread-multi/CORE/perl.h:756,
>                  from Git.xs:15:
> /usr/lib/perl5/5.8.8/ppc-linux-thread-multi/CORE/embed.h:4195:1:
> warning: "die" redefined
> Git.xs:11:1: warning: this is the location of the previous definition
I've seen this but haven't looked into it.  Pasky?
Show 6 quoted lines
> I'm very concerned about the combine-diff.c warning.  The warning seems
> to be legitimate and I don't see an obvious fix.  The offending line
> comes from 3969cf7db1a13a78f3b7a36d8c1084bbe0a53459 ("Fix some more diff
> options changes"):
>
> show_log_first = rev->loginfo;

This is saying "If rev->loginfo is pointing at some string, we are going to show the log message first and then output from the diff machinery (otherwise rev->loginfo has NULL)". I'll rephrase it to read as:

	show_log_first = !!rev->loginfo;
Show 5 quoted lines
> The testsuite passes, but "git-pull" is indeed broken:
>
> $ git-pull
> Can't locate Git.pm in @INC (@INC
> contains: /usr/lib/perl5/site_perl/5.8.8/ppc-linux-thread-multi /usr/lib/perl5/site_perl/5.8.7/ppc-linux-thread-multi /usr/lib/perl5/site_perl/5.8.6/ppc-linux-thread-multi /usr/lib/perl5/site_perl/5.8.5/ppc-linux-thread-multi /usr/lib/perl5/site_perl/5.8.4/ppc-linux-thread-multi /usr/lib/perl5/site_perl/5.8.3/ppc-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl/5.8.7 /usr/lib/perl5/site_perl/5.8.6 /usr/lib/perl5/site_perl/5.8.5 /usr/lib/perl5/site_perl/5.8.4 /usr/lib/perl5/site_perl/5.8.3 /usr/lib/perl5/site_perl /usr/lib/perl5/vendor_perl/5.8.8/ppc-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.7/ppc-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.6/ppc-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.5/ppc-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.4/ppc-linux-thread-multi /usr/lib/perl5/vendor_perl/5.8.3/ppc-linux-thread-multi /usr/lib/perl5/ve
 ndor_perl/5.8.8 /usr/lib/perl5/vendor_perl/5.8.7 /usr/lib/perl5/vendor_perl/5.8.6 /usr/lib/perl5/vendor_perl/5.8.5 /usr/lib/perl5/vendor_perl/5.8.4 /usr/lib/perl5/vendor_perl/5.8.3 /usr/lib/perl5/vendor_perl /usr/lib/perl5/5.8.8/ppc-linux-thread-multi /usr/lib/perl5/5.8.8 .) at /home/proski/bin/git-fmt-merge-msg line 10.
Show 5 quoted lines
> BEGIN failed--compilation aborted at /home/proski/bin/git-fmt-merge-msg
> line 10.
>
> Git.pm is installed into
> /home/proski/lib/perl5/site_perl/5.8.8/ppc-linux-thread-multi/
The same problem with the last paragraph.
> Speaking of x86_64 (also Fedora Core 5, gcc 4.1.1, perl 5.8.8), git
> doesn't even build:
	$ git grep -A1 -e 'Define USE_PIC" pu:Makefile
in other words:
	USE_PIC=YesPlease make
> The testsuite passes.  git-pull is also broken with a similar error
> message.  Git.pm is installed into
> /home/proski/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi/

I suspect this is either FC perl-dev package is broken (I doubt it) or your installation procedure is pecurilar (much more likely). I pass the same set of prefix, bindir and friends to "make" and "make install" and do not see the problem.

Pavel Roskin· Jun 28, 2006, 10:05 UTC · re: Junio C Hamano · lore

Re: Quick merge status updates.

On Wed, 2006-06-28 at 01:49 -0700, Junio C Hamano wrote:
> I suspect this is either FC perl-dev package is broken (I doubt
> it) or your installation procedure is pecurilar (much more
> likely).  I pass the same set of prefix, bindir and friends to
> "make" and "make install" and do not see the problem.
I think my Perl 5.8.8 is "too new".  "man perlfunc" says about "use":

"Imports some semantics into the current package from the named module, generally by aliasing certain subroutine or variable names into your package. It is exactly equivalent to

      BEGIN { require Module; import Module LIST; }
except that Module must be a bareword."

I think the BEGIN block has priority over other statements. My solution was to put the @INC change in the BEGIN block as well.

This patch is working for me:
diff --git a/git-fmt-merge-msg.perl b/git-fmt-merge-msg.perl
index e8fad02..1b23fa1 100755
--- a/git-fmt-merge-msg.perl
+++ b/git-fmt-merge-msg.perl
@@ -5,7 +5,7 @@ #
 # Read .git/FETCH_HEAD and make a human readable merge message
 # by grouping branches and tags together to form a single line.
 
-unshift @INC, '@@INSTLIBDIR@@';
+BEGIN { unshift @INC, '@@INSTLIBDIR@@'; }
 use strict;
 use Git;
 use Error qw(:try);
-- 
Regards,
Pavel Roskin
Junio C Hamano· Jun 28, 2006, 10:14 UTC · re: Pavel Roskin · lore

Re: Quick merge status updates.

Pavel Roskin <proski@gnu.org> writes:
> I think my Perl 5.8.8 is "too new".  "man perlfunc" says about "use":
> ...
> I think the BEGIN block has priority over other statements.  My solution
> was to put the @INC change in the BEGIN block as well.

Actually I do use 5.8.8 and everything you quoted makes perfect sense, -- in fact now I do not know *why* it did _not_ break for me without the BEGIN {} block, especially I do not have any PERL* environment variable to point at anywhere under $HOME.

Thanks for the fix.
Petr Baudis· Jul 2, 2006, 20:49 UTC · re: Pavel Roskin · lore

Re: Quick merge status updates.

Dear diary, on Wed, Jun 28, 2006 at 12:05:03PM CEST, I got a letter where Pavel Roskin <proski@gnu.org> said that...

Show 18 quoted lines
> I think the BEGIN block has priority over other statements.  My solution
> was to put the @INC change in the BEGIN block as well.
> 
> This patch is working for me:
> 
> diff --git a/git-fmt-merge-msg.perl b/git-fmt-merge-msg.perl
> index e8fad02..1b23fa1 100755
> --- a/git-fmt-merge-msg.perl
> +++ b/git-fmt-merge-msg.perl
> @@ -5,7 +5,7 @@ #
>  # Read .git/FETCH_HEAD and make a human readable merge message
>  # by grouping branches and tags together to form a single line.
>  
> -unshift @INC, '@@INSTLIBDIR@@';
> +BEGIN { unshift @INC, '@@INSTLIBDIR@@'; }
>  use strict;
>  use Git;
>  use Error qw(:try);

I feel that it is time for another stupid question of mine - why can't you just use lib?

	use lib ('@@INSTLIBDIR@@');

Looks a lot better than some @INC unshifting, and it should be equivalent.

Let's pour in to the confusion:
The unshifting was introduced w/o BEGIN{} in
	From: Junio C Hamano <junkio@cox.net>
	Subject: Re: [PATCH 01/12] Introduce Git.pm (v4)
	Date:   Sat, 24 Jun 2006 04:57:31 -0700

but that patch is not in pu anymore while the description of the new patch implicitly refers to it, which made it all a bit confusing.

So the purpose of the original patch was to make it play nicely with $PERLLIB, but unshifting helps nothing, since:

	There's default @INC
	Perl spots PERLLIB and unshifts @INC
	We then unshift @INC too, taking precedence
So didn't the original patch rather want to do push?
	$ PERL5LIB=perl perl -le "BEGIN { unshift @INC, '/home/xpasky/lib/perl5/site_perl/5.8.8/i686-linux'; } use Git; print Git::hash_object('blob','Makefile');"
	17842a3657ae8e5b4fd3ddfeb69268a4b94cb97a
	$ PERL5LIB=perl perl -le "use Git; print Git::hash_object('blob','Makefile');"
	syntax error at perl/Git.pm line 44, near "h>"
(after inserting random junk to perl/Git.pm)
-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
Snow falling on Perl. White noise covering line noise.
Hides all the bugs too. -- J. Putnam
Junio C Hamano· Jul 2, 2006, 21:33 UTC · re: Petr Baudis · lore

Re: Quick merge status updates.

Petr Baudis <pasky@suse.cz> writes:
Show 6 quoted lines
> So the purpose of the original patch was to make it play nicely with
> $PERLLIB, but unshifting helps nothing, since:
>
> 	There's default @INC
> 	Perl spots PERLLIB and unshifts @INC
> 	We then unshift @INC too, taking precedence
I tried this:
 0. check out the branch that has the Perly git ("pu").  build
    and install normally to have a perfectly working version
    accessible on your usual $PATH.
 1. apply the patch [1] below to make it use "use lib" instead of
    "unshift".
 2. break perl/Git.pm being built to pretend we introduced a bug
    in the work in progress by applying the patch [2] below.
 3. without installing the broken Git.pm, run "make test", and
    see a test that uses "git pull" and needs to create a true
    merge succeed.  It tells me that everything including
    perl/Git.pm is GOOD, and I'd find the breakage only after
    installing and running the test again.

If you make the freshly built script to say "use lib" to use Git.pm and its friends from the installed location, it defeats the attempt by test-lib.sh to override it to test what we freshly built -- the use of "unshift @INC" is to work that around and is parallel to the way Python stuff works around the same problem.

[Footnotes] *1* "use lib" patch.

diff --git a/git-fmt-merge-msg.perl b/git-fmt-merge-msg.perl
index 1b23fa1..3a42950 100755
--- a/git-fmt-merge-msg.perl
+++ b/git-fmt-merge-msg.perl
@@ -5,7 +5,7 @@ #
 # Read .git/FETCH_HEAD and make a human readable merge message
 # by grouping branches and tags together to form a single line.
 
-BEGIN { unshift @INC, '@@INSTLIBDIR@@'; }
+use lib '@@INSTLIBDIR@@';
 use strict;
 use Git;
 use Error qw(:try);

*2* "break Git.pm" patch.

diff --git a/perl/Git.pm b/perl/Git.pm
index b4ee88b..34b4f12 100644
--- a/perl/Git.pm
+++ b/perl/Git.pm
@@ -6,6 +6,7 @@ Git - Perl interface to the Git version 
 
 
 package Git;
+syntax error -- kill me
 
 use strict;
 
Petr Baudis· Jul 2, 2006, 21:49 UTC · re: Junio C Hamano · lore

Re: Quick merge status updates.

Dear diary, on Sun, Jul 02, 2006 at 11:33:47PM CEST, I got a letter where Junio C Hamano <junkio@cox.net> said that...

Show 17 quoted lines
> I tried this:
> 
>  0. check out the branch that has the Perly git ("pu").  build
>     and install normally to have a perfectly working version
>     accessible on your usual $PATH.
> 
>  1. apply the patch [1] below to make it use "use lib" instead of
>     "unshift".
> 
>  2. break perl/Git.pm being built to pretend we introduced a bug
>     in the work in progress by applying the patch [2] below.
> 
>  3. without installing the broken Git.pm, run "make test", and
>     see a test that uses "git pull" and needs to create a true
>     merge succeed.  It tells me that everything including
>     perl/Git.pm is GOOD, and I'd find the breakage only after
>     installing and running the test again.

So, just to clarify and make sure we understand each other perfectly, you claim that when skipping (1), (3) _does_ FAIL for you? Because it really doesn't for me and I can't see how could it ever fail without installing the broken version first.

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
Snow falling on Perl. White noise covering line noise.
Hides all the bugs too. -- J. Putnam
Junio C Hamano· Jul 2, 2006, 22:50 UTC · re: Petr Baudis · lore

Re: Quick merge status updates.

Petr Baudis <pasky@suse.cz> writes:
Show 24 quoted lines
> Dear diary, on Sun, Jul 02, 2006 at 11:33:47PM CEST, I got a letter
> where Junio C Hamano <junkio@cox.net> said that...
>> I tried this:
>> 
>>  0. check out the branch that has the Perly git ("pu").  build
>>     and install normally to have a perfectly working version
>>     accessible on your usual $PATH.
>> 
>>  1. apply the patch [1] below to make it use "use lib" instead of
>>     "unshift".
>> 
>>  2. break perl/Git.pm being built to pretend we introduced a bug
>>     in the work in progress by applying the patch [2] below.
>> 
>>  3. without installing the broken Git.pm, run "make test", and
>>     see a test that uses "git pull" and needs to create a true
>>     merge succeed.  It tells me that everything including
>>     perl/Git.pm is GOOD, and I'd find the breakage only after
>>     installing and running the test again.
>
> So, just to clarify and make sure we understand each other perfectly,
> you claim that when skipping (1), (3) _does_ FAIL for you? Because it
> really doesn't for me and I can't see how could it ever fail without
> installing the broken version first.
Gaah.  You are right.

PERL5LIB does not seem to just do a push (and that was I thought why unshift was a way to defeat it) but do something more evil.

With this:
diff --git a/git-fmt-merge-msg.perl b/git-fmt-merge-msg.perl
index 1b23fa1..5d1ae44 100755
--- a/git-fmt-merge-msg.perl
+++ b/git-fmt-merge-msg.perl
@@ -6,9 +6,11 @@ # Read .git/FETCH_HEAD and make a human 
 # by grouping branches and tags together to form a single line.
 
 BEGIN { unshift @INC, '@@INSTLIBDIR@@'; }
+use lib '@@INSTLIBDIR@@';
 use strict;
 use Git;
 use Error qw(:try);
+print STDERR "\@INC is @INC\n";
 
 my $repo = Git->repository();
 
It spits this out: 

@INC is /home/junio/git-pu/lib/perl/5.8.8 /opt/git/git.git/t/../perl/blib/lib /opt/git/git.git/t/../perl/blib/arch/auto/Git /etc/perl /usr/local/lib/perl/5.8.8 /usr/local/share/perl/5.8.8 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl .

So "BEGIN { unshift }" is JUST AS WRONG as "use lib".

I thought we killed this showstopper and was hoping now the
series is mergeable to "next" but apparently not yet X-<.

Sigh....
Junio C Hamano· Jul 2, 2006, 23:49 UTC · re: Junio C Hamano · lore

Re: Quick merge status updates.

Junio C Hamano <junkio@cox.net> writes:
Show 9 quoted lines
> Gaah.  You are right.
>
> PERL5LIB does not seem to just do a push (and that was I thought
> why unshift was a way to defeat it) but do something more evil.
> ...
> I thought we killed this showstopper and was hoping now the
> series is mergeable to "next" but apparently not yet X-<.
>
> Sigh....
Yuck; that means we would need to have something evil like this.

-- >8 -- Perly Git: make sure we do test the freshly built one.

We could BEGIN { push @INC, '@@INSTLIBDIR@@'; } but that is not a good idea for normal execution. The would prevent a workaround for a user who is trying to override an old, faulty Git.pm installed on the system path with a newer version installed under $HOME/.

Signed-off-by: Junio C Hamano <junkio@cox.net>
---
diff --git a/git-fmt-merge-msg.perl b/git-fmt-merge-msg.perl
index 1b23fa1..a9805dd 100755
--- a/git-fmt-merge-msg.perl
+++ b/git-fmt-merge-msg.perl
@@ -5,7 +5,11 @@ #
 # Read .git/FETCH_HEAD and make a human readable merge message
 # by grouping branches and tags together to form a single line.
 
-BEGIN { unshift @INC, '@@INSTLIBDIR@@'; }
+BEGIN {
+	unless (exists $ENV{'RUNNING_GIT_TESTS'}) {
+		unshift @INC, '@@INSTLIBDIR@@';
+	}
+}
 use strict;
 use Git;
 use Error qw(:try);
diff --git a/git-mv.perl b/git-mv.perl
index a604896..5134b80 100755
--- a/git-mv.perl
+++ b/git-mv.perl
@@ -6,7 +6,11 @@ #
 # This file is licensed under the GPL v2, or a later version
 # at the discretion of Linus Torvalds.
 
-BEGIN { unshift @INC, '@@INSTLIBDIR@@'; }
+BEGIN {
+	unless (exists $ENV{'RUNNING_GIT_TESTS'}) {
+		unshift @INC, '@@INSTLIBDIR@@';
+	}
+}
 use warnings;
 use strict;
 use Getopt::Std;
diff --git a/t/test-lib.sh b/t/test-lib.sh
index fba0c51..298c6ca 100755
--- a/t/test-lib.sh
+++ b/t/test-lib.sh
@@ -206,8 +206,9 @@ PYTHON=`sed -e '1{
 	PYTHONPATH=$(pwd)/../compat
 	export PYTHONPATH
 }
+RUNNING_GIT_TESTS=YesWeAre
 PERL5LIB=$(pwd)/../perl/blib/lib:$(pwd)/../perl/blib/arch/auto/Git
-export PERL5LIB
+export PERL5LIB RUNNING_GIT_TESTS
 test -d ../templates/blt || {
 	error "You haven't built things yet, have you?"
 }
Linus Torvalds· Jul 3, 2006, 00:00 UTC · re: Junio C Hamano · lore

Re: Quick merge status updates.

On Sun, 2 Jul 2006, Junio C Hamano wrote:
> Yuck; that means we would need to have something evil like this.
That's just disgusting.
How about a _much_ simpler approach.
Just make it do
	BEGIN { push ENV{'GIT_PERL_EXEC_DIR'}; }
And then simply _require_ that the setup code sets up GIT_PERL_EXEC_DIR.

Which is usually simple enough to do. For git.c, something like this will do it, other places you can reach things through can have something similar.

		Linus
---
diff --git a/git.c b/git.c
index ca8961f..e8f25ee 100644
--- a/git.c
+++ b/git.c
@@ -294,6 +294,7 @@ int main(int argc, const char **argv, ch
 		prepend_to_path(exec_path, strlen(exec_path));
 	exec_path = git_exec_path();
 	prepend_to_path(exec_path, strlen(exec_path));
+	setenv(exec_path, "GIT_PERL_EXEC_DIR", 0);
 
 	while (1) {
 		/* See if it's an internal command */
Junio C Hamano· Jul 3, 2006, 00:06 UTC · re: Linus Torvalds · lore

Re: Quick merge status updates.

Linus Torvalds <torvalds@osdl.org> writes:
Show 12 quoted lines
> On Sun, 2 Jul 2006, Junio C Hamano wrote:
>> Yuck; that means we would need to have something evil like this.
>
> That's just disgusting.
>
> How about a _much_ simpler approach.
>
> Just make it do
>
> 	BEGIN { push ENV{'GIT_PERL_EXEC_DIR'}; }
>
> And then simply _require_ that the setup code sets up GIT_PERL_EXEC_DIR.

No, we are not mucking with /usr/bin but are talking about a directory for platform specific Perl libraries, which we need to ask Perl at build-time.

And the standard way to say that is to do:
	use lib '@@INSTLIBDIR@@';

but that always prepends the directory to the search path, and the ugly stuff is to allow test scripts to override it when needed.

Pavel Roskin· Jul 8, 2006, 07:36 UTC · re: Petr Baudis · lore

Re: Quick merge status updates.

On Sun, 2006-07-02 at 22:49 +0200, Petr Baudis wrote:
> Dear diary, on Wed, Jun 28, 2006 at 12:05:03PM CEST, I got a letter
> where Pavel Roskin <proski@gnu.org> said that...
Show 7 quoted lines
> I feel that it is time for another stupid question of mine - why can't
> you just use lib?
> 
> 	use lib ('@@INSTLIBDIR@@');
> 
> Looks a lot better than some @INC unshifting, and it should be
> equivalent.

I honestly have no idea. I think whatever gets you closer to the satisfaction of the "three conditions" should be used.

-- 
Regards,
Pavel Roskin
Johannes Schindelin· Jun 28, 2006, 07:32 UTC · re: Junio C Hamano · lore

Re: Quick merge status updates.

Hi,
On Tue, 27 Jun 2006, Junio C Hamano wrote:
> Immediately after 1.4.1 happens, I would like to pull in
> "Git.xs/Git.pm" series by Pasky into "next".

Earlier, you said that this is primarily for gitweb, not so much for the core of git. But...

> Breakage there would stop your "git pull" working, so this is somewhat 
> important.

May I respectfully offer my objection? This is the _heart_ of git. You do not want to muck around with this.

I am not opposed to a sane interface between Perl and git, but please please PLEASE do not make such an important part of git dependent on Git.pm. (Somehow I have the impressions there are echoes here.)

Ciao, Dscho

Johannes Schindelin· Jun 28, 2006, 07:39 UTC · re: Johannes Schindelin · lore

Re: Quick merge status updates.

Hi,
on my iBook, make in pu outputs:
GIT_VERSION = 1.4.1.rc1.gf5d3
    * new build flags or prefix
(cd perl && /usr/bin/perl Makefile.PL \
     PREFIX='/Users/gene099' \
     DEFINE=' -I/sw/include -DSHA1_HEADER='\''<openssl/sha.h>'\'' 
-DNO_STRCASESTR -DNO_STRLCPY -DGIT_VERSION='\''"1.4.1.rc1.gf5d3"'\''' \
     LIBS=' -L/sw/lib -lz  -liconv  -lcrypto -lssl')
Can't locate Devel/PPPort.pm in @INC (@INC contains: 
/System/Library/Perl/darwin /System/Library/Perl /Library/Perl/darwin 
/Library/Perl /Library/Perl /Network/Library/Perl/darwin 
/Network/Library/Perl /Network/Library/Perl .) at Makefile.PL line 29.
BEGIN failed--compilation aborted at Makefile.PL line 29.
make: *** [perl/Makefile] Error 2
FWIW all Perl scripts in git, except git-send-email, work here.

Ciao, Dscho

Junio C Hamano· Jun 28, 2006, 08:51 UTC · re: Johannes Schindelin · lore

Re: Quick merge status updates.

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 19 quoted lines
> Hi,
>
> on my iBook, make in pu outputs:
>
> GIT_VERSION = 1.4.1.rc1.gf5d3
>     * new build flags or prefix
> (cd perl && /usr/bin/perl Makefile.PL \
>      PREFIX='/Users/gene099' \
>      DEFINE=' -I/sw/include -DSHA1_HEADER='\''<openssl/sha.h>'\'' 
> -DNO_STRCASESTR -DNO_STRLCPY -DGIT_VERSION='\''"1.4.1.rc1.gf5d3"'\''' \
>      LIBS=' -L/sw/lib -lz  -liconv  -lcrypto -lssl')
> Can't locate Devel/PPPort.pm in @INC (@INC contains: 
> /System/Library/Perl/darwin /System/Library/Perl /Library/Perl/darwin 
> /Library/Perl /Library/Perl /Network/Library/Perl/darwin 
> /Network/Library/Perl /Network/Library/Perl .) at Makefile.PL line 29.
> BEGIN failed--compilation aborted at Makefile.PL line 29.
> make: *** [perl/Makefile] Error 2
>
> FWIW all Perl scripts in git, except git-send-email, work here.
I suspect git-fmt-merge-msg doesn't, and perhaps git-mv.
Johannes Schindelin· Jun 28, 2006, 09:13 UTC · re: Junio C Hamano · lore

Re: Quick merge status updates.

Hi,
On Wed, 28 Jun 2006, Junio C Hamano wrote:
Show 23 quoted lines
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> 
> > Hi,
> >
> > on my iBook, make in pu outputs:
> >
> > GIT_VERSION = 1.4.1.rc1.gf5d3
> >     * new build flags or prefix
> > (cd perl && /usr/bin/perl Makefile.PL \
> >      PREFIX='/Users/gene099' \
> >      DEFINE=' -I/sw/include -DSHA1_HEADER='\''<openssl/sha.h>'\'' 
> > -DNO_STRCASESTR -DNO_STRLCPY -DGIT_VERSION='\''"1.4.1.rc1.gf5d3"'\''' \
> >      LIBS=' -L/sw/lib -lz  -liconv  -lcrypto -lssl')
> > Can't locate Devel/PPPort.pm in @INC (@INC contains: 
> > /System/Library/Perl/darwin /System/Library/Perl /Library/Perl/darwin 
> > /Library/Perl /Library/Perl /Network/Library/Perl/darwin 
> > /Network/Library/Perl /Network/Library/Perl .) at Makefile.PL line 29.
> > BEGIN failed--compilation aborted at Makefile.PL line 29.
> > make: *** [perl/Makefile] Error 2
> >
> > FWIW all Perl scripts in git, except git-send-email, work here.
> 
> I suspect git-fmt-merge-msg doesn't, and perhaps git-mv.

Last time I checked, git-mv worked (couple of weeks ago). And if I am not mistaken, git-fmt-merge-msg is needed when git-pull does not fast forward? I definitely successfully merged on my iBook, IIRC last time was last week.

BTW: Devel/PPPort.pm is introduced by this line in perl/Git.xs:
> #include "ppport.h"

Ciao, Dscho

Petr Baudis· Jul 1, 2006, 23:48 UTC · re: Johannes Schindelin · lore

[PATCH] Git.pm: Avoid ppport.h

  Hi,

Dear diary, on Wed, Jun 28, 2006 at 09:39:46AM CEST, I got a letter where Johannes Schindelin <Johannes.Schindelin@gmx.de> said that...

Show 15 quoted lines
> on my iBook, make in pu outputs:
> 
> GIT_VERSION = 1.4.1.rc1.gf5d3
>     * new build flags or prefix
> (cd perl && /usr/bin/perl Makefile.PL \
>      PREFIX='/Users/gene099' \
>      DEFINE=' -I/sw/include -DSHA1_HEADER='\''<openssl/sha.h>'\'' 
> -DNO_STRCASESTR -DNO_STRLCPY -DGIT_VERSION='\''"1.4.1.rc1.gf5d3"'\''' \
>      LIBS=' -L/sw/lib -lz  -liconv  -lcrypto -lssl')
> Can't locate Devel/PPPort.pm in @INC (@INC contains: 
> /System/Library/Perl/darwin /System/Library/Perl /Library/Perl/darwin 
> /Library/Perl /Library/Perl /Network/Library/Perl/darwin 
> /Network/Library/Perl /Network/Library/Perl .) at Makefile.PL line 29.
> BEGIN failed--compilation aborted at Makefile.PL line 29.
> make: *** [perl/Makefile] Error 2
  ow, Devel::PPPort might not be around all the way back to 5.6.0. What
is your Perl version, BTW?
->8-

This makes us not include ppport.h which seems not to give us anything real anyway; it is useful for checking for portability warts but since Devel::PPPort is a portability wart itself, we shouldn't require it for build. You can check for portability problems by calling make check in perl/.

Signed-off-by: Petr Baudis <pasky@suse.cz>
---
 perl/Git.xs      |    2 --
 perl/Makefile.PL |   10 +++++-----
 2 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/perl/Git.xs b/perl/Git.xs
index cb23261..51bfac3 100644
--- a/perl/Git.xs
+++ b/perl/Git.xs
@@ -15,8 +15,6 @@ #include "EXTERN.h"
 #include "perl.h"
 #include "XSUB.h"
 
-#include "ppport.h"
-
 #undef die
 
 
diff --git a/perl/Makefile.PL b/perl/Makefile.PL
index 25ae54a..97ee9af 100644
--- a/perl/Makefile.PL
+++ b/perl/Makefile.PL
@@ -5,6 +5,11 @@ sub MY::postamble {
 instlibdir:
 	@echo '$(INSTALLSITEARCH)'
 
+check:
+	perl -MDevel::PPPort -le 'Devel::PPPort::WriteFile(".ppport.h")' && \
+	perl .ppport.h --compat-version=5.6.0 Git.xs && \
+	rm .ppport.h
+
 MAKE_FRAG
 }
 
@@ -24,8 +29,3 @@ WriteMakefile(
 	MYEXTLIB        => '../libgit.a',
 	INC             => '-I. -I..',
 );
-
-
-use Devel::PPPort;
-
--s 'ppport.h' or Devel::PPPort::WriteFile();
-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
Snow falling on Perl. White noise covering line noise.
Hides all the bugs too. -- J. Putnam
Johannes Schindelin· Jul 2, 2006, 09:52 UTC · re: Petr Baudis · lore

Re: [PATCH] Git.pm: Avoid ppport.h

Hi,
On Sun, 2 Jul 2006, Petr Baudis wrote:
>   ow, Devel::PPPort might not be around all the way back to 5.6.0. What
> is your Perl version, BTW?
This is perl, v5.6.0 built for darwin
> This makes us not include ppport.h which seems not to give us anything real
> anyway; it is useful for checking for portability warts but since Devel::PPPort
> is a portability wart itself, we shouldn't require it for build.

Why do people introduce a "portability enhancer" like that? This is soo dumb.

Well, your patch helped. Now the error is somewhere else:
mkdir blib
mkdir blib/lib
mkdir blib/arch
mkdir blib/arch/auto
mkdir blib/arch/auto/Git
mkdir blib/lib/auto
mkdir blib/lib/auto/Git
mkdir blib/man3
cp private-Error.pm blib/lib/Error.pm
cp Git.pm blib/lib/Git.pm
/usr/bin/perl -I/System/Library/Perl/darwin -I/System/Library/Perl 
/System/Library/Perl/ExtUtils/xsubpp  -typemap 
/System/Library/Perl/ExtUtils/typemap Git.xs > Git.xsc && mv Git.xsc Git.c
Error: 'const char *' not in typemap in Git.xs, line 69
Error: 'const char *' not in typemap in Git.xs, line 79
make: *** [Git.c] Error 1
It seems like my typemap starts like this:

-- snip -- # $Header: /cvs/Darwin/src/live/perl/perl/lib/ExtUtils/typemap,v 1.2 2002/03/14 08:58:22 zarzycki Exp $ # basic C types int T_IV unsigned T_UV unsigned int T_UV long T_IV unsigned long T_UV short T_IV unsigned short T_UV char T_CHAR unsigned char T_U_CHAR char * T_PV unsigned char * T_PV caddr_t T_PV wchar_t * T_PV wchar_t T_IV bool_t T_IV size_t T_IV ssize_t T_IV time_t T_NV -- snap --

So, no "const char *". See next mail for a minimal patch. The warning (IIRC that was mentioned already on the list) still persists:

cc -c -I. -I.. -g -pipe -pipe -fno-common -no-cpp-precomp -flat_namespace 
-DHAS_TELLDIR_PROTOTYPE -fno-strict-aliasing -Os     -DVERSION=\"0.01\" 
-DXS_VERSION=\"0.01\"  -I/System/Library/Perl/darwin/CORE -I/sw/include 
-DSHA1_HEADER='<openssl/sha.h>' -DNO_STRCASESTR -DNO_STRLCPY 
-DGIT_VERSION='"1.4.1.g3b26"' Git.c
In file included from /System/Library/Perl/darwin/CORE/perl.h:500,
                 from Git.xs:15:
/System/Library/Perl/darwin/CORE/embed.h:156:1: warning: "die" redefined
Git.xs:11:1: warning: this is the location of the previous definition

Ciao, Dscho

Junio C Hamano· Jul 2, 2006, 19:05 UTC · re: Johannes Schindelin · lore

Re: [PATCH] Git.pm: Avoid ppport.h

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 6 quoted lines
>> This makes us not include ppport.h which seems not to give us anything real
>> anyway; it is useful for checking for portability warts but since Devel::PPPort
>> is a portability wart itself, we shouldn't require it for build.
>
> Why do people introduce a "portability enhancer" like that? This is soo 
> dumb.
I think that statement is a bit too harsh.

My understanding is that it's more for use by developers working with later version to produce portability headers, so used that way it is very sane. From its manual page:

       How to use ppport.h
       Don't direct the users of your module to download "Devel::PPPort".
       They are most probably no XS writers. Also, don't make ppport.h
       optional. Rather, just take the most recent copy of ppport.h that you
       can find (e.g. by generating it with the latest "Devel::PPPort" release
       from CPAN), copy it into your project, adjust your project to use it,
       and distribute the header along with your module.

But in the case of source distribution, and if the source distribution wants to be compatible with older versions, the above advice does not apply.

Show 7 quoted lines
> Error: 'const char *' not in typemap in Git.xs, line 69
> Error: 'const char *' not in typemap in Git.xs, line 79
> make: *** [Git.c] Error 1
>
> It seems like my typemap starts like this:
>...
> So, no "const char *". See next mail for a minimal patch.

An alternative would be to carry our own typemap but I think your fix is less intrusive and fine. Pasky?

Show 12 quoted lines
> The warning 
> (IIRC that was mentioned already on the list) still persists:
>
> cc -c -I. -I.. -g -pipe -pipe -fno-common -no-cpp-precomp -flat_namespace 
> -DHAS_TELLDIR_PROTOTYPE -fno-strict-aliasing -Os     -DVERSION=\"0.01\" 
> -DXS_VERSION=\"0.01\"  -I/System/Library/Perl/darwin/CORE -I/sw/include 
> -DSHA1_HEADER='<openssl/sha.h>' -DNO_STRCASESTR -DNO_STRLCPY 
> -DGIT_VERSION='"1.4.1.g3b26"' Git.c
> In file included from /System/Library/Perl/darwin/CORE/perl.h:500,
>                  from Git.xs:15:
> /System/Library/Perl/darwin/CORE/embed.h:156:1: warning: "die" redefined
> Git.xs:11:1: warning: this is the location of the previous definition
I see the same here.
Petr Baudis· Jul 2, 2006, 20:57 UTC · re: Junio C Hamano · lore

[PATCH] Git.pm: Don't #define around die

Dear diary, on Sun, Jul 02, 2006 at 09:05:33PM CEST, I got a letter where Junio C Hamano <junkio@cox.net> said that...

Show 11 quoted lines
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> > Error: 'const char *' not in typemap in Git.xs, line 69
> > Error: 'const char *' not in typemap in Git.xs, line 79
> > make: *** [Git.c] Error 1
> >
> > It seems like my typemap starts like this:
> >...
> > So, no "const char *". See next mail for a minimal patch.
> 
> An alternative would be to carry our own typemap but I think
> your fix is less intrusive and fine.  Pasky?
Yes, it should be fine.
Show 14 quoted lines
> > The warning 
> > (IIRC that was mentioned already on the list) still persists:
> >
> > cc -c -I. -I.. -g -pipe -pipe -fno-common -no-cpp-precomp -flat_namespace 
> > -DHAS_TELLDIR_PROTOTYPE -fno-strict-aliasing -Os     -DVERSION=\"0.01\" 
> > -DXS_VERSION=\"0.01\"  -I/System/Library/Perl/darwin/CORE -I/sw/include 
> > -DSHA1_HEADER='<openssl/sha.h>' -DNO_STRCASESTR -DNO_STRLCPY 
> > -DGIT_VERSION='"1.4.1.g3b26"' Git.c
> > In file included from /System/Library/Perl/darwin/CORE/perl.h:500,
> >                  from Git.xs:15:
> > /System/Library/Perl/darwin/CORE/embed.h:156:1: warning: "die" redefined
> > Git.xs:11:1: warning: this is the location of the previous definition
> 
> I see the same here.
-8<-

Back in the old days, we called Git's die() from the .xs code, but we had to hijack Perl's die() for that. Now we don't call Git's die() so no need to do the hijacking and it silences a compiler warning.

Signed-off-by: Petr Baudis <pasky@suse.cz>
---
 perl/Git.xs |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)
diff --git a/perl/Git.xs b/perl/Git.xs
index 51bfac3..1e6c1eb 100644
--- a/perl/Git.xs
+++ b/perl/Git.xs
@@ -8,15 +8,11 @@ #include <ctype.h>
 #include "../cache.h"
 #include "../exec_cmd.h"
 
-#define die perlyshadow_die__
-
 /* XS and Perl interface */
 #include "EXTERN.h"
 #include "perl.h"
 #include "XSUB.h"
 
-#undef die
-
 
 static char *
 report_xs(const char *prefix, const char *err, va_list params)
-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
Snow falling on Perl. White noise covering line noise.
Hides all the bugs too. -- J. Putnam

← back to recent threads