Discussion:
[perl.git] branch blead, updated. GitLive-blead-80-g54ad55c
(too old to reply)
Rafael Garcia-Suarez
2008-12-25 23:24:59 UTC
Permalink
In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/54ad55c59e2227f3197e56a9a85b1f78d0229ac7?hp=d4222de00860407a7c86f19fdb5531ac98b1b7ad>

- Log -----------------------------------------------------------------
commit 54ad55c59e2227f3197e56a9a85b1f78d0229ac7
Author: Rafael Garcia-Suarez <***@gmail.com>
Date: Fri Dec 26 00:24:20 2008 +0100

Add description of last commit in perldelta

(see ccb8f6a64f3dd06b4360bc27c194b28e6766a6ad)

M pod/perl5110delta.pod

commit ccb8f6a64f3dd06b4360bc27c194b28e6766a6ad
Author: Renee Baecker <***@smart-websolutions.de>
Date: Fri Dec 26 00:15:25 2008 +0100

[perl #6665] Different behavior using the -Idir option on the command line and inside a perl script

Adds the -Idir at the beginning of @INC.

(Plus a test by rgs -- check that -I does not add directories at the end
of the @INC array anymore)

M perl.c
M t/run/switchI.t

commit 0147cd53faa57ffcd05cb0455b952fbfbe63b0b2
Author: Matt Kraai <***@ftbfs.org>
Date: Thu Jul 3 14:04:44 2008 -0700

Use the F formatting codes for filenames in pod/perlguts.pod.

M pod/perlguts.pod
-----------------------------------------------------------------------

Summary of changes:
perl.c | 8 +++++---
pod/perl5110delta.pod | 9 +++++++++
pod/perlguts.pod | 6 +++---
t/run/switchI.t | 4 ++--
4 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/perl.c b/perl.c
index 021f35d..deb9d38 100644
--- a/perl.c
+++ b/perl.c
@@ -4873,7 +4873,8 @@ S_incpush_if_exists(pTHX_ SV *dir)

if (PerlLIO_stat(SvPVX_const(dir), &tmpstatbuf) >= 0 &&
S_ISDIR(tmpstatbuf.st_mode)) {
- av_push(GvAVn(PL_incgv), dir);
+ av_unshift( GvAVn( PL_incgv ), 1 );
+ av_store( GvAVn( PL_incgv ), 0, dir );
dir = newSV(0);
}
return dir;
@@ -5093,8 +5094,9 @@ S_incpush(pTHX_ const char *dir, bool addsubdirs, bool addoldvers, bool usesep,
#endif
}

- /* finally push this lib directory on the end of @INC */
- av_push(GvAVn(PL_incgv), libdir);
+ /* finally add this lib directory at the beginning of @INC */
+ av_unshift( GvAVn( PL_incgv ), 1 );
+ av_store( GvAVn( PL_incgv ), 0, libdir );
}
if (subdir) {
assert (SvREFCNT(subdir) == 1);
diff --git a/pod/perl5110delta.pod b/pod/perl5110delta.pod
index 65cfb94..91b9682 100644
--- a/pod/perl5110delta.pod
+++ b/pod/perl5110delta.pod
@@ -23,6 +23,15 @@ developement releases.

=head1 Selected Bug Fixes

+=over 4
+
+=item C<-I> on shebang line now adds directories in front of @INC
+
+as documented, and as does C<-I> when specified on the command-line.
+(Renée BÀcker)
+
+=back
+
=head1 New or Changed Diagnostics

=head1 Changed Internals
diff --git a/pod/perlguts.pod b/pod/perlguts.pod
index 58e866d..3ce60d0 100644
--- a/pod/perlguts.pod
+++ b/pod/perlguts.pod
@@ -1959,7 +1959,7 @@ sanctioned for use in extensions) begins like this:
void
Perl_sv_setiv(pTHX_ SV* dsv, IV num)

-C<pTHX_> is one of a number of macros (in perl.h) that hide the
+C<pTHX_> is one of a number of macros (in F<perl.h>) that hide the
details of the interpreter's context. THX stands for "thread", "this",
or "thingy", as the case may be. (And no, George Lucas is not involved. :-)
The first character could be 'p' for a B<p>rototype, 'a' for B<a>rgument,
@@ -2028,7 +2028,7 @@ built with PERL_IMPLICIT_CONTEXT enabled.

There are three ways to do this. First, the easy but inefficient way,
which is also the default, in order to maintain source compatibility
-with extensions: whenever XSUB.h is #included, it redefines the aTHX
+with extensions: whenever F<XSUB.h> is #included, it redefines the aTHX
and aTHX_ macros to call a function that will return the context.
Thus, something like:

@@ -2165,7 +2165,7 @@ This allows the ability to provide an extra pointer (called the "host"
environment) for all the system calls. This makes it possible for
all the system stuff to maintain their own state, broken down into
seven C structures. These are thin wrappers around the usual system
-calls (see win32/perllib.c) for the default perl executable, but for a
+calls (see F<win32/perllib.c>) for the default perl executable, but for a
more ambitious host (like the one that would do fork() emulation) all
the extra work needed to pretend that different interpreters are
actually different "processes", would be done here.
diff --git a/t/run/switchI.t b/t/run/switchI.t
index 41192cd..cfb0f6e 100644
--- a/t/run/switchI.t
+++ b/t/run/switchI.t
@@ -15,11 +15,11 @@ my $Is_VMS = $^O eq 'VMS';
my $lib;

$lib = $Is_MacOS ? ':Bla:' : 'Bla';
-ok(grep { $_ eq $lib } @INC);
+ok(grep { $_ eq $lib } @INC[0..($#INC-1)]);
SKIP: {
skip 'Double colons not allowed in dir spec', 1 if $Is_VMS;
$lib = $Is_MacOS ? 'Foo::Bar:' : 'Foo::Bar';
- ok(grep { $_ eq $lib } @INC);
+ ok(grep { $_ eq $lib } @INC[0..($#INC-1)]);
}

$lib = $Is_MacOS ? ':Bla2:' : 'Bla2';

--
Perl5 Master Repository
Nicholas Clark
2008-12-26 10:38:27 UTC
Permalink
Post by Rafael Garcia-Suarez
[perl #6665] Different behavior using the -Idir option on the command line and inside a perl script
(Plus a test by rgs -- check that -I does not add directories at the end
M perl.c
M t/run/switchI.t
diff --git a/perl.c b/perl.c
index 021f35d..deb9d38 100644
--- a/perl.c
+++ b/perl.c
@@ -4873,7 +4873,8 @@ S_incpush_if_exists(pTHX_ SV *dir)
if (PerlLIO_stat(SvPVX_const(dir), &tmpstatbuf) >= 0 &&
S_ISDIR(tmpstatbuf.st_mode)) {
- av_push(GvAVn(PL_incgv), dir);
+ av_unshift( GvAVn( PL_incgv ), 1 );
+ av_store( GvAVn( PL_incgv ), 0, dir );
dir = newSV(0);
}
return dir;
@@ -5093,8 +5094,9 @@ S_incpush(pTHX_ const char *dir, bool addsubdirs, bool addoldvers, bool usesep,
#endif
}
- av_push(GvAVn(PL_incgv), libdir);
+ av_unshift( GvAVn( PL_incgv ), 1 );
+ av_store( GvAVn( PL_incgv ), 0, libdir );
}
if (subdir) {
assert (SvREFCNT(subdir) == 1);
This patch does more than it says. It also moves '.' to the start of @INC:

$ ./miniperl -le 'print foreach @INC'
.
/home/nick/Perl/lib/perl5/site_perl/5.11.0
/home/nick/Perl/lib/perl5/site_perl/5.11.0/x86_64-linux-thread-multi
/home/nick/Perl/lib/perl5/5.11.0
/home/nick/Perl/lib/perl5/5.11.0/x86_64-linux-thread-multi

Which has the side effect of breaking the build:

make[2]: Entering directory `/home/nick/Perl/perl/ext/Encode/Symbol'
../../../miniperl "-I../../../lib" "-I../../../lib" ../../../lib/ExtUtils/xsubpp -nolinenumbers -typemap ../../../lib/ExtUtils/typemap Symbol.xs > Symbol.xsc && mv Symbol.xsc Symbol.c
Can't load module Encode, dynamic loading not available in this perl.
(You may need to build a new perl executable which either supports
dynamic loading or has the Encode module statically linked into it.)
at Symbol.pm line 4
Compilation failed in require at Symbol.pm line 4.
BEGIN failed--compilation aborted at Symbol.pm line 4.
Compilation failed in require at ../../../lib/ExtUtils/ParseXS.pm line 8.
BEGIN failed--compilation aborted at ../../../lib/ExtUtils/ParseXS.pm line 8.
Compilation failed in require at ../../../lib/ExtUtils/xsubpp line 4.
BEGIN failed--compilation aborted at ../../../lib/ExtUtils/xsubpp line 4.
make[2]: *** [Symbol.c] Error 9
make[2]: Leaving directory `/home/nick/Perl/perl/ext/Encode/Symbol'
make[1]: *** [subdirs] Error 2
make[1]: Leaving directory `/home/nick/Perl/perl/ext/Encode'
make: *** [lib/auto/Encode/Encode.so] Error 2


(use Symbol picks up Encode::Symbol from . rather than the Symbol.pm from lib)

I guess we're missing regression tests to make sure that '.' is last in @INC.

Also, right now I'm not sure what part of this change needs undoing to fix '.'
in @INC and hence the build.

Nicholas Clark
H.Merijn Brand
2008-12-26 11:08:07 UTC
Permalink
Post by Nicholas Clark
Post by Rafael Garcia-Suarez
[perl #6665] Different behavior using the -Idir option on the command line and inside a perl script
(Plus a test by rgs -- check that -I does not add directories at the end
M perl.c
M t/run/switchI.t
(use Symbol picks up Encode::Symbol from . rather than the Symbol.pm from lib)
Also, right now I'm not sure what part of this change needs undoing to fix '.'
Do not unconditionally `force' '.' to the end. I think that if someone
explicitly sets $PERL5LIB to .:/what/ever, . shouls at least be/stay
in front of /what/ever
--
H.Merijn Brand http://tux.nl Perl Monger http://amsterdam.pm.org/
using & porting perl 5.6.2, 5.8.x, 5.10.x, 5.11.x on HP-UX 10.20, 11.00,
11.11, 11.23, and 11.31, SuSE 10.1, 10.3, and 11.0, AIX 5.2, and Cygwin.
http://mirrors.develooper.com/hpux/ http://www.test-smoke.org/
http://qa.perl.org http://www.goldmark.org/jeff/stupid-disclaimers/
Rafael Garcia-Suarez
2008-12-26 12:52:27 UTC
Permalink
[...]
Do we mandate to run tests with PERL5LIB unset, etc ?
Post by Nicholas Clark
Also, right now I'm not sure what part of this change needs undoing to fix '.'
http://camel.booking.com/perl.git/commit/20189146be79a0596543441fa369c6bf7f85103f
should take care of that.

Loading...