You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by ma...@apache.org on 2014/07/11 21:03:59 UTC

[1/8] git commit: Adapt CFC Perl build for CPAN dist compat.

Repository: lucy-clownfish
Updated Branches:
  refs/heads/master ee29c9ada -> fb9f9efb8


Adapt CFC Perl build for CPAN dist compat.

The CFC build process has to work properly in both the repo layout and
the layout of a CPAN dist.


Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/22d5b798
Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/22d5b798
Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/22d5b798

Branch: refs/heads/master
Commit: 22d5b7984dff5cb1b380d5cf16bac0a2a142aea5
Parents: ee29c9a
Author: Marvin Humphrey <ma...@rectangular.com>
Authored: Mon Jul 7 11:51:54 2014 -0700
Committer: Marvin Humphrey <ma...@rectangular.com>
Committed: Wed Jul 9 22:15:14 2014 -0700

----------------------------------------------------------------------
 compiler/perl/Build.PL                        |  6 ----
 compiler/perl/buildlib/Clownfish/CFC/Build.pm | 37 ++++++++++++++++++----
 2 files changed, 30 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/22d5b798/compiler/perl/Build.PL
----------------------------------------------------------------------
diff --git a/compiler/perl/Build.PL b/compiler/perl/Build.PL
index 842a4e1..24a67f3 100644
--- a/compiler/perl/Build.PL
+++ b/compiler/perl/Build.PL
@@ -18,7 +18,6 @@ use strict;
 use warnings;
 use lib 'buildlib';
 use Clownfish::CFC::Build;
-use File::Spec::Functions qw( updir catdir curdir );
 
 my $builder = Clownfish::CFC::Build->new(
     module_name => 'Clownfish::CFC',
@@ -31,11 +30,6 @@ my $builder = Clownfish::CFC::Build->new(
         'ExtUtils::ParseXS'  => 2.16,
         'Devel::PPPort'      => 3.13,
     },
-    include_dirs   => [
-        curdir(), # for charmony.h
-        catdir( updir(), 'include' ),
-    ],
-    c_source       => catdir( updir(),   'src' ),
     add_to_cleanup => [
         qw(
             MANIFEST.bak

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/22d5b798/compiler/perl/buildlib/Clownfish/CFC/Build.pm
----------------------------------------------------------------------
diff --git a/compiler/perl/buildlib/Clownfish/CFC/Build.pm b/compiler/perl/buildlib/Clownfish/CFC/Build.pm
index 93fa675..8de7c9c 100644
--- a/compiler/perl/buildlib/Clownfish/CFC/Build.pm
+++ b/compiler/perl/buildlib/Clownfish/CFC/Build.pm
@@ -24,21 +24,44 @@ use lib 'lib';
 use base qw( Clownfish::CFC::Perl::Build::Charmonic );
 no lib 'lib';
 
-use File::Spec::Functions qw( catfile updir catdir );
+use File::Spec::Functions qw( catfile updir catdir curdir );
 use Config;
 use Cwd qw( getcwd );
 use Carp;
 
-my $base_dir = catdir( updir(), updir() );
-my $COMMON_SOURCE_DIR = catdir( updir(), 'common' );
-my $CHARMONIZER_C     = catfile( $COMMON_SOURCE_DIR, 'charmonizer.c' );
-my $PPPORT_H_PATH = catfile( updir(), qw( include ppport.h ) );
-my $LEMON_DIR = catdir( $base_dir, 'lemon' );
+# Establish the filepaths for various assets.  If the file `LICENSE` is found
+# in the current working directory, this is a CPAN distribution rather than a
+# checkout from version control and things live in different dirs.
+my $CHARMONIZER_C;
+my $LEMON_DIR;
+my $INCLUDE;
+my $CFC_SOURCE_DIR;
+my $IS_CPAN = -e 'LICENSE';
+if ($IS_CPAN) {
+    $CHARMONIZER_C  = 'charmonizer.c';
+    $INCLUDE        = 'include';
+    $LEMON_DIR      = 'lemon';
+    $CFC_SOURCE_DIR = 'src';
+}
+else {
+    $CHARMONIZER_C = catfile( updir(), 'common', 'charmonizer.c' );
+    $INCLUDE        = catdir( updir(), 'include' );
+    $LEMON_DIR      = catdir( updir(), updir(), 'lemon' );
+    $CFC_SOURCE_DIR = catdir( updir(), 'src' );
+}
 my $LEMON_EXE_PATH = catfile( $LEMON_DIR, "lemon$Config{_exe}" );
-my $CFC_SOURCE_DIR = catdir( updir(), 'src' );
+my $PPPORT_H_PATH  = catfile( $INCLUDE,   'ppport.h' );
 
 sub new {
     my ( $class, %args ) = @_;
+    $args{c_source} = $CFC_SOURCE_DIR;
+    $args{include_dirs} ||= [];
+    my @aux_include = (
+        $INCLUDE,
+        $CFC_SOURCE_DIR,
+        curdir(),    # for charmony.h
+    );
+    push @{ $args{include_dirs} }, @aux_include;
     return $class->SUPER::new(
         %args,
         recursive_test_files => 1,


[3/8] git commit: Add a `dist` action for CPAN to CFC Perl build.

Posted by ma...@apache.org.
Add a `dist` action for CPAN to CFC Perl build.


Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/13ac440e
Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/13ac440e
Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/13ac440e

Branch: refs/heads/master
Commit: 13ac440ee830051e073ed80faa322f55edf9604a
Parents: 22d5b79
Author: Marvin Humphrey <ma...@rectangular.com>
Authored: Mon Jul 7 12:44:52 2014 -0700
Committer: Marvin Humphrey <ma...@rectangular.com>
Committed: Wed Jul 9 22:15:15 2014 -0700

----------------------------------------------------------------------
 compiler/perl/buildlib/Clownfish/CFC/Build.pm | 34 ++++++++++++++++++++++
 1 file changed, 34 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/13ac440e/compiler/perl/buildlib/Clownfish/CFC/Build.pm
----------------------------------------------------------------------
diff --git a/compiler/perl/buildlib/Clownfish/CFC/Build.pm b/compiler/perl/buildlib/Clownfish/CFC/Build.pm
index 8de7c9c..0eeb1db 100644
--- a/compiler/perl/buildlib/Clownfish/CFC/Build.pm
+++ b/compiler/perl/buildlib/Clownfish/CFC/Build.pm
@@ -25,6 +25,8 @@ use base qw( Clownfish::CFC::Perl::Build::Charmonic );
 no lib 'lib';
 
 use File::Spec::Functions qw( catfile updir catdir curdir );
+use File::Copy qw( move );
+use File::Path qw( rmtree );
 use Config;
 use Cwd qw( getcwd );
 use Carp;
@@ -167,5 +169,37 @@ sub ACTION_code {
     $self->SUPER::ACTION_code;
 }
 
+sub ACTION_dist {
+    my $self = shift;
+
+    # We build our Perl release tarball from a subdirectory rather than from
+    # the top-level $REPOS_ROOT.  Because some assets we need are outside this
+    # directory, we need to copy them in.
+    my %to_copy = (
+        '../../CONTRIBUTING' => 'CONTRIBUTING',
+        '../../LICENSE'      => 'LICENSE',
+        '../../NOTICE'       => 'NOTICE',
+        '../../README'       => 'README',
+        '../../lemon'        => 'lemon',
+        '../src'             => 'src',
+        '../include'         => 'include',
+        $CHARMONIZER_C       => 'charmonizer.c',
+    );
+    print "Copying files...\n";
+    while (my ($from, $to) = each %to_copy) {
+        confess("'$to' already exists") if -e $to;
+        system("cp -R $from $to") and confess("cp failed");
+    }
+    move( "MANIFEST", "MANIFEST.bak" ) or die "move() failed: $!";
+    $self->depends_on("manifest");
+    $self->SUPER::ACTION_dist;
+
+    # Now that the tarball is packaged up, delete the copied assets.
+    rmtree($_) for values %to_copy;
+    unlink("META.yml");
+    unlink("META.json");
+    move( "MANIFEST.bak", "MANIFEST" ) or die "move() failed: $!";
+}
+
 1;
 


[6/8] git commit: Update runtime Build.PL prereq, abstract.

Posted by ma...@apache.org.
Update runtime Build.PL prereq, abstract.

Make Clownfish::CFC a CPAN prereq for Clownfish.  Use "Apache Clownfish"
rather than "Clownfish" in dist abstract.


Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/852cb0da
Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/852cb0da
Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/852cb0da

Branch: refs/heads/master
Commit: 852cb0da349c354b20075f3c754c00b4dcc2acbc
Parents: b5b80b4
Author: Marvin Humphrey <ma...@rectangular.com>
Authored: Mon Jul 7 17:54:42 2014 -0700
Committer: Marvin Humphrey <ma...@rectangular.com>
Committed: Fri Jul 11 12:01:22 2014 -0700

----------------------------------------------------------------------
 runtime/perl/Build.PL | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/852cb0da/runtime/perl/Build.PL
----------------------------------------------------------------------
diff --git a/runtime/perl/Build.PL b/runtime/perl/Build.PL
index 22cf778..887f320 100644
--- a/runtime/perl/Build.PL
+++ b/runtime/perl/Build.PL
@@ -25,10 +25,11 @@ my $builder = Clownfish::Build->new(
     dist_author =>
         'The Apache Lucy Project <dev at lucy dot apache dot org>',
     dist_version       => '0.3.0',
-    dist_abstract      => 'Clownfish Runtime',
+    dist_abstract      => 'Apache Clownfish Runtime',
     requires           => { 'perl' => '5.8.3', },
     configure_requires => { 'Module::Build' => 0.280801 },
     build_requires     => {
+        'Clownfish::CFC'     => '0.1.0',
         'Module::Build'      => 0.280801,
         'ExtUtils::CBuilder' => 0.21,
         'ExtUtils::ParseXS'  => 2.18,


[4/8] git commit: Add a `dist` action for the runtime's Perl build.

Posted by ma...@apache.org.
Add a `dist` action for the runtime's Perl build.


Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/834ab5d7
Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/834ab5d7
Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/834ab5d7

Branch: refs/heads/master
Commit: 834ab5d73f4180b3ab54d589e038695a7db073fb
Parents: a2167fb
Author: Marvin Humphrey <ma...@rectangular.com>
Authored: Mon Jul 7 17:38:59 2014 -0700
Committer: Marvin Humphrey <ma...@rectangular.com>
Committed: Wed Jul 9 22:15:15 2014 -0700

----------------------------------------------------------------------
 runtime/perl/buildlib/Clownfish/Build.pm | 30 +++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/834ab5d7/runtime/perl/buildlib/Clownfish/Build.pm
----------------------------------------------------------------------
diff --git a/runtime/perl/buildlib/Clownfish/Build.pm b/runtime/perl/buildlib/Clownfish/Build.pm
index 4e7137d..5865fd9 100644
--- a/runtime/perl/buildlib/Clownfish/Build.pm
+++ b/runtime/perl/buildlib/Clownfish/Build.pm
@@ -309,5 +309,35 @@ sub ACTION_clean {
     $self->SUPER::ACTION_clean;
 }
 
+sub ACTION_dist {
+    my $self = shift;
+
+    # We build our Perl release tarball from a subdirectory rather than from
+    # the top-level $REPOS_ROOT.  Because some assets we need are outside this
+    # directory, we need to copy them in.
+    my %to_copy = (
+        '../../CONTRIBUTING' => 'CONTRIBUTING',
+        '../../LICENSE'      => 'LICENSE',
+        '../../NOTICE'       => 'NOTICE',
+        '../../README'       => 'README',
+        $CORE_SOURCE_DIR     => 'core',
+        $CHARMONIZER_C       => 'charmonizer.c',
+    );
+    print "Copying files...\n";
+    while ( my ( $from, $to ) = each %to_copy ) {
+        confess("'$to' already exists") if -e $to;
+        system("cp -R $from $to") and confess("cp failed");
+    }
+    move( "MANIFEST", "MANIFEST.bak" ) or die "move() failed: $!";
+    $self->depends_on("manifest");
+    $self->SUPER::ACTION_dist;
+
+    # Now that the tarball is packaged up, delete the copied assets.
+    rmtree($_) for values %to_copy;
+    unlink("META.yml");
+    unlink("META.json");
+    move( "MANIFEST.bak", "MANIFEST" ) or die "move() failed: $!";
+}
+
 1;
 


[2/8] git commit: Make runtime Perl build work with CPAN layout.

Posted by ma...@apache.org.
Make runtime Perl build work with CPAN layout.

Correct some incompatibilities which assumed the repo layout.

Consolidate code which changes behavior for CPAN layouts inside the
module, leaving Build.PL with only straightforward arguments.


Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/a2167fbc
Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/a2167fbc
Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/a2167fbc

Branch: refs/heads/master
Commit: a2167fbc0350bdc90bd473d46f5661e16136a5bd
Parents: 13ac440
Author: Marvin Humphrey <ma...@rectangular.com>
Authored: Mon Jul 7 17:34:53 2014 -0700
Committer: Marvin Humphrey <ma...@rectangular.com>
Committed: Wed Jul 9 22:15:15 2014 -0700

----------------------------------------------------------------------
 runtime/perl/Build.PL                    | 16 --------------
 runtime/perl/buildlib/Clownfish/Build.pm | 31 +++++++++++++++++++--------
 2 files changed, 22 insertions(+), 25 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/a2167fbc/runtime/perl/Build.PL
----------------------------------------------------------------------
diff --git a/runtime/perl/Build.PL b/runtime/perl/Build.PL
index 94cf181..22cf778 100644
--- a/runtime/perl/Build.PL
+++ b/runtime/perl/Build.PL
@@ -17,13 +17,8 @@ use 5.008003;
 use strict;
 use warnings;
 use lib 'buildlib';
-use File::Spec::Functions qw( catdir );
 use Clownfish::Build;
 
-my @BASE_PATH        = Clownfish::Build->cf_base_path;
-my $CORE_SOURCE_DIR  = catdir( @BASE_PATH, 'core' );
-my $XS_SOURCE_DIR    = 'xs';
-
 my $builder = Clownfish::Build->new(
     module_name => 'Clownfish',
     license     => 'apache',
@@ -47,16 +42,6 @@ my $builder = Clownfish::Build->new(
             bugtracker => 'https://issues.apache.org/jira/browse/LUCY',
         },
     },
-    include_dirs => [
-        $XS_SOURCE_DIR,
-    ],
-    clownfish_params => {
-        source => [
-            $CORE_SOURCE_DIR,
-            $XS_SOURCE_DIR,
-        ],
-        include => [], # Don't use default includes.
-    },
     add_to_cleanup => [
         qw(
             Clownfish-*
@@ -70,4 +55,3 @@ my $builder = Clownfish::Build->new(
 
 $builder->create_build_script();
 
-__END__

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/a2167fbc/runtime/perl/buildlib/Clownfish/Build.pm
----------------------------------------------------------------------
diff --git a/runtime/perl/buildlib/Clownfish/Build.pm b/runtime/perl/buildlib/Clownfish/Build.pm
index 2c01db6..4e7137d 100644
--- a/runtime/perl/buildlib/Clownfish/Build.pm
+++ b/runtime/perl/buildlib/Clownfish/Build.pm
@@ -44,14 +44,29 @@ use Cwd qw( getcwd );
 my @BASE_PATH = __PACKAGE__->cf_base_path;
 
 my $COMMON_SOURCE_DIR = catdir( @BASE_PATH, 'common' );
-my $CHARMONIZER_C     = catfile( $COMMON_SOURCE_DIR, 'charmonizer.c' );
 my $CORE_SOURCE_DIR   = catdir( @BASE_PATH, 'core' );
 my $CFC_DIR           = catdir( @BASE_PATH, updir(), 'compiler', 'perl' );
-my $CFC_BUILD         = catfile( $CFC_DIR, 'Build' );
-my $LIB_DIR           = 'lib';
+my $XS_SOURCE_DIR = 'xs';
+my $CFC_BUILD     = catfile( $CFC_DIR, 'Build' );
+my $LIB_DIR       = 'lib';
+my $CHARMONIZER_C;
+my $IS_CPAN_DIST = !@BASE_PATH;
+if ($IS_CPAN_DIST) {
+    $CHARMONIZER_C = 'charmonizer.c';
+}
+else {
+    $CHARMONIZER_C = catfile( $COMMON_SOURCE_DIR, 'charmonizer.c' );
+}
 
 sub new {
-    my $self = shift->SUPER::new( recursive_test_files => 1, @_ );
+    my ( $class, %args ) = @_;
+    $args{include_dirs}     = $XS_SOURCE_DIR;
+    $args{clownfish_params} = {
+        autogen_header => _autogen_header(),
+        include        => [],                  # Don't use default includes.
+        source => [ $CORE_SOURCE_DIR, $XS_SOURCE_DIR ],
+    };
+    my $self = $class->SUPER::new( recursive_test_files => 1, %args );
 
     if ( $ENV{LUCY_VALGRIND} ) {
         my $optimize = $self->config('optimize') || '';
@@ -61,8 +76,6 @@ sub new {
 
     $self->charmonizer_params( charmonizer_c => $CHARMONIZER_C );
 
-    $self->clownfish_params( autogen_header => $self->autogen_header );
-
     return $self;
 }
 
@@ -85,7 +98,8 @@ sub _run_make {
 }
 
 sub ACTION_cfc {
-    my $self    = shift;
+    my $self = shift;
+    return if $IS_CPAN_DIST;
     my $old_dir = getcwd();
     chdir($CFC_DIR);
     if ( !-f 'Build' ) {
@@ -248,8 +262,7 @@ sub ACTION_test_valgrind {
     }
 }
 
-sub autogen_header {
-    my $self = shift;
+sub _autogen_header {
     return <<"END_AUTOGEN";
 /***********************************************
 


[5/8] git commit: Prep Clownfish::CFC for independent CPAN dist.

Posted by ma...@apache.org.
Prep Clownfish::CFC for independent CPAN dist.

Flesh out prerequisites and other dist metadata.


Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/b5b80b41
Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/b5b80b41
Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/b5b80b41

Branch: refs/heads/master
Commit: b5b80b41ae60f9fb76a3d6240d108921a9525b33
Parents: 834ab5d
Author: Marvin Humphrey <ma...@rectangular.com>
Authored: Mon Jul 7 17:52:45 2014 -0700
Committer: Marvin Humphrey <ma...@rectangular.com>
Committed: Fri Jul 11 11:58:43 2014 -0700

----------------------------------------------------------------------
 compiler/perl/Build.PL | 13 +++++++++++++
 1 file changed, 13 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/b5b80b41/compiler/perl/Build.PL
----------------------------------------------------------------------
diff --git a/compiler/perl/Build.PL b/compiler/perl/Build.PL
index 24a67f3..af7256b 100644
--- a/compiler/perl/Build.PL
+++ b/compiler/perl/Build.PL
@@ -25,13 +25,26 @@ my $builder = Clownfish::CFC::Build->new(
     dist_author =>
         'The Apache Lucy Project <dev at lucy dot apache dot org>',
     dist_version_from => 'lib/Clownfish/CFC.pm',
+    dist_abstract      => 'CFC Apache Clownfish compiler',
+    requires           => { 'perl' => '5.8.3', },
+    configure_requires => { 'Module::Build' => 0.280801 },
     build_requires    => {
+        'Module::Build'      => 0.280801,
         'ExtUtils::CBuilder' => 0.18,
         'ExtUtils::ParseXS'  => 2.16,
         'Devel::PPPort'      => 3.13,
     },
+    meta_merge => { keywords => [qw( clownfish )], },
+    meta_add   => {
+        resources => {
+            homepage   => 'http://lucy.apache.org',
+            repository => 'https://git-wip-us.apache.org/repos/asf/lucy-clownfish.git',
+            bugtracker => 'https://issues.apache.org/jira/browse/LUCY',
+        },
+    },
     add_to_cleanup => [
         qw(
+            Clownfish-CFC-*
             MANIFEST.bak
             perltidy.ERR
             *.pdb


[8/8] git commit: Make Storable failures graceful.

Posted by ma...@apache.org.
Make Storable failures graceful.

Throw exceptions rather than segfault when Clownfish objects are
serialized using Storable.


Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/fb9f9efb
Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/fb9f9efb
Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/fb9f9efb

Branch: refs/heads/master
Commit: fb9f9efb8b5a861bb35cc99a201e1b554dc690d2
Parents: 1642349
Author: Marvin Humphrey <ma...@rectangular.com>
Authored: Wed Jul 9 19:55:14 2014 -0700
Committer: Marvin Humphrey <ma...@rectangular.com>
Committed: Fri Jul 11 12:02:20 2014 -0700

----------------------------------------------------------------------
 runtime/perl/lib/Clownfish.pm    |  9 +++++++++
 runtime/perl/t/binding/019-obj.t | 17 ++++++++++++++++-
 2 files changed, 25 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/fb9f9efb/runtime/perl/lib/Clownfish.pm
----------------------------------------------------------------------
diff --git a/runtime/perl/lib/Clownfish.pm b/runtime/perl/lib/Clownfish.pm
index e1baa6e..e0ede72 100644
--- a/runtime/perl/lib/Clownfish.pm
+++ b/runtime/perl/lib/Clownfish.pm
@@ -85,6 +85,15 @@ sub error {$Clownfish::Err::error}
     our $VERSION = '0.003000';
     $VERSION = eval $VERSION;
     use Clownfish qw( to_clownfish to_perl );
+    use Carp qw( confess );
+    sub STORABLE_freeze {
+        my $class_name = ref(shift);
+        confess("Storable serialization not implemented for $class_name");
+    }
+    sub STORABLE_thaw {
+        my $class_name = ref(shift);
+        confess("Storable serialization not implemented for $class_name");
+    }
 }
 
 {

http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/fb9f9efb/runtime/perl/t/binding/019-obj.t
----------------------------------------------------------------------
diff --git a/runtime/perl/t/binding/019-obj.t b/runtime/perl/t/binding/019-obj.t
index 5560f48..ce9e9d9 100644
--- a/runtime/perl/t/binding/019-obj.t
+++ b/runtime/perl/t/binding/019-obj.t
@@ -16,7 +16,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 15;
+use Test::More tests => 17;
 
 package TestObj;
 use base qw( Clownfish::Obj );
@@ -43,6 +43,7 @@ use base qw( Clownfish::Obj );
 }
 
 package main;
+use Storable qw( freeze thaw );
 
 ok( defined $TestObj::version,
     "Using base class should grant access to "
@@ -53,6 +54,20 @@ my $object = TestObj->new;
 isa_ok( $object, "Clownfish::Obj",
     "Clownfish objects can be subclassed" );
 
+{
+    no warnings 'once';
+    eval { freeze($object) };
+    like( $@, qr/implement/i,
+        "freezing an Obj throws an exception rather than segfaults" );
+    *TestObj::STORABLE_freeze = sub {"meep"};
+    local *TestObj::DESTROY = sub {};
+    my $fake = bless {}, 'TestObj';
+    my $frozen = freeze($fake);
+    eval { thaw($frozen) };
+    like( $@, qr/implement/,
+        "thawing an Obj throws an exception rather than segfaults" );
+}
+
 ok( $object->is_a("Clownfish::Obj"),     "custom is_a correct" );
 ok( !$object->is_a("Clownfish::Object"), "custom is_a too long" );
 ok( !$object->is_a("Clownfish"),         "custom is_a substring" );


[7/8] git commit: Add MANIFEST.SKIP for CFC Perl build.

Posted by ma...@apache.org.
Add MANIFEST.SKIP for CFC Perl build.


Project: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/commit/16423496
Tree: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/tree/16423496
Diff: http://git-wip-us.apache.org/repos/asf/lucy-clownfish/diff/16423496

Branch: refs/heads/master
Commit: 1642349649017379980c9bbcf57b69b81707f5d5
Parents: 852cb0d
Author: Marvin Humphrey <ma...@rectangular.com>
Authored: Mon Jul 7 17:59:17 2014 -0700
Committer: Marvin Humphrey <ma...@rectangular.com>
Committed: Fri Jul 11 12:02:20 2014 -0700

----------------------------------------------------------------------
 compiler/perl/MANIFEST.SKIP | 56 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 56 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucy-clownfish/blob/16423496/compiler/perl/MANIFEST.SKIP
----------------------------------------------------------------------
diff --git a/compiler/perl/MANIFEST.SKIP b/compiler/perl/MANIFEST.SKIP
new file mode 100644
index 0000000..4e3113d
--- /dev/null
+++ b/compiler/perl/MANIFEST.SKIP
@@ -0,0 +1,56 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements.  See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You under the Apache License, Version 2.0
+# (the "License"); you may not use this file except in compliance with
+# the License.  You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# cvs files and directories
+\bCVS\b
+,v$
+
+# all object files
+\.o
+
+# Module::Build generated files and dirs.
+^Build$
+^blib/
+^_build
+^MYMETA.yml$
+
+# Makemaker generated files and dirs.
+^MANIFEST\.
+^Makefile$
+^Makefile\.old$
+^MakeMaker-\d
+pm_to_blib
+
+# hidden files
+^\.
+/\.
+
+# Apple window status files
+\.DS_Store
+
+# vim swap files
+\.swp$
+
+# log files
+\.log$
+
+# various detritus
+^helper
+^_Inline
+\.gz$
+\.ERR$
+
+^MYMETA.yml$
+^MYMETA\.json$