This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Father Chrysostomos [Sun, 12 Jun 2016 13:19:47 +0000 (06:19 -0700)]
[perl #128260] Fix \substr %h
This is a follow-up to
79409ac8, which propagated substr’s own lvalue
context to the first argument only if it was one that would not croak
at compile time.
We can’t propagate OP_REFGEN lvalue context to the first argument,
as it causes the same bug for which #128260 was originally reported;
namely, that it prevents a hash or array from being flattened, causing
an unflattened aggregate to follow code paths that expect only sca-
lars, resulting in assertion failures:
$ ./perl -Ilib -e '%h=1..100; print ${\substr %h, 0}'
Assertion failed: (SvTYPE(sv) != SVt_PVAV && SvTYPE(sv) != SVt_PVHV && SvTYPE(sv) != SVt_PVFM), function Perl_sv_2pv_flags, file sv.c, line 2924.
Abort trap: 6
$ ./perl -Ilib -e '@h=1..100; print ${\vec @a, 0, 1}'
Assertion failed: (SvTYPE(sv) != SVt_PVAV && SvTYPE(sv) != SVt_PVHV && SvTYPE(sv) != SVt_PVFM), function Perl_sv_2pv_flags, file sv.c, line 2924.
Abort trap: 6
H.Merijn Brand [Sun, 12 Jun 2016 09:37:03 +0000 (11:37 +0200)]
Update the notes on Synology/DSM
Father Chrysostomos [Sat, 11 Jun 2016 01:08:50 +0000 (18:08 -0700)]
[perl #128260] Fix lvalue cx for substr and vec
When lvalue context was applied to the substr and vec at compile time,
that context was propagated to the first argument. That meant that
substr %foo, 1, = 3;
would correctly die, but give the wrong op in the error message, say-
ing ‘in scalar assignment’ whereas ‘in substr’ is more appropriate.
Contrariwise,
(substr %foo, 1) = 3;
would apply list lvalue context to %foo, which does not die at compile
time and prevents flattening (that’s what allows %foo=... to work).
The unflattened hash would be passed to internal functions that only
expect scalars, resulting in assertion failures.
The fix is to introduce two new types of scalar lvalue context, namely
OP_SUBSTR and OP_VEC, and apply those to the first argument, causing
both the examples above to die at compile time with ‘Can't modify hash
dereference in substr’.
If the surrounding context is only potential modifiable context (such
as \substr), then that same non-fatal context is applied to the
first argument.
Father Chrysostomos [Fri, 10 Jun 2016 15:54:56 +0000 (08:54 -0700)]
op.c: Factor out common code for potential lv cx
Father Chrysostomos [Fri, 10 Jun 2016 15:49:59 +0000 (08:49 -0700)]
Make lv keys distinguish scalar/list cx properly
keys(%h) was special in that it did not use the same code path as
other ops that distinguish between scalar and list lvalue context.
Consequently, some scalar lvalue contexts worked:
keys %h = 3;
${\scalar keys %h} = 3;
sub { $_[0] = 3 }->(scalar keys %h);
foreach(scalar keys %h) { $_ = 3 }
grep { $_ = 3 } scalar keys %h;
substr keys %h, 0, = 3;
while others did not:
keys %h .= 0;
read FH, keys %h, 0;
Fixing other bugs in the same code paths without breaking keys (or
adding *more* exceptions) is harder to do if keys is not consistent.
So this commit allows .= and read to assign to keys, by using the same
internal code (scalar_mod_type) that determines whether %h assignment
is allowed. The logic is reversed (since %h is list-only and keys %h
is scalar-only), so where %h is a valid lvalue keys %h is not, and
vice versa.
Father Chrysostomos [Thu, 9 Jun 2016 19:30:14 +0000 (12:30 -0700)]
bisect-runner.pl: Correct --no-module-tests example
Copy-&-paste strikes again!
Lukas Mai [Sat, 11 Jun 2016 10:40:42 +0000 (12:40 +0200)]
pod/*: remove deprecated L<"section"> and L<section> syntax
Lukas Mai [Sat, 11 Jun 2016 10:39:18 +0000 (12:39 +0200)]
README*: remove deprecated L<"section"> and L<section> syntax
Lukas Mai [Sat, 11 Jun 2016 10:07:23 +0000 (12:07 +0200)]
perldeltas: remove deprecated L<"section"> and L<section> syntax
Lukas Mai [Sat, 11 Jun 2016 10:06:41 +0000 (12:06 +0200)]
handy.h: remove deprecated L<"section"> syntax
Lukas Mai [Sat, 11 Jun 2016 09:42:46 +0000 (11:42 +0200)]
perlsyn: remove deprecated L<"section"> syntax
... and fix a typo.
Yves Orton [Fri, 10 Jun 2016 11:34:37 +0000 (13:34 +0200)]
fixup, guard av_top_index() for null RExC_warn_text
Yves Orton [Fri, 10 Jun 2016 10:20:20 +0000 (12:20 +0200)]
move warning text to RExC_state (via RExC_warn_text)
This way we reuse the same AV each time, and avoid various refcount bookkeeping issues, all at a relatively modest cost (IMO)
Sandbox [Wed, 8 Jun 2016 21:15:41 +0000 (23:15 +0200)]
Updates CPAN.pm to ANDK/CPAN-2.14-TRIAL.tar.gz
Yves Orton [Wed, 8 Jun 2016 16:42:30 +0000 (18:42 +0200)]
[perl #128313] Fix leak in perl 5.24 with strict and regex posix char classes
This patch is a refinement of one written by Dan Collins.
Any thanks for this patch should go to him.
Tony Cook [Wed, 8 Jun 2016 06:41:38 +0000 (16:41 +1000)]
perldelta for the
79881ad71252 merge
Tony Cook [Wed, 8 Jun 2016 05:12:37 +0000 (15:12 +1000)]
Only produce perlio debug output when the -Di switch is supplied
Craig A. Berry [Thu, 14 Apr 2016 19:23:52 +0000 (14:23 -0500)]
(perl #127380) Update PERLIO_DEBUG documentation.
Now defaults to stderr if unspecified, and requires -Di (and thus
-DDEBUGGING).
TonyC: modify a couple of verbatim lines to bring them under the limit
enforced by the new podcheck.t changes
Tony Cook [Thu, 7 Apr 2016 05:35:42 +0000 (15:35 +1000)]
(perl #127380) default PERLIO_DEBUG/-Di to use STDERR
This includes under taint, just as other -D switches write to stderr
when taint is on.
Tony Cook [Tue, 3 May 2016 00:41:15 +0000 (10:41 +1000)]
(perl #127380) add tests for -Di
Tony Cook [Mon, 28 Mar 2016 03:58:56 +0000 (14:58 +1100)]
(perl #127380) only trace to $PERLIO_DEBUG if -Di is supplied
Chad Granum [Tue, 7 Jun 2016 15:04:02 +0000 (08:04 -0700)]
Update to Test-Simple 1.302026
- Fix SHM leak
- Update Porting/Maintainers.pl
Father Chrysostomos [Tue, 7 Jun 2016 21:36:58 +0000 (14:36 -0700)]
Porting/todo.pod: refaliasing needs fixing still
I don’t know when I’ll be able to get to this. This seems like a good
place to jot down the ideas that existed only in my head till now.
Father Chrysostomos [Tue, 7 Jun 2016 21:17:38 +0000 (14:17 -0700)]
Porting/todo.pod: Suggest Deparse improvements
David Mitchell [Tue, 7 Jun 2016 16:41:20 +0000 (17:41 +0100)]
op/lex_assign.t: fix intermittent failures
The bulk of this test script tests whether ops which are capable of
the OA_TARGLEX optimisation return the same results with lexical and
package var assignments, i.e.
my $a;
$a = OP;
$b = OP;
is($a,$b);
When OP is 'time', the two calls can return different times, resulting in
occasional intermittent failures. So move time into it's custom test which
can cope with a delta of 1.
Similarly if the op is <*>, parallel testing can result in temporary files
appearing in the current directory, resulting in different returns.
However, since glob doesn't actually have the 'T' (OA_TARGLEX) set in
regen/opcodes, this test is moot - so skip it.
If glob ever does ever get OA_TARGLEX, and so need to be tested, it may
require some subtlety, such as globbing for a pattern that won't match any
temporary files.
Chris 'BinGOs' Williams [Tue, 7 Jun 2016 14:49:51 +0000 (15:49 +0100)]
Fix Pod-Checker version
Father Chrysostomos [Tue, 7 Jun 2016 05:30:17 +0000 (22:30 -0700)]
Porting/todo.pod: Add note to ‘repack the optree’
Father Chrysostomos [Tue, 7 Jun 2016 05:26:11 +0000 (22:26 -0700)]
Porting/todo.pod: Hey, we have refaliasing
Father Chrysostomos [Tue, 7 Jun 2016 05:25:19 +0000 (22:25 -0700)]
Porting/todo.pod: Rmv ‘LVALUE functions for lists’
$ ./perl -Ilib -e 'sub foo :lvalue{@hash{"foo","bar"}} (foo) = (3,4); use Data::Dumper; warn Dumper \%hash'
$VAR1 = {
'foo' => 3,
'bar' => 4
};
$ ./perl -Ilib -e 'sub foo :lvalue{@arr[1,2]} (foo) = (3,4); use Data::Dumper; warn Dumper \@arr'
$VAR1 = [
undef,
3,
4
];
Apparently slices do work.
Father Chrysostomos [Tue, 7 Jun 2016 05:21:11 +0000 (22:21 -0700)]
Porting/todo.pod: Update file name in ‘truncate() prototype’
Father Chrysostomos [Tue, 7 Jun 2016 05:19:46 +0000 (22:19 -0700)]
Porting/todo.pod: Point out problem with readpipe(LIST)
Father Chrysostomos [Tue, 7 Jun 2016 05:13:42 +0000 (22:13 -0700)]
Porting/todo.pod: Suggest documenting XS & lex subs
Father Chrysostomos [Tue, 7 Jun 2016 05:11:15 +0000 (22:11 -0700)]
Porting/todo.pod: Delete strcat/strcpy test entry
We have t/porting/libperl.t.
Tony Cook [Tue, 7 Jun 2016 05:11:44 +0000 (15:11 +1000)]
perldelta for
0a44e30b028e99
Dan Collins [Tue, 7 Jun 2016 01:04:46 +0000 (21:04 -0400)]
[perl #127333] add warning for until(assignment)
while ($a = 1) emits a warning "Found = in conditional, should be ==".
However, until ($a = 1) does not. The parser breaks down until
(condition) into while (!(condition)), which defeats the check in
S_scalarboolean, since it is looking for a conditional that /is/ an
assignment, but we have a conditional that is a thinly veiled assignment.
A similar bug is [perl #127122]. That bug was fixed by treating
unless (a) {b} else {c} as if (a) {c} else {b}, instead of treating it
as if (!a) {b} else {c}. That approach will not work here.
Instead, the test in S_scalarboolean has been widened. It previously
looked for an OP_SASSIGN with op_first OP_CONST, it now also detects an
OP_NOT surrounding that construct.
Tests for both while() and until() were also added to t/lib/warnings/op.
Tony Cook [Tue, 7 Jun 2016 01:30:03 +0000 (11:30 +1000)]
skip a Tets-Simple test that's leaking shm blocks
Reported upstream as
https://github.com/Test-More/test-more/issues/679
Karl Williamson [Mon, 6 Jun 2016 21:12:53 +0000 (15:12 -0600)]
Porting/todo.pod: Don't need pod fixes anymore
I recently fixed just about all the core perl pod errors that are
fixable, so this task can be considered completed.
Andy Lester [Mon, 6 Jun 2016 19:13:53 +0000 (14:13 -0500)]
Fix compiler warning -Wuninitialized
Father Chrysostomos [Mon, 6 Jun 2016 20:41:39 +0000 (13:41 -0700)]
Increase $XS::APItest::VERSION to 0.82
Father Chrysostomos [Mon, 6 Jun 2016 20:40:12 +0000 (13:40 -0700)]
Add intro_my to XS::APItest::lexical_import
so that code thieves will have some correct code to steal.
Without intro_my(), the lexical subs installed in a ‘use’ block will
not be visible to the following statement, but only the one after it.
BEGIN blocks already get intro_my called, so it worked already with a
BEGIN block, but not with ‘use’.
Tony Cook [Mon, 6 Jun 2016 00:43:48 +0000 (10:43 +1000)]
(perl #127993) test reporting of multiple conflict markers
Lukas Mai [Sat, 4 Jun 2016 11:05:36 +0000 (13:05 +0200)]
use yyerror instead of croaking immediately (RT #127993)
Dominic Hargreaves [Sun, 5 Jun 2016 10:44:51 +0000 (11:44 +0100)]
constant: don't skip the E2BIG test on Hurd, but improve comments
As Father Chrysostomos explained on [perl #128319] the previous change
was based on a misunderstanding of the purpose of the test, which is
only to test that constant.pm can create a dualvar out of $! which
has an error string, and nothing specifically to do with E2BIG.
The new comments, also suggested by Father Chrysostomos, make this more
clear.
Dominic Hargreaves [Sat, 4 Jun 2016 13:36:26 +0000 (14:36 +0100)]
constant: skip E2BIG test on GNU/Hurd
Hurd doesn't use 7 for E2BIG, so this string test would fail if the
test itself were more precise.
Lukas Mai [Sat, 4 Jun 2016 10:44:57 +0000 (12:44 +0200)]
fix bogus "at end of line" error message for "my (my $x, $y, $z)"
Lukas Mai [Sat, 4 Jun 2016 10:23:06 +0000 (12:23 +0200)]
spelling: s/delimeter/delimiter/
Father Chrysostomos [Fri, 3 Jun 2016 05:35:10 +0000 (22:35 -0700)]
[perl #128307] Fix ‘foo ? require : bar’
The lexer’s bareword-parser that kicks in after it sees ‘require’ was
getting confused by the single colon, since it assumed that if the
thing that followed began with a letter or colon it must be a package
or module name. Hence, require with : after it was parsed as
require "", but with a ‘bareword’ "". The lexer should be checking
for two colons, not just one.
Father Chrysostomos [Fri, 3 Jun 2016 05:10:04 +0000 (22:10 -0700)]
Don’t use yyerror for each($scalar) experiment err
This is a follow-up to
69e7f50e50.
69e7f50e50 resulted in yyerror
being called twice for the same error, resulting in double diagnos-
tics for where the error occurred:
$ ./perl -e 'keys $scalar, $1'
Experimental keys on scalar is now forbidden at -e line 1, near "$scalar,"
Type of arg 1 to keys must be hash or array (not scalar dereference) at -e line 1, near "$scalar,"
Execution of -e aborted due to compilation errors.
We don’t need ‘near "$scalar,"’ twice.
For the first one we should queue the error directly, using qerror()
(which yyerror itself normally calls), so we don’t get double
diagnostics.
Aaron Crane [Thu, 2 Jun 2016 18:11:12 +0000 (19:11 +0100)]
Add Configure probe for strerror_l()
As requested by khw++
Until the relevant symbol is used, HAS_STRERROR_L must be mentioned
explicitly in metaconfig.h.
This corresponds to metaconfig
d0838744f03cfe7642950ea91dd48f575d0bfd15.
Aaron Crane [Thu, 2 Jun 2016 18:04:49 +0000 (19:04 +0100)]
Add Configure probe for querylocale()
As requested by khw++
Until the relevant symbol is used, HAS_QUERYLOCALE must be mentioned
explicitly in metaconfig.h.
This corresponds to metaconfig
541f0dd272df4f9326996727898393ac8f6626f7.
Aaron Crane [Thu, 2 Jun 2016 17:56:02 +0000 (18:56 +0100)]
Rebuild Configure from current metaconfig
Relevant changes:
commit
5d3ffa97290d2d3d65a42a0ed8b69d945b661ee7
Author: H.Merijn Brand - Tux <h.m.brand@xs4all.nl>
Date: Sun May 29 15:30:33 2016 +0200
Finish.U isn't modified anymore
All changes accepted by upstream. One down, 164 to go
commit
5d805d83bd4663831594540ddadeeb6213d19736
Author: H.Merijn Brand - Tux <h.m.brand@xs4all.nl>
Date: Sat May 14 18:48:26 2016 +0200
Remove trailing whitespace on meta-lines in unit files
This change has also been proposed as PR to dist upstream
commit
b9807b5fe3f4c97fa34e19b8a9b265f91f0e4aca
Author: H.Merijn Brand - Tux <h.m.brand@xs4all.nl>
Date: Sat May 14 18:30:03 2016 +0200
Merged changes to Finish.U
Craig A. Berry [Thu, 2 Jun 2016 12:18:20 +0000 (07:18 -0500)]
Get EUMM basic.t passing again on Win32.
There are dueling uses of PERL_CORE. On Windows, the FIXIN macro
assumes it can run pl2bat.bat from the installed Perl if PERL_CORE
is not set, so deleting PERL_CORE from the environment as this
test was doing makes you get the wrong one (or none at all).
But if PERL_CORE is set, the metafile target is not generated in
the Makefile, so you can't test that or things that depend on it
(e.g. disttest). So at least for now, get basic.t passing by
skipping those tests.
Sawyer X [Wed, 1 Jun 2016 09:21:33 +0000 (11:21 +0200)]
Renée Bäcker will be doing the October release, 5.25.10
Tony Cook [Wed, 1 Jun 2016 07:23:05 +0000 (17:23 +1000)]
allow ext/XS-APItest/t/win32.t to pass with both E: and T: drives
Encountered while testing locally on Windows 7 x64.
cmd.exe stores the current directory for each drive as entries in the
environment, like:
C:\Users\tony>set "" | findstr "^="
=::=::\
=C:=C:\Users\tony
=D:=D:\ASM1061
When a Win32 build of perl built with USE_IMP_SYS starts up it saves
the current directories of each drive in a per-thread structure so
that each pseudo-forked process can have it's own set of drive current
directories.
If you run an external command, some versions of cmd.exe will add
an entry to the environment storing the result of that command, for
example:
C:\Users\tony>set "" | find "ExitCode"
C:\Users\tony>git status
fatal: Not a git repository (or any of the parent directories): .git
C:\Users\tony>set "" | find "ExitCode"
=ExitCode=
00000080
which is similar to the current directory entries.
The sloppy parsing by VDir::FromEnv[WA]() would treat that as a
current directory entry for the E: drive, copying the "tCode=...."
into the current directory. Normally these values include a leading
drive letter and \, like "E:\", but this case leaves us without that.
Later, when harness spawns the child process it builds a new environment
block, including the drive current directories, which is done by
VDir::BuildEnvironmentSpace(). This, rather than using the index of
the drive to build the "=C:=..." entries above, uses the first
letter of the stored entry, so the environment block would have
something like:
t:=tCode=
00000080
which the child perl would treat as the current directory for the T:
drive.
Father Chrysostomos [Tue, 31 May 2016 13:32:16 +0000 (06:32 -0700)]
[perl #128294] bisect-runner.pl: --no-module-tests
Karl Williamson [Mon, 30 May 2016 16:39:05 +0000 (10:39 -0600)]
Unicode/UCD.t: better handling of errors
This now looks for the PERL_DIFF_TOOL environment variable, and if found
uses that to display some problems. If not found, it uses is(), with a
message that better output is available through setting this variable.
PERL_DIFF_TOOL is a convention I wasn't familiar with.
Jarkko Hietaniemi [Sat, 28 May 2016 17:56:27 +0000 (13:56 -0400)]
Add an example of the '0x' string format.
I am not certain that I find the 'leading zero means hex' format
recommendable ('0123' meaning '0x123', the octal format has poisoned
the well); but water under the bridge.
Samuel Thibault [Mon, 30 May 2016 15:11:00 +0000 (11:11 -0400)]
Modify hints for Hurd per Debian ticket 825020.
For: RT #128279
Patch written by Samuel Thibault, forwarded by Dominic Hargreaves.
Chad Granum [Mon, 30 May 2016 12:56:31 +0000 (05:56 -0700)]
Update Test-Simple in blead
This updates to the latest Test-Simple. This fixes several small bugs
including noisy STDERR in the test suite, and leaking TEMP files.
Father Chrysostomos [Sun, 29 May 2016 22:48:24 +0000 (15:48 -0700)]
op.c:S_my_kid: Remove obsolete comment
/* XXX does this let anything illegal in? */
The commit that added that comment indeed allowed ‘our $$x’ and even
‘my $$x’, so it was a problem at the time. It was this commit:
commit
77ca0c92d2c0e47301d906d355d9ab3afb6f6bcb
Author: Larry Wall <larry@wall.org>
Date: Fri Sep 24 14:59:37 1999 -0700
Re: [PATCH 5.005_61] "our" declarations
This commit fixed the problem:
commit
b6512f489e761186d508cf0b8b7705805cfefc52
Author: Mark-Jason Dominus <mjd@plover.com>
Date: Mon Dec 24 13:14:48 2001 -0500
PATCH: Restore "Can't declare scalar dereference in my" error
so the comment is no longer relevant.
Father Chrysostomos [Sun, 29 May 2016 21:18:07 +0000 (14:18 -0700)]
[perl #128266] libperl.t: Ignore $UNIX2003 suffix
Dominic Hargreaves [Sat, 28 May 2016 14:51:53 +0000 (15:51 +0100)]
ext/POSIX/t/sigaction.t: Skip uid and pid tests on GNU/Hurd
SA_SIGINFO does not include uid and pid on GNU/Hurd, and this is
unlikely to change in the near future, so skip these tests.
Thanks to Samuel Thibault for the report.
Bug-Debian: https://bugs.debian.org/825016
Karl Williamson [Wed, 25 May 2016 19:22:26 +0000 (13:22 -0600)]
podcheck.t: Include tr// and y// detection
These are like regular expressions, and for syntactic purposes can be
treated as such.
Karl Williamson [Fri, 27 May 2016 17:24:57 +0000 (11:24 -0600)]
Merge branch to update Pod::Checker into blead
This merge branch contains two commits, which should be considered
inseperable. The first updates Pod::Checker, and the second changes
podcheck.t to use the new Pod::Checker.
This is the biggest remaining step in allowing Pod::Parser to be
removed from core. podcheck.t still uses Pod::Parser to extract just
the pod from files. That dependency can be removed when Pod::Simple
changes to allow equivalent functionality, something I myself am working
on.
There are two cpan .t files (both in pod2usage) that use subcomponents
of Pod::Parser (Pod::Find and Pod::PlainText). There appears to be
similar functionality in Pod::Simple, so that shouldn't be too hard to
fix, but I haven't looked further than finding that these aren't drop-in
replacements. The pod2usage maintainer has been notified.
Karl Williamson [Wed, 25 May 2016 17:10:18 +0000 (11:10 -0600)]
podcheck.t: Use new Pod::Checker
podcheck.t extends the Pod::Checker class. Pod::Checker has been
rewritten to base off of Pod::Simple instead of Pod::Parser, and so
podcheck.t must switch to use use the completely new methods defined.
Karl Williamson [Wed, 25 May 2016 17:10:23 +0000 (11:10 -0600)]
Update Pod::Checker to CPAN version 1.72
This is now based on Pod::Simple instead of Pod::Parser
podcheck.t will fail until the next commit is done.
Karl Williamson [Thu, 26 May 2016 23:33:32 +0000 (17:33 -0600)]
Subject: Pod::Checker: convert files from DOS to unix
This is in preparation for applying patches to these. git am failed on
these. Only files that need to be DOS should be.
The version is bumped to 1.72, which is what version the real patches
are from.
Karl Williamson [Wed, 25 May 2016 16:40:51 +0000 (10:40 -0600)]
podcheck.t: Move a declaration
This just moves a variable declaration and initialization to elsewhere
in the file where it can be used in a different place in a future
commit. And it is now placed where it is more visible, as it really is
a program-level definition.
The code is outdented as well, and the comment unwrapped to be on a
single line, but no other changes were made.
Karl Williamson [Thu, 3 Mar 2016 21:24:39 +0000 (14:24 -0700)]
regcomp.c: Add shortcuts to some inversion list ops
When taking the union or intersection of two inversion lists, not
infrequently the result is the same as one of the inputs. An example is
the union of a set that contains all code points with any other set.
The result is the set that contains all code points. Also, not
infrequently, the result is to overwrite one of the inputs. If the
other input contributed nothing to the result, the whole operation is
effectively a no-op, as the result has the same contents as the input it
overwrites.
It turns out that it is cheap to keep track of if just one input
contributes to the result. This commit does that, and short-circuits
the rest of the code if it is going to turn out to be a no-op.
Karl Williamson [Thu, 26 May 2016 01:23:57 +0000 (19:23 -0600)]
ext/VMS-DCLsym/DCLsym.pm: Fix missing pod reference
This looks like it was meant to point to a later heading or item in the
document, but which was removed at some point, with the reference left
dangling. I confirmed with Craig Berry that what it is referring to is
the text in the next paragraph.
Karl Williamson [Wed, 25 May 2016 04:14:59 +0000 (22:14 -0600)]
Devel::Peek: Fix a couple of pod glitches
Karl Williamson [Wed, 25 May 2016 01:35:17 +0000 (19:35 -0600)]
porting/dual-life.t: Clarify test messages
This changes the message output by the ok() sub to show precisely what
is being tested
David Mitchell [Wed, 25 May 2016 18:15:27 +0000 (19:15 +0100)]
fix locale.c under -DPERL_GLOBAL_STRUCT(_PRIVATE)
With that build option initialised statics aren't allowed (no BSS).
So just disable using $ENV{PERL_DEBUG_LOCALE_INIT} under
-DPERL_GLOBAL_STRUCT.
David Mitchell [Wed, 25 May 2016 17:50:10 +0000 (18:50 +0100)]
porting/libperl.t: better diag output
when it complains about unexpected BSS symbols, list them
David Mitchell [Wed, 25 May 2016 17:30:17 +0000 (18:30 +0100)]
add missing dVAR in pp_avhvswitch
make it build under -DPERL_GLOBAL_STRUCT.
Karl Williamson [Wed, 25 May 2016 03:31:13 +0000 (21:31 -0600)]
ExtUtils::ParseXS: Silence some pod warnings
These were found by the new Pod::Checker, soon to be committed.
Karl Williamson [Wed, 25 May 2016 03:23:59 +0000 (21:23 -0600)]
PathTools: fix Pod::Checker warning for pod
The new Pod::Checker soon to be commited doesn't like lines with only
white space.
Karl Williamson [Thu, 28 Apr 2016 22:53:40 +0000 (16:53 -0600)]
Pod::Functions/Functions_pm.PL: Fix pod error
This is trailing white space, that is warned against by the
new version of Pod::Checker that is soon to be committed.
David Mitchell [Tue, 24 May 2016 22:45:48 +0000 (23:45 +0100)]
locale.c: don't use strcpy()
A recent commit added a strcpy() to locale.c.
This is Frowned Upon, and was making porting/libperl.t fail.
Since PL_strxfrm_min_char appears to be a 3-byte buffer, I've just changed
it to manually copy 3 individual bytes - which is probably more efficient
than a full-blown Copy(). But I haven't looked closely at whether this is
correct - this is more of quick fix to get smoking passing again.
Karl Williamson [Fri, 13 May 2016 17:32:44 +0000 (11:32 -0600)]
locale.c: Make locale collation predictions adaptive
We try to avoid calling strxfrm() more than needed by predicting its
needed buffer size. This generally works because the size of the
transformed string is roughly linear with the size of the input string.
But the key word here is "roughly". This commit changes things, so that
when we guess low, we change the coefficients in the equation to guess
higher the next time.
Karl Williamson [Tue, 12 Apr 2016 20:28:57 +0000 (14:28 -0600)]
locale.c: Not so aggressive collation memory use guess
On platforms where strxfrm() is not well-behaved, and it fails because
it needs a larger buffer, prior to this commit, the size was doubled
before trying again. This could require a lot of memory on large
inputs. I'm uncomfortable with such a big delta on very large strings.
This commit changes it so it is not so aggressive. Note that this now
only gets called on platforms whose strxfrm() is not well behaved, and I
think the size prediction is better due to a recent commit, and there
isn't really much of a downside in not gobbling up memory so fast.
Karl Williamson [Wed, 18 May 2016 19:18:01 +0000 (13:18 -0600)]
locale.c: Add some debugging statements
Karl Williamson [Wed, 18 May 2016 19:17:25 +0000 (13:17 -0600)]
locale.c: Minor cleanup
This replaces an expression with what I think is an easier to understand
macro, and eliminates a couple of temporary variables that just
cluttered things up.
Karl Williamson [Sun, 15 May 2016 00:23:02 +0000 (18:23 -0600)]
locale.c: Fix some debugging so will output during init
Because the command line options are currently parsed after the locale
initialization is done, an environment variable is read to allow
debugging of the function that is called to do the initialization.
However, any functions that it calls, prior to this commit, were unaware
of this and so did not output debugging. This commit fixes most of
them.
Karl Williamson [Tue, 12 Apr 2016 18:49:36 +0000 (12:49 -0600)]
mv function from locale.c to mathoms.c
The previous commit causes this function being moved to be just a
wrapper not called in core. Just in case someone is calling it, it is
retained, but moved to mathoms.c
Karl Williamson [Wed, 18 May 2016 02:50:55 +0000 (20:50 -0600)]
Do better locale collation in UTF-8 locales
On some platforms, the libc strxfrm() works reasonably well on UTF-8
locales, giving a default collation ordering. It will assume that every
string passed to it is in UTF-8. This commit changes Perl to make sure
that strxfrm's expectations are met.
Likewise under a non-UTF-8 locale, strxfrm is expecting a non-UTF-8
string. And this commit makes sure of that as well.
So, simply meeting strxfrm's expectations allows Perl to start
supporting default collation in UTF-8 locales, and fixes it to work on
single-byte locales with UTF-8 input. (Unicode::Collate provides
tailorable functionality and is portable to platforms where strxfrm
isn't as intelligent, but is a much more heavy-weight solution that may
not be needed for particular applications.)
There is a problem in non-UTF-8 locales if the passed string contains
code points representable only in UTF-8. This commit causes them to be
changed, before being passed to strxfrm, into the highest collating
character in the locale that doesn't require UTF-8. They then will sort
the same as that character, which means after all other characters in
the locale but that one. In strings that don't have that character,
this will generally provide exactly correct operation. There still is a
problem, if that character, in the given locale, combines with adjacent
characters to form a specially weighted sequence. Then, the change of
these above-255 code points into that character can skew the results.
See the commit message for
6696cfa7cc3a0e1e0eab29a11ac131e6f5a3469e for
more on this. But it is really an illegal situation to have above-255
code points in a single-byte locale, so this behavior is a reasonable
degradation when given illegal input. If two transformed strings
compare exactly equal, Perl already uses the un-transformed versions to
break ties, and there, these faked-up strings will collate so the
above-255 code points sort after everything else, and in code point
order amongst themselves.
Karl Williamson [Tue, 12 Apr 2016 19:51:48 +0000 (13:51 -0600)]
perllocale: Change headings so two aren't identical
Two html anchors in this pod were identical, which isn't a problem
unless you try to link to one of them, as the next commit does
Karl Williamson [Tue, 12 Apr 2016 17:21:40 +0000 (11:21 -0600)]
Change calculation of locale collation coefficients
Every time a new collation locale is set, two coefficients are calculated
that are used in predicting how much space is needed in the
transformation of a string by strxfrm(). The transformed string is
roughly linear with the the length of the input string, so we are
calcaulating 'm' and 'b' such that
transformed_length = m * input_length + b
Space is allocated based on this prediction. If it is too small, the
strxfrm() will fail, and we will have to increase the allotted amount
and try again. It's better to get the prediction right to avoid
multiple, expensive strxfrm() calls.
Prior to this commit, the calculation was not rigorous, and failed on
some platforms that don't have a fully conforming strxfrm().
This commit changes to not panic if a locale has an apparent defective
collation, but instead silently change to use C-locale collation. It
could be argued that a warning should additionally be raised.
This commit fixes [perl #121734].
Karl Williamson [Tue, 12 Apr 2016 01:11:07 +0000 (19:11 -0600)]
locale.c: Change algorithm for strxfrm() trials
It's kind of guess work deciding how big a buffer to give to strxfrm().
If you give it too small a one, it will fail. Prior to this commit, the
buffer size was doubled and then strxfrm() was called again, looping
until it worked, or we used too much memory.
Each time a new locale is made, we try to minimize the necessity of
doing this by calculating numbers 'm' and 'b' that can be plugged into
the equation
mx + b
where 'x' is the size of the string passed to strxfrm(). strxfrm() is
roughly linear with respect to its input's length, so this generally
works without us having to do many loops to get a large enough size.
But on many systems, strxfrm(), in failing, returns how much space you
should have given it. On such systems, we can just use that number on
the 2nd try and not have to keep guessing. This commit changes to do
that.
But on other systems this doesn't work. So the original method is
retained if we determine that there are problems with strxfrm(), either
from previous experience, or because using the size returned from the
first trial didn't work
Karl Williamson [Sun, 10 Apr 2016 02:40:48 +0000 (20:40 -0600)]
locale.c: Free over-allocated space early
We may over malloc some space in buffers to strxfrm(). This frees it
now instead of waiting for the whole block to be freed sometime later.
This can be a significant amount of memory if the input string to
strxfrm() is long.
Karl Williamson [Sun, 10 Apr 2016 02:36:01 +0000 (20:36 -0600)]
locale.c: White-space only
Outdent and reflow because the previous commit removed an enclosing
block.
Karl Williamson [Sat, 9 Apr 2016 21:52:05 +0000 (15:52 -0600)]
Change mem_collxfrm() algorithm for embedded NULs
One of the problems in implementing Perl is that the C library routines
forbid embedded NUL characters, which Perl accepts. This is true for
the case of strxfrm() which handles collation under locale.
The best solution as far as functionality goes, would be for Perl to
write its own strxfrm replacement which would handle the specific needs
of Perl. But that is not going to happen because of the huge complexity
in handling it across many platforms. We would have to know the
location and format of the locale definition files for every such
platform. Some might follow POSIX guidelines, some might not.
strxfrm creates a transformation of its input into a new string
consisting of weight bytes. In the typical but general case, a 3
character NUL-terminated input string 'A B C 00' (spaces added for
readability) gets transformed into something like:
A¹ B¹ C¹ 01 A² B² C² 01 A³ B³ C³ 00
where the superscripted characters are weights for the corresponding
input characters. Superscript 1 represents (essentially) the primary
sorting key; 2, the secondary, etc, for as many levels as the locale
definition gives. The 01 byte is likely to be the separator between
levels, but not necessarily, and there could be some other mechanisms
used on various platforms.
To handle embedded NULs, the simplest thing would be to just remove them
before passing in to strxfrm(). Then they would be entirely ignored,
which might not be what you want. You might want them to have some
weight at the tertiary level, for example. It also causes problems
because strxfrm is very context sensitive. The locale definition can
define weights for specific sequences of any length (and the weights can
be multi-byte), and by removing a NUL, two characters now become
adjacent that weren't in the input, and they could now form one of those
special sequences and thus throw things off.
Another way to handle NULs, that seemingly ignores them, but actually
doesn't, is the mechanism in use prior to this commit. The input string
is split at the NULs, and the substrings are independently passed to
strxfrm, and the results concatenated together. This doesn't work
either. In our example 'A B C 00', suppose B is a NUL, and should have
some weight at the tertiary level. What we want is:
A¹ C¹ 01 A² C² 01 A³ B³ C³ 00
But that's not at all what you get. Instead it is:
A¹ 01 A² 01 A³ C¹ 01 C² 01 C³ 00
The primary weight of C comes immediately after the teriary weight of A,
but more importantly, a NUL, instead of being ignored at the primary
levels, is significant at all levels, so that "a\0c" would sort before
"ab".
Still another possibility is to replace the NUL with some other
character before passing it to strxfrm. That was my original plan, to
replace each NUL with the character that this code determines has the
lowest collation order for the current locale. On strings that don't
contain that character, the results would be as good as it gets for that
locale. That character is likely to be ignored at higher weight levels,
but have some small non-ignored weight at the lowest ones. And
hopefully the character would rarely be encountered in practice. When
it does happen, it and NUL would sort identically; hardly the end of the
world. If the entire strings sorted identically, the NUL-containing one
would come out before the other one, since the original Perl strings are
used as a tie breaker. However, testing showed a problem with this. If
that other character is part of a sequence that has special weighting,
the results won't be correct. With gcc, U+00B4 ACUTE ACCENT is the
lowest collating character in many UTF-8 locales. It combines in
Romanian and Vietnamese with some other characters to change weights,
and hence changing NULs into U+B4 screws things up.
What I finally have come to is to do is a modification of this final
approach, where the possible NUL replacements are limited to just
characters that are controls in the locale. NULs are replaced by the
lowest collating control. It would really be a defective locale if this
control combined with some other character to form a special sequence.
Often the character will be a 01, START OF HEADING. In the very
unlikely case that there are absolutely no controls in the locale, 01 is
used, because we have to replace it with something.
The code added by this commit is mostly utf8-ready. A few commits from
now will make Perl properly work with UTF-8 (if the platform supports
it). But until that time, this isn't a full implementation; it only
looks for the lowest-sorting control that is invariant, where the
the UTF8ness doesn't matter. The added tests are marked as TODO until
then.
Karl Williamson [Wed, 18 May 2016 03:53:53 +0000 (21:53 -0600)]
locale.c: Add, move, clarify comments
This moves a large block of comments to before a block, outdents it, and
adds to it, plus adding another comment
Karl Williamson [Mon, 16 May 2016 21:19:14 +0000 (15:19 -0600)]
Keep track of if collation locale is UTF-8 or not
This will be used in future commits
Karl Williamson [Mon, 16 May 2016 21:15:26 +0000 (15:15 -0600)]
locale.c: Don't use special locale collation for C locale
We can skip all the locale collation calculations if the locale we are
in is C or POSIX.
Karl Williamson [Sat, 21 May 2016 17:35:10 +0000 (11:35 -0600)]
perllocale: Document NUL collation handling
And add a TODO test, because this shortly will be improved upon
Karl Williamson [Fri, 13 May 2016 17:51:55 +0000 (11:51 -0600)]
lib/locale.t: Don't calculate value unless needed
Karl Williamson [Mon, 23 May 2016 16:01:41 +0000 (10:01 -0600)]
mathoms.c: Remove obsolete text
makedef.pl no longer needs special handling for any functions that get
moved to mathoms.c
Chris 'BinGOs' Williams [Tue, 24 May 2016 10:39:59 +0000 (11:39 +0100)]
Update ExtUtils-MakeMaker to CPAN version 7.18
[DELTA]
7.18 Mon May 23 15:55:26 BST 2016
No changes since 7.17_03
7.17_03 Wed May 11 18:22:06 BST 2016
Dist fixes:
- remove build_requires on ourselves
7.17_02 Mon May 9 23:55:09 BST 2016
Bug fixes:
- Resolve a regression in c_o with trailing spaces
7.17_01 Mon May 9 20:02:02 BST 2016
Test fixes:
- Resolve issues with tests when running in core
7.16 Sat May 7 10:13:05 BST 2016
No changes since 7.15_03
7.15_03 Sun May 1 14:13:44 BST 2016
Bug fixes:
- lazy load Time::HiRes in ExtUtils::Command::MM
- fix 5.6 compat by removing indexed sprintf
7.15_02 Thu Apr 28 12:54:23 BST 2016
Bug fixes:
- Fix regression with small fractional numeric versions
7.15_01 Wed Apr 27 19:13:46 BST 2016
Bug fixes:
- Fix regression with SKIP and dynamic and static targets
7.14 Sun Apr 24 13:53:33 BST 2016
No changes since 7.13_01
7.13_01 Sat Apr 23 16:41:20 BST 2016
Bug fixes:
- Make dynamic depend on config again, fixes issues with Inline
7.12 Tue Apr 19 12:24:41 BST 2016
Enhancements:
- version ranges are now supported for PREREQS, etc.
- Metadata is now represented internally as Meta Spec 2.0
- ExtUtils::Command has been re-incorporated at 1.19 of that module
- Refactored XS handling
- XSMULTI=>1 - put multiple *.xs under lib, it "just works" and XSBUILD
for refined control of XSMULTI
- can do "make test" without first doing "make"
Bug fixes:
- Handle new warnings from File::Path
- Resolve RT#106572 specifying AUTHOR via command-line is broken
- Warning on missing TEST_REQUIRES and CONFIGURE_REQUIRES
- Sanitise make_type on Win32
- Cygwin rebase fixes
- Makefile starting comments reflect decoded @ARGV, not raw
- Add various targets to .PHONY to avoid disk IO with dmake
- Fixed race condition in realclean
- improve static-build lib detection
- Eliminate non-error STDERR
- Make WriteEmptyMakefile Makefile functional when called in subdir
- manifypods fixes
- perllocal.pod generation "Perl in Space" fix
- PASTHRU fixes
- Fix distsignature dependencies for parallel make
- Check exit status for commands in "make ci" target
- Less noisey output during building sub-modules
- Fix dos2unix() on Windows
- stop makeaperl from polluting @ARGV in cases where ARGV contains args with spaces
- Fix regression when both test.pl and t/*.t are present
- Refactored internals to remove DirHandle usage
- MM_Unix::find_perl() dont repeatedly stat the same path in a loop
- No longer repeatedly attempt to load CPAN::Meta if it is now available
VMS fixes:
- Made MM_VMS::oneline build continuation lines properly
- Implemented XSMULTI and XSBUILD
- Resurrect PASTHRU on VMS
- make_macro should handle multiple macros
- Fix regression with File::Spec changes in previous release
Win32 fixes:
- t/echo.t needs SHELL env for Win32 gmake
Dist fixes:
- Made %ExtraPrereqs match bundled prereqs
- Included MANIFEST.SKIP from ExtUtils::Manifest
- The bundled Encode::Locale has been updated to 1.04
Test fixes:
- test PL_FILES of a "module"
- Various tests no longer require a separate .pm file for testing
- Support v5.6.1 in various tests
- test static build if $ENV{AUTHOR_TESTING}
- XS tests now pluggable
- test for "Perl in Space"
Doc fixes:
- better document for PL_FILES, oneliner method
- FAQ updated
Dagfinn Ilmari Mannsåker [Tue, 24 May 2016 10:25:49 +0000 (11:25 +0100)]
Fix class name typo typo in perlootut example
It's spelled correctly in the body text, but the code had it wrong.