Branch: refs/heads/smoke-me/khw-env Home: https://github.com/Perl/perl5 Commit: bd55a40ab19b663c98f3c4e18b57be28c71ad605 https://github.com/Perl/perl5/commit/bd55a40ab19b663c98f3c4e18b57be28c71ad605 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023)
Changed paths: M charclass_invlists.h M lib/unicore/Makefile M lib/unicore/mktables M lib/unicore/uni_keywords.pl M regcharclass.h M uni_keywords.h Log Message: ----------- mktables more verbose Commit: 9e41ef7af8c8296ce2318b55596e2587594b5d23 https://github.com/Perl/perl5/commit/9e41ef7af8c8296ce2318b55596e2587594b5d23 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M cpan/Pod-Simple/lib/Pod/Simple/BlackBox.pm Log Message: ----------- BlackBox dont use rare scripts Commit: f291806148c9a09e5981db4600a26143d80f9cd3 https://github.com/Perl/perl5/commit/f291806148c9a09e5981db4600a26143d80f9cd3 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M t/harness Log Message: ----------- XXX t/harness temp tweaks Commit: f61838c07ab6566b35fec5891f0f71d0342830f0 https://github.com/Perl/perl5/commit/f61838c07ab6566b35fec5891f0f71d0342830f0 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M t/harness Log Message: ----------- XXX skip croak.t under sanitizer Commit: 46e7ceb763e1f62d98685bdb10324e27c183399e https://github.com/Perl/perl5/commit/46e7ceb763e1f62d98685bdb10324e27c183399e Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M t/porting/bincompat.t Log Message: ----------- skip bincompat.t Commit: 1a863980067368197e1e4f32c8e2e74e8a77af74 https://github.com/Perl/perl5/commit/1a863980067368197e1e4f32c8e2e74e8a77af74 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M t/TEST Log Message: ----------- XXX skip cpan testing Commit: bb0bb26d30e4a64281445d822445968e792c7e50 https://github.com/Perl/perl5/commit/bb0bb26d30e4a64281445d822445968e792c7e50 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M MANIFEST M charclass_invlists.h M dist/Tie-File/t/29a_upcopy.t M lib/unicore/mktables M lib/unicore/uni_keywords.pl M regcharclass.h A t/re/uniprops11.t A t/re/uniprops12.t A t/re/uniprops13.t A t/re/uniprops14.t A t/re/uniprops15.t A t/re/uniprops16.t A t/re/uniprops17.t A t/re/uniprops18.t A t/re/uniprops19.t A t/re/uniprops20.t A t/re/uniprops21.t A t/re/uniprops22.t A t/re/uniprops23.t A t/re/uniprops24.t M uni_keywords.h Log Message: ----------- XXX temp: dist/Tie-File/t/29a_upcopy.t: Up alarm Commit: 545e20b5195e459616164f1529d8dc8def9f24df https://github.com/Perl/perl5/commit/545e20b5195e459616164f1529d8dc8def9f24df Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M MANIFEST A t/uni/idstart.pl A t/uni/idstart00.t A t/uni/idstart01.t A t/uni/idstart02.t A t/uni/idstart03.t A t/uni/idstart04.t A t/uni/idstart05.t A t/uni/idstart06.t A t/uni/idstart07.t A t/uni/idstart08.t A t/uni/idstart09.t A t/uni/idstart10.t A t/uni/idstart11.t A t/uni/idstart12.t A t/uni/idstart13.t A t/uni/idstart14.t A t/uni/idstart15.t A t/uni/idstart16.t A t/uni/idstart17.t A t/uni/idstart18.t A t/uni/idstart19.t A t/uni/idstart20.t A t/uni/idstart21.t A t/uni/idstart22.t A t/uni/idstart23.t M t/uni/variables.t Log Message: ----------- Split t/uni/variables.t into multiple tests These can be done in parallel; otherwise this is often the test that finishes last, holding up the test suite completion. Commit: 0c09b3994e7e2f7f1d8fa4d793057b6cd79acc02 https://github.com/Perl/perl5/commit/0c09b3994e7e2f7f1d8fa4d793057b6cd79acc02 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M t/test.pl Log Message: ----------- XXX test.pl: dont unlink temps Commit: 25b6e4f23c5d75243e7ccfd9e80a3cf1956f5d3f https://github.com/Perl/perl5/commit/25b6e4f23c5d75243e7ccfd9e80a3cf1956f5d3f Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M t/test.pl Log Message: ----------- Revert "XXX test.pl: dont unlink temps" This reverts commit 1579ce0dbce549cb594214ba27d4e2fa389f891b. Commit: 4acd191e64d8b5eca67ae30c74756866b3e654fe https://github.com/Perl/perl5/commit/4acd191e64d8b5eca67ae30c74756866b3e654fe Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M t/run/locale.t Log Message: ----------- run/locale.t: more debug Commit: 5ef49866f20eab64a1cc9c16340f0b910da9fa61 https://github.com/Perl/perl5/commit/5ef49866f20eab64a1cc9c16340f0b910da9fa61 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M t/run/locale.t Log Message: ----------- XXX run/locale.t: maybe f move test Commit: 4149884393176b38896cb7a335d5ae38a0109d95 https://github.com/Perl/perl5/commit/4149884393176b38896cb7a335d5ae38a0109d95 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M cpan/version/t/07locale.t M t/porting/customized.dat Log Message: ----------- version::07locale.t: Use I18N::Langinfo, not POSIX::localeconv() The former is always present; the latter might not be. Commit: 6a1fcea3d91fd51bc4adeba430dc457966e7ac21 https://github.com/Perl/perl5/commit/6a1fcea3d91fd51bc4adeba430dc457966e7ac21 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M t/porting/cmp_version.t Log Message: ----------- XXX skip cmp_version.t prob. due to 5.38 tag issue Commit: 1bf41048fd628359c13ea152f4889dedd0b95b09 https://github.com/Perl/perl5/commit/1bf41048fd628359c13ea152f4889dedd0b95b09 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M cpan/version/t/07locale.t M t/porting/customized.dat Log Message: ----------- version 07locale.t should use LC_NUMERIC, not ALL These outliers don't belong. This file is working on LC_NUMERIC only. Commit: 61e53ba5bf70d1da392b6857a4b14f98c6512710 https://github.com/Perl/perl5/commit/61e53ba5bf70d1da392b6857a4b14f98c6512710 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M cpan/Archive-Tar/t/02_methods.t Log Message: ----------- XXX skip Archive-Tar because of symlinks Commit: 046b590919746c4b4839f4dd5579a9e611f324c7 https://github.com/Perl/perl5/commit/046b590919746c4b4839f4dd5579a9e611f324c7 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M t/porting/cmp_version.t Log Message: ----------- XXX skip cmp_version.t because of sym links Commit: e1f3fc84e2e1371774a3ff9361b530c18575bcd7 https://github.com/Perl/perl5/commit/e1f3fc84e2e1371774a3ff9361b530c18575bcd7 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M perl.h Log Message: ----------- XXX temp to test broken lconv on non-Windows Commit: 71aa33a52b5476eb538c96f4d3dcdd4d5050ca17 https://github.com/Perl/perl5/commit/71aa33a52b5476eb538c96f4d3dcdd4d5050ca17 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M cpan/Sys-Syslog/t/syslog-inet-udp.t M cpan/Sys-Syslog/t/syslog.t Log Message: ----------- XXX skip syslog tests because fail without LC_TIME Commit: 734064e665d2dfd947e6326cafb056821853376c https://github.com/Perl/perl5/commit/734064e665d2dfd947e6326cafb056821853376c Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M makedef.pl M perl.h Log Message: ----------- XXX temporary: Allow undef LC_ALL Commit: a9cc48ba2cb9a2657ba150c355ebcf4b53cfe1aa https://github.com/Perl/perl5/commit/a9cc48ba2cb9a2657ba150c355ebcf4b53cfe1aa Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M perl.h Log Message: ----------- perl.h: Fake up win32 compile a bit Commit: 7c57ace7b3535e108a7d184bbe554ca65e29e6ca https://github.com/Perl/perl5/commit/7c57ace7b3535e108a7d184bbe554ca65e29e6ca Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M locale.c Log Message: ----------- ruler Commit: 168912d0929fa8b89fb5a8a3bfe0fea0ba316ac3 https://github.com/Perl/perl5/commit/168912d0929fa8b89fb5a8a3bfe0fea0ba316ac3 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M sv.c Log Message: ----------- newSVbool(): Fix compiler warning The parameter was declared const in embed.fnc, but not in the function prototype Commit: ce3767f0c6cb55cf4301fa0cb90ebcc3cc366328 https://github.com/Perl/perl5/commit/ce3767f0c6cb55cf4301fa0cb90ebcc3cc366328 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M embed.fnc M proto.h Log Message: ----------- regnode_after(): Fix compiler warning A parameter to this function was declared const in its prototype but not in embed.fnc. Commit: dee52f2f14d7d178969f87f53c33c8ec938600a7 https://github.com/Perl/perl5/commit/dee52f2f14d7d178969f87f53c33c8ec938600a7 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M embed.fnc M proto.h M utf8.c Log Message: ----------- uvoffuni_to_utf8_flags_msgs(): Fix compiler warning A parameter to this function was declared const in embed.fnc, but isn't const. This commit also adds a const to another parameter that is constant. Commit: a2bf7cc3f89284525aad54c24a9ad89df38f6234 https://github.com/Perl/perl5/commit/a2bf7cc3f89284525aad54c24a9ad89df38f6234 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M embed.fnc M proto.h Log Message: ----------- S_clear_placeholders(): Fix compiler warning A parameter to this function was declared const in its prototype but not in embed.fnc, and had a different name Commit: 240cb131e89fd5bfdee143aa52f6b1a521ad8b6b https://github.com/Perl/perl5/commit/240cb131e89fd5bfdee143aa52f6b1a521ad8b6b Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M embed.fnc M proto.h M util.c Log Message: ----------- XXX memlog Commit: b1ca88fdafe0225fb333c89858184aac9422e3b2 https://github.com/Perl/perl5/commit/b1ca88fdafe0225fb333c89858184aac9422e3b2 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M perl.h M t/run/switchDx.t Log Message: ----------- debug thread Commit: 60939fc1e327b617c915300adaeee4428fe163fe https://github.com/Perl/perl5/commit/60939fc1e327b617c915300adaeee4428fe163fe Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M dist/threads/threads.xs Log Message: ----------- threads.xs DEBUG_U Commit: b0b65eabe8bd96f4b5cf90cb46ff20de3718d713 https://github.com/Perl/perl5/commit/b0b65eabe8bd96f4b5cf90cb46ff20de3718d713 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M lib/locale.t Log Message: ----------- XXX temp: lib/locale.t: debug Commit: 750a63e709fa43829c426433819bdb809f709b04 https://github.com/Perl/perl5/commit/750a63e709fa43829c426433819bdb809f709b04 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M lib/locale.t Log Message: ----------- lib/locale.t FILE debug Commit: f590e260f9608e0b1e9bba8d6c8d21dcb235c647 https://github.com/Perl/perl5/commit/f590e260f9608e0b1e9bba8d6c8d21dcb235c647 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M lib/locale.t Log Message: ----------- lib/locale.t Commit: 0d7835f29e66a938515d80e645f6cc09d664ef41 https://github.com/Perl/perl5/commit/0d7835f29e66a938515d80e645f6cc09d664ef41 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M perl.h Log Message: ----------- XXX perl.h: Debugging mutex lock' Commit: a5dcc4a91a4681aa1f9c6107e5fdb73d930fab25 https://github.com/Perl/perl5/commit/a5dcc4a91a4681aa1f9c6107e5fdb73d930fab25 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M cpan/version/t/07locale.t M t/porting/customized.dat Log Message: ----------- 07locale.t: Add some Windows locales to try On various windows machines, none of the locales listed in <DATA> exist. This commit copies ones from core's loc_tools.pl to give additional possibilities to try Commit: 4ff35450da6fb608fa327d3b465b3f70ae8cff56 https://github.com/Perl/perl5/commit/4ff35450da6fb608fa327d3b465b3f70ae8cff56 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M cpan/version/t/07locale.t Log Message: ----------- drop, bug have to recompute md5 Commit: ee0863cf16f12d21c50537c9872d8f2dbc416fee https://github.com/Perl/perl5/commit/ee0863cf16f12d21c50537c9872d8f2dbc416fee Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M t/porting/customized.dat Log Message: ----------- customized.dat Commit: 4e49d3717df8afd6f88be093b77f5cb4a5239029 https://github.com/Perl/perl5/commit/4e49d3717df8afd6f88be093b77f5cb4a5239029 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M locale.c Log Message: ----------- S_find_locale_from_environment: Handle disparate LC_ALL Prior to this commit, it was possible on some platforms to improperly set a locale category from a locale of "". Consider: export LC_ALL="LC_CTYPE=de_DE;LC_NUMERIC=C;LC_TIME=de_DE;..." and then run print POSIX::setlocale(LC_NUMERIC, ""); It wouldn't know how to extract just the LC_NUMERIC part of the LC_ALL string. There is no test added because I didn't find a shell that allows setting LC_ALL to such a disparate value. Commit: 6e0e8635012da897842d653302ae013d345637d2 https://github.com/Perl/perl5/commit/6e0e8635012da897842d653302ae013d345637d2 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M t/loc_tools.pl Log Message: ----------- loc_tools: XXX Debug Commit: 6a3b34a634acdbb10c121a6e146219a3f947a9f6 https://github.com/Perl/perl5/commit/6a3b34a634acdbb10c121a6e146219a3f947a9f6 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M locale.c Log Message: ----------- S_querylocale_2008_i: Add entry assertion Commit: 29509fa064c9bede87e29787a408960096eb62dc https://github.com/Perl/perl5/commit/29509fa064c9bede87e29787a408960096eb62dc Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M locale.c Log Message: ----------- S_bool_setlocale_i: Add entry assertion Commit: ecad75915ab72c2de22925c460dc3ac0afa3176f https://github.com/Perl/perl5/commit/ecad75915ab72c2de22925c460dc3ac0afa3176f Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M locale.c Log Message: ----------- savepv if threaded, unused I think Commit: 24bb74c7e6cbfacc822fdb30ec0bd44d6c6f1b6e https://github.com/Perl/perl5/commit/24bb74c7e6cbfacc822fdb30ec0bd44d6c6f1b6e Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Add a debugging statement This can be helpful in tracing what's happening with nl_langinfo() calls. Commit: 3c7add7d8152008b2330f72e0aebc43e9d9e250c https://github.com/Perl/perl5/commit/3c7add7d8152008b2330f72e0aebc43e9d9e250c Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M locale.c Log Message: ----------- XXX experimental: Define setlocale_i() on unsafe threaded builds On threaded Configurations where thread-safe locale handling is not available, perl automatically does a modicum of prevention of races by executing locale changes in a critical section, and copying the results to a thread-safe location. This commit defines setlocale_i() on such builds. This macro is used to bypass more complex handling required in fully thread-safe builds. I don't see how this changes thread-safeness on the unsafe builds, and it passes the tests, but I'm considering it experimental for now, until later in the development cycle. Commit: e3f5d5e39c187ecd3e89eef6fe9d0175caf9a243 https://github.com/Perl/perl5/commit/e3f5d5e39c187ecd3e89eef6fe9d0175caf9a243 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M hints/darwin.sh Log Message: ----------- darwin hints querylocale race in earlier darwins? Commit: 828b5f091abd6981e06f7a499ea786ee78aabb2f https://github.com/Perl/perl5/commit/828b5f091abd6981e06f7a499ea786ee78aabb2f Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M pp.c Log Message: ----------- pp.c Commit: ebeb7ee9804f6539182b855dd76180b5bc4f6650 https://github.com/Perl/perl5/commit/ebeb7ee9804f6539182b855dd76180b5bc4f6650 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M hints/darwin.sh Log Message: ----------- darwin Commit: d8a569d40d5a1164d350187da1c18fa4b4b279d9 https://github.com/Perl/perl5/commit/d8a569d40d5a1164d350187da1c18fa4b4b279d9 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M hints/freebsd.sh Log Message: ----------- Enable thread-safe locales on some freebsd versions This had been disabled in the hints file due to bugs, which perl now works around, so reenable (and reformat some lines for clarity) Commit: b7366c0dae4883895d285dc87cf191fdb2c9fdb5 https://github.com/Perl/perl5/commit/b7366c0dae4883895d285dc87cf191fdb2c9fdb5 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M t/run/locale.t Log Message: ----------- t/run/locale.t: debug Commit: 6b6ae7c6ff5829140c25c0f3f592d3e203bf1030 https://github.com/Perl/perl5/commit/6b6ae7c6ff5829140c25c0f3f592d3e203bf1030 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M lib/locale_threads.t Log Message: ----------- locale_threads: add a commented out yield Commit: c5c86bdd259dbf12a54dcc9bbcc09b598b7aef5c https://github.com/Perl/perl5/commit/c5c86bdd259dbf12a54dcc9bbcc09b598b7aef5c Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M lib/locale_threads.t Log Message: ----------- locale_threads: debugging Commit: 4d7f8c3c8112e79d6d72ea19f7a3f718b84ecad8 https://github.com/Perl/perl5/commit/4d7f8c3c8112e79d6d72ea19f7a3f718b84ecad8 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M t/porting/customized.dat Log Message: ----------- customized.dat for before Time Piece Commit: 4e1f9160ac0a9375eafab28acd9b71fa0a405bee https://github.com/Perl/perl5/commit/4e1f9160ac0a9375eafab28acd9b71fa0a405bee Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M embed.fnc M embed.h M locale.c M proto.h Log Message: ----------- add is_cur_locale_utf8 Commit: 6bb29ba58779a4e134cffe0fc6dffbb7e95b2a04 https://github.com/Perl/perl5/commit/6bb29ba58779a4e134cffe0fc6dffbb7e95b2a04 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M cpan/Time-Piece/Piece.xs Log Message: ----------- Time::Piece: Use reentrant API This single line magically makes this work much better under threading, though critical section locks need to be added as well. Commit: 8875859d28fcaf037c019afae716a9250c3fb8b8 https://github.com/Perl/perl5/commit/8875859d28fcaf037c019afae716a9250c3fb8b8 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M cpan/Time-Piece/Piece.xs Log Message: ----------- Time-Piece: Use foldEQ_locale() if available This core function available since 5.13.2 is thread-safe and knows about Perl internals, so is preferable to the similar libc function, which is now used only as a fallback. This commit also bomb proofs the code by adding an additional fallback, specified in C89, which isn't a great substitute, but far better than nothing. Commit: 146a24c97b7372e890660838865996cac28ad84f https://github.com/Perl/perl5/commit/146a24c97b7372e890660838865996cac28ad84f Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M cpan/Time-Piece/Piece.xs Log Message: ----------- Time-Piece: Use isSPACE_LC, not isspace; etc isDIGIT_LC() does the same thing as isdigit when everything goes well, but is more robust when things get more complicated. The _LC forms are thread safe, for example. But note that this code doesn't work properly for a UTF-8 locale, as it assumes that a byte and character are the same thing. A major overhaul would be needed to handle that. Commit: 1cc7df0f9bcb72111d7cda8f9055e2054ba75503 https://github.com/Perl/perl5/commit/1cc7df0f9bcb72111d7cda8f9055e2054ba75503 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M thread.h Log Message: ----------- thread.h: White space only Indent some nested preproccessor defines Commit: a578d340219fa94565630982478865f4178ccc98 https://github.com/Perl/perl5/commit/a578d340219fa94565630982478865f4178ccc98 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M cpan/Time-Piece/Piece.pm M cpan/Time-Piece/Piece.xs M cpan/Time-Piece/Seconds.pm M dist/Module-CoreList/lib/Module/CoreList.pm Log Message: ----------- Time::Piece: Add critical sections This calls various macros to make certain libc calls uninterruptible, so that they can be used safely in threaded applications, when this module is loaded with a perl that supports this. The macros are defined to do nothing if the perl doesn't contain working versions of them. In such perls, the macros are also defined to do nothing except on configurations that could have races. Typically, an extra problem is that the libc calls return in a global static buffer, subject to being overwritten by another thread. But an earlier commit defined PERL_REENTRANT, which makes those functions transparently return in a thread-local buffer instead. That doesn't help if the function gets interrupted by another thread; this commit completes the process. Commit: 011e1f6be8ff092b939f0cc8001899379678b052 https://github.com/Perl/perl5/commit/011e1f6be8ff092b939f0cc8001899379678b052 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M cpan/Time-Piece/Piece.xs Log Message: ----------- XXX Time::Piece strftime Commit: 2a5ecdb906373fd351140cf14ffd96337d8e2f2b https://github.com/Perl/perl5/commit/2a5ecdb906373fd351140cf14ffd96337d8e2f2b Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M cpan/Time-Piece/Piece.xs Log Message: ----------- Time-Piece: notes to myself Commit: 4fb7969006be9120cf2ea1140954c00942081b34 https://github.com/Perl/perl5/commit/4fb7969006be9120cf2ea1140954c00942081b34 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Slightly change wording of DEBUG messages This makes them more consistent with the other messages in this file. Commit: 85e01981bc55763f276ccb9fcb6ef54ba968d337 https://github.com/Perl/perl5/commit/85e01981bc55763f276ccb9fcb6ef54ba968d337 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M util.c M win32/perlhost.h Log Message: ----------- XXX Win32 mem log Commit: 767e2c8307bf431f6ffc93be4dd1251d4fb287f8 https://github.com/Perl/perl5/commit/767e2c8307bf431f6ffc93be4dd1251d4fb287f8 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M util.c Log Message: ----------- XXX util add thread to mem_log Commit: 985e604c146859b1cad1937b38f5155e94d21579 https://github.com/Perl/perl5/commit/985e604c146859b1cad1937b38f5155e94d21579 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M locale.c Log Message: ----------- Debug wrap wset Commit: b77d5ed8f765c7855a78748815fd31343a4a80e4 https://github.com/Perl/perl5/commit/b77d5ed8f765c7855a78748815fd31343a4a80e4 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Change some -DLv statements to -DL These debug statements show something isn't quite normal, so shouldn't require a verbose option to be displayed Commit: 0f080abe22fb17760534822e77522d3b57fb30dc https://github.com/Perl/perl5/commit/0f080abe22fb17760534822e77522d3b57fb30dc Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M pod/perlhacktips.pod Log Message: ----------- XXX incomplete perlhacktips: Commit: d1b716b80f76f13e61719e2b09deb85d7564beea https://github.com/Perl/perl5/commit/d1b716b80f76f13e61719e2b09deb85d7564beea Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M iperlsys.h Log Message: ----------- iperlsys.h: TODO need to look at adding mutexes Commit: 78205119e30020c386b9f2e3568c4931edfe637c https://github.com/Perl/perl5/commit/78205119e30020c386b9f2e3568c4931edfe637c Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M regen/reentr.pl Log Message: ----------- reentr.pl: XXX about needing mutex Commit: dbe9eeb6f3ce747a9ed80acd3db3d1049eb5cfb5 https://github.com/Perl/perl5/commit/dbe9eeb6f3ce747a9ed80acd3db3d1049eb5cfb5 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M dist/ExtUtils-ParseXS/lib/perlxs.pod M t/porting/known_pod_issues.dat Log Message: ----------- perlxs Commit: 254e453c8a9a7ba6c75cb6ed1078e5b13e783cdb https://github.com/Perl/perl5/commit/254e453c8a9a7ba6c75cb6ed1078e5b13e783cdb Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M pod/perlmod.pod Log Message: ----------- perlmod Commit: 3e4d88819feeae5e1c0715992f4592083d62de4a https://github.com/Perl/perl5/commit/3e4d88819feeae5e1c0715992f4592083d62de4a Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M pod/perllocale.pod Log Message: ----------- perllocale Xxx start of changes Commit: b45b72957b77e0ecf507f12e5c88a1d4ca137aa9 https://github.com/Perl/perl5/commit/b45b72957b77e0ecf507f12e5c88a1d4ca137aa9 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M win32/config_H.gc M win32/config_h.PL M win32/config_sh.PL Log Message: ----------- XXX config Commit: 1e82e65120ca9f08cd40fc3228fabd68851bb0ad https://github.com/Perl/perl5/commit/1e82e65120ca9f08cd40fc3228fabd68851bb0ad Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M t/run/locale.t Log Message: ----------- XXX t/run/locale.t Commit: 75b397275d8a0bd5c2bd16377fd7f990706ca645 https://github.com/Perl/perl5/commit/75b397275d8a0bd5c2bd16377fd7f990706ca645 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M pod/perlembed.pod Log Message: ----------- f perlembed Commit: b1e1ac1360dacb306cb1bf80de34a7c862e35271 https://github.com/Perl/perl5/commit/b1e1ac1360dacb306cb1bf80de34a7c862e35271 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Win32: We don't know the locale here And, so we don't know whether it is a UTF-8 locale or not. So use the proper enum value to indicate that. Commit: a514a755a17daee411df995f1db503a7916d6ed2 https://github.com/Perl/perl5/commit/a514a755a17daee411df995f1db503a7916d6ed2 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M locale.c Log Message: ----------- XXX more work mingw Commit: 5c48011df77f313b99f494ca5461ede9ec9c8c74 https://github.com/Perl/perl5/commit/5c48011df77f313b99f494ca5461ede9ec9c8c74 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M pp.c Log Message: ----------- pp Commit: a0dffc70846197762b24f68fc62c8df61a411b97 https://github.com/Perl/perl5/commit/a0dffc70846197762b24f68fc62c8df61a411b97 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M pp.c Log Message: ----------- Revert "pp" This reverts commit 1133b83f4bd637f8641d66b48abd2bf7b5525ee3. Commit: d9bef675e7ad54437613064f9e45cb8d5cfa7254 https://github.com/Perl/perl5/commit/d9bef675e7ad54437613064f9e45cb8d5cfa7254 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M pp.c Log Message: ----------- Revert "pp.c" This reverts commit 6b8211cf799406b7044deceefb3b3f1a31515bda. Commit: e72441bfc29edc43ac19ce23075f26f2e5da21ac https://github.com/Perl/perl5/commit/e72441bfc29edc43ac19ce23075f26f2e5da21ac Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M lib/locale_threads.t Log Message: ----------- locale_threads: start of using platform locales Commit: b5421a991f92c64679b4dc072dd0b1027867f8fe https://github.com/Perl/perl5/commit/b5421a991f92c64679b4dc072dd0b1027867f8fe Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M lib/locale_threads.t Log Message: ----------- Revert "locale_threads: start of using platform locales" This reverts commit a7a8dea3aabb81a05aacaf3a26c49854a5854111. Commit: ac3fc3c9d4b2e7091b173b5bcbc65f18cf73080a https://github.com/Perl/perl5/commit/ac3fc3c9d4b2e7091b173b5bcbc65f18cf73080a Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M locale.c M perl.c M sv.c Log Message: ----------- define numeric values to be C when no USE_NUMERIC Commit: f41f4a537c4f83fff0f0b29962ea93532bbb3b70 https://github.com/Perl/perl5/commit/f41f4a537c4f83fff0f0b29962ea93532bbb3b70 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M locale.c M perl.c M sv.c Log Message: ----------- Revert "define numeric values to be C when no USE_NUMERIC" This reverts commit 9bb7ff6531bf9e28d635a71e6d55c752a995da2d. Commit: 891aa3272c27f89c2091a1ddf87d60ad077627cf https://github.com/Perl/perl5/commit/891aa3272c27f89c2091a1ddf87d60ad077627cf Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Use shorter macro form The _i suffix macros are for when we don't know the category at compile time, and we have to have calculated an index. In all these cases, the index has been calculated, but the value is known at compile time. The _c suffix macros are designed for this, and using them reduces visual clutter. Commit: e12e638c5716abca25698e95f6e1065940436182 https://github.com/Perl/perl5/commit/e12e638c5716abca25698e95f6e1065940436182 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Silence some compiler warnings These only occur when pretending that this is a MingW compilation, which is a development-only tool to catch errors before they show up on a real MingW box. This would never get compiled for real. Commit: 821a30cbbf0adf8240c62ac24fb1d731b6ff4543 https://github.com/Perl/perl5/commit/821a30cbbf0adf8240c62ac24fb1d731b6ff4543 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Add braces, indent code Prior to this commit, the 'switch' immediately followed the 'if' without a left brace for the 'if'. This conserved indentation and was feasible because the scopes were identical.. But a future commit will want to have the scope of the 'if' be larger than that of the 'switch', so add the braces for the 'if' and indent the 'switch' code. This commit also fixes white space on another line Commit: 9ddfea21c0f8c40871fc61f292a8762ec33ad892 https://github.com/Perl/perl5/commit/9ddfea21c0f8c40871fc61f292a8762ec33ad892 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Simplify loop A slight restructuring saves some lines. Commit: 459d1f4c4f11673522ff8c05a4a9817b42482fa1 https://github.com/Perl/perl5/commit/459d1f4c4f11673522ff8c05a4a9817b42482fa1 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Change two #define names They will soon have a more general meaning than currently. Commit: 0d980ad66d15dbe1857dc50eff50896ccd370989 https://github.com/Perl/perl5/commit/0d980ad66d15dbe1857dc50eff50896ccd370989 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Change parameter specification S_populate_hash_from_localeconv() takes a mask of one or two bits that specify which of LC_NUMERIC and/or LC_MONETARY to operate on. Prior to this commit, the appropriate bit was based on our internal index for the relevant category(ies). But we already have #defines of 0 for NUMERIC, and 1 for MONETARY. These are adjacent and start at 0, desirable properties that the internal index doesn't necessarily have. This commit changes to base the parameter on these 0,1 values. This will allow simplification in the next commit, and going forward. Commit: 2a8d43d9fbdf5fdb97741143ce1bbf4141281b2b https://github.com/Perl/perl5/commit/2a8d43d9fbdf5fdb97741143ce1bbf4141281b2b Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Simplify some localeconv() code The previous commits have allowed this code to determine by looking at the position of a bit in a mask what is going on, and so the code that used to be there to cope with not having that can be removed. Commit: cf1380aa7db906132b6773969310dafac085f67f https://github.com/Perl/perl5/commit/cf1380aa7db906132b6773969310dafac085f67f Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M embed.fnc M locale.c M proto.h Log Message: ----------- locale.c: Don't need an explicit U32 Previous commits have caused only the lowest two bits in this variable to be used; don't need anything as explicit as a U32. Commit: 598c35d42a18f66f19dfe2f3749672bb7e3a5d1b https://github.com/Perl/perl5/commit/598c35d42a18f66f19dfe2f3749672bb7e3a5d1b Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Move code to earlier in function This is in preparation for the object created here to be needed earlier. This commit also cleans up a comment related to the moved code Commit: 8189848434ad6dfa09fd934a0fdedcaf403e1392 https://github.com/Perl/perl5/commit/8189848434ad6dfa09fd934a0fdedcaf403e1392 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Reorder some statements in a switch() This unifies the common text in two case: statements, and makes all of them do their business in the same order. This makes it easier to compare and contrast the actions of the various case:s Commit: a3791ecd1df09a0dccdf28178b72b5330508a1e7 https://github.com/Perl/perl5/commit/a3791ecd1df09a0dccdf28178b72b5330508a1e7 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Remove unused #define Commit: 3a3cdf419ed71594a90bb46dda7c040d5d05e956 https://github.com/Perl/perl5/commit/3a3cdf419ed71594a90bb46dda7c040d5d05e956 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Add some #defines And collapse an existing one into one of the new ones, so as to use a parallel naming convention These will be used in future commits Commit: 949a41974fe89c8371e1505680b74985032f5aaa https://github.com/Perl/perl5/commit/949a41974fe89c8371e1505680b74985032f5aaa Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Special case some C locale values On Windows and MingW, some of this code can be frequently called, and often with the C locale in effect. Normally localeconv() is called to fill in these values, but that is expensive in part because of a bunch of setlocale() calls, some of which are extra, needed because of bugs in the Windows libc. We can short circuit that for the common C locale case, as the values are specified by the C standard, so are known at compile time. Commit: 941005d44b607f06341648cd42220450e3060203 https://github.com/Perl/perl5/commit/941005d44b607f06341648cd42220450e3060203 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M embed.fnc M locale.c M proto.h Log Message: ----------- locale.c: Use parallel array to simplify This allows the numeric fields returned by localeconv() to have the same logic as the string fields, simplifying the code a bit. They weren't previously handled the same because one category doesn't have any numeric fields. But this is now handled by creating an array and making its corresponding element NULL, so the strings and numeric fields are handled in the same way. Commit: e1293b220c6539adb6a3daf11dabaa642eace16f https://github.com/Perl/perl5/commit/e1293b220c6539adb6a3daf11dabaa642eace16f Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M embed.fnc M embed.h M locale.c M proto.h Log Message: ----------- Special case localeconv when NUMERIC, MONETARY must be C When both these categories are C, we don't need to call localeconv(), which can be expensive because it may mean toggling locales. Instead the answers are well defined by the C Standard. This adds a function that returns those, and #ifdef's to locale.c to compile to use the special function instead of the more general one if both categories must be C. A future commit will extend the use of this new function to more cases. Commit: 0f88d4fb72dda88dccebf3974a0f1bcac02c94e1 https://github.com/Perl/perl5/commit/0f88d4fb72dda88dccebf3974a0f1bcac02c94e1 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Move some code When called with just a single item, we only need a single call to the populating function, so move this code ahead of the 2nd call. This also clarifies the comments. Commit: 6c501b430807e2b14a7791b75b01e674adb70668 https://github.com/Perl/perl5/commit/6c501b430807e2b14a7791b75b01e674adb70668 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M locale.c Log Message: ----------- locale.c Special case localeconv for C locale An earlier commit created a function that speedily works when both LC_NUMERIC and LC_MONETARY are confined to the C locale, such as in OpenBSD. This commit extends that to use this function whenever a category happens to be in the C locale. This is a common case, that is thus sped up. Over the course of the development of locale.c, the meaning of not having the various categories changed from not being on the machine, or not paying attention to them, to instead mean, even if they are on the machine, they are always kept in the C locale. This code was not updated to reflect that; and this commit also does that updating. Commit: a239776a7d9a07dd596b3a14a9ab59cb8d8a6720 https://github.com/Perl/perl5/commit/a239776a7d9a07dd596b3a14a9ab59cb8d8a6720 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Use out-of-bounds value for illegality This was using 0 as a parameter, which is a legal value and could have been confused by the called subroutine as being legitimate. It is not a bug because of the way the subroutine is currently written given the other parameters in this call. But it is more robust to use an out-of-bounds value, so that if the function were to change, we would sooner find out about any improper call. Commit: d1c3a5efa2417b8f99bbf1cc25503d051d3c08df https://github.com/Perl/perl5/commit/d1c3a5efa2417b8f99bbf1cc25503d051d3c08df Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Skip locale utf8ness calculation if feasible I originally wrote this to save time processing the strings returned by localeconv(). If we know that the locale isn't UTF-8, then we don't have to calculate this for each string returned, Thus "Calculate once, not many times". But I hadn't realized that likely only one string is ever going to be non-ASCII: the currency symbol. (The decimal and thousands separators could also be, but of the >500 locales on my Linux box, only ps_AF has them so. That is the Pashtun language in Afghanistan; not a frequently occurring locale.) So it comes down to either case is effectively "calculate once". And it is generally more expensive to calculate the UTF8ness of a locale than a particular string in it, especially when those strings are going to be ASCII, as in this case. This commit changes to not calculate the locale's UTF8ness. Commit: 93fd61df03f1f63ba90af246fb86c198661903ea https://github.com/Perl/perl5/commit/93fd61df03f1f63ba90af246fb86c198661903ea Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Avoid unnecessary work around localeconv() There are now two different functions that return the values for localeconv(). One is for when the locale is "C"; the other for everything else. The C one returns values that don't need adjusting, so skip that for this case. This commit removes the SvPOK check which was recently added by fe048cfaa3b42320785bd0c34896ac834634db22. It was needed for before we got values when -DNO_LOCALE_MONETARY is specified. Now that we do get those values, the SV always will contain a PV at this point. Commit: ecc5134e560a6dbc1608fdad96b5ce6e14de05ef https://github.com/Perl/perl5/commit/ecc5134e560a6dbc1608fdad96b5ce6e14de05ef Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M locale.c Log Message: ----------- f rmv numeric lock from localeconv Commit: fad376cdd057322f8611bfcc6003ad732acfea60 https://github.com/Perl/perl5/commit/fad376cdd057322f8611bfcc6003ad732acfea60 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M locale.c Log Message: ----------- localeconv: Need to toggle current locale to desired one localeconv() returns the values from the current locale. Prior to this commit we weren't always setting the current locale to the desired one which is passed into this function. It was a rare Configuration where the two didn't match, so this bug wasn't caught until now. Commit: ae0167e995e567fd481e142852371194905f9666 https://github.com/Perl/perl5/commit/ae0167e995e567fd481e142852371194905f9666 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Combine some preprocessor directives This function is full of #if conditionals, due to the high variance in what the capabilities of platforms are. I tried various methods to lessen the cognitive load, like turning it into separate functions that each suit a particular Configuration, but it was just as complicated as before. The code is doing set up, then the actual operation, then teardown. The actual operation is invariant. What this commit does is for some of the setup conditionals to define its own teardown macro. The result is the teardown looks much cleaner, and there is no possibility that it will get out-of-sync with the setup. Commit: 9eacdc75b56b9674a2791e2f1256113888d0b03f https://github.com/Perl/perl5/commit/9eacdc75b56b9674a2791e2f1256113888d0b03f Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M locale.c Log Message: ----------- Avoid unnecessary mutex lock on Windows It turns out that Windows since VS 2015 has a completely thread-safe localeconv() function, with its result stored in a per-thread buffer. MingW when built with the Universal C Run Time (UCRT) also has this property. These are the only implementations of localeconv() I know of like this. There is thus no need to have a critical section on these platforms. This commit abstracts this, so that other platforms can be added if found to be thread-safe. Commit: 8801da88fe38d0bab9e3e096f1b9c56e7d12f724 https://github.com/Perl/perl5/commit/8801da88fe38d0bab9e3e096f1b9c56e7d12f724 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M locale.c Log Message: ----------- XXX fleash outlocale.c: Revamp localeconv() Win32 handling This reorders the Windows setup to before the individual category setups. Commit: 20874e94c0e648df2c72f08f31b35ad1b00eca92 https://github.com/Perl/perl5/commit/20874e94c0e648df2c72f08f31b35ad1b00eca92 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M locale.c Log Message: ----------- Remove unimplemented macros This section of code won't compile should it be tried. But this is a very rare Configuration that none of our smokers have encountered so far. These macros are defined in a later commit. Commit: 19d20b36446d4dd908a7d9a54da5e58eb9f0f9b2 https://github.com/Perl/perl5/commit/19d20b36446d4dd908a7d9a54da5e58eb9f0f9b2 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M locale.c Log Message: ----------- funusedarg Commit: 86bd6ba8d6a06e931e882a4af4073bf75daa2a32 https://github.com/Perl/perl5/commit/86bd6ba8d6a06e931e882a4af4073bf75daa2a32 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M embed.fnc M embed.h M locale.c M proto.h Log Message: ----------- Return C values if localeconv() not available localeconv() is a C89 function. But the existing code handled the case if it isn't available by returning an empty hash if POSIX::localeconv() is called. Prior commits have made it actually easier to instead return the hash populated with the values that the C locale has, which is more desirable than the current state. And that is what this commit does. There are reasons that localeconv() might not be available. It still is broken on MingW, and until recently on older Windows releases that we now no longer support. Workarounds were developed for those cases, but there may be other platforms where it ends up broken without a workaround, and this code handles them better and more simply than before this commit. Commit: be0da6a08af824b2b9f99a5aefb55d71278882f8 https://github.com/Perl/perl5/commit/be0da6a08af824b2b9f99a5aefb55d71278882f8 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M locale.c Log Message: ----------- locale.c: White space only We can outdent preprocessor lines because the previous commit removed a surrounding #ifdef. Commit: 566dd3cd0b73639aaab581bf7de7b5d7b8d4cb6f https://github.com/Perl/perl5/commit/566dd3cd0b73639aaab581bf7de7b5d7b8d4cb6f Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Add struct definition as a fallback If we ever encountered a platform that didn't have localeconv(), nor its structure definition, this could be used to get things to work. Commit: 1297ff03e89381750c75e2e29514f17d008633cc https://github.com/Perl/perl5/commit/1297ff03e89381750c75e2e29514f17d008633cc Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Do an adjustment in a critical section This adjustment was deferred until after the critical section, but it is only an extra conditional and variable set, whose time should be dwarfed by the store to the hash, so I think it's all right to add it to the critical section. Commit: dcb35661dddf924b34b61206f164a8cfd7d16353 https://github.com/Perl/perl5/commit/dcb35661dddf924b34b61206f164a8cfd7d16353 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M locale.c Log Message: ----------- Do localeconv() adjustments immediately unthreaded localeconv() must be called and its struct processed in a critical section when other threads or embedded perls could also be using it. Something like StructCopy can't be used to save its values, as a deep copy is needed. Some of the processing can be expensive, so is deferred to a separate pass after the critical section. But if no critical section is needed, it's cheaper to do the processing as we go along doing the copy. A comment removed in this commit said that the reason this wasn't done was because of an extra maintenance cost (having to maintain the code in two places). But when I actually looked at what it would like like to do this, I found it is essentially just an extra function call, not enough "extra" to worry about. Commit: f42c31ba67ec84fdf8934132d9473055f8796a51 https://github.com/Perl/perl5/commit/f42c31ba67ec84fdf8934132d9473055f8796a51 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M locale.c Log Message: ----------- debug populate localeconv Commit: 77dff2679e5b2306e812184bd966ab40723e787e https://github.com/Perl/perl5/commit/77dff2679e5b2306e812184bd966ab40723e787e Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M locale.c Log Message: ----------- locale.c: S_is_locale_utf8(): "C" locale not UTF-8 This adds a quick check to rule out "C" and "POSIX" as being possible UTF-8 locales. This shortcuts the more expensive checking needed for non-trivial cases. Commit: db33a41b3773f45160982b59d7ed0d1ffe641e88 https://github.com/Perl/perl5/commit/db33a41b3773f45160982b59d7ed0d1ffe641e88 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Tighten rules for detecting locale UTF-8ness This is calling mbtowc() or mbrtowc(). Prior to this commit, it only tested their returns to verify that they didn't return an error. This commit changes so that the return is tested to be the precise correct value. Commit: 8608ae069651735d299c3cf0753f8e5c5a2f516a https://github.com/Perl/perl5/commit/8608ae069651735d299c3cf0753f8e5c5a2f516a Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Move declarations, add comments C99 allows us to make declarations more local. Commit: 83393e8525d3d5961a7113848c7b6ae7458e45c4 https://github.com/Perl/perl5/commit/83393e8525d3d5961a7113848c7b6ae7458e45c4 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Move code into another function This moves the code that definitely can determine if a locale is UTF-8 into the function is_locale_utf8(). This has the benefit of avoiding some work on platforms lacking nl_langinfo(), such as Windows. Commit: 84ec2bb79a334ed42472b6df03815ac35dcefe42 https://github.com/Perl/perl5/commit/84ec2bb79a334ed42472b6df03815ac35dcefe42 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Fix up some comments I did some research as to possible alternate methods if the current one turns out not to work on some platforms, and the comments are hereby changed to reflect the results. Commit: 02135a9b61d1058bede5a9dcff89cf9eb6b82086 https://github.com/Perl/perl5/commit/02135a9b61d1058bede5a9dcff89cf9eb6b82086 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Add shortcut ruling out locale being UTF8 This quick check can shortcut the extra work for locales that aren't UTF-8. Commit: f916427bc23f2abc7d5435d5760cfe217d396ed2 https://github.com/Perl/perl5/commit/f916427bc23f2abc7d5435d5760cfe217d396ed2 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Comments and white space I did some research based on the suggestions in the comments hereby removed, only to find it is pretty much a dead-end. I added new comments to reflect this. Commit: 8111e041e10516c73a080e0e864f9625e8c48761 https://github.com/Perl/perl5/commit/8111e041e10516c73a080e0e864f9625e8c48761 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Move code to within only block using it Commit: 5f652024edeae1d1294fe3d7395b21fabe5c8f23 https://github.com/Perl/perl5/commit/5f652024edeae1d1294fe3d7395b21fabe5c8f23 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M locale.c Log Message: ----------- mismatched ctype Commit: 43b28213e3046f5ba6cc168109a600c17260c797 https://github.com/Perl/perl5/commit/43b28213e3046f5ba6cc168109a600c17260c797 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M locale.c Log Message: ----------- locale.c: XXX Move codeset to separate function Commit: 4e164f55b2792d33179b6cff5b93bc285c577a88 https://github.com/Perl/perl5/commit/4e164f55b2792d33179b6cff5b93bc285c577a88 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M locale.c Log Message: ----------- strtod Commit: d3c7d6b6fb5d528618d770767219c3de937d396b https://github.com/Perl/perl5/commit/d3c7d6b6fb5d528618d770767219c3de937d396b Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M locale.c Log Message: ----------- strtod_l Commit: 64247d808f080ad7cd5bb9c07b296fdbda2e5c45 https://github.com/Perl/perl5/commit/64247d808f080ad7cd5bb9c07b296fdbda2e5c45 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M locale.c Log Message: ----------- locale.c: If strftime() fails, use a platform errno It turns out that some platforms set errno when the libc function strftime() encounters an error. Windows is such a one. Use any errno from the platform in preference to what we otherwise would set. Commit: 75212e415189a00e72bfafc30b8742588c7c4118 https://github.com/Perl/perl5/commit/75212e415189a00e72bfafc30b8742588c7c4118 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M dist/threads/threads.xs Log Message: ----------- debug thread xs Commit: 74e92f8c07b70a752d9d5604a8cf0b0b3d62499d https://github.com/Perl/perl5/commit/74e92f8c07b70a752d9d5604a8cf0b0b3d62499d Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M intrpvar.h M locale.c M perl.h Log Message: ----------- add FAKE MING Commit: 90f163b634661aae233b6d2c0ecd67790ae477cc https://github.com/Perl/perl5/commit/90f163b634661aae233b6d2c0ecd67790ae477cc Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Rmv warning and unnecessary declaration The Windows versions we now support don't need to have this libc function declared, and warn that it is being declared. Commit: 49f4afea7076027a967e6e3f7dd08ebdf5de10b6 https://github.com/Perl/perl5/commit/49f4afea7076027a967e6e3f7dd08ebdf5de10b6 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M locale.c Log Message: ----------- XXX msg locale.c: Refactor an #ifdef maybe #undef afterwards Commit: fdfca0a1e950b541cec7503e3caf4edccd4b0b5b https://github.com/Perl/perl5/commit/fdfca0a1e950b541cec7503e3caf4edccd4b0b5b Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Change macro calls to shorter form The _c version of the macros here are shorter to read, and expand to the identical statements Commit: af12c4e05dc697a8bfb064a7263616eb21b27a79 https://github.com/Perl/perl5/commit/af12c4e05dc697a8bfb064a7263616eb21b27a79 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M lib/locale_threads.t Log Message: ----------- lib/locale_threads.t: Change variable names Using 'set' as opposed to 'group' is clearer. Commit: 96b8b4ba280b827bc575195975661612eb141046 https://github.com/Perl/perl5/commit/96b8b4ba280b827bc575195975661612eb141046 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M lib/locale_threads.t Log Message: ----------- lib/locale_threads.t: Add debugging info Commit: 3a51c783ab6d27d6fb4927ff8cf64876799cd13d https://github.com/Perl/perl5/commit/3a51c783ab6d27d6fb4927ff8cf64876799cd13d Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M locale.c Log Message: ----------- S_my_langinfo_i: Be sure to return in both places This function returns a value, and also copies that value into a buffer. Certain rare Configurations failed to fill the buffer in some circumstances. Commit: c1f5fbcc639730db0b8a597db97356b78f1d2195 https://github.com/Perl/perl5/commit/c1f5fbcc639730db0b8a597db97356b78f1d2195 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Avoid unnecessary locale changes In our emulation of nl_langinfo(), prior to this commit, we always toggled the locales of two categories to the necessary ones. Except that there are a number of paths through the code that don't require this toggling. This commit narrows the scope of the toggling to just those cases that need it. Commit: 74cb7030ada0da41bb9931e00816d7c2156af314 https://github.com/Perl/perl5/commit/74cb7030ada0da41bb9931e00816d7c2156af314 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M locale.c Log Message: ----------- locale.c: Avoid a recalculation If we already have this information, no need to recalculate it. Add ability to emulate thread-safe locale operations Commit: ea80b0af50f9d7427794a787d56c13441b832395 https://github.com/Perl/perl5/commit/ea80b0af50f9d7427794a787d56c13441b832395 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M embed.fnc M embed.h M embedvar.h M handy.h M inline.h M intrpvar.h M locale.c M makedef.pl M mg.c M perl.c M perl.h M pod/perlvar.pod M proto.h M sv.c Log Message: ----------- Add ability to emulate thread-safe locale operations Locale information was originally global for an entire process. Later, it was realized that different threads could want to be running in different locales. Windows added this ability, and POSIX 2008 followed suit (though using a completely different API). When available, perl automatically uses these capabilities. But many platforms have neither, or their implementation, such as on Darwin, is buggy. This commit adds the capability for Perl programs to operate as if the platform were thread-safe. This implementation is based on the observation that the underlying locale matters only to relatively few libc calls, and only during their execution. It can be anything at all at any other time. perl keeps what the proper locale should be for each category in a a per-thread array. Each locale-dependent operation must be wrapped in mutex lock/unlock operations. The lock additionally compares what libc knows the locale to be, and what it should be for this thread at this time, and changes the actual locale to the proper value if necessary. That's all that is needed. This commit adds macros to perl.h, for example "MBTOWC_LOCK_", that expand to do the mutex lock, and change the global locale to the expected value. On perls built without this emulation capability, they are no-ops. All code in the perl core (unless I've missed something), are changed to use these macros (there weren't actually many places that needed this). Thus, any pure perl program will automatically become locale-thread-safe under this Configuration. In order for XS code to also become locale-thread-safe, it must use these macros to wrap calls to locale-dependent functions. Relatively few modules call such functions. For example, the only one I found that ships with the perl core is Time::Piece, and it has more fundamental issues with running under threads than this. I am preparing pull requests for it. Thus, this is not completely transparent to code like native-thread-safe locale handling is. Therefore ${^SAFE_LOCALES} returns 2 (instead of 1) for this type of thread-safety. Another deficiency compared to the native thread safety is when a thread calls a non-perl library that accesses the locale. The typical example is Gtk (though this particular application can be configured to not be problematic). With the native safe threads, everything works as long as only one such thread is used per Perl program. That thread would then be the only one operating in the global locale, hence there are no conflicts. With this emulation, all threads are operating in the global locale, and mutexes would have to be used to prevent conflicts. To minimize those, the code added in this commit restores the global locale when through to the state it was in when started. A major concern is the performance impact. This is after all trading speed for accuracy. lib/locale_threads.t is noticeably slower when this is being used. But that is doing multiple threads constantly using locale-dependent operations. I don't notice any change with the rest of the test suite. In pure perl, this only comes into play while in the scope of 'use locale' or when using some of the few POSIX:: functions that are locale-dependent. And to some extent when formatting, but the regular overhead there should dwarf what this adds. This commit leaves this feature off by default. The next commit changes that for the next few 5.39 development releases, so we can see if there is actually an issue. Commit: 8ab79d2ee6d81aa5e4492e0fe7dd5c4b01881385 https://github.com/Perl/perl5/commit/8ab79d2ee6d81aa5e4492e0fe7dd5c4b01881385 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M embedvar.h M intrpvar.h M locale.c M perl.h M sv.c Log Message: ----------- more emul Commit: 01e7bc7d51b6947eea7220d876bcd5e48d522d0e https://github.com/Perl/perl5/commit/01e7bc7d51b6947eea7220d876bcd5e48d522d0e Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M locale.c Log Message: ----------- more emul Commit: 53a00e228c7fe01f35001256140d525600e5022d https://github.com/Perl/perl5/commit/53a00e228c7fe01f35001256140d525600e5022d Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M embedvar.h M locale.c Log Message: ----------- femul Commit: 15abb9f1991d57aa0acafccedb6d803f629f66e8 https://github.com/Perl/perl5/commit/15abb9f1991d57aa0acafccedb6d803f629f66e8 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M locale.c M makedef.pl M perl.h Log Message: ----------- Experimentally enable per-thread locale emulation This is set to end in 5.39.10, but will give us field experience in the meantime. Commit: 13a546f149a203349d3609b0ca16319eb1c28ee3 https://github.com/Perl/perl5/commit/13a546f149a203349d3609b0ca16319eb1c28ee3 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M perl.h Log Message: ----------- XXX perl.h maybe drop Commit: c15d749e7c26bc9a5014a7a8a379b22068bc652b https://github.com/Perl/perl5/commit/c15d749e7c26bc9a5014a7a8a379b22068bc652b Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M makedef.pl Log Message: ----------- makedef.pl: PL_cur_locale_obj is only POSIX 2008 multiplicity Commit: e44553e18af1b5703d9223dd1de0aafacc93fcb8 https://github.com/Perl/perl5/commit/e44553e18af1b5703d9223dd1de0aafacc93fcb8 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M makedef.pl Log Message: ----------- makedef.pl: Move comment Commit: e4e0325111463ee54325544cdbdbd8dac264a8fc https://github.com/Perl/perl5/commit/e4e0325111463ee54325544cdbdbd8dac264a8fc Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M perl.h Log Message: ----------- Add DEBUG_SETLOCALE_INCONSISTENCIES Commit: c4e39fb9d2de8bb41f73fb21c856d50a6d118465 https://github.com/Perl/perl5/commit/c4e39fb9d2de8bb41f73fb21c856d50a6d118465 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M perl.h Log Message: ----------- Enable DEBUG_SETLOCALE_INCONSISTENCIES Commit: f8ea1f61e569951274b005a3f46aa298d404ddde https://github.com/Perl/perl5/commit/f8ea1f61e569951274b005a3f46aa298d404ddde Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M locale.c Log Message: ----------- final commit Commit: fe97886031b3ef69b3c9e8099db510252817a287 https://github.com/Perl/perl5/commit/fe97886031b3ef69b3c9e8099db510252817a287 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M locale.c Log Message: ----------- langinfo_l Commit: 2e6ee7220e2f4e2f600237b4c02ce3b319ac106e https://github.com/Perl/perl5/commit/2e6ee7220e2f4e2f600237b4c02ce3b319ac106e Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M lib/locale_threads.t Log Message: ----------- locale_threads.t: Better handle weird locales The previous code was generating bunches of uninitialized variable warnings, due to 1) not checking for definedness early; 2) the loop termination needs to be reevaluated each time because there is a potential splice, shortening the array. This only happens, I believe, on MingW not using UCRT. Commit: 0753cc1684c2453c53b1b54b29cef7ccb38818d0 https://github.com/Perl/perl5/commit/0753cc1684c2453c53b1b54b29cef7ccb38818d0 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M makedef.pl M perl.h Log Message: ----------- Don't do thread-safe locales emulation on mingw MingW when compiled with the Universal C runtime (UCRT) is thread-safe with respect to locales, just as VS 2015 and later MSVCRT compilations are. However, versions not using UCRT cannot be compiled to emulate thread-safe locale. I'm pretty sure this is due to a bug in the libc strftime() function, having spent a bunch of hours working on this. It often fails lib/locale_threads.t when using the emulation, but not always. The failure is always in strftime(). What made me think it could be perl is another characteristic of the failures. lib/locale_threads.t works by, in each thread, setting each available locale category to a locale, different from any other category in that thread, and as different as possible from the locale for the corresponding category in any other thread. For example thread 0 might have LC_CTYPE set to locale X, LC_NUMERIC to Y, LC_TIME to Z, etc. Thread 1 would use a locale for LC_CTYPE, as different from X as possible, meaning executing the same operation on thread 0 and thread 1 would yield different expected results. (It goes to some lengths to calculate the biggest distance in the results.) Similarly LC_NUMERIC would have something almost completely different from Y; and so on. Then each thread executes a batch of iterations. Each iteration runs all the operations I could find that perl uses that apply to LC_TYPE, and all the ones that apply to each of the other categories. And verifies that all the results are as expected. Simultaneously, the other threads are executing their batch. It is verifying that there is no bleed-through from one thread to another. If the threads all have the same results as the other threads, we couldn't detect if there is real bleed-through or not. This is solved by making the results for each category as different as possible from any other thread currently executing. However, this isn't good enough. Every so many iterations, each thread changes to use a new set of locales. This verifies that the locales can be changed in a thread without that bleeding through to other threads. And thread 0 is special. It harvests the other threads as they finish, and keeps going for a while. This is to catch bugs in thread completion, of which we've had a few. MingW's failures all occur, when they occur, on the first iteration following a switch to a new set of locales. That is suspiciously like it is a race condition in cleaning up from the previous setting. But it isn't the first test of the set of the first iteration of the next set. It can be the 10th or so test. I added enough debugging statements to convince me that it isn't perl. This is the failing code in locale.c: STRFTIME_LOCK; int len = strftime(buf, bufsize, fmt, mytm); STRFTIME_UNLOCK; The returned 'buf' is not always correct. T The LOCK/UNLOCK macros on MingW with thread-safe emulation enabled, call EnterCriticalSection(), and set the locales for the categories that affect strftime() to the proper locale. Just to be sure. I tested setting LC_ALL to the correct value. While in its uninterruptible (by other locale handling code anyway) section, strftime() fills buf with the result for the current locale (which STRFTIME_LOCK has set). I added print statements within the critical section thusly STRFTIME_LOCK; DEBUG_U(PerlIO_printf(Perl_debug_log, "calling strftime(%s), LC_ALL=%s\n", fmt, setlocale(LC_ALL, NULL))); int len = strftime(buf, bufsize, fmt, mytm); DEBUG_U(PerlIO_printf(Perl_debug_log, "return=%s, LC_ALL=%s\n", buf, setlocale(LC_ALL, NULL))); STRFTIME_UNLOCK; On this platform, setlocale() expands to _wsetlocale(), a Windows libc call. Here's what they showed for one failure. calling strftime(%b), LC_ALL=Hungarian_Hungary.1250 return=marc., LC_ALL=Hungarian_Hungary.1250 The 'a' in the Hungarian for March is supposed to be a U+00E1, with an acute accent, so this is wrong. strftime() also is passed a pointer to a struct tm, which is filled in with various integers which indicate in this case which month the %b is supposed to return. That it is returning something very much like márch indicates those integers are correct. Not shown in the example above are the other prints I added to verify that we are indeed in a critical section. I didn't see a way to actually test for this via a libc call, but one could use strace and wade through the output. But there are print statements that print out immediately before entering a critical section, and immediately after leaving it. I verified that those prints indicate this code is in a critical section. I note that this box has actually not very many locales, so that the distance between the results of various threads isn't all that large. Pretty much all the locales are CP 1250, 1251, 1252, and 1257, and no UTF-8 ones, so all locales are single byte. None of them map \XE1 into plain 'a', which is what we are seeing returned, so the cleanup theory seems wrong. Sometimes the return is '?' or a series of them, indicating that the returned character is mojibake. None of the locales I saw had 'marc\.' as a possible return. It appears only here in the entire trace of all threads. This makes it again less likely that it is a cleanup issue. But where did it come from?. I don't know. The value for the C locale is 'Mar', so it didn't come from there. The localeconv() function is also broken in this Configuration. We long ago figured out a workaround for that. I tried that same workaround for strftime(), and it didn't help. Commit: 77e16b3ee04ba725161eec08ae52dff15e43b358 https://github.com/Perl/perl5/commit/77e16b3ee04ba725161eec08ae52dff15e43b358 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M ext/I18N-Langinfo/t/Langinfo.t Log Message: ----------- langinfo.t Commit: 7f791574181c5c754fe153573d87015f00861a01 https://github.com/Perl/perl5/commit/7f791574181c5c754fe153573d87015f00861a01 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M ext/I18N-Langinfo/t/Langinfo.t Log Message: ----------- Revert "langinfo.t" This reverts commit 79b7d15629ae03be0f44bc4a25ebcac9ca78a09c. Commit: 84f78d25b7112e5761726ddb057f53045eedd8ad https://github.com/Perl/perl5/commit/84f78d25b7112e5761726ddb057f53045eedd8ad Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M lib/locale_threads.t Log Message: ----------- Revert "locale_threads.t: Skip on OpenBSD and DragonFly threaded builds" This reverts commit 1d74e8214dd53cf0fa9e8c5aab3e6187685eadcd, as they have been modified Commit: df8debf119c3b5a66704b1e17c8d985f13ed86ac https://github.com/Perl/perl5/commit/df8debf119c3b5a66704b1e17c8d985f13ed86ac Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M hints/openbsd.sh Log Message: ----------- openbsd Commit: 8ce118e2187057ae6f26e9666bc301448556c14e https://github.com/Perl/perl5/commit/8ce118e2187057ae6f26e9666bc301448556c14e Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M hints/openbsd.sh Log Message: ----------- openbsd: Not thread safe locales Commit: abca44dde63148407baca769fae4200570ffe89e https://github.com/Perl/perl5/commit/abca44dde63148407baca769fae4200570ffe89e Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M hints/openbsd.sh Log Message: ----------- openbsd hints Commit: cfe5060386db608dd907a25d8712cca345072241 https://github.com/Perl/perl5/commit/cfe5060386db608dd907a25d8712cca345072241 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M hints/openbsd.sh Log Message: ----------- openbsd mismatched ctype hints Commit: 7c56ac4d44bf2a712f82f68100464e0fb76bfe17 https://github.com/Perl/perl5/commit/7c56ac4d44bf2a712f82f68100464e0fb76bfe17 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M locale.c Log Message: ----------- wrap uselocale Commit: d05bd63fcc721c16e4ae90f5abb44dce8b753a54 https://github.com/Perl/perl5/commit/d05bd63fcc721c16e4ae90f5abb44dce8b753a54 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M lib/locale.t Log Message: ----------- lib/locale.t start of setlocale failure Commit: 6016a7a7eada779413de813196d6b2add5ddf2c9 https://github.com/Perl/perl5/commit/6016a7a7eada779413de813196d6b2add5ddf2c9 Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M perl.h Log Message: ----------- perl.h: Fixup FAKE_MINGW This is used (by me) to partially emulate MingW on a *nix platform. It was passing all its tests, but I discovered that I had the wrong #if which was hence not enabling crucial parts of the emulation. Commit: 020a4c2e0baea632bdf05e53323578af602b75dd https://github.com/Perl/perl5/commit/020a4c2e0baea632bdf05e53323578af602b75dd Author: Karl Williamson <k...@cpan.org> Date: 2023-12-04 (Mon, 04 Dec 2023) Changed paths: M pp.c Log Message: ----------- pp_study: hook Compare: https://github.com/Perl/perl5/compare/37ced6c14a9d...020a4c2e0bae