r63053 - in /branches/upstream/libvariable-magic-perl/current: Changes META.yml Magic.xs Makefile.PL README lib/Variable/Magic.pm t/18-opinfo.t t/40-threads.t t/41-clone.t
angelabad-guest at users.alioth.debian.org
angelabad-guest at users.alioth.debian.org
Tue Sep 28 18:54:08 UTC 2010
Author: angelabad-guest
Date: Tue Sep 28 18:53:44 2010
New Revision: 63053
URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=63053
Log:
[svn-upgrade] new version libvariable-magic-perl (0.44)
Modified:
branches/upstream/libvariable-magic-perl/current/Changes
branches/upstream/libvariable-magic-perl/current/META.yml
branches/upstream/libvariable-magic-perl/current/Magic.xs
branches/upstream/libvariable-magic-perl/current/Makefile.PL
branches/upstream/libvariable-magic-perl/current/README
branches/upstream/libvariable-magic-perl/current/lib/Variable/Magic.pm
branches/upstream/libvariable-magic-perl/current/t/18-opinfo.t
branches/upstream/libvariable-magic-perl/current/t/40-threads.t
branches/upstream/libvariable-magic-perl/current/t/41-clone.t
Modified: branches/upstream/libvariable-magic-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libvariable-magic-perl/current/Changes?rev=63053&op=diff
==============================================================================
--- branches/upstream/libvariable-magic-perl/current/Changes (original)
+++ branches/upstream/libvariable-magic-perl/current/Changes Tue Sep 28 18:53:44 2010
@@ -1,4 +1,22 @@
Revision history for Variable-Magic
+
+0.44 2010-09-24 19:10 UTC
+ + Fix : Broken linkage on Windows with gcc 3.4, which appears in
+ particular when using ActivePerl's default compiler suite.
+ For those setups, the Variable::Magic shared library will now
+ be linked against the perl dll directly (instead of the import
+ library). This (should) fix RT #51483.
+ Thanks Christian Walde for helping to reproduce this failure
+ and extra testing.
+ + Rem : Support for development perls from the 5.11 branch but older
+ than the 5.11.0 release was removed. This could cause more
+ recent setups to fail.
+ + Tst : Threads tests are now only run on perl 5.13.4 and higher.
+ They could segfault randomly because of what seems to be an
+ internal bug of Perl, which has been addressed in 5.13.4.
+ There is also an environment variable that allows you to
+ forcefully run those tests, but it should be set only for
+ author testing and not for end users.
0.43 2010-06-25 23:35 UTC
+ Add : The new constant VMG_COMPAT_GLOB_GET tells you whether get magic
Modified: branches/upstream/libvariable-magic-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libvariable-magic-perl/current/META.yml?rev=63053&op=diff
==============================================================================
--- branches/upstream/libvariable-magic-perl/current/META.yml (original)
+++ branches/upstream/libvariable-magic-perl/current/META.yml Tue Sep 28 18:53:44 2010
@@ -1,6 +1,6 @@
--- #YAML:1.0
name: Variable-Magic
-version: 0.43
+version: 0.44
abstract: Associate user-defined magic to variables from Perl.
author:
- Vincent Pit <perl at profvince.com>
Modified: branches/upstream/libvariable-magic-perl/current/Magic.xs
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libvariable-magic-perl/current/Magic.xs?rev=63053&op=diff
==============================================================================
--- branches/upstream/libvariable-magic-perl/current/Magic.xs (original)
+++ branches/upstream/libvariable-magic-perl/current/Magic.xs Tue Sep 28 18:53:44 2010
@@ -160,9 +160,11 @@
* reverted to dev-5.11 as 9cdcb38b */
#if VMG_HAS_PERL_MAINT(5, 8, 9, 28160) || VMG_HAS_PERL_MAINT(5, 9, 3, 25854) || VMG_HAS_PERL(5, 10, 0)
# ifndef VMG_COMPAT_ARRAY_PUSH_NOLEN
-/* This branch should only apply for perls before the official 5.11.0 release.
- * Makefile.PL takes care of the higher ones. */
-# define VMG_COMPAT_ARRAY_PUSH_NOLEN 1
+# if VMG_HAS_PERL(5, 11, 0)
+# define VMG_COMPAT_ARRAY_PUSH_NOLEN 0
+# else
+# define VMG_COMPAT_ARRAY_PUSH_NOLEN 1
+# endif
# endif
# ifndef VMG_COMPAT_ARRAY_PUSH_NOLEN_VOID
# define VMG_COMPAT_ARRAY_PUSH_NOLEN_VOID 1
@@ -447,26 +449,35 @@
if (!w)
return;
- if (w->cb_data) SvREFCNT_dec(w->cb_data);
- if (w->cb_get) SvREFCNT_dec(w->cb_get);
- if (w->cb_set) SvREFCNT_dec(w->cb_set);
- if (w->cb_len) SvREFCNT_dec(w->cb_len);
- if (w->cb_clear) SvREFCNT_dec(w->cb_clear);
- if (w->cb_free) SvREFCNT_dec(w->cb_free);
+ /* We reach this point in dirty state when ptable_free() is called from the
+ * atexit cleanup callback, and that the global table still holds a live
+ * wizard. This happens before all the SV bodies are freed, so all the wizard
+ * callbacks are still alive (as they are referenced by the undead wizard).
+ * Hence it is safe to decrement their refcount. Later on, the wizard free
+ * callback itself will trigger when the wizard body is reaped, but it will
+ * be skipped as it guards against dirty state - which is good since nothing
+ * has to be done anymore at that point. */
+
+ SvREFCNT_dec(w->cb_data);
+ SvREFCNT_dec(w->cb_get);
+ SvREFCNT_dec(w->cb_set);
+ SvREFCNT_dec(w->cb_len);
+ SvREFCNT_dec(w->cb_clear);
+ SvREFCNT_dec(w->cb_free);
#if MGf_COPY
- if (w->cb_copy) SvREFCNT_dec(w->cb_copy);
+ SvREFCNT_dec(w->cb_copy);
#endif /* MGf_COPY */
#if 0 /* MGf_DUP */
- if (w->cb_dup) SvREFCNT_dec(w->cb_dup);
+ SvREFCNT_dec(w->cb_dup);
#endif /* MGf_DUP */
#if MGf_LOCAL
- if (w->cb_local) SvREFCNT_dec(w->cb_local);
+ SvREFCNT_dec(w->cb_local);
#endif /* MGf_LOCAL */
#if VMG_UVAR
- if (w->cb_fetch) SvREFCNT_dec(w->cb_fetch);
- if (w->cb_store) SvREFCNT_dec(w->cb_store);
- if (w->cb_exists) SvREFCNT_dec(w->cb_exists);
- if (w->cb_delete) SvREFCNT_dec(w->cb_delete);
+ SvREFCNT_dec(w->cb_fetch);
+ SvREFCNT_dec(w->cb_store);
+ SvREFCNT_dec(w->cb_exists);
+ SvREFCNT_dec(w->cb_delete);
#endif /* VMG_UVAR */
Safefree(w->vtbl);
Modified: branches/upstream/libvariable-magic-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libvariable-magic-perl/current/Makefile.PL?rev=63053&op=diff
==============================================================================
--- branches/upstream/libvariable-magic-perl/current/Makefile.PL (original)
+++ branches/upstream/libvariable-magic-perl/current/Makefile.PL Tue Sep 28 18:53:44 2010
@@ -11,59 +11,54 @@
}
my @DEFINES;
+my %macro;
-my $pl = $Config{perl_patchlevel};
-print "Checking perl patchlevel... ";
-if (defined $pl && length $pl) {
- $pl = int $pl;
- push @DEFINES, '-DVMG_PERL_PATCHLEVEL=' . $pl;
- print $pl, "\n";
-} else {
- $pl = undef;
- print "none\n";
+my $as_perl = eval {
+ require ActivePerl;
+ defined &ActivePerl::BUILD ? ActivePerl::BUILD() : undef
+};
+
+my $is_as_822 = 0;
+print "Checking if this is ActiveState Perl 5.8.8 build 822 or higher... ";
+if ($^V eq v5.8.8 and defined $as_perl and $as_perl >= 822) {
+ $is_as_822 = 1;
+ push @DEFINES, '-DVMG_COMPAT_ARRAY_PUSH_NOLEN=1';
}
+print $is_as_822 ? "yes\n" : "no\n";
-my $is_as = 0;
-print "Checking if this is ActiveState Perl 5.8.8 build 822 or higher... ";
-if ($^V eq v5.8.8) {
- eval {
- require ActivePerl;
- 1;
- } and do {
- if (defined &ActivePerl::BUILD) {
- my $build = int ActivePerl::BUILD();
- if ($build >= 822) {
- $is_as = 1;
- push @DEFINES, '-DVMG_COMPAT_ARRAY_PUSH_NOLEN=1';
- }
- }
+my $is_gcc_34 = 0;
+print "Checking if this is gcc 3.4 on Windows trying to link against an import library... ";
+if ($^O eq 'MSWin32' and not grep /^LD[A-Z]*=/, @ARGV) {
+ my ($libperl, $gccversion) = map $_ || '', @Config{qw/libperl gccversion/};
+ if ($gccversion =~ /^3\.4\.[0-9]+/ and $libperl =~ s/\.lib$//) {
+ $is_gcc_34 = 1;
+ my ($lddlflags, $ldflags) = @Config{qw/lddlflags ldflags/};
+ $_ ||= '', s/-L(?:".*?"|\S+)//g for $lddlflags, $ldflags;
+ $libperl = "-l$libperl";
+ my $libdirs = join ' ',
+ map { s/(?<!\\)((?:\\\\)*")/\\$1/g; qq[-L"$_"] }
+ @Config{qw/bin sitebin/};
+ $macro{LDDLFLAGS} = "$lddlflags $libdirs $libperl";
+ $macro{LDFLAGS} = "$ldflags $libdirs $libperl";
+ $macro{PERL_ARCHIVE} = '',
}
}
-print $is_as ? "yes\n" : "no\n";
-
-my $is_5110rel = 0;
-print "Checking if this is a released perl 5.11.0 or higher... ";
-if ($^V ge v5.11.0 and not defined $pl) {
- my $describe = $Config{git_describe};
- # An empty 'describe' is fine
- if (defined $describe and $describe !~ /^GitLive-/) {
- $is_5110rel = 1;
- push @DEFINES, '-DVMG_COMPAT_ARRAY_PUSH_NOLEN=0';
- }
-}
-print $is_5110rel ? "yes\n" : "no\n";
+print $is_gcc_34 ? "yes\n" : "no\n";
# Threads, Windows and 5.8.x don't seem to be best friends
if ($^O eq 'MSWin32' && $^V lt v5.9.0) {
push @DEFINES, '-DVMG_MULTIPLICITY=0';
+ print "Thread safety disabled for perl 5.8.x on Windows.\n"
}
# Fork emulation got "fixed" in 5.10.1
if ($^O eq 'MSWin32' && $^V lt v5.10.1) {
push @DEFINES, '-DVMG_FORKSAFE=0';
+ print "Fork safety not ensured for perl 5.8.x and 5.10.0 on Windows.\n";
}
@DEFINES = (DEFINE => join ' ', @DEFINES) if @DEFINES;
+%macro = (macro => { %macro }) if %macro; # Beware of the circle
my $dist = 'Variable-Magic';
@@ -118,4 +113,5 @@
clean => {
FILES => "$dist-* *.gcov *.gcda *.gcno cover_db Debian_CPANTS.txt"
},
+ %macro,
);
Modified: branches/upstream/libvariable-magic-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libvariable-magic-perl/current/README?rev=63053&op=diff
==============================================================================
--- branches/upstream/libvariable-magic-perl/current/README (original)
+++ branches/upstream/libvariable-magic-perl/current/README Tue Sep 28 18:53:44 2010
@@ -2,7 +2,7 @@
Variable::Magic - Associate user-defined magic to variables from Perl.
VERSION
- Version 0.43
+ Version 0.44
SYNOPSIS
use Variable::Magic qw/wizard cast VMG_OP_INFO_NAME/;
Modified: branches/upstream/libvariable-magic-perl/current/lib/Variable/Magic.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libvariable-magic-perl/current/lib/Variable/Magic.pm?rev=63053&op=diff
==============================================================================
--- branches/upstream/libvariable-magic-perl/current/lib/Variable/Magic.pm (original)
+++ branches/upstream/libvariable-magic-perl/current/lib/Variable/Magic.pm Tue Sep 28 18:53:44 2010
@@ -5,21 +5,19 @@
use strict;
use warnings;
-use Carp qw/croak/;
-
=head1 NAME
Variable::Magic - Associate user-defined magic to variables from Perl.
=head1 VERSION
-Version 0.43
+Version 0.44
=cut
our $VERSION;
BEGIN {
- $VERSION = '0.43';
+ $VERSION = '0.44';
}
=head1 SYNOPSIS
@@ -296,19 +294,32 @@
=cut
sub wizard {
- croak 'Wrong number of arguments for wizard()' if @_ % 2;
+ if (@_ % 2) {
+ require Carp;
+ Carp::croak('Wrong number of arguments for wizard()');
+ }
+
my %opts = @_;
+
my @keys = qw/data op_info get set len clear free/;
push @keys, 'copy' if MGf_COPY;
push @keys, 'dup' if MGf_DUP;
push @keys, 'local' if MGf_LOCAL;
push @keys, qw/fetch store exists delete copy_key/ if VMG_UVAR;
- my $ret = eval { _wizard(map $opts{$_}, @keys) };
- if (my $err = $@) {
+
+ my ($wiz, $err);
+ {
+ local $@;
+ $wiz = eval { _wizard(map $opts{$_}, @keys) };
+ $err = $@;
+ }
+ if ($err) {
$err =~ s/\sat\s+.*?\n//;
- croak $err;
+ require Carp;
+ Carp::croak($err);
}
- return $ret;
+
+ return $wiz;
}
=head2 C<cast>
Modified: branches/upstream/libvariable-magic-perl/current/t/18-opinfo.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libvariable-magic-perl/current/t/18-opinfo.t?rev=63053&op=diff
==============================================================================
--- branches/upstream/libvariable-magic-perl/current/t/18-opinfo.t (original)
+++ branches/upstream/libvariable-magic-perl/current/t/18-opinfo.t Tue Sep 28 18:53:44 2010
@@ -3,7 +3,7 @@
use strict;
use warnings;
-use Test::More tests => 17 * (3 + 4) + 5;
+use Test::More tests => 17 * (3 + 4) + 5 + 1;
use Config qw/%Config/;
@@ -106,3 +106,13 @@
eval { dispell $c, $wiz };
is $@, '', "get dispell with out of bounds op_info doesn't croak";
}
+
+{
+ local $@;
+ my $wiz = eval {
+ local $SIG{__WARN__} = sub { die @_ };
+ wizard op_info => "hlagh";
+ };
+ like $@, qr/^Argument "hlagh" isn't numeric in subroutine entry at \Q$0\E/,
+ 'wizard(op_info => "text") throws numeric warnings';
+}
Modified: branches/upstream/libvariable-magic-perl/current/t/40-threads.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libvariable-magic-perl/current/t/40-threads.t?rev=63053&op=diff
==============================================================================
--- branches/upstream/libvariable-magic-perl/current/t/40-threads.t (original)
+++ branches/upstream/libvariable-magic-perl/current/t/40-threads.t Tue Sep 28 18:53:44 2010
@@ -12,10 +12,13 @@
use Config qw/%Config/;
BEGIN {
- my $t_v = '1.67';
- my $ts_v = '1.14';
+ my $force = $ENV{PERL_VARIABLE_MAGIC_TEST_THREADS} ? 1 : !1;
+ my $t_v = $force ? '0' : '1.67';
+ my $ts_v = $force ? '0' : '1.14';
skipall 'This perl wasn\'t built to support threads'
unless $Config{useithreads};
+ skipall 'perl 5.13.4 required to test thread safety'
+ unless $force or $] >= 5.013004;
skipall "threads $t_v required to test thread safety"
unless eval "use threads $t_v; 1";
skipall "threads::shared $ts_v required to test thread safety"
Modified: branches/upstream/libvariable-magic-perl/current/t/41-clone.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libvariable-magic-perl/current/t/41-clone.t?rev=63053&op=diff
==============================================================================
--- branches/upstream/libvariable-magic-perl/current/t/41-clone.t (original)
+++ branches/upstream/libvariable-magic-perl/current/t/41-clone.t Tue Sep 28 18:53:44 2010
@@ -12,10 +12,13 @@
use Config qw/%Config/;
BEGIN {
- my $t_v = '1.67';
- my $ts_v = '1.14';
+ my $force = $ENV{PERL_VARIABLE_MAGIC_TEST_THREADS} ? 1 : !1;
+ my $t_v = $force ? '0' : '1.67';
+ my $ts_v = $force ? '0' : '1.14';
skipall 'This perl wasn\'t built to support threads'
unless $Config{useithreads};
+ skipall 'perl 5.13.4 required to test thread safety'
+ unless $force or $] >= 5.013004;
skipall "threads $t_v required to test thread safety"
unless eval "use threads $t_v; 1";
skipall "threads::shared $ts_v required to test thread safety"
More information about the Pkg-perl-cvs-commits
mailing list