Skip Menu |
Report information
Id: 132925
Status: resolved
Priority: 0/
Queue: perl5

Owner: Nobody
Requestors: bulk88 <bulk88 [at] hotmail.com>
Cc:
AdminCc:

Operating System: (no value)
PatchStatus: (no value)
Severity: low
Type: core
Perl Version: 5.27.9
Fixed In: (no value)

Attachments
0001-perl-132925-correct-path-handling-in-mktables.patch
0001-regen_lib.pl-dont-output-Windows-path-seps-on-Window.patch
0002-perl-132925-don-t-use-0-to-get-the-name-of-mk_invlis.patch



From: bulk 88 <bulk88 [...] hotmail.com>
Subject: [PATCH] regen_lib.pl dont output Windows path seps on Windows
Date: Thu, 1 Mar 2018 02:19:52 +0000
To: "perlbug [...] perl.org" <perlbug [...] perl.org>
Download (untitled) / with headers
text/plain 8.6k
This is a bug report for perl from bulk88@hotmail.com, generated with the help of perlbug 1.41 running under perl 5.27.9. ----------------------------------------------------------------- [Please describe your issue here] See attached patch. Diff of what goes wrong when charclass_invlists.h regened on windows. ------------------------- charclass_invlists.h | 40 ++++++++++++++++++++-------------------- 1 files changed, 20 insertions(+), 20 deletions(-) diff --git a/charclass_invlists.h b/charclass_invlists.h index 60c64ef..e63df5a 100644 --- a/charclass_invlists.h +++ b/charclass_invlists.h @@ -1,6 +1,6 @@ /* -*- buffer-read-only: t -*- * !!!!!!! DO NOT EDIT THIS FILE !!!!!!! - * This file is built by regen/mk_invlists.pl from Unicode::UCD. + * This file is built by regen\mk_invlists.pl from Unicode::UCD. * Any changes made here will be lost! */ @@ -109516,26 +109516,26 @@ static const U8 WB_table[24][24] = { * e9947a0e86f27353f0e776403c4826675001210bd39d7114118a8864a57f7472 lib/unicore/SpecialCasing.txt * 52423e4d7492167b62f518f68d54db88930abbbff7f11edfcaec8f726498cab1 lib/unicore/UnicodeData.txt * f28caf260635cebf25fd58124bdc9aa22af08ba4d039ffc584365fb41a31cda5 lib/unicore/VerticalOrientation.txt - * 718d174957712410bfad782b10d557e1047574d7ef1642d6bb122f8ca5662c82 lib/unicore/auxiliary/GCBTest.txt - * 3b66caefc4fa877d0e50dbbbfa39658c86e29b26c6f206f68d7aec192d4c59b6 lib/unicore/auxiliary/GraphemeBreakProperty.txt - * 2aad3836c37fc4c2fa2a24f21586fb3a931dacaf0a1c845a6dc6395f30bd79a7 lib/unicore/auxiliary/LBTest.txt - * eacc03e39dddc60cc59ec9bd274b8ac8dfa25d61745ef0d5c8aa1c151a5b68ba lib/unicore/auxiliary/SBTest.txt - * e45fa8195bb413b901cc1e3772dfea2cead86805d46a51e3480a5a256e8c24d9 lib/unicore/auxiliary/SentenceBreakProperty.txt - * 95789f62e3b1e781dc9ed78f3983d39ff1a5e36ff0b497d6e610446df902b0f6 lib/unicore/auxiliary/WBTest.txt - * c207e8ebd06ee591a27b1087f2971f4cd93e960103c453d85d1d9ba26fb8b202 lib/unicore/auxiliary/WordBreakProperty.txt - * a3c0839826a30166b2bb06ba58df403547b8c3d9eae995ef889d20d115f4b223 lib/unicore/extracted/DBidiClass.txt - * 280afe22f6c4d56566d17d6d1400f33465a979c96f3d99ff3bff9bd14d17e734 lib/unicore/extracted/DBinaryProperties.txt - * db7fd6a5e6f068c47dbc3b74fb633fb1d09d17073410fe435295d05ce925c5f6 lib/unicore/extracted/DCombiningClass.txt - * 8204c07a7c217bdf22525030ad7b4fb991edf463bffcca7e6dba46b9992e0d99 lib/unicore/extracted/DDecompositionType.txt - * e343113719b660bdd81217ec101ce751f844fca0e8d6f15fb21c8ee7dfe7c14c lib/unicore/extracted/DEastAsianWidth.txt - * 07c55b0ed7271fe1a5f4d68059291288b1a8ad61940602d18956fd87390c2d9e lib/unicore/extracted/DGeneralCategory.txt - * d788b9362ec7681e98f8b9d6ef276546e1a6207dda05317ede55bd686b0940a9 lib/unicore/extracted/DJoinGroup.txt - * ebbea3c93eeb7431378885aebac0490d77f6900239c9176f90b6fee030903d96 lib/unicore/extracted/DJoinType.txt - * be0f129691d479aa38646e4ca0ec1ee576ae7f75b0300a5624a7fa862fa8abba lib/unicore/extracted/DLineBreak.txt - * 92449d354d9f6b6f2f97a292ebb59f6344ffdeb83d120d7d23e569c43ba67cd5 lib/unicore/extracted/DNumType.txt - * e3a319527153b0c6c0c549b40fc6f3a01a7a0dcd6620784391db25901df3b154 lib/unicore/extracted/DNumValues.txt + * 718d174957712410bfad782b10d557e1047574d7ef1642d6bb122f8ca5662c82 lib/unicore/auxiliary\GCBTest.txt + * 3b66caefc4fa877d0e50dbbbfa39658c86e29b26c6f206f68d7aec192d4c59b6 lib/unicore/auxiliary\GraphemeBreakProperty.txt + * 2aad3836c37fc4c2fa2a24f21586fb3a931dacaf0a1c845a6dc6395f30bd79a7 lib/unicore/auxiliary\LBTest.txt + * eacc03e39dddc60cc59ec9bd274b8ac8dfa25d61745ef0d5c8aa1c151a5b68ba lib/unicore/auxiliary\SBTest.txt + * e45fa8195bb413b901cc1e3772dfea2cead86805d46a51e3480a5a256e8c24d9 lib/unicore/auxiliary\SentenceBreakProperty.txt + * 95789f62e3b1e781dc9ed78f3983d39ff1a5e36ff0b497d6e610446df902b0f6 lib/unicore/auxiliary\WBTest.txt + * c207e8ebd06ee591a27b1087f2971f4cd93e960103c453d85d1d9ba26fb8b202 lib/unicore/auxiliary\WordBreakProperty.txt + * a3c0839826a30166b2bb06ba58df403547b8c3d9eae995ef889d20d115f4b223 lib/unicore/extracted\DBidiClass.txt + * 280afe22f6c4d56566d17d6d1400f33465a979c96f3d99ff3bff9bd14d17e734 lib/unicore/extracted\DBinaryProperties.txt + * db7fd6a5e6f068c47dbc3b74fb633fb1d09d17073410fe435295d05ce925c5f6 lib/unicore/extracted\DCombiningClass.txt + * 8204c07a7c217bdf22525030ad7b4fb991edf463bffcca7e6dba46b9992e0d99 lib/unicore/extracted\DDecompositionType.txt + * e343113719b660bdd81217ec101ce751f844fca0e8d6f15fb21c8ee7dfe7c14c lib/unicore/extracted\DEastAsianWidth.txt + * 07c55b0ed7271fe1a5f4d68059291288b1a8ad61940602d18956fd87390c2d9e lib/unicore/extracted\DGeneralCategory.txt + * d788b9362ec7681e98f8b9d6ef276546e1a6207dda05317ede55bd686b0940a9 lib/unicore/extracted\DJoinGroup.txt + * ebbea3c93eeb7431378885aebac0490d77f6900239c9176f90b6fee030903d96 lib/unicore/extracted\DJoinType.txt + * be0f129691d479aa38646e4ca0ec1ee576ae7f75b0300a5624a7fa862fa8abba lib/unicore/extracted\DLineBreak.txt + * 92449d354d9f6b6f2f97a292ebb59f6344ffdeb83d120d7d23e569c43ba67cd5 lib/unicore/extracted\DNumType.txt + * e3a319527153b0c6c0c549b40fc6f3a01a7a0dcd6620784391db25901df3b154 lib/unicore/extracted\DNumValues.txt * 5671c3de473b25e7ea47097e4906260624dfabe3e9b1739f490aecbc3d858459 lib/unicore/mktables * 21653d2744fdd071f9ef138c805393901bb9547cf3e777ebf50215a191f986ea lib/unicore/version * 913d2f93f3cb6cdf1664db888bf840bc4eb074eef824e082fceda24a9445e60c regen/charset_translations.pl - * 4898ec84e2b81e8bf948dcdb1c015c14f258cc652337122719885a276ea46d7b regen/mk_invlists.pl + * 4898ec84e2b81e8bf948dcdb1c015c14f258cc652337122719885a276ea46d7b regen\mk_invlists.pl * ex: set ro: */ ------------------------------ [Please do not change anything below this line] ----------------------------------------------------------------- --- 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)

Message body is not shown because sender requested not to inline it.

RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 729b
On Wed, 28 Feb 2018 18:20:29 -0800, bulk88 wrote: Show quoted text
> See attached patch. Diff of what goes wrong when charclass_invlists.h > regened on windows.
Your patch is a workaround for bugs in mktables and in mk_invlists.pl. a) mktables attempts to write out canonical pathnames, but due to a lexcial scoping issue, doesn't. b) mk_invlists.pl uses $0 for itself as a dependency rather than the literal that the other regen scripts that I looked at. You'll only encounter b) if you run mk_invlists.pl manually - regen.pl will run it as "regen/mk_invlists.pl" which matches the POSIX-ish name. Your patch will fix the user running: perl regen\mk_invlists.pl but it won't fix: perl j:/dev/perl/git/perl/regen/mk_invlists.pl Tony
Subject: 0001-perl-132925-correct-path-handling-in-mktables.patch
From 9277931e32ef3052fb988380f30095a8a9ca7b3b Mon Sep 17 00:00:00 2001 From: Tony Cook <tony@develop-help.com> Date: Thu, 1 Mar 2018 15:26:22 +1100 Subject: [PATCH 1/2] (perl #132925) correct path handling in mktables the lexical my $file inside the loop masked the for loop $file, wasting the work done to canonicalize the path names. The grep on length is required since splitdir() can return empty strings. --- charclass_invlists.h | 2 +- lib/unicore/mktables | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/charclass_invlists.h b/charclass_invlists.h index 60c64ef157..e31e49cec5 100644 --- a/charclass_invlists.h +++ b/charclass_invlists.h @@ -109534,7 +109534,7 @@ static const U8 WB_table[24][24] = { * be0f129691d479aa38646e4ca0ec1ee576ae7f75b0300a5624a7fa862fa8abba lib/unicore/extracted/DLineBreak.txt * 92449d354d9f6b6f2f97a292ebb59f6344ffdeb83d120d7d23e569c43ba67cd5 lib/unicore/extracted/DNumType.txt * e3a319527153b0c6c0c549b40fc6f3a01a7a0dcd6620784391db25901df3b154 lib/unicore/extracted/DNumValues.txt - * 5671c3de473b25e7ea47097e4906260624dfabe3e9b1739f490aecbc3d858459 lib/unicore/mktables + * 823b41f276979dd5e2df12f0c7339f3d1aa2c805848958f31ddc549cb11bed9f lib/unicore/mktables * 21653d2744fdd071f9ef138c805393901bb9547cf3e777ebf50215a191f986ea lib/unicore/version * 913d2f93f3cb6cdf1664db888bf840bc4eb074eef824e082fceda24a9445e60c regen/charset_translations.pl * 4898ec84e2b81e8bf948dcdb1c015c14f258cc652337122719885a276ea46d7b regen/mk_invlists.pl diff --git a/lib/unicore/mktables b/lib/unicore/mktables index c6436723d5..88d9c036a3 100644 --- a/lib/unicore/mktables +++ b/lib/unicore/mktables @@ -20230,9 +20230,9 @@ if ( $file_list and $make_list ) { print "Updating '$file_list'\n" if $verbosity >= $PROGRESS; foreach my $file (@input_files, @files_actually_output) { - my (undef, $directories, $file) = File::Spec->splitpath($file); - my @directories = File::Spec->splitdir($directories); - $file = join '/', @directories, $file; + my (undef, $directories, $basefile) = File::Spec->splitpath($file); + my @directories = grep length, File::Spec->splitdir($directories); + $file = join '/', @directories, $basefile; } my $ofh; -- 2.14.1.windows.1
Subject: 0002-perl-132925-don-t-use-0-to-get-the-name-of-mk_invlis.patch
From 5270ff61edf70ef869e8d66ed568610b5c7e61ab Mon Sep 17 00:00:00 2001 From: Tony Cook <tony@develop-help.com> Date: Thu, 1 Mar 2018 15:42:56 +1100 Subject: [PATCH 2/2] (perl #132925) don't use $0 to get the name of mk_invlists.pl Other regen scripts simply embed the name as a literal, using $0 means that the output varies depending on the path used to call regen/mk_invlists.pl. --- charclass_invlists.h | 2 +- regen/mk_invlists.pl | 11 ++++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/charclass_invlists.h b/charclass_invlists.h index e31e49cec5..beb185fc9e 100644 --- a/charclass_invlists.h +++ b/charclass_invlists.h @@ -109537,5 +109537,5 @@ static const U8 WB_table[24][24] = { * 823b41f276979dd5e2df12f0c7339f3d1aa2c805848958f31ddc549cb11bed9f lib/unicore/mktables * 21653d2744fdd071f9ef138c805393901bb9547cf3e777ebf50215a191f986ea lib/unicore/version * 913d2f93f3cb6cdf1664db888bf840bc4eb074eef824e082fceda24a9445e60c regen/charset_translations.pl - * 4898ec84e2b81e8bf948dcdb1c015c14f258cc652337122719885a276ea46d7b regen/mk_invlists.pl + * d3e239a5688d86573d75b4ffc38a60e2f90add5845d359c28b3e76257b022870 regen/mk_invlists.pl * ex: set ro: */ diff --git a/regen/mk_invlists.pl b/regen/mk_invlists.pl index 79ceba94a0..358e4e76c6 100644 --- a/regen/mk_invlists.pl +++ b/regen/mk_invlists.pl @@ -36,7 +36,7 @@ my $numeric_re = qr/ ^ -? \d+ (:? \. \d+ )? $ /ax; my $enum_name_re = qr / ^ [[:alpha:]] \w* $ /ax; my $out_fh = open_new('charclass_invlists.h', '>', - {style => '*', by => $0, + {style => '*', by => 'regen/mk_invlists.pl', from => "Unicode::UCD"}); my $in_file_pound_if = 0; @@ -2236,10 +2236,11 @@ output_WB_table(); end_file_pound_if; my $sources_list = "lib/unicore/mktables.lst"; -my @sources = ($0, qw(lib/unicore/mktables - lib/Unicode/UCD.pm - regen/charset_translations.pl - )); +my @sources = qw(regen/mk_invlists.pl + lib/unicore/mktables + lib/Unicode/UCD.pm + regen/charset_translations.pl + ); { # Depend on mktables’ own sources. It’s a shorter list of files than # those that Unicode::UCD uses. -- 2.14.1.windows.1
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 972b
On Wed, 28 Feb 2018 20:48:30 -0800, tonyc wrote: Show quoted text
> On Wed, 28 Feb 2018 18:20:29 -0800, bulk88 wrote:
> > See attached patch. Diff of what goes wrong when charclass_invlists.h > > regened on windows.
> > Your patch is a workaround for bugs in mktables and in mk_invlists.pl. > > a) mktables attempts to write out canonical pathnames, but due to a > lexcial scoping issue, doesn't. > > b) mk_invlists.pl uses $0 for itself as a dependency rather than the > literal that the other regen scripts that I looked at. > > You'll only encounter b) if you run mk_invlists.pl manually - regen.pl > will run it as "regen/mk_invlists.pl" which matches the POSIX-ish > name.
As far as I can tell regen.pl never runs mk_invlists.pl, either it is manually run, or it its in TAP mode by from porting/regen.t, Your 2 patches fix the pathnames being rewriten if I regen the files, so feel free to push those 2 patches and reject my attempt at a fix. -- bulk88 ~ bulk88 at hotmail.com
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 1.2k
On Thu, 01 Mar 2018 13:23:07 -0800, bulk88 wrote: Show quoted text
> On Wed, 28 Feb 2018 20:48:30 -0800, tonyc wrote:
> > On Wed, 28 Feb 2018 18:20:29 -0800, bulk88 wrote:
> > > See attached patch. Diff of what goes wrong when > > > charclass_invlists.h > > > regened on windows.
> > > > Your patch is a workaround for bugs in mktables and in > > mk_invlists.pl. > > > > a) mktables attempts to write out canonical pathnames, but due to a > > lexcial scoping issue, doesn't. > > > > b) mk_invlists.pl uses $0 for itself as a dependency rather than the > > literal that the other regen scripts that I looked at. > > > > You'll only encounter b) if you run mk_invlists.pl manually - > > regen.pl > > will run it as "regen/mk_invlists.pl" which matches the POSIX-ish > > name.
> > As far as I can tell regen.pl never runs mk_invlists.pl, either it is > manually run, or it its in TAP mode by from porting/regen.t,
You're right, I think I got mixed up with porting/regen.t, which runs it with the /. Show quoted text
> Your 2 patches fix the pathnames being rewriten if I regen the files, > so feel free to push those 2 patches and reject my attempt at a fix.
Thanks for the feedback. Applied as b857191d01c23df63dc1112e443b194a13305179 and b857191d01c23df63dc1112e443b194a13305179. Tony
Download (untitled) / with headers
text/plain 317b
Thank you for filing this report. You have helped make Perl better. With the release yesterday of Perl 5.28.0, this and 185 other issues have been resolved. Perl 5.28.0 may be downloaded via: https://metacpan.org/release/XSAWYERX/perl-5.28.0 If you find that the problem persists, feel free to reopen this ticket.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org