GitHub (also) checks the vim-modeline to decide how the file should
be rendered.
These files are all in the POD format so add the vim-modeline so that
GitHub displays them in a formatted way.
(Note: adding `linguist-language=Pod` in .gitattributes does not work,
I created a GH support ticket for that a month ago but there have
been little progress on it.)
All the READMEs start with a preamble describing that the file is
written in the POD format.
When the '=encoding' line is put before the preamble then the
preamble is also rendered when viewing the file with `perldoc`
(and/or when viewing the file as POD).
Fix: move '=encoding' to the place where the actual POD starts.
7e19816aa8661ce0e984742e2df11dd20dcdff18 removed it from the default
list, but it is apparently still necessary on Solaris so we add it back
in the hints file.
Add a special case for the porting test in the sanity check of the
CI run.
Before:
When a porting test failed (such as t/porting/authors.t,
t/porting/cmp_version.t, ...) then it would skip all the other
test configurations.
Now:
When a porting test fails:
- result of sanity check is failure (i.e. it's red)
- other test configurations are run and these will also run the
porting tests. (These may or may not fail, depending on the test)
When a non-porting test fails:
- result of sanity check is failure (i.e. it's red)
- sanity check still runs the porting tests
- other test configurations are skipped
Note: in the `if`conditions of the other test configurations it was
needed to include `always()` because otherwise GitHub uses an
implicit `success() &&` (which check the result of the
sanity check - which is unwanted if only the porting tests failed)
Fixes#19867
When `config_sh.PL` failed then it created an empty '..\config.sh' file.
This is unwanted since if make is then re-run it detects a '..\config.sh'
file and skips the target which leads to completely different errors.
After adding a `die "Foobar";` in win32/config_sh.PL:
$ gmake INST_TOP=... CCHOME=...
...
..\miniperl.exe -I..\lib config_sh.PL ... > ..\config.sh
Foobar at config_sh.PL line 5.
gmake: *** [GNUmakefile:1175: ..\config.sh] Error 255
Re-running the make command:
$ gmake INST_TOP=... CCHOME=...
..\miniperl.exe -I..\lib ..\configpm --chdir=..
Use of uninitialized value $t in string eq at ..\configpm line 345.
...
written lib/Config.pod
updated lib/Config.pm
updated lib/Config_heavy.pl
syntax error at lib/Config_heavy.pl line 165, near "x;"
Compilation failed in require at ..\configpm line 1144.
gmake: *** [GNUmakefile:1190: ..\lib\Config.pm] Error 255
When `gmake` was re-run it started with the '$(CONFIGPM)' target instead
of the '..\config.sh' target.
The fix: instead of creating '..\config.sh' it now first creates
'..\config.sh.tmp' and then renames[^1] it to '..\config.sh'
Tested the GNUmakefile on Windows 10 using GNU Make v4.2.1,
I did *not* test the Makefile (no nmake installed).
[^1]: `rename` on windows only takes a path in the first argument.
That is: `rename ..\config.sh.tmp config.sh` can be considered
the same as `move ..\config.sh.tmp ..\config.sh`.
The test was checking the return value of `getsockopt(..., SO_RCVBUF)`
after setting it with `setsockopt(..., SO_RCVBUF, $i)`.
The values the test accepted:
- '$i'
- '2 * $i'
The '2 * $i' is because Linux doubles the size of the buffer.[^1]
On OmniOS(/SmartOS/Solaris?) it also treats the SO_RCVBUF special..
Apparently:
- when using g++: it returns '$i'
- when using gcc: the value depends on the 'tcp_mss_def_ipv4' setting.[^2].
By default this is 536 so the value it returns is: '536 * ceil($i / 536)'
(with a minimum of 'tcp_recv_hiwat_minmss' (=4) * 'tcp_mss_def_ipv4' (=536)
It doesn't seem to do anything special for `SO_SNDBUF` so let's use that
in the test instead.
(Tested on: Linux (gcc), Windows 10 (gcc), OmniOS (gcc,g++), FreeBSD (gcc).)
Fixes#20188
[^1]: https://www.cs.helsinki.fi/linux/linux-kernel/2001-30/0880.html
[^2]: https://github.com/TritonDataCenter/illumos-joyent/blob/master/usr/src/stand/lib/tcp/tcp.c#L7034
```
case SOL_SOCKET: {
switch (option) {
case SO_RCVBUF:
...
val = MSS_ROUNDUP(val, tcp->tcp_mss);
```
(with thanks to @wolfsage for that link)
This file was used a mix in indentation of tabs and spaces..
Sometimes even in the same code-block..
Fix this by replacing the tabs to spaces using:
`perl -pli -e 's/^(\t+)/" " x (8 * length ($1))/e' Porting/cmpVERSION.pl`
The original message added in commit a9a41e90102044c0dec8a28b7a0d24a7f4a9b84d:
"... - can be removed once v5.37.2 is released"
When v5.37.2 was released the message was updated to 'once v5.37.3 is released'
When v5.37.3 was released the message was updated to 'once v5.37.4 is released'
-> Remove the entry since it's no longer needed.
Add a small section in the release manager guide about using your own
fork of the perl5 repo when making the release. The current guide is
not written with that in mind and as a result is missing some steps.
Clean up the report created by `perlbug` so that it looks better
when pasted in a GitHub issue:
- Put the 'perl configuration' in a code-block
- Hide some sentences
- Clean up 'Flags' section (it was shown as a very big header and
taking up quite a lot of space)
- Add `**Description**`, `**Steps to Reproduce**` and `**Expected behaviour**`
in the body of the report (similar to the GitHub issue template)
- If this is a report about a core module then also put the name of the Module
at the top (it's still included in 'Flags' as well)
- ...
(There are two newlines added before 'Flags', this is to deal with someone
using `perlbug -b foo`, without the newlines GitHub would make turn the
'foo' into a title)
CATCH_GET is never true in this code, so we never called try_yyparse()
which in turn meant we leaked debug data from failed evals. With this
in place an eval that dies during compile will always be handled by
doeval_comp() properly.
This includes changes to t/comp/readlines.t so it tests code that
croaks during compile, which used to leak and fail test but was not
actually tested.
This fixes GH Issue #20161.
Porting/todo.pod contains one todo item that mentions a version number.
That particular version number has already been bumped 90 times on blead...
I think it's time to stop bumping it and replace it with a generic text.
(It started as v5.14.0, then got bumped to v5.18.0 and then got bumped
with every release...)
This is based on the existing README and is an almost exact copy.
Some minor formatting changes to improve the rendering but the text
remains the same. This is done because not having a formatted README
is blocking some other changes.[^1]
t/porting/copyright.t was also adjusted to check the copyright in
.github/README.md
*Long term*: In the long term the contents of README and .github/README.md
will differ. Since these serve a different purpose:
- README: this is included with each release and for that it's more then
good enough enough;
- .github/README.md: this is for people viewing the repository on GitHub
and for that the current README is - in my opinion - not good enough.
It should be much more informative (compare it with some other repos
and that should be obvious, in #18965 there are some examples but
many more exist).
[^1]: rendering platform specific READMEs as POD in GitHub.
This reverts commit 857320cbf85e762add18885ae8a197b5e0c21b69.
There were a lot of conflicts due to whitespace changes in the
intervening time. I manually reviewed the differences and merged them.
This converts INIT {} blocks from the Module::Install::DSL
namespace into BEGIN blocks. This works around the bug reported in
GH Issue #16300. (Hopefully, not fully tested yet.) Which in turn
should allow us to close the bug in #2754.
See also PR: #20168 and Issue: #20161 both of which are blocked by
this.
This series of commits improves the handling of system error messages
that come from strerror().
It turns out that strerror() can return mojibake if the LC_CTYPE locale
and the LC_MESSAGES locale aren't set to the same thing. They are now
synced for the duration of the routine, if necessary.
There have long been lots of preprocessor conditionals depending on the
platform's capabilities. These are now refactored so that the various
implementations are separate short functions, which are easier to
understand when not interrupted by those directives.
These commits and previous ones have now completely replaced some large
and cumbersome functions, which are also removed in this series.
What these functions do has been subsumed by code introduced in previous
commits, and in a more straight forward manner.
Also removed in this commit is the cache of the knowing what locales are
UTF-8 or not. This data is now cheaper to calculate when needed, and
there is now a single entry cache, so I don't think the complexity
warrants keeping it.
It could be added back if necessary, split off from the remainder of
this commit.
locale.c has the infrastructure to handle this, so remove repeated
logic.
The removed code tried to discern better based on using script runs, but
this actually doesn't help, so is removed.
Since we're now using C99, we can remove the block that was previously
needed, and now the code is properly indented, whereas before it wasn't
In stress testing, I discovered that the LC_CTYPE and LC_MESSAGES
locales need to be the same locale, or strerror() can return
question marks or mojibake instead of the proper message.
This commit refactors the handling of stringifying "$!" to make the
locales of both categories the same during the stringification.
Actually, I suspect it isn't the locale, but the codeset of the locale
that needs to be the same. I suspect that if the categories were both
in different UTF-8 locales, or both in single-byte locales, that things
would work fine. But it's cheaper to find the locale rather than the
locale's codeset, so that is what is done.
The my_strerror() function has effectively 5 different implementations
depending on the capabilities of the platform. Only a few lines are
common to all, the set-up and the return. The #ifdefs obscure the
underlying logic. So this commit separates things out so that the
ifdefs don't interrupt the flow as much, with the result that it's
clearer what is going on in each implementation.
Nested BEGIN blocks can cause us to segfault by exhausting
the C stack. Eg:
perl -le'sub f { eval "BEGIN { f() }" } f()'
will segfault. This adds a new interpreter var PL_eval_begin_nest_depth
to keep track of how many layer of eval/BEGIN we have seen, and a new
reserved variable called ${^MAX_NESTED_EVAL_BEGIN_BLOCKS} which can be
used to raise or lower the limit. When set to 0 it blocks BEGIN entirely,
which might be useful from time to time.
This fixes https://github.com/Perl/perl5/issues/20176
newcollate is called when LC_COLLATE is set to a new locale. This series
of commits improves its operation
Some platforms require LC_CTYPE and LC_COLLATE to be the same locale in
order to operate properly. These commits now bring LC_CTYPE into sync
with LC_COLLATE for the duration of the calculations.
More and better debugging statements are added
Memory is allocated when a string is collated. The amount is roughly a
linear function of the string length, varying depending on the locale.
To save some recalculations, perl calculates and saves coefficients for
the current locale's equation once, revising them if necessary. Prior to
this commit, this somewhat expensive calculation was done every time the
locale changed. Now it is deferred until the first time it is needed.
When comparing two strings for order under 'use locale', one can call
strcoll() which creates hidden modified versions of the strings based on
the locale's collation ordering, does the comparison, and then throws
away the modified versions.
Or one can call strxfrm() to create a non-hidden modified version of
each string, and then do a straight comparison. The advantage here is
that you are in control of when to discard the modified version, and the
(expensive) transformation is done just once, no matter how many times a
comparison is done.
Perl assumes that a string will be compared multiple times, so the first
time it happens under 'use locale', strxfrm() is called, and the
modified string is attached via magic to the SV. The modified string is
discarded if the string changes, or is recomputed if the locale has
changed since the computation was done.
The transformation generally occupies some multiple of size of the
original string. Memory must be allocated to hold it. For any given
locale, the amount is predictable for all strings, roughly via a linear
equation "mx+b", where x is the size of the original string. By
computing 'm' and 'b' once, Perl can allocate enough memory to hold the
transformation, but not too much. (m and b are adjusted up as necessary
as more strings get transformed.) This minimizes mallocs.
But the calculation of m and b is somewhat expensive, and only necessary
if the program actually does a string compare under 'use locale'.
This commit defers the calculation until needed. It does the bare
minimum of changes accomplish this. The next commit will rearrange
things.
Perhaps this should be a warning to the user that we couldn't calculate
collation info for the locale, but at least there should be a way to
get that info from a DEBUG statement
The libc functions strxfrm() on some platforms requires the LC_CTYPE
locale to be the same as the LC_COLLATE locale (or rather, probably that
they have the same code set, but checking for locale is cheaper).
Otherwise mojibake would result, or more likely the function will fail,
setting errno.
This commit brings the locales into alignment if necessary
This code is using isCNTRL_LC which depends on LC_CTYPE to verify that
something in the LC_COLLATE locale is a control. That only works
properly if the two locales are the same. This commit adds code to
ensure they are.
The code to handle changing LC_COLLATE handled the possibility of being
passed a NULL locale name. But we're not changing things unless we have
a new locale, and know its name, so a name is always passed