PAR vs. Inline

jonasbn on 2006-02-01T15:07:38

Me and Johan debugged and fixed a problem with PAR and Inline some time ago, then we both forgot about it - but all of a sudden the problem appeared again and Johan fixed it.

So this time I promised to send a bug report and a patch. This have been on my TODO list eversince the first round, but then I kind of forgot what the problem was and then it got harder to get the todo out of the way.

But luckily the problem reappeared and this time I can report it and I will do it while it is still fresh in my mind.

So the problem is getting PAR and Inline to work together. PAR moves some stuff around and when Inline wants to check the file is no longer there and things are not good.

So the problem is of course to find out whether this is a PAR or an Inline problem, one could argue PAR, but the workaround we have made is in Inline since this was the easiest.

So the workaround is checking for the environment variable PAR_INITIALIZED is set and if not letting Inline do what it has always done.

diff -b -B -w -u -r1.1 Inline.pm
--- Inline.pm   1 Feb 2006 11:12:52 -0000       1.1
+++ Inline.pm   1 Feb 2006 15:03:02 -0000
@@ -453,10 +453,12 @@
     $o->{API}{modpname} = File::Spec->catdir(@modparts);
 
     my $suffix = $Config{dlext};
+    unless ($ENV{PAR_INITIALIZED}) {
     my $obj = File::Spec->catfile($realpath,'auto',$o->{API}{modpname},
                                   "$o->{API}{modfname}.$suffix");
     croak M30_error_no_obj($o->{CONFIG}{NAME}, $o->{API}{pkg}, 
                           $realpath) unless -f $obj;
+    }
 
     @{$o->{CONFIG}}{qw( PRINT_INFO 
                        REPORTBUG 


The workaround is somewhat weak, being based in the presence of an environment variable, but it works - I will let the Inline author decide on whether this really is a PAR problem.


The Patch on rt.cpan.org

jonasbn on 2006-11-16T11:38:51

The patch is accesible in a more accesible format at rt.cpan.org as ticket: #17415...