Perl / perl5

🐪 The Perl programming language
https://dev.perl.org/perl5/
Other
1.93k stars 551 forks source link

caller has mangled file path for "./" but not ".\" #16641

Open p5pRT opened 6 years ago

p5pRT commented 6 years ago

Migrated from rt.perl.org#133396 (status was 'new')

Searchable as RT133396$

p5pRT commented 6 years ago

From @bulk88

Created by @bulk88

Continuation of no responses https://www.nntp.perl.org/group/perl.perl5.porters/2018/07/msg251582.html

----------------------------------------------- C​:\perl528\srcnew>perl -e"@​INC = ('.\lib'); require Cwd;" b4 .\lib/Cwd.pm at .\lib/XSLoader.pm line 42. af .\lib at .\lib/XSLoader.pm line 44. ----------------------------------------------- ----------------------------------------------- C​:\perl528\srcnew>perl -e"@​INC = ('./lib'); require Cwd;" b4 lib/Cwd.pm at lib/XSLoader.pm line 42. af lib at lib/XSLoader.pm line 44. bad DY at lib/XSLoader.pm line 117. Compilation failed in require at -e line 1. ----------------------------------------------- Why did the "./" disappear from caller() but ".\" does not in how caller/require works?

*********new text below***********

This commit and bug ticket last touched the "./" removal code https://rt-archive.perl.org/perl5/Ticket/Display.html?id=66942

commit https://perl5.git.perl.org/perl.git/commit/e63be7465b2d564165a64209685cfd7026a2005b but the code really dates to commit https://github.com/Perl/perl5/commit/33b78306b8a6f9a33cf09697c8c3167d2111ea12#diff-1809087843b30c07d241e424dbbb3900R831 "perl 3.0 patch #24 patch #19\, continued" "Wed Aug 8 13​:04​:39 1990"\, change line " * patch19​: . is now explicitly in @​INC (and last)". The stripping of the "./" causes XSLoader to thunk into full DynaLoader unnecessarily.

Perl Info ``` --- Flags: category=core severity=low --- Site configuration information for perl 5.27.9: Configured by Administrator at Tue Jan 30 20:34:30 2018. Summary of my perl5 (revision 5 version 27 subversion 9) configuration: Platform: osname=MSWin32 osvers=5.2.3790 archname=MSWin32-x86-multi-thread uname='' config_args='undef' hint=recommended useposix=true d_sigaction=undef useithreads=define usemultiplicity=define use64bitint=undef use64bitall=undef uselongdouble=undef usemymalloc=n default_inc_excludes_dot=define bincompat5005=undef Compiler: cc='cl' ccflags ='-nologo -GF -W3 -O1 -MD -Zi -DNDEBUG -GL -DWIN32 -D_CONSOLE -DNO_STRICT -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DPERL_TEXTMODE_SCRIPTS -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DWIN32_NO_REGISTRY' optimize='-O1 -MD -Zi -DNDEBUG -GL' cppflags='-DWIN32' ccversion='15.00.30729.01' gccversion='' gccosandvers='' intsize=4 longsize=4 ptrsize=4 doublesize=8 byteorder=1234 doublekind=3 d_longlong=undef longlongsize=8 d_longdbl=define longdblsize=8 longdblkind=0 ivtype='long' ivsize=4 nvtype='double' nvsize=8 Off_t='__int64' lseeksize=8 alignbytes=8 prototype=define Linker and Libraries: ld='link' ldflags ='-nologo -nodefaultlib -debug -opt:ref,icf -ltcg -libpath:"c:\perl\lib\CORE" -machine:x86' libpth="C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\lib" libs=oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib comctl32.lib msvcrt.lib perllibs=oldnames.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib netapi32.lib uuid.lib ws2_32.lib mpr.lib winmm.lib version.lib odbc32.lib odbccp32.lib comctl32.lib msvcrt.lib libc=msvcrt.lib so=dll useshrplib=true libperl=perl527.lib gnulibc_version='' Dynamic Linking: dlsrc=dl_win32.xs dlext=dll d_dlsymun=undef ccdlflags=' ' cccdlflags=' ' lddlflags='-dll -nologo -nodefaultlib -debug -opt:ref,icf -ltcg -libpath:"c:\perl\lib\CORE" -machine:x86' --- @INC for perl 5.27.9: lib C:/p527/srcnew/lib --- Environment for perl 5.27.9: CYGWIN=tty HOME (unset) LANG (unset) LANGUAGE (unset) LD_LIBRARY_PATH=/usr/lib/x86:/usr/X11R6/lib LOGDIR (unset) PATH=C:\WINDOWS\system32;C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\BIN;C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin;C:\Perl\bin;C:\WINDOWS;C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE;C:\Program Files (x86)\Git\bin;C:\sp3220\c\bin; PERL_BADLANG (unset) SHELL (unset) ```