This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
perl5.git
10 months agoMake bareword_filehandles feature wording consistent
Dagfinn Ilmari Mannsåker [Thu, 20 Jul 2023 21:38:47 +0000 (22:38 +0100)]
Make bareword_filehandles feature wording consistent

The other similar features (indirect, multidimensional, array_base)
use the word "available", not "enabled", since they are disabled in
later versions.

10 months agot/porting/authors.t - make robust to -Dmksymlinks to a git checkout
Yves Orton [Thu, 20 Jul 2023 19:09:13 +0000 (21:09 +0200)]
t/porting/authors.t - make robust to -Dmksymlinks to a git checkout

If someone configures with -Dmksymlinks to a git checkout t/porting/authors.t
gets confused, and fails test. This teaches it and Porting/updateAUTHORS.p[lm]
to handle this build scenario properly.

Fixes #21272

10 months agoDisable network tests in dist test jobs
Dagfinn Ilmari Mannsåker [Fri, 21 Jul 2023 13:06:34 +0000 (14:06 +0100)]
Disable network tests in dist test jobs

Net::Ping disables its network tests under PERL_CORE, but these tests
are testing the dists under dist/ on other versions of Perl, not as
part of core.

10 months agot/lib/croak/class: remove skip from of leaking test
Dagfinn Ilmari Mannsåker [Fri, 21 Jul 2023 09:27:32 +0000 (10:27 +0100)]
t/lib/croak/class: remove skip from of leaking test

The line number wasn't adjusted when the skip was added, so now that
the skipe condition is false the test fails.

10 months agoPerl_av_extend_guts: Zero() trailing elements after unshift & resize
Richard Leach [Tue, 18 Jul 2023 21:43:19 +0000 (21:43 +0000)]
Perl_av_extend_guts: Zero() trailing elements after unshift & resize

Since https://github.com/Perl/perl5/commit/399fef93c903aedee05a74de780b57eeeb571b32,
trailing elements in an array that has been unshifted and resized
might not be properly Zero() initialized. This is because of faulty
arithmetic when calculating `to_null`, the number of elements to
initialize, when the array was only partially shifted.

This commit corrects the arithmetic, adds comments arount the
calculation of `to_null`, and adds a test based upon the case
provided in GH #21235.

The test added segfaults more reliably for me - almost every time -
than the originally supplied case. However, since it relies upon
uninitialized memory, it's probably still not deterministic and
somewhat dependent upon the choice of memory allocator.

Closes #21235

10 months agoUse strict and warnings in B::Deparse tests
Dagfinn Ilmari Mannsåker [Thu, 20 Jul 2023 12:31:29 +0000 (13:31 +0100)]
Use strict and warnings in B::Deparse tests

This would have caught the duplicate (and it turns out, useless)
definition of $expr in do_infix_keyword().

10 months agoPrepare Module-CoreList for 5.39.2
Steve Hay [Thu, 20 Jul 2023 19:52:09 +0000 (20:52 +0100)]
Prepare Module-CoreList for 5.39.2

10 months agoBump version for 5.39.2
Steve Hay [Thu, 20 Jul 2023 19:41:45 +0000 (20:41 +0100)]
Bump version for 5.39.2

10 months agoNew perldelta for 5.39.2
Steve Hay [Thu, 20 Jul 2023 19:33:52 +0000 (20:33 +0100)]
New perldelta for 5.39.2

10 months agoTick off 5.39.1
Steve Hay [Thu, 20 Jul 2023 19:26:09 +0000 (20:26 +0100)]
Tick off 5.39.1

10 months agoUse https for recent epigraph links
Steve Hay [Thu, 20 Jul 2023 19:24:32 +0000 (20:24 +0100)]
Use https for recent epigraph links

10 months agoAdd epigraph for 5.39.1
Steve Hay [Thu, 20 Jul 2023 19:20:43 +0000 (20:20 +0100)]
Add epigraph for 5.39.1

10 months agoUpdate perlhist for 5.39.1 v5.39.1
Steve Hay [Thu, 20 Jul 2023 16:47:13 +0000 (17:47 +0100)]
Update perlhist for 5.39.1

10 months agoFinalize perldelta
Steve Hay [Thu, 20 Jul 2023 16:41:23 +0000 (17:41 +0100)]
Finalize perldelta

10 months agoUpdate Module::CoreList for 5.39.1
Steve Hay [Thu, 20 Jul 2023 16:33:18 +0000 (17:33 +0100)]
Update Module::CoreList for 5.39.1

10 months agoperldelta - Wrapping, typos, GH links
Steve Hay [Thu, 20 Jul 2023 12:49:12 +0000 (13:49 +0100)]
perldelta - Wrapping, typos, GH links

10 months agoperldelta - Remove boilerplate
Steve Hay [Thu, 20 Jul 2023 12:29:42 +0000 (13:29 +0100)]
perldelta - Remove boilerplate

10 months agoperldelta - Fix (remove) broken link
Steve Hay [Thu, 20 Jul 2023 12:06:21 +0000 (13:06 +0100)]
perldelta - Fix (remove) broken link

10 months agoperldelta - Fix up Porting/acknowledgements.pl arguments
Steve Hay [Thu, 20 Jul 2023 11:23:08 +0000 (12:23 +0100)]
perldelta - Fix up Porting/acknowledgements.pl arguments

This (and the perldelta for the unreleased 5.39.0) had come out wrong due
to issues with the version bumps to 5.39.0/5.39.1.

10 months agoRemove text from perl5390delta.pod
Steve Hay [Thu, 20 Jul 2023 11:22:28 +0000 (12:22 +0100)]
Remove text from perl5390delta.pod

All of this text is in perldelta.pod (which will shortly become
perl5391delta.pod), which is where it belongs since the changes all
occurred after the commit tagged as 5.39.0 (which was not released).

10 months agoperldelta - Update modules section
Steve Hay [Thu, 20 Jul 2023 11:21:38 +0000 (12:21 +0100)]
perldelta - Update modules section

10 months agoNote two modified files as customized for blead
Steve Hay [Thu, 20 Jul 2023 11:20:44 +0000 (12:20 +0100)]
Note two modified files as customized for blead

10 months agoperldelta.pod - document changes to UNIVERSAL.pm
Yves Orton [Wed, 19 Jul 2023 17:40:11 +0000 (19:40 +0200)]
perldelta.pod - document changes to UNIVERSAL.pm

We now define a UNIVERSAL::import and UNIVERSAL::unimport
this explains why and what the consequences. Also tweaks
the existing perldiag documentation of it.

10 months agogetpgrp: getpgid used for PID != 0 is now a lot more portable
Tony Cook [Mon, 12 Jun 2023 02:09:11 +0000 (12:09 +1000)]
getpgrp: getpgid used for PID != 0 is now a lot more portable

POSIX.1 2004 lists getpgid as an XSI extension, 2017 edition lists
it as BASE.

Removed the comments since it now seems irrelevant.

Fixes #19648

10 months agoUpdate Makefile.SH for CPAN::Meta::Requirements update
Steve Hay [Wed, 19 Jul 2023 22:08:07 +0000 (23:08 +0100)]
Update Makefile.SH for CPAN::Meta::Requirements update

10 months agoRevert "Update Pod::Simple from 3.43 to 3.45"
Steve Hay [Wed, 19 Jul 2023 21:35:35 +0000 (22:35 +0100)]
Revert "Update Pod::Simple from 3.43 to 3.45"

This reverts commit dcfcd777eabb848596d2672749d4f1d7b1a96a86.

(porting/cmp_version.t failed for Pod/Simple/HTMLLegacy.pm version 5.01
and ext/Pod-Html/t/anchorify.t failed test 1)

10 months agoRevert "Update Archive::Tar from 2.40 to 3.02"
Steve Hay [Wed, 19 Jul 2023 21:32:04 +0000 (22:32 +0100)]
Revert "Update Archive::Tar from 2.40 to 3.02"

This reverts commit 591063c99f0757db88773c5d1ee03dbfbf334613.

(cpan/Archive-Tar/t/90_symlink.t failed tests 6, 11, 16 and 20-21)

10 months agoUpdate Time::Local from 1.30 to 1.35
Steve Hay [Wed, 19 Jul 2023 20:52:00 +0000 (21:52 +0100)]
Update Time::Local from 1.30 to 1.35

10 months agoUpdate Text-Tabs+Wrap from 2021.0814 to 2023.0511
Steve Hay [Wed, 19 Jul 2023 20:49:07 +0000 (21:49 +0100)]
Update Text-Tabs+Wrap from 2021.0814 to 2023.0511

10 months agoUpdate Test::Simple from 1.302194 to 1.302195
Steve Hay [Wed, 19 Jul 2023 20:44:30 +0000 (21:44 +0100)]
Update Test::Simple from 1.302194 to 1.302195

10 months agoUpdate Socket from 2.036 to 2.037
Steve Hay [Wed, 19 Jul 2023 20:41:53 +0000 (21:41 +0100)]
Update Socket from 2.036 to 2.037

10 months agoUpdate Pod::Simple from 3.43 to 3.45
Steve Hay [Wed, 19 Jul 2023 20:38:49 +0000 (21:38 +0100)]
Update Pod::Simple from 3.43 to 3.45

10 months agoUpdate perlfaq from 5.20210520 to 5.20230701
Steve Hay [Wed, 19 Jul 2023 20:33:17 +0000 (21:33 +0100)]
Update perlfaq from 5.20210520 to 5.20230701

10 months agoUpdate Module::Metadata from 1.000037 to 1.000038
Steve Hay [Wed, 19 Jul 2023 20:31:40 +0000 (21:31 +0100)]
Update Module::Metadata from 1.000037 to 1.000038

10 months agoModule::CoreList is currently based on 5.20230520
Steve Hay [Wed, 19 Jul 2023 20:31:10 +0000 (21:31 +0100)]
Module::CoreList is currently based on 5.20230520

10 months agoUpdate Math::BigInt::FastCalc from 0.5013 to 0.5014
Steve Hay [Wed, 19 Jul 2023 20:27:43 +0000 (21:27 +0100)]
Update Math::BigInt::FastCalc from 0.5013 to 0.5014

10 months agoUpdate Math::BigInt from 1.999837 to 1.999839
Steve Hay [Wed, 19 Jul 2023 20:25:14 +0000 (21:25 +0100)]
Update Math::BigInt from 1.999837 to 1.999839

10 months agoUpdate IO-Compress from 2.204 to 2.205
Steve Hay [Wed, 19 Jul 2023 20:19:51 +0000 (21:19 +0100)]
Update IO-Compress from 2.204 to 2.205

10 months agoUpdate ExtUtils::Manifest from 1.73 to 1.75
Steve Hay [Wed, 19 Jul 2023 20:16:42 +0000 (21:16 +0100)]
Update ExtUtils::Manifest from 1.73 to 1.75

10 months agoUpdate CPAN::Meta::Requirements from 2.140 to 2.143
Steve Hay [Wed, 19 Jul 2023 20:15:10 +0000 (21:15 +0100)]
Update CPAN::Meta::Requirements from 2.140 to 2.143

10 months agoUpdate Archive::Tar from 2.40 to 3.02
Steve Hay [Wed, 19 Jul 2023 20:10:39 +0000 (21:10 +0100)]
Update Archive::Tar from 2.40 to 3.02

10 months agoFix up lib/croak.t skip following the version bump
Steve Hay [Wed, 19 Jul 2023 18:30:19 +0000 (19:30 +0100)]
Fix up lib/croak.t skip following the version bump

10 months agoManually prepare Module::CoreList for 5.39.1
Steve Hay [Wed, 19 Jul 2023 17:56:41 +0000 (18:56 +0100)]
Manually prepare Module::CoreList for 5.39.1

There was no 5.39.0, so adjust versions (and dates) for 5.39.1.
Also, there was no 5.37.12... but there was a 5.38.0!

10 months agoNew perldelta for 5.39.1
Steve Hay [Wed, 19 Jul 2023 17:35:30 +0000 (18:35 +0100)]
New perldelta for 5.39.1

(Additions to perldelta since 5.38.0 have been manually retained rather
than moved to perl5390delta.pod. Normally there wouldn't be any when
performing this step because it was traditionally done right after a
stable .0 release, but that didn't happen this time.)

10 months agoBump version for 5.39.1
Steve Hay [Wed, 19 Jul 2023 17:10:48 +0000 (18:10 +0100)]
Bump version for 5.39.1

10 months agoFix version bump to 5.39.0
Steve Hay [Wed, 19 Jul 2023 17:01:25 +0000 (18:01 +0100)]
Fix version bump to 5.39.0

The bump done by 2083cfe50f was oddly missing lots of parts :-s The missing
INSTALL parts were picked up by 355437ea80 but much more was still missing.

Manually complete the remaining parts by comparison with the previous bump
for a .0 version (namely, e0fe22bd0d -- the bump to 5.3.7.0).

10 months agocpan/Compress-Raw-Zlib - Update to version 2.205
James E Keenan [Wed, 19 Jul 2023 13:58:45 +0000 (09:58 -0400)]
cpan/Compress-Raw-Zlib - Update to version 2.205

  2.205 16 July 2023

      * 2.205
        Sun, 16 Jul 2023 16:11:31 +0100
        3effdb9dbaa9bedfff3cad44902e515409ffae78

      * Test::More::isn't warns in perl 5.38
        Sun, 9 Jul 2023 21:38:15 +0100
        928bbc6ddc5178621fb477b38a1b4b4de38866cf

      * add zlib-ng 2.1.3
        Thu, 29 Jun 2023 19:51:58 +0100
        b1aa2583b4c114c2194890a0e015fdc439928c31

      * add zlib-ng 2.1.2
        Fri, 9 Jun 2023 14:51:17 +0100
        0d505d9156ca7e9cac15e2d6e574099300f91a14

      * Change storage of ZLIBNG_VER_STATUS from IV to PV https://github.com/pmqs/Compress-Raw-Zlib/issues/24
        Fri, 9 Jun 2023 14:30:36 +0100
        0a8fb7141a43b8e49609fb06f05fad5150a97c2a

      * Fix to allow building with C++17 register keyword not allowed in C++17 https://github.com/pmqs/Compress-Raw-Zlib/issues/23
        Mon, 22 May 2023 12:42:51 +0100
        a7c12acdd4ce7fdc070f50ac78e68e04c8699c81

      * Change while loop for `LimitOutput`  example https://github.com/pmqs/Compress-Raw-Zlib/issues/21
        Sun, 21 May 2023 21:32:19 +0100
        972f03b5b0bf06d44991bbee2d2c9216e4175154

      * [doc] zlib.h: Remove duplicate "the" (#22)
        Mon, 1 May 2023 22:46:39 +0200
        89b43e6978d8e9b16801f48881cadf822585be0d

      * Add zlib compat version for 2.0.7
        Sat, 18 Mar 2023 08:42:59 +0000
        e7d79cbd5924fbdcd3515fb3b0ad171c7720105c

10 months agocpan/Compress-Raw-Bzip2 - Update to version 2.205
James E Keenan [Wed, 19 Jul 2023 13:49:51 +0000 (09:49 -0400)]
cpan/Compress-Raw-Bzip2 - Update to version 2.205

  2.205 8 February 2023

    * 2.205
      Sun, 16 Jul 2023 16:21:33 +0100
      62de94af7f8328691abbadbeeb0f2b5effc551b2

    * Test::More::isn't warns in perl 5.38
      Sun, 9 Jul 2023 21:52:47 +0100
      cab526b7f1d8fed30e30f3a16c07af66d5b4d4b5

    * Add perl 5.38 & run cron for upstream repos
      Sun, 9 Jul 2023 21:49:34 +0100
      6c9f55033f725eab641411a1ac7f54f26250eeef

    * add on workflow_dispatch
      Fri, 9 Jun 2023 16:32:22 +0100
      4d3a1d1a261be3599eee48ba28c349a7fc0f1750

    * fix reference to github issue
      Mon, 22 May 2023 12:37:07 +0100
      edcb04c0b3bdbc2893654fcc7600474ba090c77a

    * Fix to allow building with C++17 register keyword not allowed in C++17 https://github.com/pmqs/Compress-Raw-Bzip2/issues/11
      Mon, 22 May 2023 12:29:30 +0100
      9357289d218d14d64fc31cfa8ae5746a6dcbfca3

    * Silence warnings on HPUX https://github.com/pmqs/Compress-Raw-Bzip2/issues/10
      Thu, 23 Mar 2023 14:05:43 +0000
      1418b2afd5b16bb9ddbc19e377c16c6af113d64f

10 months agoRemove customizations for Compress::Raw::* in core
James E Keenan [Tue, 18 Jul 2023 20:03:40 +0000 (16:03 -0400)]
Remove customizations for Compress::Raw::* in core

Compress::Raw::Bzip2: https://github.com/Perl/perl5/issues/21262

Compress::Raw::Zlib:  https://github.com/Perl/perl5/issues/21263

As recommended by Tony Cook, we can eliminate customizations in the
t/porting/customized.dat metadata now that we no longer need to account
for CUSTOMIZED elements when synching these two distributions with CPAN.

10 months ago.lgtm.yml: Delete obsolete file
Elvin Aslanov [Tue, 18 Jul 2023 09:06:53 +0000 (11:06 +0200)]
.lgtm.yml: Delete obsolete file

Fixes #21252

10 months agoFix assorted bugs related to not having a UNIVERSAL::import
Yves Orton [Mon, 14 Feb 2022 11:24:21 +0000 (12:24 +0100)]
Fix assorted bugs related to not having a UNIVERSAL::import

Since perl 5.0 the methods "import" and "unimport" have been
special cased in gv.c (unimport was removed for a while) to
not produce errors if they are called. This is partly
because

    use Foo;

is defined to be

    BEGIN {
        require Foo;
        Foo->import();
    }

which would blow up if there is no import function defined in
Foo, for instance if it were defining a class and not a package
which exports modules.

This special case can be broken by simple code like

    \&UNIVERSAL::isa

which will create a stub function which then blows up when it is
used. Notably the module "autouse" which is shipped with perl will
trigger this behavior.

A related issue is that if you ask for a function to be exported
from a module that does not have support for exporting there is no
error, eg:

    use File::Spec qw(catfile);

will silently succeed without exporting a catfile function. This is
exacerbated on case insensitive file systems when the module name
is case-mismatched, the use succeeds but the export does not, leading
to confusion, eg:

    use LIst::Util qw(sum); # note the typo!

will load List::Util but will not export the sum function.

This patch defines UNIVERSAL::import() and UNIVERSAL::unimport()
functions. This prevents the "reference to \&UNIVERSAL::import" bug.
The function is defined to be a no-op unless arguments are passed into
the functions, in which case a warning is thrown indicating
that there is likely a problem. The error is modelled after the
error produced by calling a non-existent method or function:

    ./perl -Ilib -le'BEGIN{ my $import_sub= \&UNIVERSAL::import;}
        use File::Spec qw(catfile);'
    Attempt to call UNIVERSAL::import() with arguments via package File::Spec
        (Perhaps you forgot to load "File::Spec"?) at -e line 1.
    BEGIN failed--compilation aborted at -e line 1.

This fixes Issue #19416, Issue #19417, Issue #19418. See also Issue #19410 for
discussion, however this patch does not fix that case (it may not be
fixable.)

10 months agotestsuite.yml: manually download and extract mingw
Tomasz Konojacki [Tue, 18 Jul 2023 13:47:05 +0000 (15:47 +0200)]
testsuite.yml: manually download and extract mingw

This is much faster than the "setup-mingw" GitHub action (~1 min vs
~6min). It's also more flexible, we can easily switch to a different
mingw build.

10 months agoregexp.h/perlreapi.pod - synchronize struct regexp documentation with source
Yves Orton [Sun, 16 Jul 2023 11:17:48 +0000 (13:17 +0200)]
regexp.h/perlreapi.pod - synchronize struct regexp documentation with source

and update the individual struct members documentation accordingly,
some time ago this structure was synchonize with the SV structure,
so some members that used to be documented are now actually macros.

This also includes a couple of field reordering to make the struct
easier to understand and also to cluster the 32 bit fields together
so that the structure is a minimal size.

Thanks to Tony C for noticing this and calling it to my attention.

10 months agot/porting/podcheck.t - some verbatim text is copied from the source
Yves Orton [Sun, 16 Jul 2023 11:10:24 +0000 (13:10 +0200)]
t/porting/podcheck.t - some verbatim text is copied from the source

So we should check if it is still in sync with the source, and ignore
any line length issues as the source needs to be changed, not the copy.

To enable this simply put "file source: FILENAME" or
"copied from: FILENAME" in the first line of the verbatim text.

10 months agolocale.c: Add commit number to comments 21257/head
Karl Williamson [Wed, 5 Apr 2023 00:58:51 +0000 (18:58 -0600)]
locale.c: Add commit number to comments

to refer to details of the problem

10 months agoperl.h: White space, comments only
Karl Williamson [Sun, 5 Mar 2023 13:03:13 +0000 (06:03 -0700)]
perl.h: White space, comments only

10 months agoRemove the duplicate "to"
Elvin Aslanov [Mon, 17 Jul 2023 11:25:16 +0000 (13:25 +0200)]
Remove the duplicate "to"

Correct spelling in comments

10 months agopp.c: Use utf8_hop_back instead of rolling our own
Karl Williamson [Sun, 10 Jul 2022 17:12:15 +0000 (11:12 -0600)]
pp.c: Use utf8_hop_back instead of rolling our own

This is inlined, so shouldn't be any slower, and fixing bugs will be
done in a single place

10 months agoutf8_hop_back: Check before derefencing
Karl Williamson [Mon, 17 Jul 2023 01:17:54 +0000 (19:17 -0600)]
utf8_hop_back: Check before derefencing

This conditional derefenced before checking if it is safe to dereference

10 months agolocale.c: Add missing mutex locks
Karl Williamson [Sat, 10 Sep 2022 17:50:40 +0000 (11:50 -0600)]
locale.c: Add missing mutex locks

This adds locks around mbrtowc and reading the environment that a code
review indicated were missing.  The mbrtowc lock is currently a no-op,
but a future commit will change that.  The other lock is in code rarely
compiled.

10 months agoPod-Perldoc: exclude corpus files that are not used for anything
Graham Knop [Tue, 6 Jun 2023 11:19:12 +0000 (13:19 +0200)]
Pod-Perldoc: exclude corpus files that are not used for anything

The Pod-Perldoc distribution includes several files in its corpus
directory but which aren't used for anything. They appear to be for
manual testing. There is little reason to include them in core.
Additionally, one of the files included is an old copy of perlfunc.pod,
which continually confuses contributors to core.

10 months agoconfig.yml: RFC -> PPC
Elvin Aslanov [Sun, 9 Jul 2023 17:03:52 +0000 (19:03 +0200)]
config.yml: RFC -> PPC

Rename in "url" and "about"

10 months agoperl5100delta: document removal of 'package;' syntax
Lukas Mai [Sun, 16 Jul 2023 18:22:27 +0000 (20:22 +0200)]
perl5100delta: document removal of 'package;' syntax

The 'package;' (null package) syntax that was deprecated in perl 5.8 was
removed in 5.10, but there is no mention of it in the perldeltas. Until
now.

10 months agoregen/HeaderParser.pm - friendly perl version check
Yves Orton [Sun, 16 Jul 2023 13:03:16 +0000 (15:03 +0200)]
regen/HeaderParser.pm - friendly perl version check

If the installed version of perl is too old then HeaderParser.pm
will die because it uses named capture buffers. We could do a "standard"
version assertion, but doing it this way makes for a more user friendly
error message.

10 months agolocale.c: Move setting errno out of critical section
Karl Williamson [Fri, 7 Apr 2023 15:18:35 +0000 (09:18 -0600)]
locale.c: Move setting errno out of critical section

I doesn't matter much, but its better practice to make critical sections
as small as possible.

10 months agolocale.c: Improve collation debugging output
Karl Williamson [Wed, 5 Apr 2023 16:18:44 +0000 (10:18 -0600)]
locale.c: Improve collation debugging output

This adds a special case for when the buffer is empty

10 months agoPerl__byte_dump_string(): Properly handle NULL input
Karl Williamson [Sun, 2 Apr 2023 09:51:09 +0000 (03:51 -0600)]
Perl__byte_dump_string(): Properly handle NULL input

Instead of an assert, this returns (nil) and things can proceed.

10 months agomingw64 ci: install a fresh mingw64 and use it
Tony Cook [Wed, 5 Jul 2023 04:31:42 +0000 (14:31 +1000)]
mingw64 ci: install a fresh mingw64 and use it

This is far from perfect but should let us become less accustomed to
red crosses due to mingw64.

The installation of mingw64 is slow, hopefully a future change will
let us use the github workflow caching mechanism.

10 months agowin32: make win32 FILE access macros depend on libc instead of compiler
Tony Cook [Tue, 11 Jul 2023 00:20:15 +0000 (10:20 +1000)]
win32: make win32 FILE access macros depend on libc instead of compiler

Thanks to xenu for information on the macro used here.

10 months agoRevert "use the linker to link generate_uudmap$(EXE)"
Tony Cook [Wed, 12 Jul 2023 05:00:21 +0000 (15:00 +1000)]
Revert "use the linker to link generate_uudmap$(EXE)"

This introduced smoke failures on AIX and HP-UX, for example on AIX:

[2023-07-11 23:38:52METDST] xlc_r -q64 -c -DPERL_CORE -q64 -DDEBUGGING -DPERL_DONT_CREATE_GVSV -qlanglvl=extended -D_ALL_SOURCE -D_ANSI_C_SOURCE -D_POSIX_SOURCE -qmaxmem=-1 -qnoansialias -qlanglvl=extc99 -DUSE_NATIVE_DLOPEN -DNEED_PTHREAD_INIT -DDEBUGGING -I/pro/local/include -q64 -DUSE_64_BIT_ALL -q64 -O -g generate_uudmap.c
[2023-07-11 23:38:52METDST] ld -o generate_uudmap -L/usr/local/ppc64/lib64 -b64 -q64 -L/pro/local/lib -brtl -bdynamic -b64 generate_uudmap.o -lpthread -lbind -ldl -lld -lm -lcrypt -lpthreads -lc
[2023-07-11 23:38:52METDST]
[2023-07-11 23:38:52METDST] If you compile perl5 on a different machine or from a different object
[2023-07-11 23:38:52METDST] directory, copy the Policy.sh file from this object directory to the
[2023-07-11 23:38:52METDST] new one before you run Configure -- this will help you with most of
[2023-07-11 23:38:52METDST] the policy defaults.
[2023-07-11 23:38:52METDST] 5.39.0 <=> 5.014002
[2023-07-11 23:38:52METDST] ===== PROCURA Policy for aix/cc ========================
[2023-07-11 23:38:52METDST] ===== PROCURA Policy results ============================
[2023-07-11 23:38:52METDST] cc:         xlc_r
[2023-07-11 23:38:52METDST] ccversion:  -
[2023-07-11 23:38:52METDST] gccversion: -
[2023-07-11 23:38:52METDST] ccflags:    -q64 -DDEBUGGING -DPERL_DONT_CREATE_GVSV -qlanglvl=extended
[2023-07-11 23:38:52METDST] optimize:
[2023-07-11 23:38:52METDST] ld:
[2023-07-11 23:38:52METDST] ldflags:    -L/usr/local/ppc64/lib64 -b64 -q64 -L/pro/local/lib
[2023-07-11 23:38:52METDST] libswanted: cl pthread socket bind inet ndbm gdbm dbm db malloc dl ld sun m crypt sec util c cposix posix ucb bsd BSD
[2023-07-11 23:38:52METDST] libsdirs:    /usr/local/ppc64/lib64  /lib /pro/local/lib
[2023-07-11 23:38:52METDST] locincpth:  /pro/local/include
[2023-07-11 23:38:52METDST] loclibpth:  /usr/local/ppc64/lib64
[2023-07-11 23:38:52METDST] useshrplib:
[2023-07-11 23:38:52METDST] ===== PROCURA Policy done ===============================
[2023-07-11 23:38:52METDST] ld: 0706-012 The -q flag is not recognized.
[2023-07-11 23:38:52METDST] ld: 0706-012 The -6 flag is not recognized.
[2023-07-11 23:38:52METDST] ld: 0706-012 The -4 flag is not recognized.
[2023-07-11 23:38:52METDST] make: *** [generate_uudmap] Error 255

and HP-UX:

[2023-07-12 02:09:20+0200] ccache cc -c -DPERL_CORE -D_POSIX_C_SOURCE=199506L -D_REENTRANT -Ae -Wp,-H150000 -DDEBUGGING +Z -z -D_HPUX_SOURCE -Wl,+vnocompatwarnings +DD64 -DDEBUGGING -I/pro/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 +O2 +Onolimit -g generate_uudmap.c
[2023-07-12 02:09:20+0200] /usr/bin/ld -o generate_uudmap -L/pro/local/lib +DD64 -L/usr/lib/hpux64 generate_uudmap.o -lcl -lpthread -ldl -lm -lsec -lc
[2023-07-12 02:09:20+0200]
[2023-07-12 02:09:20+0200] If you compile perl5 on a different machine or from a different object
[2023-07-12 02:09:20+0200] directory, copy the Policy.sh file from this object directory to the
[2023-07-12 02:09:20+0200] new one before you run Configure -- this will help you with most of
[2023-07-12 02:09:20+0200] the policy defaults.
[2023-07-12 02:09:20+0200] 5.39.0 <=> 5.026002
[2023-07-12 02:09:20+0200] ===== PROCURA Policy for hpux/ccache cc ========================
[2023-07-12 02:09:20+0200] ===== PROCURA Policy results ============================
[2023-07-12 02:09:20+0200] cc:         ccache cc
[2023-07-12 02:09:20+0200] ccversion:  -
[2023-07-12 02:09:20+0200] gccversion: -
[2023-07-12 02:09:20+0200] ccflags:    -DDEBUGGING +Z -z
[2023-07-12 02:09:20+0200] optimize:
[2023-07-12 02:09:20+0200] ld:
[2023-07-12 02:09:20+0200] ldflags:    -L/pro/local/lib
[2023-07-12 02:09:20+0200] libswanted: cl pthread cl pthread socket bind inet ndbm gdbm dbm db malloc dl ld sun m crypt sec util c cposix posix ucb bsd BSD
[2023-07-12 02:09:20+0200] libsdirs:    /lib /pro/local/lib
[2023-07-12 02:09:20+0200] locincpth:  /pro/local/include
[2023-07-12 02:09:20+0200] loclibpth:  /pro/local/lib
[2023-07-12 02:09:20+0200] useshrplib:
[2023-07-12 02:09:20+0200] ===== PROCURA Policy done ===============================
[2023-07-12 02:09:20+0200] ld: Unrecognized argument: +DD64
[2023-07-12 02:09:20+0200] Fatal error.
[2023-07-12 02:09:20+0200] make: *** [generate_uudmap] Error 1

This reverts commit 07e3b5cdb6f7260446b791acf0623e01a37e4739.

10 months agolocale.c: Add warning if function return ignored
Karl Williamson [Thu, 16 Mar 2023 13:18:45 +0000 (07:18 -0600)]
locale.c: Add warning if function return ignored

10 months agolocale.c: configthreadlocale() error checking
Karl Williamson [Mon, 19 Dec 2022 11:10:21 +0000 (04:10 -0700)]
locale.c: configthreadlocale() error checking

The code previously just assumed the system call always worked.  But it
may not if the CRTL is wrong; this surfaced on a mingw compile.

It's better to have it fail outright than to continue and silently give
a wrong answer.

10 months agoloc_tools: Add check for ISO-8859
Karl Williamson [Mon, 3 Jul 2023 23:14:26 +0000 (17:14 -0600)]
loc_tools: Add check for ISO-8859

Previously the dashless version was tested, leading to some missed
locales on some systems.

10 months agoloc_tools: Always check for C.UTF-8 locale
Karl Williamson [Mon, 3 Jul 2023 23:03:44 +0000 (17:03 -0600)]
loc_tools: Always check for C.UTF-8 locale

On many platforms this is a basic included locale, and there is even a
Configure probe for its existence, which we can take advantage of.

10 months agoloc_tools: Add input param check to external function
Karl Williamson [Mon, 3 Jul 2023 23:02:51 +0000 (17:02 -0600)]
loc_tools: Add input param check to external function

10 months agoloc_tools: White space only
Karl Williamson [Mon, 3 Jul 2023 22:18:13 +0000 (16:18 -0600)]
loc_tools: White space only

Indent because the previous commit formed a new block around this code.

10 months agoloc_tools.pl: Cache results
Karl Williamson [Mon, 3 Jul 2023 20:37:59 +0000 (14:37 -0600)]
loc_tools.pl: Cache results

Some of the functions in this file are slow, because it speculatively
tries various potential somewhat commonly-encountered locales to see
which ones actually work on this platform.

On many boxes, much of the potential list can be quickly gathered from a
call to a system command, but on other platforms, including Windows, the
list comes from trying all the possibilities in the <DATA> section of
the file, including permutations.

And the determination that each locale actually works takes time.

So this commit caches the list of available locales it finds, avoiding
doing all this work again if the calling test program calls it again.

10 months agolocale.c: Use wider than U32 for a counter
Karl Williamson [Fri, 7 Apr 2023 13:38:48 +0000 (07:38 -0600)]
locale.c: Use wider than U32 for a counter

Processes that change locales are incrementing a counter that could
eventully wrap if the process is long-lived.  It's not likely, but it's
also easy to make this a U64 if available, and make the chances of it
happening much closer to zero.

10 months agoget_win32_message_utf8ness() Fix unlikely case
Karl Williamson [Fri, 7 Apr 2023 15:21:17 +0000 (09:21 -0600)]
get_win32_message_utf8ness() Fix unlikely case

This function calls get_locale_string_utf8ness_i().  The API of that
function changed earlier in the 5.37 series, and this was not updated to
correspond.  It is calling it with category 0, which it thinks is an
out-of-bounds value, but it really is LC_ALL on Windows.  Thus it
actually probably doesn't lead to a failure, but it theoretically could
fail if LC_ALL is not uniform.

So it's better to not succeed just by accident.  This commit changes to
now use LC_CTYPE as the category.  And if someone has managed to compile
Windows without LC_CTYPE, it now just says that the input string isn't
UTF-8, as without LC_CTYPE, you've only got the C locale.

10 months agolocale.c: Only compile workaround on platforms needing it
Karl Williamson [Thu, 6 Apr 2023 22:39:23 +0000 (16:39 -0600)]
locale.c: Only compile workaround on platforms needing it

This code works around a bug on Windows with regard to localeconv().
And the bug only exists on such platforms that have thread-safety.
Prior to this commit, the code was compiled on platforms lacking
thread-safety, so was unnecessary.

10 months agoRelease schedule for 5.39 dev cycle
James E Keenan [Mon, 3 Jul 2023 21:13:28 +0000 (17:13 -0400)]
Release schedule for 5.39 dev cycle

Skeleton only; no assignments yet.

10 months agoXSUB.h: remove setjmp and longjmp overrides
Tomasz Konojacki [Mon, 5 Jun 2023 19:07:28 +0000 (21:07 +0200)]
XSUB.h: remove setjmp and longjmp overrides

Those redefinitions are in effect only when PERL_IMPLICIT_SYS is defined
(pretty much only on Windows) and they're broken (circular) when
HAS_SIGSETJMP isn't defined (e.g. on Windows). Also, even if they
weren't broken, they don't provide any value.

The workaround in threads.xs for this issue is still needed, because
it's a dual-life module and it's supposed to work on older Perls.
However, it can be simplified by defining NO_XSLOCKS to suppress the
redefinitions.

Fixes #21039

10 months agoperl.h: Create a locale mnemonic #define for sync across files
Karl Williamson [Sat, 31 Dec 2022 22:08:22 +0000 (15:08 -0700)]
perl.h: Create a locale mnemonic #define for sync across files

10 months agoperl.h: Add DISABLE_LC_NUMERIC_CHANGES macro
Karl Williamson [Fri, 12 May 2023 00:56:10 +0000 (18:56 -0600)]
perl.h: Add DISABLE_LC_NUMERIC_CHANGES macro

This is for code that needs to keep other code from changing LC_NUMERIC
out from under it, but avoids the knowledge of PL_numeric_standard,
which is used when perl controls the locale handling.

This is designed for 'version' (vutil.c) to use, because it has to
operate seamlessly in the mode where perl controls the handling, and
when it doesn't, even if it doesn't know it doesn't.

10 months agoA broken localeconv() doesn't depend on being threaded
Karl Williamson [Tue, 20 Jun 2023 17:34:45 +0000 (11:34 -0600)]
A broken localeconv() doesn't depend on being threaded

Earlier Windows and Mingw have a broken localeconv() libc function.
This breakage occurs on unthreaded builds too.

10 months agoregen/unicode_constants.pl: Add Arabic radix
Karl Williamson [Mon, 12 Jun 2023 18:27:30 +0000 (12:27 -0600)]
regen/unicode_constants.pl: Add Arabic radix

This will be helpful to vutil.c

10 months agoregen/unicode_constants.pl: Add generating first byte as string
Karl Williamson [Sun, 25 Jun 2023 07:30:49 +0000 (01:30 -0600)]
regen/unicode_constants.pl: Add generating first byte as string

This enhances this utility script to have the capability of getting the
first byte of a UTF-8 string expressed as a literal (single-byte) string
itself.

10 months agolocale.c: Work around a Win32 bug in localeconv()
Karl Williamson [Mon, 28 Nov 2022 17:45:56 +0000 (10:45 -0700)]
locale.c: Work around a Win32 bug in localeconv()

If the locale for an individual category is set, and then the locale for
LC_CTYPE is set afterwards, it trashes (at least partially), the first
category's setting for the purposes of localeconv().  This can happen
even if LC_CTYPE is the same locale as that of the other category.

This commit implements a workaround for that, where LC_CTYPE is set,
then the other cateorgy's locale is switched to C, then to whatever is
should be.   The problem doesn't seem to happen if the destination
locale is C.

I have a short C-language reproducer program that doesn't involve Perl,
but I haven't submitted it to Microsoft due to my cynicism about them
patying any attention to it.

10 months agoNeed threads to use cur_locale obj
Karl Williamson [Sat, 8 Apr 2023 13:52:18 +0000 (07:52 -0600)]
Need threads to use cur_locale obj

On Configurations that are very unlikely to be seen in the wild, these
bits of code were attempted to be compiled when they weren't actually
needed, leading to undefined symbols compilation errors.

The configuration basically involved requiring the POSIX 2008 locale
thread-safe API when no threads are in use.

10 months agoperlapi: Improve wording for Perl_langinfo()
Karl Williamson [Fri, 7 Apr 2023 15:54:40 +0000 (09:54 -0600)]
perlapi: Improve wording for Perl_langinfo()

10 months agoXS-APItest/t/locale.t: White space only
Karl Williamson [Tue, 30 May 2023 12:54:08 +0000 (06:54 -0600)]
XS-APItest/t/locale.t: White space only

Indent to correspond with a new block added in the previous commit

10 months agoXS-APItest/t/locale.t: Skip tests if pre-req not met
Karl Williamson [Tue, 30 May 2023 12:52:52 +0000 (06:52 -0600)]
XS-APItest/t/locale.t: Skip tests if pre-req not met

Rather than have them all failing, if the test that tries to set things
up fails, skip the ones that depend on it having succeeded

10 months agoAdd distribution-friendly make message (PR#21207)
H.Merijn Brand [Mon, 10 Jul 2023 09:02:54 +0000 (11:02 +0200)]
Add distribution-friendly make message (PR#21207)

by Elvin Aslanov (rwp0)

Straight to the point as "Public domain implementation" wasn't very helpful.

Came across this message building Perl on a freshly installed Ubuntu Linux doing:

 git clone https://github.com/Perl/perl5
 sh Configure -des -Dusedevel

10 months agoInsert missing apostrophe
James E Keenan [Mon, 10 Jul 2023 01:36:08 +0000 (21:36 -0400)]
Insert missing apostrophe

As reported by Keith Thompson in https://github.com/Perl/perl5/issues/21203

10 months agoFix compilation with NO_LOCALE
Karl Williamson [Sun, 9 Jul 2023 18:52:22 +0000 (12:52 -0600)]
Fix compilation with NO_LOCALE

Commit c164c467952dd4fb7b81b3030f8ccc445ae438a8 causes the compilation
to fail on platforms that do not have locales enabled.

The enum's start is only done when there are locales, while the enum's
ending is done regardless, leaving the start missing when no locales.

This commit fixes that.

10 months agolocale.c: Rmv unexecuted statement after croak
Karl Williamson [Wed, 5 Apr 2023 01:12:24 +0000 (19:12 -0600)]
locale.c: Rmv unexecuted statement after croak

And it is misleading to have it.

10 months agoDocument the relative order of version and attributes to the class keyword
Paul "LeoNerd" Evans [Sun, 9 Jul 2023 10:52:34 +0000 (11:52 +0100)]
Document the relative order of version and attributes to the class keyword

10 months agoFix up link to renamed PPC document
Paul "LeoNerd" Evans [Sun, 9 Jul 2023 10:30:07 +0000 (11:30 +0100)]
Fix up link to renamed PPC document

10 months agoregexec.c: Use utf8_hop_safe() instead of rolling our own
Karl Williamson [Sun, 10 Jul 2022 20:29:27 +0000 (14:29 -0600)]
regexec.c: Use utf8_hop_safe() instead of rolling our own

10 months agosv.c: Use utf8_hop instead of rolling our own
Karl Williamson [Sun, 10 Jul 2022 16:57:42 +0000 (10:57 -0600)]
sv.c: Use utf8_hop instead of rolling our own

The inlined functions should be no slower than the hand rolling, and the
code is easier to maintain, with better handling of malformed input.