develooper Front page | perl.perl5.porters | Postings from September 2016

Re: [perl #125603] failed to compile perl5 when path includes thestring "blib"

Thread Previous | Thread Next
From:
Dave Mitchell
Date:
September 27, 2016 15:58
Subject:
Re: [perl #125603] failed to compile perl5 when path includes thestring "blib"
Message ID:
20160927155825.GH3193@iabyn.com
On Wed, Aug 12, 2015 at 03:13:38PM +0200, Jens Rehsack wrote:
> 
> > Am 12.08.2015 um 08:41 schrieb Tony Cook via RT <perlbug-followup@perl.org>:
> > 
> > On Thu Jul 16 06:18:09 2015, rehsack@gmail.com wrote:
> >> Maybe Steffen Müller has an idea (especially at PathTools I'm always
> >> confused whether it's first updated in core and than mirrored to 2nd
> >> life on CPAN or vice versa), or Leon Timmermans or David Golden (who
> >> was responsible for Module::Build::Compat version 0.2808_01? Oh my, it
> >> was Ken Williams - maybe one should ask him  or simply regenerate ...)
> > 
> > The offending line was added to fix this bug:
> > 
> > https://rt.cpan.org/Ticket/Display.html?id=4681
> 
> The bug looks very weird - where comes the dirty Cwd 2.08 stuff from?
> I'm not sure the line fixes the root cause, it seems to work on symptom...
> 
> However - 10 years later searching and fixing the root-cause might not
> be reasonable at all.
> 
> Let's try to figure out how to fix the symptom fix to avoid breakage
> of third party environments:
> 
> Merijn proposed using /\bblib\b/ instead of /blib/ - looking at rt#4681
> I would suggest using /^\bblib\b/
> 
> That should be restrictive enough to avoid disturbing anything else than
> dirty blib/inc ...
> 
> > The line wasn't generated by Module::Build::Compat
> 
> Thanks for investigating, Tony.

I've just applied the following to blead. Hopefully its a suitable
compromise.

commit 850e14d313dc5493e5162c407f21ae0a9fec2805
Author:     David Mitchell <davem@iabyn.com>
AuthorDate: Tue Sep 27 16:43:30 2016 +0100
Commit:     David Mitchell <davem@iabyn.com>
CommitDate: Tue Sep 27 16:48:53 2016 +0100

    Cwd.xs: avoid blib better while building
    
    RT # 125603
    
    There's an old line in Cwd's Makefile.PL:
    
        BEGIN { @INC = grep {!/blib/} @INC }
    
    This was added 12 years ago to solve a problem with a static perl and
    building a newer Cwd (but no-one's quite sure what *exactly* the issue was
    any more).
    
    However, this breaks building perl under a directory that has 'blib'
    in the pathname. This commit estricts the grep  to just exclusing exactly
    blib/lib and blib/arch.
    
    This should hopefully still workaround the static build issue, while no
    longer breaking perl builds.


Affected files ...
    M	dist/PathTools/Makefile.PL

Differences ...

diff --git a/dist/PathTools/Makefile.PL b/dist/PathTools/Makefile.PL
index 6cd70fa..71b9a60 100644
--- a/dist/PathTools/Makefile.PL
+++ b/dist/PathTools/Makefile.PL
@@ -1,5 +1,11 @@
 
-BEGIN { @INC = grep {!/blib/} @INC }
+# See https://rt.cpan.org/Public/Bug/Display.html?id=4681
+# and https://rt.perl.org/Ticket/Display.html?id=125603
+# When installing a newer Cwd on a system with an existing Cwd,
+# under some circumstances the old Cwd.pm and the new Cwd.xs could
+# get mixed up and SEGVs ensue.
+
+BEGIN { @INC = grep { $_ ne "blib/arch" and $_ ne "blib/lib" } @INC }


-- 
"Foul and greedy Dwarf - you have eaten the last candle."
    -- "Hordes of the Things", BBC Radio.

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About