David Mitchell [Mon, 20 May 2013 15:22:20 +0000 (16:22 +0100)]
Eliminate PL_reg_match_utf8
Earlier commits made the use of this var just local to the current
match, so move it to the local regmatch_info struct instead.
David Mitchell [Mon, 20 May 2013 14:04:11 +0000 (15:04 +0100)]
regex engine: simplify is_utf8_pat handling
Since this value is actually just always equal to cBOOL(RX_UTF8(rx)),
there's no need to save the old value of the local boolean
(as u.eval.saved_utf8_pat) when switching back and forwards between
regexes with (??{}); instead, just re-calculate it whenever we switch,
and update reginfo->is_utf8_pat and its cached value in the is_utf8_pat
local var accordingly.
Also, pass reginfo as an arg to S_setup_EXACTISH_ST_c1_c2() rather than
is_utf8_pat directly; this will allow us to eliminate PL_reg_match_utf8
shortly.
A new test is included that detects a mistake I made while working up
this change: I recalculated is_utf8_pat, but forgot to update
reginfo->is_utf8_pat too.
David Mitchell [Mon, 20 May 2013 13:17:33 +0000 (14:17 +0100)]
stop callers of rex engine using RX_MATCH_UTF8_set
The way that the regex engine knows that the match string is utf8 is
currently a complete mess. It's partially signalled by the utf8 flag of
the passed SV, but also by the RXf_MATCH_UTF8 flag in the regex itself,
and the value of PL_reg_match_utf8.
Currently all the callers of the engine (such as pp_match, pp_split etc)
initially use RX_MATCH_UTF8_set() before calling the engine. This sets both
the RXf_MATCH_UTF8 flag on the regex, and PL_reg_match_utf8.
Then the two entry points to the engine (regexec_flags() and
re_intuit_start()) initially repeat the RX_MATCH_UTF8_set()
themselves.
Remove the usage of RX_MATCH_UTF8_set() by the callers of the engine,
and instead just rely on the engine to do it.
Also, remove the "secret" setting of PL_reg_match_utf8 by
RX_MATCH_UTF8_set(), and do it explicitly.
This is a prelude to eliminating PL_reg_match_utf8.
David Mitchell [Sun, 19 May 2013 08:38:23 +0000 (09:38 +0100)]
add regmatch_eval_state struct
Replace several PL_reg* vars with a new struct. This is part of the
goal of removing all global regex state.
These particular vars are used in the case of a regex with (?{}) code
blocks. In this case, when the code in a block is called, various bits of
state (such as $1, pos($_)) are temporarily set up, even though the match
has not yet completed.
This involves updating the current PL_curpm to point to a fake PMOP which
points to the regex currently being executed. That regex has all its
current fields that are associated with captures (such as subbeg)
temporarily saved and overwritten with the current partial match results.
Similarly, $_ is temporarily aliased to the current match string, and any
old pos() position is saved. This saving was formerly done to the various
PL_reg* vars.
When the regex has finished executing (or if the code block croaks),
its fields are restored to the original values. Since this can happen in a
croak, it may be done using SAVEDESTRUCTOR_X() on the save stack. This
precludes just moving the PL_reg* vars into the regmatch_info struct,
since that is just allocated as a local var in regexec_flags(), and would
have already been abandoned and possibly overwritten after the croak and
longjmp, but before the SAVEDESTRUCTOR_X() action is taken.
So instead we put all the vars into new struct, and malloc that on entry to
the regex engine when we know we need to copy the various fields.
We save a pointer to that in the regmatch_info struct, as well as passing
it to SAVEDESTRUCTOR_X(). The destructor may get called up to twice in the
non-croak case: first it's called explicitly at the end of regexec_flags(),
which restores subbeg etc; then again from the savestack, which just
free()s the struct. In the croak case, it's called just once, and does
both the restoring and the freeing.
The vars / PL_reg_state fields this commit eliminates are:
re_state_eval_setup_done
PL_reg_oldsaved
PL_reg_oldsavedlen
PL_reg_oldsavedoffset
PL_reg_oldsavedcoffset
PL_reg_magic
PL_reg_oldpos
PL_nrs
PL_reg_oldcurpm
David Mitchell [Sat, 18 May 2013 16:44:40 +0000 (17:44 +0100)]
S_setup_eval_state(): always set up destructor
This function only set up a destructor if reginfo->sv existed. If not,
some stuff which was set up wouldn't be restored if the code died within a
(?{}) block.
As it happens, the way the regex engine is called from perl core means we
always pass a valid SV; but in theory someone could call the engine from
XS while passing just a string and no SV.
David Mitchell [Sat, 18 May 2013 16:25:44 +0000 (17:25 +0100)]
S_regtry(): move eval setup code into separate fn
There's a block of code in S_regtry() that looks a bit like:
if ((prog->extflags & RXf_EVAL_SEEN) && not_yet_done)
{
...
}
Move this block of code out into a separate static function,
S_setup_eval_state(). No functional changes.
Also, rename the corresponding static cleanup/destructor function from
restore_pos() to S_restore_eval_state(), to better reflect what it does
these days (restoring pos() being only a small part of it).
David Mitchell [Sat, 18 May 2013 14:44:03 +0000 (15:44 +0100)]
remove unused reginfo->bol field
David Mitchell [Sat, 18 May 2013 14:40:47 +0000 (15:40 +0100)]
eliminate PL_bostr
by moving it from the global PL_reg_state struct to the local reginfo
struct.
David Mitchell [Sat, 18 May 2013 14:05:57 +0000 (15:05 +0100)]
add strbeg argument to Perl_re_intuit_start()
(note that this is a change both to the perl API and the regex engine
plugin API).
Currently, Perl_re_intuit_start() is passed an SV, plus pointers to:
where in the string to start matching (strpos); and to the end of the
string (strend).
Unlike Perl_regexec_flags(), it doesn't also have a strbeg arg.
Because of this this, it guesses strbeg: based on the passed SV (if its
svPOK()); or just set to strpos otherwise. This latter can happen if for
example the SV is overloaded. Note also that this latter guess is wrong,
and could in theory make /\b.../ fail.
But just to confuse matters, although Perl_re_intuit_start() itself uses
its guesstimate strbeg var, some of the functions it calls use the global
value of PL_bostr instead. To make this work, the *callers* of
Perl_re_intuit_start() currently set PL_bostr first. This is why \b
doesn't actually break.
The fix to this unholy mess is to simply add a strbeg arg to
Perl_re_intuit_start(). It's also the first step to eliminating PL_bostr
altogether.
David Mitchell [Sat, 18 May 2013 12:25:36 +0000 (13:25 +0100)]
find_byclass, regrepeat: remove is_utf8_pat arg
Remove the is_utf8_pat arg from these two static functions in regexec.c.
Since both these functions are now passed a valid reginfo pointer, this
info is already available as one of the fields in that struct.
David Mitchell [Fri, 17 May 2013 16:38:26 +0000 (17:38 +0100)]
eliminiate PL_regeol
This is another global regex state variable (actually a field of
PL_reg_state). Eliminate it by moving it into the regmatch_info struct
instead, which is local to each match. Also, rename it to strend, which is
a less misleading description in these exciting days of multi-line matches.
David Mitchell [Fri, 17 May 2013 16:38:00 +0000 (17:38 +0100)]
make more use of regmatch_info struct.
regmatch_info is a small struct that is currently directly allocated as a
local var in Perl_regexec_flags(), and has a few fields that maintain part
of the state of the current pattern match. It is passed as an arg to
various functions that regexec_flags() calls, such as regtry().
In some ways its a rival to PL_reg_state, which also maintains state for
the current match, but which is a global variable (whose state needs
saving and restoring whenever the regex engine goes reentrant). It makes
more sense to store state in the regmatch_info struct, and as a first step
in moving more state to there, this commit makes more use of
regmatch_info.
In particular, it makes Perl_re_intuit_start() also allocate such a
struct, so that now *both* the main execution entry points to the regex
engine make use of it. It's also now passed as an arg to more of the static
functions that these two op-level ones call.
Two changes of special note. First, whether S_find_byclass() got called
with a null reginfo pointer of not indicated whether it had been called
from Perl_regexec_flags() (with a valid reginfo pointer), or from
Perl_re_intuit_start() (null pointer). Since they both pass non-null
reginfo pointers now, instead we add an extra field, reginfo->intuit that
indicates who's the top-level caller.
Secondly, to allow in future for various macros to uniformly refer to
values like reginfo->foo, where the structure is actually allocated as a
local var in Perl_regexec_flags(), we change the reginfo from being the
struct itself to being a pointer to the struct, (so Perl_regexec_flags
itself now uses reginfo->foo too rather than reginfo.foo).
In summary, all the above is essentially window dressing that makes no
functional changes to the code, but will facilitate future changes.
Father Chrysostomos [Sun, 2 Jun 2013 20:25:24 +0000 (13:25 -0700)]
Fix crashes after syntax errors in lexical subs
Peter Martini fixed this in commit
89e006ae4e39db for our subs.
(Thank you, BTW, if you are reading this.)
The warning is expected; the assertion failure is not:
$ ./miniperl -Ilib -Mfeature=:all -e 'state sub a { is ref } a()'
The lexical_subs feature is experimental at -e line 1.
Assertion failed: (hek), function Perl_ck_subr, file op.c, line 10558.
Abort trap: 6
$ ./miniperl -Ilib -Mfeature=:all -e 'my sub a { is ref } a()'
The lexical_subs feature is experimental at -e line 1.
Assertion failed: (SvTYPE(_svmagic) >= SVt_PVMG), function S_mg_findext_flags, file mg.c, line 398.
Abort trap: 6
$
The prototype CV for a my sub is stored in magic attached to the pad
name. The. The code to fetch the prototype CV for a my sub calls
mg_find on the pad name. If a syntax error occurs when the sub is be
ing compiled, the magic will never be attached, so the pad name (pad
names are currently SVs) will not have been upgraded to SVt_PVMG,
causing an assertion failure in mg_find, which only accepts SVs
thus upgraded.
When a pad entry is created, it is automatically filled with an empty
SV of the appropriate type. For a subroutine, this is a nameless CV
stub. CVs can be named in two ways, via GVs for package subs, or via
heks for lexical subs. This stub has neither and is truly nameless.
Since a lexical sub is never installed if it contains a syntax error,
this stub is visible during subsequent compilation in the same scope.
ck_subr wasn’t prepared to handle a stub with absolutely no name
attached to it, since it is designed for handling sub calls where the
sub is known at compile time, so there must be a GV available to it,
unless the sub is lexical, and all lexical subs have heks.
This commit fixes the assumptions in both places. Exactly what hap-
pens and what is returned is not so important, as this only hap-
pens after a syntax error, when the op tree is going to be thrown
away anyway.
Father Chrysostomos [Sun, 2 Jun 2013 07:54:09 +0000 (00:54 -0700)]
[perl #116735] Honour lexical prototypes when no parens are used
As Peter Martini noted in ticket #116735, lexical subs produce dif-
ferent op trees for ‘foo 1’ and ‘foo(1)’. foo(1) produces an rv2cv
op with a padcv kid. The unparenthetical version produces just
a padcv op.
And the difference in op trees caused lexical sub calls to honour
prototypes only in the presence of parentheses, because rv2cv_op_cv
(which searches for the cv in order to check its prototype) was
expecting rv2cv+padcv.
Not realising there was a discrepancy between the two forms, and
noticing that foo() produces *two* newCVREF ops, in commit
279d09bf893
I made newCVREF return just a padcv op for lexical subs. At the time
I couldn’t figure out why there were two rv2cv ops, and punted on
researching it.
This is how it works for package subs:
When a sub call is compiled, if there are parentheses, an implicit '&'
is fed to the parser. The token that follows is a WORD token with a
constant op attached to it, containing the name of the subroutine.
When the parser sees '&', it calls newCVREF on the const op to create
an rv2cv op.
For sub calls without parentheses, the token passed to the parser is
already an rv2cv op.
The resulting op tree is the same either way.
For lexical subs, I had the lexer emitting an rv2cv op in both paths,
which was why we got the double rv2cv when newCVREF was returning an
rv2cv for lexical subs.
The real solution is to call newCVREF in the lexer only when there
are no parentheses, since in that case the lexer is not going to call
newCVREF itself. That avoids a redundant newCVREF call. Hence, we
can have newCVREF always return an rv2cv op.
The result is that ‘foo(1)’ and ‘foo 1’ produce identical op trees for
a lexical sub.
One more thing needed to change: The lexer was not looking at the
lexical prototype CV but simply the stub to be autovivified, so it
couldn’t see the parameter prototype attached to the CV (the stub
doesn’t have one).
The lexer needs to see the parameter prototype too, in order to deter-
mine precedence.
The logic for digging through pads to find the CV has been extracted
out of rv2cv_op_cv into a separate (non-API!) routine.
Father Chrysostomos [Sun, 2 Jun 2013 01:39:33 +0000 (18:39 -0700)]
Name lexical constants
$ ./perl -Ilib -Mfeature=:all -e 'my sub a(){44} a()'
The lexical_subs feature is experimental at -e line 1.
Assertion failed: (hek), function Perl_ck_subr, file op.c, line 10558.
Abort trap: 6
The experimental warning is expected. The assertion failure is not.
When a call checker is invoked, the name of the subroutine is passed
to it. op.c:ck_subr gets the name from the CV’s cv (CvGV) or, in the
case of lexical subs, from its name hek (CvNAME_HEK). If neither
exists, ck_subr cannot cope.
Lexical subs never have a GV pointer. Lexical constants were acci-
dentally having neither a GV pointer nor a hek. They should have a
hek, like other lexical subs.
Father Chrysostomos [Sat, 1 Jun 2013 13:28:12 +0000 (06:28 -0700)]
lexsub.t: To-do tests for citing lex subs after errors
This currently causes assertion failures on debugging builds. On
non-debugging builds (untested), it probably crashes:
my sub a { foo ref } # foo must not exist
a();
Chris 'BinGOs' Williams [Sun, 2 Jun 2013 08:22:51 +0000 (09:22 +0100)]
Update Pod-Usage to CPAN version 1.63
[DELTA]
1.63 (marekr)
- CPAN#85477: Module version not updated in last release
...fixed
- CPAN#85478: typo fixes
...corrected
Father Chrysostomos [Sun, 2 Jun 2013 07:36:33 +0000 (00:36 -0700)]
[perl #118237] Fix coreamp.t’s rand test
when rand returns something really small that does not
begin with 0, such as 2.
90736361456823e-05.
Father Chrysostomos [Sun, 2 Jun 2013 07:31:27 +0000 (00:31 -0700)]
Stop constant inlining from countermanding ‘use subs’
Ever since
commit
f7461760003db2ce68155c97ea6c1658e96fcd27
Author: Zefram <zefram@fysh.org>
Date: Sun Nov 8 15:03:45 2009 +0100
Bareword sub lookups
...
this has failed:
$ perl5.10 -le 'use subs "abs"; sub abs() {44}; print abs + abs'
88
$ perl5.12 -le 'use subs "abs"; sub abs() {44}; print abs + abs'
44
A GV holding a single constant is a candidate for downgrading after
it uhas been used. The GV gets downgraded after the first ‘abs’ is
inlined. In the process, the CV-imported flag, which is stored in the
GV, not the CV, is lost, preventing &abs from overriding the built-in
function on the second mention.
There is a special flag for RVs, namely SVprv_PCS_IMPORTED,
which indicates that, when expanded to GVs, they should have the
GVf_IMPORTED_CV flag set. But gv_try_downgrade wasn‘t setting
that flag.
Chris 'BinGOs' Williams [Sat, 1 Jun 2013 20:58:02 +0000 (21:58 +0100)]
Update Filter-Util-Call to CPAN version 1.49
[DELTA]
1.46 2013-03-29 rurban
----
* Fix RT #84292 PIPE_PID/waitpid broken in Exec pipe_read since 5.17.6 (rurban)
* Fix RT #84210 Bad NAME in Makefile.PL (miyagawa)
* Fix RT #82687 cpansign MANIFEST failure (myra)
* Work on RT #41285 test failures with non-english locale (reported by srezic)
* Skip patching the src for newWarnings style, these are the default (rurban)
* Fix RT #53132 examples/method/Decompress.pm syntax error (kevin ryde)
and add usage docs.
1.47 2013-03-31 rurban
----
* Reproduced and fixed RT #41285 test failures with non-english locale
(reported by srezic)
1.48 2013-04-01 rurban
----
* added META records, such as repository, recommends to Makefile.PL
* added META and POD tests
1.49 2013-04-02 rurban
----
* Better fix for RT #41285 test failures with non-english locale
(patched by srezic, pull #1)
* Add t/z_*.t meta tests (now for real), move Try to t/FilterTry,
add POD to Filter::Util::Call, Filter::Util::Exec and generated
FilterTry.
Chris 'BinGOs' Williams [Sat, 1 Jun 2013 20:47:07 +0000 (21:47 +0100)]
Update Pod-Parser to CPAN version 1.61
[DELTA]
01-Jun-2013 Marek Rouchal <marekr@cpan.org>
-----------------------------------------------------------------------------
Version 1.61
+ CPAN#85656 fix typos in comments
Father Chrysostomos [Sat, 1 Jun 2013 03:24:31 +0000 (20:24 -0700)]
Correct three sub call comments in perly.y
NOAMP is only emitted by toke.c when there are no parentheses. If
there is a parenthesis following a word, the lexer conjures up an '&'
token from nowhere.
Father Chrysostomos [Sat, 1 Jun 2013 01:27:19 +0000 (18:27 -0700)]
toke.c: Under -DT, report pending idents more clearly
These are treated as forced tokens of type 'p'. Indicate what the 'p'
means in the debug output.
This:
### 0:LEX_NORMAL/XSTATE "\n;"
### forced token:
### <== 'p'
becomes this:
### 0:LEX_NORMAL/XSTATE "\n;"
### forced token:
### <== 'p' (pending identifier)
Craig A. Berry [Sat, 1 Jun 2013 01:26:11 +0000 (20:26 -0500)]
Fix ExtUtils::Constant test failure on VMS.
Awaiting upstream application for many months now at:
https://rt.cpan.org/Public/Bug/Display.html?id=81249
But it's not at all clear that this module is even maintained as
the only two "maintainers" are former pumpkings who probably had
to become maintainers in order to cut a Perl release.
From the message originally submitted upstream:
It turns out the easiest and most robust way to handle the fact that
filename case may or may not be preserved is simply to do all
filename comparisons in a case blind fashion. This is safe to do
because there is no practical possibility of distinct filenames that
differ only by case, especially with the short list of well-known
files being considered here.
Ricardo Signes [Fri, 31 May 2013 22:15:57 +0000 (18:15 -0400)]
update link for DTrace user guide
Craig A. Berry [Fri, 31 May 2013 21:23:24 +0000 (16:23 -0500)]
Update the GSMATCH handling in vms/gen_shrfls.pl.
This code (which only runs if you have set PERLSHR_USE_GSMATCH in
the environment) has not been updated in a long time. It was
assuming that $] had only five digits after the decimal, whereas
it's had six for some time. And it assumed that the Perl5 version
could be represented in 4 bits, which was true up through 5.15
but isn't true anymore.
So get all the digits of the version number, and go wild and spend
5 bits on the value of $Config{PERL_VERSION}, which will get us
through 5.31. That only leaves three bits in which to encode all
the options that could break binary compatibility, whereas in fact
we need about thirty bits.
So clearly this only works in a situation where the configuration
can be standardized and/or different configurations are packaged
separately.
Shlomi Fish [Fri, 31 May 2013 13:48:04 +0000 (14:48 +0100)]
iperlipc: s/multithreading/multitasking/
Replace some occurrences of "multithreading" in perlipc.pod
where they actually refer to multi-processing, with "multitasking".
Ricardo Signes [Fri, 31 May 2013 00:05:37 +0000 (20:05 -0400)]
correct example for turning of experimental warnings
Original patch from Thomas Klausner <domm@plix.at>, tweaked with a
suggestion by Karen Etheridge <perl@froods.org>.
Chris 'BinGOs' Williams [Thu, 30 May 2013 16:16:14 +0000 (17:16 +0100)]
Update Text-Tabs to CPAN version 2013.0523
[DELTA]
= 2013/05/23
Change module 'NAME'
= 2013/05/22
Typos
= 2013/04/26
Minor test suite fixes - bug 81698.
Fixed bug 79766 -- an extraneous "=" in a regex.
Changed the license to qualify as an "open source" license.
Chris 'BinGOs' Williams [Thu, 30 May 2013 16:46:22 +0000 (17:46 +0100)]
CPAN-Meta bugfix exposed an assumption in EUMM tests, fix that.
Chris 'BinGOs' Williams [Thu, 30 May 2013 16:32:26 +0000 (17:32 +0100)]
CPAN-Meta has changed so regenerate the META.* files
Chris 'BinGOs' Williams [Thu, 30 May 2013 15:43:05 +0000 (16:43 +0100)]
Update CPAN-Meta to CPAN version 2.131490
[DELTA]
2.131490 2013-05-29 14:15:16 America/New_York
[BUGFIX]
- Downconversion of custom resources was not dropping the leading "x_".
Now "x_MailingList" will downconvert correctly to "MailingList".
[SPEC]
- Per the Lancaster Consensus, the 'file' subkey of a package listed in
'provides' must refer to an actual file in the distribution, either the
.pm file that provides the package or another file (*.PL) that
generates it
David Golden [Wed, 29 May 2013 20:40:53 +0000 (16:40 -0400)]
git-deltatool: show files changed when tagging new commits
David Golden [Wed, 29 May 2013 19:50:55 +0000 (15:50 -0400)]
git-deltatool: fix problem reading changed commit message
Nicholas Clark [Mon, 11 Mar 2013 11:42:32 +0000 (11:42 +0000)]
Cache HvFILL() for larger hashes, and update on insertion/deletion.
This avoids HvFILL() being O(n) for large n on large hashes, but also avoids
storing the value of HvFILL() in smaller hashes (ie a memory overhead on
every single object built using a hash.)
Jerry D. Hedden [Tue, 28 May 2013 15:20:56 +0000 (11:20 -0400)]
Upgrade to threads 1.87
Father Chrysostomos [Tue, 28 May 2013 16:52:22 +0000 (09:52 -0700)]
[perl #117081] Deparse foreach my $lexical correctly under -p
The lexical topic in foreach is not allowed to have parentheses around
it, but B::Deparse was putting parentheses there when the -p option
was specified.
Father Chrysostomos [Tue, 28 May 2013 01:18:20 +0000 (18:18 -0700)]
perlthrtut: Shorten/rewrap long lines
Ricardo Signes [Tue, 28 May 2013 13:01:21 +0000 (09:01 -0400)]
remove the expectation of a "P" command
This command was introduced for the ill-fated assertions system,
then *mostly* removed by commit
584420f022.
Reported as [perl #118191] and [perl #118185]
Nicholas Clark [Tue, 28 May 2013 07:19:34 +0000 (09:19 +0200)]
Merge in various enhancements to bisect.pl and bisect-runner.pl
Nicholas Clark [Mon, 27 May 2013 15:19:43 +0000 (17:19 +0200)]
Add -q to git clean in bisect-runner.pl
This makes the output considerably less verbose. In particular, it becomes a
lot easier to spot the "revisions left to test after this" status message
from git bisect.
Nicholas Clark [Tue, 26 Feb 2013 19:52:56 +0000 (20:52 +0100)]
Three Configure fixups so that bisect-runner.pl can build 1997-era 5.004
Specifically, so that it can build revisions near
15f0808c5d67b362.
Nicholas Clark [Tue, 26 Feb 2013 19:50:46 +0000 (20:50 +0100)]
bisect-runner.pl should match patches with directory 'b' before 'a'.
The pattern to extract the file for diagnostics should a patch not apply was
failing to match (and generating a legitimate used of uninitialized value
warning) for the case where the patch was specified as --- b/ +++ a/
The pattern was only expecting --- a/ +++ b/
Nicholas Clark [Wed, 1 Aug 2012 11:55:58 +0000 (13:55 +0200)]
Add a 'none' target to bisect-runner.pl
This runs the user's test case directly against a clean checkout.
Using this gives a couple of features that a plain git bisect run can't
offer - automatic start revision detection, and test case timeouts.
Nicholas Clark [Tue, 31 Jul 2012 16:54:24 +0000 (18:54 +0200)]
bisect.pl can now optionally timeout the user's test case.
This permits bisection to locate the cause (or cure) of bugs which cause
programs to hang. When using a timeout, bisect-runner.pl defaults to
running the test case in its own process group, and tries hard to ensure
that all processes in that process group are killed if the timeout fires.
Nicholas Clark [Tue, 31 Jul 2012 14:05:58 +0000 (16:05 +0200)]
Add an option to bisect.pl to run the user testcase in its own process group.
Nicholas Clark [Tue, 31 Jul 2012 13:17:48 +0000 (15:17 +0200)]
In bisect-runner.pl, run_report_and_exit() now uses run_with_options().
Nicholas Clark [Tue, 31 Jul 2012 13:06:33 +0000 (15:06 +0200)]
In bisect-runner.pl, extract the Configure running into run_with_options().
Configure is run using explicit fork, exec and waitpid so that it can be run
with with STDIN from /dev/null, but without going through the shell (to
avoid having to worry about quoting command line arguments). This code will
be useful for adding optional timeouts when running the user test case.
Nicholas Clark [Tue, 31 Jul 2012 12:28:46 +0000 (14:28 +0200)]
In bisect-runner.pl, invert the first parameter to report_and_exit().
A true first parameter now means "good". Previously the first parameter was
assumed to be a return value from system, and hence true meant "bad".
Nicholas Clark [Tue, 31 Jul 2012 10:59:42 +0000 (12:59 +0200)]
In bisect-runner.pl, refactor the calls to system @ARGV into a function.
This will permit the addition of timeouts when running the test user's case.
Nicholas Clark [Tue, 31 Jul 2012 10:40:33 +0000 (12:40 +0200)]
bisect.pl can run in-place if the checkout is totally clean.
Copy bisect-runner.pl to a tempfile, and use that with git bisect run.
Nicholas Clark [Fri, 6 Jul 2012 15:35:08 +0000 (17:35 +0200)]
If there is no 'blead' branch, bisect.pl now uses a suitable alternative.
If HEAD is more recent than the last stable release (ie the latter is
reachable from the former), HEAD is used for the bisect end, otherwise the
last stable tag is used (and that release removed from the list of potential
starts to try).
Nicholas Clark [Fri, 6 Jul 2012 15:00:35 +0000 (17:00 +0200)]
Add --gold option to bisect.pl for the revision to use for "recent" files.
Historically when bisect-runner.pl wanted to check out a known good recent
version of a file (such as makedepend.SH) it would check out the revision
from blead. However, that may not be wise as blead isn't guaranteed always to
be stable and therefore "known good". So default to using the most recent
tagged stable release.
Nicholas Clark [Thu, 5 Jul 2012 14:00:44 +0000 (16:00 +0200)]
bisect-runner.pl always needs to pass paths gleaned from gcc to Configure.
Commits
fdbac266ba9ef2a6 and
599ee4f7809ae508 ensure that /usr/local/lib,
/lib and /usr/lib are searched on all platforms for shared libraries, and
that multiarch library locations gleaned from gcc are searched on x86_64.
However, on other Linux architectures it fails to pass the multiarch
locations to Configure. Version (just) prior to 5.14.0 do not contain the
logic to ask gcc, so they fail to build on multiarch setups.
This commit ensures that the correct library locations are available on
all platforms.
Nicholas Clark [Wed, 4 Jul 2012 13:34:31 +0000 (14:34 +0100)]
When bisecting, use `git tag -l` to get the list of stable releases.
Previously bisect.pl was using a hard coded list, which (obviously) will
become stale.
Also, note in the docs that we only use .0 stable releases, and why.
Nicholas Clark [Wed, 4 Jul 2012 12:52:19 +0000 (13:52 +0100)]
bisect-runner.pl needs to probe DB_File.xs before running Configure
Commit
f2f0a0ff7250e0ba (in Nov 2011), consolidated all the code that
patches extensions. As a side effect, it moved all extension patching
after Configure is run. Unfortunately this introduced a bug, because one
test of DB_File.xs was to change the arguments to Configure to skip building
DB_File at all if it's too old. Return this logic to before when Configure
is run, so that bisect-runner.pl can once again build 5.005 and earlier on
machines with the Berkley DB headers installed, by forcibly skipping the
build of DB_File there.
Nicholas Clark [Thu, 10 May 2012 15:47:11 +0000 (17:47 +0200)]
bisect-runner.pl needs another minor fixup to build 5.004_05 on Linux.
bisect-runner.pl already reverts a sequence of commits to doio.c related to
special case handling of union semun on Linux and Solaris, which cause the
build to fail on current Linux. The last of these,
9b599b2a63d2324d is
described as "[win32] merge change#887 from maintbranch". However, it uses
__sun__ and __svr4__ instead of the __sun and __SVR4 of the maint branch
commit
6cdf74fe31f049dc. Hence the code in bisect-runner.pl needs to be
taught about this variation in the maint-5.004 branch, so that it can also
unwind the problematic code in doio.c there.
Nicholas Clark [Thu, 3 May 2012 12:43:11 +0000 (14:43 +0200)]
bisect-runner.pl should fix 5.7.x to export Perl_cxinc on AIX.
Without this, about 60 commits in a key area of history fail to build,
between the upgrade of Scalar-List-Utils to 1.03, and the commit that
amends makedef.pl to export Perl_cxinc, which Utils.xs indirectly started
using (via a macro).
Nicholas Clark [Wed, 2 May 2012 09:26:15 +0000 (11:26 +0200)]
bisect-runner.pl should fix a typo in the Solaris hints file.
Without this typo fix about 700 revisions from 5.13.10 to 5.14.0-RC1 can't
be built on Solaris with Sun's compiler.
Yves Orton [Mon, 16 Apr 2012 18:23:32 +0000 (20:23 +0200)]
Tweak to make it clearer what to do if your working space is dirty
If you try to biect in a directory with .gitignore'd files in it
bisect will refuse to run. Since these files arent shown by status
this can cause some head scratching.
This patch makes it more obvious what is wrong by showing the listed
files and suggesting git clean as a solution. I deliberately did not
document the command to clean up untracked files, so people wouldn't
knee jerk paste it somewhere and lose something important. And by people
I mean me. :-) Thus it just shows the command to wipe ignored files,
which I figure is safe.
Nicholas Clark [Fri, 13 Apr 2012 14:49:24 +0000 (16:49 +0200)]
Add a --valgrind option to bisect.pl, to run the test program with valgrind.
Specifically this option prepends valgrind --error-exitcode=124
to the command line, so that git bisect run will treat this revision as a
failure if valgrind finds any problems.
Nicholas Clark [Fri, 13 Apr 2012 14:00:49 +0000 (16:00 +0200)]
bisect-runner.pl will now invoke with ./perl -Ilib if it sees a #!./perl line
If the first argument of the test case given to bisect-runner.pl is a readable
file with a #! line of ./perl or ./miniperl (only), bisect-runner.pl with
prepend ./perl -Ilib or ./miniperl -Ilib to the command sent to system.
This increases flexibility somewhat, and will avoid problems with
inconsistencies between directly running system(...), and running
system('valgrind', ...). The former accepts a #!./perl line, the latter sends
it to /bin/sh.
Nicholas Clark [Thu, 12 Apr 2012 19:50:11 +0000 (21:50 +0200)]
bisect-runner.pl should fix Makefile.SH to remove remove GNU make-isms.
Commit
c7b956bbbaff0c46 inadvertently added a GNU (and BSD) make specific
construction to the *nix Makefile, which other platforms' makes choke on.
It was corrected with commit
cfe76a0a8e5b6f21 (and
0961731461727bea), but
those changes are not the simplest way to get things passing again, so use
a simpler custom patch here.
Nicholas Clark [Mon, 9 Apr 2012 13:14:32 +0000 (15:14 +0200)]
Add --early-fixup and --late-fixup to bisect.pl, for user-controlled patching.
These provide a way to run code or to conditionally or unconditionally
apply patches for each revision tested during git bisect. This is very
useful when for the commit range, operating system and configuration options
tested, the behaviour otherwise would be to fail to build for a wide range
of revisions, and hence the bisect would finish without finding culprit
commit due to getting bogged down in 'skipped' revisions.
Nicholas Clark [Mon, 9 Apr 2012 09:04:37 +0000 (11:04 +0200)]
Add --all-fixups to bisect.pl, to apply all patches and fixups.
bisect-runner.pl will minimally patch various files on a platform and
version dependent basis to get the build to complete. Normally it defers
doing this as long as possible - .SH files aren't patched until after
Configure is run, and C and XS code isn't patched until after miniperl is
built. If --all-fixups is specified, all the fixups are done before running
Configure.
Nicholas Clark [Mon, 9 Apr 2012 08:18:34 +0000 (10:18 +0200)]
bisect-runner.pl should always exit fatally with 255, to abort the bisect.
Don't use die or croak, as these will exit with the value of $! or $? instead
of 255, and git bisect doesn't treat these as fatal errors, but ploughs on
before inevitably failing messily for some other reason, concealing the true
error message.
Nicholas Clark [Mon, 9 Apr 2012 09:31:25 +0000 (11:31 +0200)]
In bisect-runner.pl, refactor the system ... and die; into system_or_die().
Nicholas Clark [Mon, 9 Apr 2012 07:25:09 +0000 (09:25 +0200)]
When testing the end version, bisect.pl should treat a 'skip' as fatal.
git bisect uses exit code 125 to signal a skip. Previously bisect.pl would
treat 125 just like every other non-zero exit code, assume that it meant
'fail', and if 'fail' was expected for the end version then it would start
the bisect run as normal. Which isn't useful, as it means that there's a
problem with the user's test case.
Nicholas Clark [Mon, 9 Apr 2012 07:14:21 +0000 (09:14 +0200)]
bisect-runner.pl should search for lib*.a as well as lib*.so
When forcing the library list on earlier perls to avoid versioned shared
objects, also look for static libraries. Also, ensure bisect-runner.pl
searches additional library paths given to it via -Alibpth
Without this, one can't test build against static libraries in non-standard
locations.
Nicholas Clark [Mon, 9 Apr 2012 06:38:08 +0000 (08:38 +0200)]
bisect-runner.pl should use ".$Config{dlext}" instead of hard-coding ".so".
Nicholas Clark [Mon, 9 Apr 2012 06:05:16 +0000 (08:05 +0200)]
Teach bisect-runner.pl that on HP-UX, _filbuf() is named __filbuf().
This is all that is needed to build 5.003 and earlier. bisect.pl can validate
all stable versions from blead back to 5.002
Nicholas Clark [Mon, 9 Apr 2012 06:02:38 +0000 (08:02 +0200)]
bisect-runner.pl needs to know how to identify HP-UX's patch.
Unlike AIX, HP-UX patch offers no meaningful clue as to its upstream version:
$ patch -v
$Header: patch.c,v 76.1.1.2.1.3 2001/12/03 12:24:52 abhinav Exp $
Patch level: 0
But it ignores unified diffs, so assume the worst and feed it context diffs.
Nicholas Clark [Tue, 10 Apr 2012 13:18:03 +0000 (15:18 +0200)]
On HP-UX, bisect without any -j option as the system make is "special".
HP-UX system make offers parallelism with -P not -j. (But doesn't deliver on
it, so we're not going to attempt to work round its crankiness and failings.)
Nicholas Clark [Tue, 10 Apr 2012 08:37:41 +0000 (10:37 +0200)]
In bisect{,-runner}.pl, refactor the code for CPU probing and make jobs.
Move the code that attempts various ways to probe for the number of CPUs
from bisect-runner.pl to bisect.pl. Skip the probe entirely if a -j (--jobs)
options is passed to bisect.pl. For --jobs=0 (or -j0) entirely skip adding
-j to the make command line. (For heretical versions of make which don't use
-j for parallelism).
Previously the probe code always ran for each call to bisect-runner.pl,
which is completely redundant if bisect-runner.pl is being called for
argument validation or help text, and inefficient even when building, as the
number of CPUs rarely changes during a bisect run. Additionally there was no
way to avoid a -j in the make command line, which isn't going to fly on
systems where the make utility doesn't have a -j option.
Father Chrysostomos [Tue, 28 May 2013 01:02:21 +0000 (18:02 -0700)]
diag.t, perldiag.pod: Make sure S is used for Perl_warn
Perl_warn does not allow a category, and is not used in conjunction
with ckWARN checks (if it is, that is a bug, as such warnings will
be emitted when the category is enabled, but not fatal when the
category is fatal). So such warnings are mandatory and should be
marked with S.
Father Chrysostomos [Tue, 28 May 2013 00:45:50 +0000 (17:45 -0700)]
[perl #117947] Verify lvalueness of XSUBs at run time
If the sub is not visible at compile time, the op tree is flagged such
that pp_entersub will know whether to check the lvalueness of the
called sub.
That check has been in pp_entersub since
da1dff9483c. When I moved
it to pp_entersub in that commit, I only added it to the pure-Perl
branch, not to the XS branch, allowing all XSUBs to be treated as
lvalues if they are not visible at compile time.
Chris 'BinGOs' Williams [Mon, 27 May 2013 21:57:18 +0000 (22:57 +0100)]
Update IO-Compress to CPAN version 2.061
[DELTA]
2.061 19 May 2013
* zipdetails (1.06)
Get it to cope with Android 'zipalign' non-standard extra fields.
These are used to make sure that a non-compressed member starts on
a 4 byte boundary.
* RT#84647: unzip example with IO::Uncompress::Unzip
Chris 'BinGOs' Williams [Mon, 27 May 2013 21:53:30 +0000 (22:53 +0100)]
Update Compress-Raw-Zlib to CPAN version 2.061
[DELTA]
2.061 19 May 2013
* Include zlib 1.2.8 source.
* typo fix
[#85431]
* silence compiler warning by making 2nd parameter to
DispStream a const char*
Chris 'BinGOs' Williams [Mon, 27 May 2013 21:50:46 +0000 (22:50 +0100)]
Update Compress-Raw-Bzip2 to CPAN version 2.061
[DELTA]
2.061 19 May 2013
* silence compiler warning by making 2nd parameter to
DispStream a const char*
Father Chrysostomos [Mon, 27 May 2013 15:44:34 +0000 (08:44 -0700)]
pat_advanced.t: fix two tests
If two pieces of code are executed to see if they produce exactly the
same warning, the scalar holding the warning needs to be cleared in
between, otherwise the second test is useless if the first one passes
and the second piece of code doesn’t warn.
Nicholas Clark [Mon, 27 May 2013 12:53:30 +0000 (14:53 +0200)]
On Linux LC_ALL overrides LC_MESSAGES, so tweak perl5db.t accordingly.
Without this, the test fails when LC_ALL is set to a non-English locale for
which man has been localised.
David Steinbrunner [Sun, 26 May 2013 12:11:31 +0000 (08:11 -0400)]
typo fixes for Math-BigInt
Tony Cook [Mon, 27 May 2013 10:15:21 +0000 (20:15 +1000)]
man perlrules doesn't always output "No manual entry for perlrules"
especially when the locale is non-English.
Hopefully all Linux dists are producing the same message, and force the
language to "C" so we get English messages.
Nicholas Clark [Fri, 24 May 2013 10:20:02 +0000 (12:20 +0200)]
Remove DG/UX support.
DG/UX was a Unix sold by Data General. The last release was in April 2001.
It only runs on Data General's own hardware.
Nicholas Clark [Mon, 11 Mar 2013 11:18:11 +0000 (11:18 +0000)]
Perl_hv_fill() can return early if the hash only has 0 or 1 keys.
No keys implies no chains used, so the return value is 0. One key
unambiguously means 1 chain used, and all the others are free. Two or more
keys might share the same chain, or might not, so the calculation can't be
short-circuited.
Nicholas Clark [Mon, 11 Mar 2013 10:32:12 +0000 (10:32 +0000)]
Tests for hashes in scalar context (and hence HvFILL()).
Father Chrysostomos [Mon, 27 May 2013 07:49:03 +0000 (00:49 -0700)]
perldiag: reflow another entry for nice splain output
Father Chrysostomos [Mon, 27 May 2013 07:17:09 +0000 (00:17 -0700)]
Make \N{ } deprecation warnings fatalizable
What drew my attention to this was the missing category in
perldiag.pod. I tried adding it, but diag.t complained that it should
be absent.
It thinks it should be absent, because Perl_warn (when used correctly)
does not put the warning in any category, and does not allow it to be
suppressed except via $SIG{__WARN__}.
Use of if(ckWARN) followed by Perl_warn is not correct. ckWARN checks
to see whether the category is enabled, and then Perl_warn warns with-
out reference to the category at all, so whether it is fatal cannot
be looked up.
The result is that these warnings do not die under ‘use warnings
FATAL => 'deprecated'’.
Father Chrysostomos [Mon, 27 May 2013 07:10:57 +0000 (00:10 -0700)]
Turn \N{ } deprecation warnings on by default
All deprecation warnings are supposed to be on by default, but
these two were not.
Father Chrysostomos [Mon, 27 May 2013 06:53:40 +0000 (23:53 -0700)]
Make ‘Escape literal pattern white space’ a default warning
All deprecated warnings are supposed to be default warnings.
Father Chrysostomos [Mon, 27 May 2013 06:52:56 +0000 (23:52 -0700)]
perldiag: mark two deprecated entries with D
Father Chrysostomos [Mon, 27 May 2013 06:50:25 +0000 (23:50 -0700)]
perldiag: wrap an entry for better splain output
H.Merijn Brand [Mon, 27 May 2013 07:42:58 +0000 (09:42 +0200)]
[perl #64126] ./Configure -de -Dusevendorprefix didn't default
Father Chrysostomos [Mon, 27 May 2013 06:17:29 +0000 (23:17 -0700)]
perldiag: more alphabetisation
Ricardo Signes [Sun, 26 May 2013 23:16:37 +0000 (19:16 -0400)]
do not wrap long non-verbatim lines in perldiag.pod
This is an unfortunate situation. diagnostics.pm gets its
explanation of an error or warning from perldiag.pod and (basically)
strips out Pod formatting sequences. That means that if a line is
long because of a Pod sequence, it may be the "right" length for an
80 column terminal with the Pod stripped, even though the source
document will be "too long." There isn't much of a presentation
layer here, because diagnostics.pm will not attempt to reflow text.
Adding such a layer may be better later, and the benefit to this
reversion is low, but the benefit of the commit itself was also low.
(In fact, this change may have had no value: the long lines about
which our Pod checker complains are in verbatim paragraphs, and this
line is not a verbatim paragraph.)
This regression was reported by Father Chrysostomos:
After
1dcc3c19f1c0:
$ ./perl -Ilib -Mdiagnostics -e 'warn "Lexing code attempted to stuff non-Latin-1 character into Latin-1 input"'
Lexing code attempted to stuff non-Latin-1 character into Latin-1 input at -e
line 1 (#1)
(F) An extension is attempting to insert text into the current parse (using
lex_stuff_pvn or similar), but tried to insert a
character that couldn't be part of the current input. This is an inherent
pitfall of the stuffing mechanism, and one of the reasons to avoid it. Where
it is necessary to stuff, stuffing only plain ASCII is recommended.
Note the awkward line break.
This commit reverts a change made in
1dcc3c19f1c0.
Father Chrysostomos [Mon, 27 May 2013 02:12:50 +0000 (19:12 -0700)]
perldiag: miscellaneous clean-up
•‘Corrupted regexp opcode’ is a ‘can’t happen’ error, so it belongs
in the P category.
• Two spaces after dots for consistency
• Rewrap for slightly better splain output
• The description usually begins on the same line as the category, so
do so consistently
• Reorder alphabetically
• Missing category
• Single, not double, backslash
• Squash two adjacent (due to reordering) entries with identical
descriptions
• ‘given’ does not depend on lexical $_ any more
• Remove duplicate entries (and placate diag.t with diag_listed_as)
Father Chrysostomos [Mon, 27 May 2013 02:08:46 +0000 (19:08 -0700)]
Increase $Net::Ping::VERSION to 2.42
Father Chrysostomos [Sun, 26 May 2013 21:40:39 +0000 (14:40 -0700)]
regen pod issues
Father Chrysostomos [Sun, 26 May 2013 21:12:25 +0000 (14:12 -0700)]
POSIX.pod: wrap/shorten long lines
Father Chrysostomos [Sun, 26 May 2013 18:31:27 +0000 (11:31 -0700)]
Net::Ping: wrap long pod lines