2 weeks agomove most of the work code from do_close to io_close() tonyc/127663-safe-inplace
Tony Cook [Thu, 26 May 2016 05:31:33 +0000]
move most of the work code from do_close to io_close()

(this commit will be rebased back to the top)

2 weeks ago(perl #127663) test that setuid is preserved with nested in-place editing
Tony Cook [Mon, 23 May 2016 05:59:44 +0000]
(perl #127663) test that setuid is preserved with nested in-place editing

This test fails previously.

2 weeks ago(perl #127663) add more in-place edit tests
Tony Cook [Mon, 23 May 2016 23:06:18 +0000]
(perl #127663) add more in-place edit tests

2 weeks ago(perl #127663) all platforms no longer need a backup file
Tony Cook [Thu, 19 May 2016 05:22:32 +0000]
(perl #127663) all platforms no longer need a backup file

Since we do the work without touching the original file.

2 weeks agomake sure the Perl_my_mkstemp() name is always available
Tony Cook [Wed, 18 May 2016 06:02:52 +0000]
make sure the Perl_my_mkstemp() name is always available

2 weeks agouse internal drand48() to innoculate against quadratic behaviour in pp_sort
Tony Cook [Wed, 18 May 2016 05:17:42 +0000]
use internal drand48() to innoculate against quadratic behaviour in pp_sort

2 weeks agouse the "internal" random source to initialize hash randomization
Tony Cook [Wed, 18 May 2016 05:08:50 +0000]
use the "internal" random source to initialize hash randomization

2 weeks ago(perl #127663) add our own mkstemp() implementation
Tony Cook [Thu, 12 May 2016 06:58:05 +0000]
(perl #127663) add our own mkstemp() implementation

this needs a couple of adjustments:

- needs a wrapper that calls either the system mkstemp() with a fallback
to Perl_my_mkstemp().

Not based on any particular implementation, the BSD implementations
tend to be wrappers around a megafunction that also does a few variations
of mkstemp() and mkdtemp(), which we don't need (yet.)

One implementation I found, part of the heimdal crypto library, was
simpler, but horrible.

2 weeks ago(perl #127663) create a separate random souce for internal use
Tony Cook [Wed, 18 May 2016 05:03:14 +0000]
(perl #127663) create a separate random souce for internal use

2 weeks ago(perl #127663) ensure abandoned work files are cleaned up
Tony Cook [Thu, 12 May 2016 04:46:18 +0000]
(perl #127663) ensure abandoned work files are cleaned up

If the user code that's processing in-place edit files exits or dies,
previously this would leave the in-place edit work file in place.

This patch deletes the temp file, abandoning the edit, which is a change
from the old in-place editing, so maybe this should do the normal
success processing currently done in do_close().

2 weeks ago(perl #127663) don't test renaming directories if rename() isn't available.
Tony Cook [Thu, 12 May 2016 01:31:19 +0000]
(perl #127663) don't test renaming directories if rename() isn't available.

Perl uses link() to implement rename() if the rename system call
isn't available, but using link() on directories varies between
unavailable and dangerous.

Since we haven't had any reports that of this test failing, it may
mean we don't need to fallback to link().

2 weeks ago(perl #127663) use link when rename() isn't available
Tony Cook [Thu, 12 May 2016 01:29:37 +0000]
(perl #127663) use link when rename() isn't available

I suspect this is unnecessary, since unrelated tests failed without
rename(), but it's not a huge change.

Also, if rename() is available, attempt use link() to create the backup
so there's always some version of the original file.  Falls back to
rename() if the link() fails, since the filesystem might not support
link().

2 weeks ago(perl #127663) WIP, safer in-place editing
Tony Cook [Mon, 9 May 2016 04:59:56 +0000]
(perl #127663) WIP, safer in-place editing

Previously in-place editing opened the file then immediately
*replaced* the file, so if an error occurs while writing the output,
such as running out of space, the content of the original file is lost.

This changes in-place editing to write to a work file which is renamed
over the original only once the output file is successfully closed.

It also fixes an issue with setting setuid/setgid file modes for
recursive in-place editing.

The implementation (beyond some TODO issues below) has at least one
problem - if the user code changes directory between the file open and
the close then the final clean-up stage is going to fail if the input
name wasn't an absolute path.

This might be fixable, but on some systems it may put the perl process
in a difficult to recover from position - if the system doesn't
implement getcwd() perl may change directory out of the original and not
have a way to return to it.

Now the TODO issues:

- the code uses mkstemp() - solvable by adapting a BSD implementation if
the system doesn't provide it.

- the code uses rename() - I need to re-work the code to use link() /
UNLINK() where rename() isn't available

- perl -i.back -pe 'exit' foo # leaves an orphan work file, this might
be messy to fix (the fix would be trashing the work file, not moving it
over the original).

- where rename() and link() are available it might be desirable to link
the backup file to the original file then rename the temp over the
original so there's no point where the original doesn't exist.  This
would need to fallback to rename/rename just in case the system supports
link but the current filesystem doesn't.

- tests - existing tests caught one problem, but it needs more.

2 weeks agofix locale.c under -DPERL_GLOBAL_STRUCT(_PRIVATE)
David Mitchell [Wed, 25 May 2016 18:15:27 +0000]
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.

2 weeks agoporting/libperl.t: better diag output
David Mitchell [Wed, 25 May 2016 17:50:10 +0000]
porting/libperl.t: better diag output

when it complains about unexpected BSS symbols, list them

2 weeks agoadd missing dVAR in pp_avhvswitch
David Mitchell [Wed, 25 May 2016 17:30:17 +0000]
add missing dVAR in pp_avhvswitch

make it build under -DPERL_GLOBAL_STRUCT.

2 weeks agoExtUtils::ParseXS: Silence some pod warnings
Karl Williamson [Wed, 25 May 2016 03:31:13 +0000]
ExtUtils::ParseXS: Silence some pod warnings

These were found by the new Pod::Checker, soon to be committed.

2 weeks agoPathTools: fix Pod::Checker warning for pod
Karl Williamson [Wed, 25 May 2016 03:23:59 +0000]
PathTools: fix Pod::Checker warning for pod

The new Pod::Checker soon to be commited doesn't like lines with only
white space.

2 weeks agoPod::Functions/Functions_pm.PL: Fix pod error
Karl Williamson [Thu, 28 Apr 2016 22:53:40 +0000]
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.

2 weeks agolocale.c: don't use strcpy()
David Mitchell [Tue, 24 May 2016 22:45:48 +0000]
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.

2 weeks agolocale.c: Make locale collation predictions adaptive
Karl Williamson [Fri, 13 May 2016 17:32:44 +0000]
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.

2 weeks agolocale.c: Not so aggressive collation memory use guess
Karl Williamson [Tue, 12 Apr 2016 20:28:57 +0000]
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.

2 weeks agolocale.c: Add some debugging statements
Karl Williamson [Wed, 18 May 2016 19:18:01 +0000]
locale.c: Add some debugging statements

2 weeks agolocale.c: Minor cleanup
Karl Williamson [Wed, 18 May 2016 19:17:25 +0000]
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.

2 weeks agolocale.c: Fix some debugging so will output during init
Karl Williamson [Sun, 15 May 2016 00:23:02 +0000]
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.

2 weeks agomv function from locale.c to mathoms.c
Karl Williamson [Tue, 12 Apr 2016 18:49:36 +0000]
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

2 weeks agoDo better locale collation in UTF-8 locales
Karl Williamson [Wed, 18 May 2016 02:50:55 +0000]
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.

2 weeks agoperllocale: Change headings so two aren't identical
Karl Williamson [Tue, 12 Apr 2016 19:51:48 +0000]
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

2 weeks agoChange calculation of locale collation coefficients
Karl Williamson [Tue, 12 Apr 2016 17:21:40 +0000]
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].

2 weeks agolocale.c: Change algorithm for strxfrm() trials
Karl Williamson [Tue, 12 Apr 2016 01:11:07 +0000]
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

2 weeks agolocale.c: Free over-allocated space early
Karl Williamson [Sun, 10 Apr 2016 02:40:48 +0000]
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.

2 weeks agolocale.c: White-space only
Karl Williamson [Sun, 10 Apr 2016 02:36:01 +0000]
locale.c: White-space only

Outdent and reflow because the previous commit removed an enclosing
block.

2 weeks agoChange mem_collxfrm() algorithm for embedded NULs
Karl Williamson [Sat, 9 Apr 2016 21:52:05 +0000]
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.

2 weeks agolocale.c: Add, move, clarify comments
Karl Williamson [Wed, 18 May 2016 03:53:53 +0000]
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

2 weeks agoKeep track of if collation locale is UTF-8 or not
Karl Williamson [Mon, 16 May 2016 21:19:14 +0000]
Keep track of if collation locale is UTF-8 or not

This will be used in future commits

2 weeks agolocale.c: Don't use special locale collation for C locale
Karl Williamson [Mon, 16 May 2016 21:15:26 +0000]
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.

2 weeks agoperllocale: Document NUL collation handling
Karl Williamson [Sat, 21 May 2016 17:35:10 +0000]
perllocale: Document NUL collation handling

And add a TODO test, because this shortly will be improved upon

2 weeks agolib/locale.t: Don't calculate value unless needed
Karl Williamson [Fri, 13 May 2016 17:51:55 +0000]
lib/locale.t: Don't calculate value unless needed

2 weeks agomathoms.c: Remove obsolete text
Karl Williamson [Mon, 23 May 2016 16:01:41 +0000]
mathoms.c: Remove obsolete text

makedef.pl no longer needs special handling for any functions that get
moved to mathoms.c

2 weeks agoUpdate ExtUtils-MakeMaker to CPAN version 7.18
Chris 'BinGOs' Williams [Tue, 24 May 2016 10:39:59 +0000]
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

2 weeks agoFix class name typo typo in perlootut example
Dagfinn Ilmari Mannsåker [Tue, 24 May 2016 10:25:49 +0000]
Fix class name typo typo in perlootut example

It's spelled correctly in the body text, but the code had it wrong.

2 weeks agomathoms.c: consolidate comments
David Mitchell [Mon, 23 May 2016 14:53:05 +0000]
mathoms.c: consolidate comments

The head of this source file contains quite a few general comment
paragraphs. Consolidate them all into one

  /*
   *
   */

block.

2 weeks agomathoms.c: add explanation why fns must be kept
David Mitchell [Mon, 23 May 2016 14:45:20 +0000]
mathoms.c: add explanation why fns must be kept

See http://nntp.perl.org/group/perl.perl5.porters/236384.

2 weeks agoPATCH: [perl #128219] typo in perlrecharclass
Karl Williamson [Mon, 23 May 2016 14:04:53 +0000]
PATCH: [perl #128219] typo in perlrecharclass

Thanks for spotting this.  It was a typo.  Alpha matches XPosixAlpha.

2 weeks agoCX_POP_SAVEARRAY(): use more distinctive var name
David Mitchell [Mon, 23 May 2016 13:43:56 +0000]
CX_POP_SAVEARRAY(): use more distinctive var name

Under -Wshadow, CX_POP_SAVEARRAY's local var 'av' can generate this
warning:

    warning: declaration shadows a local variable [-Wshadow]

So rename it to cx_pop_savearay_av to reduce the risk of a clash.

(See http://nntp.perl.org/group/perl.perl5.porters/236444)

2 weeks agoUpdate release link in epigraph for 5.25.1
Sawyer X [Sun, 22 May 2016 17:10:41 +0000]
Update release link in epigraph for 5.25.1

2 weeks agoUpdate Module::CoreList for 5.25.2
Sawyer X [Sun, 22 May 2016 17:00:13 +0000]
Update Module::CoreList for 5.25.2

2 weeks agoperldiag: Rewrite a mangled sentence
Father Chrysostomos [Sun, 22 May 2016 01:33:38 +0000]
perldiag: Rewrite a mangled sentence

2 weeks agoSort perldiag
Father Chrysostomos [Sun, 22 May 2016 01:31:26 +0000]
Sort perldiag

2 weeks agorecognize and reject version control conflict markers (RT #127993)
Lukas Mai [Sat, 21 May 2016 17:12:21 +0000]
recognize and reject version control conflict markers (RT #127993)

2 weeks agoFix STRESS_REALLOC after 3caf0269d
Father Chrysostomos [Sat, 21 May 2016 18:36:56 +0000]
Fix STRESS_REALLOC after 3caf0269d

This commit:

commit 3caf0269dd4c609b8c2bc22b54598c642ba63ed8
Author: David Mitchell <[email protected]>
Date:   Sun Dec 27 14:07:02 2015 +0000

    offset PL_savestack_max by SS_MAXPUSH

stopped savestack_grow from adding 4 to the allocated amount, which
broke builds with -Accflags=-DSTRESS_REALLOC.

savestack_grow accepts no arguments.  The callers have no way to
tell it how much to allocate; they just assume that it will allocate
enough.  By default, in increases the stack size by 50%, and the stack
starts out at 128 elements, so everything works fine.

Under STRESS_REALLOC, introduced by commit 2ce36478e5 in ’98, the
savestack started out at 1 (later, SS_MAXPUSH; as of 3caf0269d,
PL_savestack_max is 0 initially, though the actual stack size is
SS_MAXPUSH).  And the stack-growing functions in scope.h that default
to 50% instead add 1 element to the stack.

Anything that calls savestack_grow assumes it will allocate enough for
the savestack elements pushed.  The most elements ever pushed at once
is 4, so 2ce36478e5 added a +4 to the size in savestack_grow.

3caf0269d removed that +4, so the stack is only incremented by 1, and
this assertion at the end of scope.h:SS_ADD_END failed:

    if (UNLIKELY(ix > PL_savestack_max)) savestack_grow();      \
    assert(PL_savestack_ix <= PL_savestack_max);

3caf0269d was right in removing the +4, since it is unnecessary for
normal builds.  For STRESS_REALLOC, which is designed to grow stacks
as little as possible, we were allocating one more element than neces-
sary.  So this commit just explicitly grows the stack by SS_MAXPUSH
(the new name for 4) in savestack_grow if STRESS_REALLOC is defined.

2 weeks agoUpdate for the version thats on the CPAN
Chris 'BinGOs' Williams [Sat, 21 May 2016 15:46:12 +0000]
Update for the version thats on the CPAN

2 weeks agoSimplify parser’s handling of my/local
Father Chrysostomos [Sat, 21 May 2016 12:42:55 +0000]
Simplify parser’s handling of my/local

In Perl 5.000, the same token, LOCAL, was used for both ‘my’ and
‘local’, with a token value, passed to localize() as a second argu-
ment, to distinguish between them.

perl-5.003_07-9-g55497cf (inseparable changes from patch from
perl5.003_07 to perl5.003_08), for no apparent reason, split them into
two tokens, removing the token values and assigning values in perly.y
via $$ = 0 and $$ = 1.  They still ultimately made their way through
the same grammar rule, as there was only one localize() call in
perly.y.  The code still made sense.

perl-5.005_02-1816-g09bef84 (sub : attrlist) changed things, such that
the tokens are separate *and* they get separate token values assigned
to them.  ‘local’ and ‘my’ no longer follow the same grammar rules
in perly.y, so there are separate localize() calls for the different
token types.  Hence, the use of a token value to distinguish them does
not make sense.  It just makes this more complicated that necessary.

So this commit removes the token values.  Since the two token types
follow different paths through perly.y and have separate localize()
calls, we can hard-code the argument to localize() there, instead of
passing the value through from toke.c as a token value.

This does shrink toke.o slightly (for me it went from 876040 to
876000), and it makes this conceptually clearer.

2 weeks ago[perl #128204] Fix crash with @a &.= etc.
Father Chrysostomos [Sat, 21 May 2016 04:55:40 +0000]
[perl #128204] Fix crash with @a &.= etc.

The new bitwise operators in their assignment forms were not correctly
catching things like arrays on the lhs at compile time.

At run time, they would either crash or croak with ‘Can’t coerce
ARRAY...’.

This commit puts in the correct compile-time check, simply by flagging
these as scalar modifiers.

2 weeks agoAnother op description correction: & -> &.
Father Chrysostomos [Sat, 21 May 2016 03:32:48 +0000]
Another op description correction: & -> &.

The string bitwise ops have dots in them, which should be included
in the op descriptions.

2 weeks agoCorrect ‘bitiwse’ in two op descriptions
Father Chrysostomos [Sat, 21 May 2016 03:24:50 +0000]
Correct ‘bitiwse’ in two op descriptions

Oops!

2 weeks ago[Merge] &CORE::foo() calls with keys, push, etc.
Father Chrysostomos [Sat, 21 May 2016 05:14:08 +0000]
[Merge] &CORE::foo() calls with keys, push, etc.

The hash and array functions, keys, each, values, push, pop, shift,
unshift and splice, can now be called with ampersand syntax and via
reference.

2 weeks agoUpdate CORE.pod to reflect &CORE::keys() etc.
Father Chrysostomos [Sat, 21 May 2016 04:57:32 +0000]
Update CORE.pod to reflect &CORE::keys() etc.

2 weeks agoAllow assignment to &CORE::keys()
Father Chrysostomos [Sat, 21 May 2016 00:50:23 +0000]
Allow assignment to &CORE::keys()

2 weeks agoAllow &CORE::foo() with array functions
Father Chrysostomos [Tue, 17 May 2016 07:27:30 +0000]
Allow &CORE::foo() with array functions

2 weeks agoperldiag: Document unknown OA_* panic
Father Chrysostomos [Tue, 17 May 2016 06:32:06 +0000]
perldiag: Document unknown OA_* panic

2 weeks agof
Father Chrysostomos [Sat, 21 May 2016 05:13:15 +0000]
f

2 weeks agoAllow &CORE::foo() with hash functions
Father Chrysostomos [Tue, 17 May 2016 06:10:17 +0000]
Allow &CORE::foo() with hash functions

&CORE::keys does not yet work as an lvalue.  (I’m not sure how to make
that work.)

2 weeks agoIncrease $Opcode::VERSION to 1.35
Father Chrysostomos [Tue, 17 May 2016 01:16:28 +0000]
Increase $Opcode::VERSION to 1.35

2 weeks agoAdd avhvswitch op
Father Chrysostomos [Tue, 17 May 2016 01:15:42 +0000]
Add avhvswitch op

&CORE::keys() et al. will use this to switch between keys and akeys
depending on the argument type.

2 weeks agoregen/opcodes: Re-order aeach, akeys, and avalues
Father Chrysostomos [Tue, 17 May 2016 01:09:02 +0000]
regen/opcodes: Re-order aeach, akeys, and avalues

In a forthcoming commit, I will need them to be in the same order as
the corresponding hash functions.

2 weeks agopp.c: Use PL_op_desc in pp_coreargs
Father Chrysostomos [Sun, 15 May 2016 20:59:24 +0000]
pp.c: Use PL_op_desc in pp_coreargs

OP_DESC is inconvienient here, because it expects an op, not an op
number, so we have to follow pointers to find an appropriate op.  It
is also needlessly expensive, since we do not need to check for custom
ops in pp_coreargs (which OP_DESC does).  Just access the underlying
array directly.

2 weeks agoUpgrade to threads 2.09
jdhedden [Fri, 20 May 2016 18:59:02 +0000]
Upgrade to threads 2.09

For: RT #128197

2 weeks agoUpgrade to Thread::Queue 3.11
jdhedden [Fri, 20 May 2016 18:33:31 +0000]
Upgrade to Thread::Queue 3.11

For: RT #128195

2 weeks agoIncrement $VERSION to 5.YYYYMMDD for next scheduled monthly release date.
James E Keenan [Sat, 21 May 2016 01:59:46 +0000]
Increment $VERSION to 5.YYYYMMDD for next scheduled monthly release date.

2 weeks agocorelist: update for v5.25.2
Father Chrysostomos [Sat, 21 May 2016 01:04:52 +0000]
corelist: update for v5.25.2

I really have no idea what I’m doing.  I just copied 4170737e2, sort of,
and the tests started passing.

2 weeks ago[Merge] Lexical subs are no longer experimental
Father Chrysostomos [Fri, 20 May 2016 23:00:09 +0000]
[Merge] Lexical subs are no longer experimental

2 weeks agoGive feature.pm the concept of no-op features
Father Chrysostomos [Fri, 20 May 2016 21:30:14 +0000]
Give feature.pm the concept of no-op features

2 weeks agoRemove @experimental from regen/feature.pl
Father Chrysostomos [Fri, 20 May 2016 21:17:55 +0000]
Remove @experimental from regen/feature.pl

Originally, we were going to have feature.pm warning when enabling
an experimental feature.  That changed, though, when we introduced
the :all tag, because it is unkind for :all to warn.  So in
v5.17.6-49-g64fbf0d we started warning when a feature is used,
not enabled.

It does not appear that that will ever change, so we might as well
remove the dead code (and comments) from regen/feature.pl.

2 weeks agoUpdate other docs on lexical sub acceptance
Father Chrysostomos [Fri, 20 May 2016 21:11:30 +0000]
Update other docs on lexical sub acceptance

2 weeks agoIncrease $feature::VERSION to 1.44
Father Chrysostomos [Fri, 20 May 2016 20:26:17 +0000]
Increase $feature::VERSION to 1.44

2 weeks agoUpdate feature.pm docs for lex sub acceptance
Father Chrysostomos [Fri, 20 May 2016 20:25:20 +0000]
Update feature.pm docs for lex sub acceptance

2 weeks agoUpdate perldiag for lexsub diag removals
Father Chrysostomos [Fri, 20 May 2016 19:46:07 +0000]
Update perldiag for lexsub diag removals

2 weeks agoEnable lex subs everywhere; suppress warning
Father Chrysostomos [Fri, 20 May 2016 19:45:10 +0000]
Enable lex subs everywhere; suppress warning

Adjust tests, too.

2 weeks ago[perl #128187] Forbid keys @_ in assigned lv sub
Father Chrysostomos [Fri, 20 May 2016 13:22:40 +0000]
[perl #128187] Forbid keys @_ in assigned lv sub

This is a continuation of this commit’s great grandparent, extending
the error to arrays.

2 weeks agotoke: yylex comments
Father Chrysostomos [Fri, 20 May 2016 04:32:02 +0000]
toke: yylex comments

Update; clarify; fix typo.

2 weeks agoCorrect error msg for sub:lvalue{%h{k}} in sassign
Father Chrysostomos [Fri, 20 May 2016 01:31:56 +0000]
Correct error msg for sub:lvalue{%h{k}} in sassign

This:

    sub foo : lvalue { %hash{'key'} }
    foo = 3;

was incorrectly giving ‘Can't modify key/value hash slice in list
assignment’.  There is no list assignment there.

2 weeks ago[perl #128187] Forbid sub :lvalue{keys} in aassign
Father Chrysostomos [Fri, 20 May 2016 01:27:24 +0000]
[perl #128187] Forbid sub :lvalue{keys} in aassign

This commit makes perl die when keys(%hash) is returned from an lvalue
sub and the lvalue sub call is assigned to in list assignment:

    sub foo : lvalue { keys(%INC) }
    (foo) = 3; # death

This prevents an assignment that is completely useless and probably a
mistake, and it makes the lvalue-sub use of keys behave the same way
as (keys(%INC)) = 3.

2 weeks agoNote latest stable in INSTALL:
Sawyer X [Fri, 20 May 2016 22:39:12 +0000]
Note latest stable in INSTALL:

This was in the instructions but as it appears right after bumping
the version number (which contains a note that BLEAD-POINT should
only do it later), I had missed it. Also, INSTALL is generally
updated by the bump version script, which is usually done the
version before.

Anyway, might as well fix it now.

2 weeks agoBump the perl version in various places for 5.25.2
Sawyer X [Fri, 20 May 2016 22:08:13 +0000]
Bump the perl version in various places for 5.25.2

2 weeks agonew delta for 5.25.2
Sawyer X [Fri, 20 May 2016 22:03:08 +0000]
new delta for 5.25.2

2 weeks agomark 5.25.1 release as done
Sawyer X [Fri, 20 May 2016 21:53:53 +0000]
mark 5.25.1 release as done

2 weeks agoAdd epigraph to list:
Sawyer X [Fri, 20 May 2016 21:53:16 +0000]
Add epigraph to list:

NNTP link not available yet, I'll update it in the near future
(tomorrow) when it's available.

2 weeks ago[MERGE] resolve conflicts and merge 5.25.1 release with blead
Sawyer X [Fri, 20 May 2016 21:46:30 +0000]
[MERGE] resolve conflicts and merge 5.25.1 release with blead

2 weeks agoadd new release to perlhist v5.25.1
Sawyer X [Fri, 20 May 2016 19:47:28 +0000]
add new release to perlhist

2 weeks agoupdated perldelta
Sawyer X [Fri, 20 May 2016 19:25:04 +0000]
updated perldelta

2 weeks agoUpdate Module::CoreList for 5.25.1
Sawyer X [Fri, 20 May 2016 16:08:40 +0000]
Update Module::CoreList for 5.25.1

2 weeks agoadd a change to perldelta
Sawyer X [Fri, 20 May 2016 15:20:58 +0000]
add a change to perldelta

3 weeks agoImporting not-useful POSIX subs now fails at import time.
Jarkko Hietaniemi [Fri, 20 May 2016 11:38:31 +0000]
Importing not-useful POSIX subs now fails at import time.

3 weeks agoIndirect object syntax fixed in FileHandle.pm
Chase Whitener [Wed, 18 May 2016 16:20:28 +0000]
Indirect object syntax fixed in FileHandle.pm

Increment $FileHandle::VERSION.

For: RT #128178

3 weeks agoCorrect POD for release managers document:
Sawyer X [Thu, 19 May 2016 20:01:57 +0000]
Correct POD for release managers document:

A literal / (solidus) is E<sol>.

3 weeks agoUpdate and correct release schedule:
Sawyer X [Thu, 19 May 2016 19:54:32 +0000]
Update and correct release schedule:

* The release schedule had the dates for some releases twice
  and they weren't the same. Ricardo Signes released 5.24.0 sooner
  than on the schedule (good thing, since we kept slipping away)
  so that's fixed.

* We're releasing 5.25.1 tomorrow, on May, instead of June. That
  means all numbers are bumped.

* Aaron Crane volunteered to take on the November release.
  (Joke's on him, he'll have to do it!)

3 weeks ago[perl #123367] Test my sub defined in BEGIN{eval}
Father Chrysostomos [Thu, 19 May 2016 13:08:12 +0000]
[perl #123367] Test my sub defined in BEGIN{eval}

This accidentally started working in v5.21.6-197-g0f94cb1.

3 weeks agoAllow require_error.t be run from the top level
Father Chrysostomos [Thu, 19 May 2016 04:42:03 +0000]
Allow require_error.t be run from the top level

3 weeks agoNo such thing as MACOSX_DEVELOPMENT_TARGET.
Craig A. Berry [Thu, 19 May 2016 11:35:49 +0000]
No such thing as MACOSX_DEVELOPMENT_TARGET.

This appears to be a typo that has been with us since 69625aa92a9
and the real name is MACOSX_DEPLOYMENT_TARGET.

So do the same thing the MacPorts folks have been doing, meaning
this is just the "fix-ld-modification.patch" from:

https://trac.macports.org/browser/trunk/dports/lang/perl5/files/5.24?rev=148407