develooper Front page | perl.perl5.porters | Postings from October 2018

[perl #133612] ext/File-Glob/t/basic.t: Use of PERL_EXTERNAL_GLOBcauses test failure on Linux

Thread Previous | Thread Next
James E Keenan
October 23, 2018 12:42
[perl #133612] ext/File-Glob/t/basic.t: Use of PERL_EXTERNAL_GLOBcauses test failure on Linux
Message ID:
# New Ticket Created by  James E Keenan 
# Please include the string:  [perl #133612]
# in the subject line of all future correspondence about this issue. 
# <URL: >

Last week, on Oct 17, in the two commits below we fatalized 
File::Glob::glob() as per our schedule of deprecations and fatalizations.


Karl Williamson has encountered one gotcha, which I have confirmed.  If, 
on Linux, you include this obscure (to me, at least) 'ccflag' 
configuration option:


... then when you run ext/File-Glob/t/basic.t, you get 1 test failure 
and 3 shell-level warnings.  See attachments.

I have produced this error on Linux with both gcc and g++ -- but I do 
*not* get the error on FreeBSD (where clang is the default compiler).

There is no adequate documentation of PERL_EXTERNAL_GLOB in INSTALL, 
pod/perlintern.pod or similar locations.  Its name suggests that it 
means something like "Use a glob outside Perl", but that doesn't help us 
very much.  Looking at the source code, I think the following sections 
of code need investigation:

$ grep -nC3 PERL_EXTERNAL_GLOB pp_sys.c op.c doio.c
pp_sys.c-368-    /* Note that we only ever get here if File::Glob fails 
to load
pp_sys.c-369-     * without at the same time croaking, for some reason, 
or if
pp_sys.c:370:     * perl was built with PERL_EXTERNAL_GLOB */
pp_sys.c-372-    ENTER_with_name("glob");
op.c-11880-	return o;
op.c-11881-    }
op.c-11882-    else o->op_flags &= ~OPf_SPECIAL;
op.c:11883:#if !defined(PERL_EXTERNAL_GLOB)
op.c-11884-    if (!PL_globhook) {
op.c-11885-	ENTER;
op.c-11886-	Perl_load_module(aTHX_ PERL_LOADMOD_NOIMPORT,
op.c-11887-			       newSVpvs("File::Glob"), NULL, NULL, NULL);
op.c-11888-	LEAVE;
op.c-11889-    }
op.c:11890:#endif /* !PERL_EXTERNAL_GLOB */
op.c-11891-    gv = (GV *)newSV(0);
op.c-11892-    gv_init(gv, 0, "", 0, 0);
op.c-11893-    gv_IOadd(gv);
doio.c-3208-Function called by C<do_readline> to spawn a glob (or do the 
glob inside
doio.c-3209-perl on VMS).  This code used to be inline, but now perl 
uses C<File::Glob>
doio.c-3210-this glob starter is only used by miniperl during the build 
doio.c:3211:or when PERL_EXTERNAL_GLOB is defined.
doio.c-3212-Moving it away shrinks F<pp_hot.c>; shrinking F<pp_hot.c> 
helps speed perl up.

Thank you very much.
Jim Keenan

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About