This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Steve Hay [Thu, 10 Dec 2020 14:15:51 +0000 (09:15 -0500)]
Synch with CPAN distribution libnet-3.12
James E Keenan [Thu, 10 Dec 2020 14:01:03 +0000 (09:01 -0500)]
Correct POD formatting error
Paul "LeoNerd" Evans [Sat, 27 Jun 2020 17:10:47 +0000 (18:10 +0100)]
Implement SAVEt_STRLEN_SMALL
Most uses of SAVEt_STRLEN actually store small values; often zero.
Rather than using an entire U64-sized element for these values, it saves
space to use the same "SMALL" mechanism as other numerical values, like
SAVEt_INT_SMALL.
Karl Williamson [Wed, 9 Dec 2020 00:09:04 +0000 (17:09 -0700)]
Fix freebsd/netbsd builds
These have an inconsistent configuration in which several functions exist
for thread-safe locales, but the crucial one doesn't show up in our
Configure probe. The code this commit fixes assumed that all or nothing
would be present.
Karl Williamson [Wed, 9 Dec 2020 00:07:17 +0000 (17:07 -0700)]
Fix cygwin build
A macro name changed, and I didn't see it in the grep
Tony Cook [Tue, 8 Dec 2020 23:43:12 +0000 (10:43 +1100)]
bump perl5db.pl's $VERSION
Tony Cook [Tue, 8 Dec 2020 23:42:59 +0000 (10:42 +1100)]
jkahrman is now a perl author
Tony Cook [Tue, 8 Dec 2020 23:19:26 +0000 (10:19 +1100)]
test - and . at beginning of debugger alias name
jkahrman [Thu, 16 Apr 2020 06:00:04 +0000 (02:00 -0400)]
Allow debugger aliases that start with '-' and '.'
Since the '.' and '-' commands don't take any arguments and don't run if any are provided, don't treat commands starting with these characters as the single commands '.' and '-'. Restores behavior that existed prior to https://github.com/Perl/perl5/commit/
7fdd4f080863703d44282c6988834455d129040 (v5.27) at least back to v5.8.8
https://github.com/Perl/perl5/commit/
7fdd4f080863703d44282c6988834455d129040
Karl Williamson [Tue, 8 Dec 2020 20:25:36 +0000 (13:25 -0700)]
locale.c: Remove some unnecessary mutex locks
These aren't necessary as the called function has its own lock until
done copying into the local structure.
And these were breaking blead on Windows, as they are no longer defined.
The smoke I ran included more commits beyond the breaking one, so I
didn't catch it.
Karl Williamson [Sun, 6 Dec 2020 23:29:11 +0000 (16:29 -0700)]
locale.c: Unlock mutex before croaking
These cases aren't supposed to happen, but unlock the mutex first;
we could get into deadlock in trying to output the death message.
Karl Williamson [Mon, 30 Nov 2020 17:11:01 +0000 (10:11 -0700)]
Name individual locale locks
These locks for different functions all use the same underlying mutex;
but that may not always be the case. By creating separate names
used only when we think they will be necessary, the compiler will
complain if the conditions in the code that actually use them are the
same. Doing this showed a misspelling in an #ifdef, fixed in
9289d4dc7a3d24b20c6e25045e687321ee3e8faf
Karl Williamson [Mon, 30 Nov 2020 16:46:34 +0000 (09:46 -0700)]
Refactor locale mutex setup
This was prompted by my realization that even on a locale thread-safe
platform, there are functions we call that may not be thread-safe in
that they return their results in an internal static buffer, which may
be process-wide instead of per-thread. Tomasz Konojacki++ briefly
looked at Windows source code for localeconv() and this indeed did
appear to be the case.
If we thought a platform was thread-safe, no locale mutexes were set up,
and instead the calls in the code to lock were no-oops. This would lead
to potential races, the most likely candidate being localeconv(). None
have been reported, at least as far as we know. Likely that function
isn't called frequently. This would be true on both Posix 2008 and
Windows platforms, except possibly for FreeBSD, which may be the only
platform that we support that has a localeconv_l() function, which is
supposed to be immune from this issue..
The solution adopted here is to test for all the possible functions that
the Perl core uses that may be susceptible to this, and to set up the
mutex if any are found. Thus there won't be no-ops where there should
be a lock.
Karl Williamson [Mon, 30 Nov 2020 00:05:13 +0000 (17:05 -0700)]
Change name of mutex macro.
This macro is for localeconv(); the new name is clearer as to the
meaning, and this preps for further changes.
Karl Williamson [Sun, 6 Dec 2020 22:45:20 +0000 (15:45 -0700)]
locale.c: Add debugging info to panic message
Karl Williamson [Sun, 6 Dec 2020 22:43:45 +0000 (15:43 -0700)]
duplocale() is part of Posix 2008 locales
Thus if we know we have the Posix versions, we have duplocale(), and
hence don't need to test separately for it.
Karl Williamson [Sun, 6 Dec 2020 22:16:41 +0000 (15:16 -0700)]
Fix up many-reader mutex typedef
This previously worked on some compilers, but not others.
Jae Bradley [Sat, 5 Dec 2020 20:57:16 +0000 (15:57 -0500)]
Add author name in alphabetically correct place
Jae Bradley [Wed, 2 Dec 2020 00:35:30 +0000 (19:35 -0500)]
Update the Xcode version in the testsuite.yml workflow
Xcode v12 is now the default Xcode version: https://github.com/actions/virtual-environments/issues/2056
Jae Bradley [Tue, 1 Dec 2020 23:48:55 +0000 (18:48 -0500)]
Use macOS-10.15 explicitly
Jae Bradley [Tue, 1 Dec 2020 23:40:12 +0000 (18:40 -0500)]
Add Jae Bradley as an Author
Jae Bradley [Tue, 1 Dec 2020 20:04:51 +0000 (15:04 -0500)]
Explicitly use Catalina when running the test with Xcode 11
Tom Hukins [Wed, 2 Dec 2020 17:00:09 +0000 (17:00 +0000)]
Remove empty "#ifdef"s
Chris 'BinGOs' Williams [Tue, 8 Dec 2020 11:58:44 +0000 (11:58 +0000)]
Here be camels
David Mitchell [Tue, 8 Dec 2020 09:50:47 +0000 (09:50 +0000)]
perly.y: avoid <0 test on unsigned value
Coverity CID 313707
Moving to a newer version of Bison has changed how the YYTRANSLATE()
macro is defined: in particular it now has a <0 test, which
Coverity is complaining about, since the arg is an unsigned value.
This commit just casts the arg back to a signed value. In more detail:
we formerly had:
yytoken = YYTRANSLATE(NATIVE_TO_UNI(parser->yychar));
yychar is of type int, but NATIVE_TO_UNI returns a UV. So just cast the
result back to an int:
yytoken = YYTRANSLATE((int)NATIVE_TO_UNI(parser->yychar));
TAKAI Kousuke [Tue, 1 Dec 2020 00:50:35 +0000 (09:50 +0900)]
perldelta.pod: Document new "0o" octal syntax.
TAKAI Kousuke [Sat, 31 Oct 2020 05:15:27 +0000 (14:15 +0900)]
perlfunc.pod: add a description for octal strings for oct()
These sentences are borrowed from the description for hex().
TAKAI Kousuke [Fri, 30 Oct 2020 12:55:03 +0000 (21:55 +0900)]
perldata.pod: mention new octal integer format (0o12_345).
TAKAI Kousuke [Thu, 22 Oct 2020 17:14:57 +0000 (02:14 +0900)]
pp.c: oct() now skips "0o" and "o" prefix.
t/op/oct.t: Add test for oct() with 0o and o prefix.
TAKAI Kousuke [Thu, 22 Oct 2020 16:07:16 +0000 (01:07 +0900)]
toke.c: Eliminate temporary variables base, Base and max.
These variables are only used on emitting diagnostic messages.
Calculating them on-demand will make the code slightly faster
on normal cases.
Note: previously bases[], Bases[] and maxima[] may be completely
optimized out by fusing array accesses into if-brances.
Now they become real arrays, and will slightly increase the number
of dynamic relocations on PIC build.
TAKAI Kousuke [Thu, 22 Oct 2020 14:56:58 +0000 (23:56 +0900)]
toke.c: Preserve "0o" prefix on warnings and strings passed to overload hook.
TAKAI Kousuke [Thu, 22 Oct 2020 14:23:57 +0000 (23:23 +0900)]
toke.c: Recognize "0odddd" octal literals.
t/base/num.t: Add some test for "0odddd" octals.
Branislav Zahradník [Thu, 6 Aug 2020 07:18:15 +0000 (09:18 +0200)]
Use GNU Bison's named references
Usage of Bison's named references makes actions little bit easier
to read and maintain.
Branislav Zahradník [Thu, 6 Aug 2020 17:42:08 +0000 (19:42 +0200)]
Raise minimal supported GNU Bison version to 2.5
which added support for named references
Karl Williamson [Mon, 30 Nov 2020 19:18:30 +0000 (12:18 -0700)]
Add start-up/tear-down for many-reader mutexes
These were missed in
5640a370e8b19af74b8ca0b4694464c21a87916b.
Karl Williamson [Tue, 1 Dec 2020 00:09:56 +0000 (17:09 -0700)]
Change many-reader mutex API for consistency
The API for other mutexes passes the address of the lock, instead of the
lock itself. It is less confusing to have the APIs be the same.
Karl Williamson [Mon, 30 Nov 2020 18:16:16 +0000 (11:16 -0700)]
HiRes.xs: Remove unused macro defns
Karl Williamson [Tue, 1 Dec 2020 19:37:52 +0000 (12:37 -0700)]
perllocale: Remove stray markup
Karl Williamson [Fri, 4 Dec 2020 15:01:31 +0000 (08:01 -0700)]
Not all Win32 compilers have a small macro buffer
Commit
e7ae132ec78 consolidated PERL_SMALL_MACRO_BUFFER usages, but it
omitted the _MSC_VER number at which the buffer became large enough.
Apparently it did this because Windows compilations were failing with
the error "string too long", which doesn't happen if __ASSERT_ expands
to nothing, which it does under PERL_SMALL_MACRO_BUFFER.
However, commits 92a0bb2 and 88086fd shortened the offending strings
so later Windows compilers don't have to be considered as having small
macro buffers.
Karl Williamson [Fri, 4 Dec 2020 14:40:54 +0000 (07:40 -0700)]
Revert "Don't test for 16-bit inputs in inRANGE()"
This effectively reverts commit
4c2aa7c802893d0276551ade1b9d5dcd1226afc4.
That commit removed checking for 16 bit inputs because an assert in a
macro was making compilations fail in some compilers that couldn't
handle the complexity. This inadvertently broke systems which use C
language shorts in certain places, such Mingw and Win32 with their use
of UTF16, not typically found on other platforms. At the time, we
weren't smoking Mingw so we didn't know about it there, but the Win32
failures on Win32 were "fixed" by another commit which disabled
assertions of this type completely. It turns out the issue was passing
too long a string to assert(). Commits 92a0bb2 and 88086fd removed a
bunch of unnecessary and/or duplicate asserts, bringing the size down,
so that the 16 bit checks can be added back in without breaking these
compilers.
The reverted commit mentioned HP compilers as having problems. The only
such box we currently have available for testing is HP-31, and the
reversion works fine on it, even before 92a0bb2 and 88086fd.
This fixes GH #18364
Karl Williamson [Sun, 5 Jul 2020 04:01:16 +0000 (22:01 -0600)]
perl.h: Move some code around
This is in preparation for future commits where things will be needed
earlier/later than currently.
Karl Williamson [Sat, 5 Dec 2020 23:35:17 +0000 (16:35 -0700)]
regen/regcharclass.pl: Use smaller inRANGE version
The previous commit split inRANGE up so that code that was known to have
valid inputs to it could use a component that didn't have all the
compile-time checks (often duplicates) that otherwise are made.
This commit changes to use that component. The reason the compile-time
checks are unnecessary here, is this is machine-generated code known to
meet the inRANGE input requirements.
All those compile-time checks added up to being too large for some
compilers to handle.
Karl Williamson [Sat, 5 Dec 2020 23:21:52 +0000 (16:21 -0700)]
inRANGE, withinCOUNT: Split so can avoid asserts
This commit splits these macros up into components that are separately
callable. The components are considered internal core only, and the
purpose is to avoid duplicate assert() calls that were causing some
compilers to crash from not being able to handle the size.
In particular, this commit refactors inRANGE so that the asserts are
done only once, shortening what it expands to.
Karl Williamson [Sat, 5 Dec 2020 23:20:41 +0000 (16:20 -0700)]
handy.h: Fix typo in comment
Karl Williamson [Sat, 29 Aug 2020 20:07:45 +0000 (14:07 -0600)]
Remove my_l?stat from public API
They are not documented, and if you try to use them, you get a compile
error.
Karl Williamson [Sun, 6 Sep 2020 17:04:52 +0000 (11:04 -0600)]
perlapi: Consolidate SvSET-ish entries
These should also be in the SV section instead of Magic
Karl Williamson [Sun, 29 Nov 2020 15:54:43 +0000 (08:54 -0700)]
Evaluate arg once in all forms of SvTRUE
5.32 did this for one form; now all do.
Karl Williamson [Wed, 22 Jul 2020 22:59:03 +0000 (16:59 -0600)]
Always define dMY_CXT_SV, and to dNOOP
Tom Hukins [Wed, 2 Dec 2020 18:04:13 +0000 (18:04 +0000)]
Use a more suitable test method
like() provides better errors on failure thank ok(). This reduces the
usefulness of the removed printf() diagnostic.
Tom Hukins [Wed, 2 Dec 2020 17:39:35 +0000 (17:39 +0000)]
Avoid unnecessarily skipping a test to set $0
The absence of /proc/$$/cmdline doesn't mean running ps(1) won't work.
Tom Hukins [Wed, 2 Dec 2020 17:26:09 +0000 (17:26 +0000)]
Test setting $0 on Dragonfly BSD
Support for this began in Perl 5.26.0 with commit
38626956885060503.
Karl Williamson [Fri, 4 Dec 2020 23:39:02 +0000 (16:39 -0700)]
utf8.h: Fix syntax error only found on EBCDIC builds
Karl Williamson [Tue, 1 Dec 2020 14:28:13 +0000 (07:28 -0700)]
perl.h: Remove ';' from 'NOOP;'
These are useless here
Karl Williamson [Tue, 1 Dec 2020 04:27:44 +0000 (21:27 -0700)]
time64_config.h: #include reentr.h
This is so it will get any reentrant versions automatically
Karl Williamson [Mon, 30 Nov 2020 16:39:34 +0000 (09:39 -0700)]
perlvars.h: Fix comment
Karl Williamson [Mon, 30 Nov 2020 16:33:42 +0000 (09:33 -0700)]
POSIX.xs: White-space only
Indent to standards
Karl Williamson [Mon, 30 Nov 2020 16:30:52 +0000 (09:30 -0700)]
POSIX.xs: Use alternative functions if avail
These preprocessor directives failed to account for the existence of
common alternative functions (which the implementation knows about) if
the plain function is not available on the platform.
I doubt that this makes any difference, but it makes these conditionals
consistent with the others nearby.
Karl Williamson [Mon, 30 Nov 2020 16:25:52 +0000 (09:25 -0700)]
locale.c: Fix typo in #ifdef
This misspelling led to the code assuming that the platform didn't have
a feature that, if used, would result in faster execution.
Karl Williamson [Fri, 4 Dec 2020 00:56:21 +0000 (17:56 -0700)]
Fix and update documentation of memEQ, memNE, ...
This fixes GH #18379
David Mitchell [Thu, 3 Dec 2020 10:36:42 +0000 (10:36 +0000)]
time64.c: avoid 'uninit' compiler warning
clang isn't smart enough to recognise the pattern:
if (foo) { ...} { else orig_year = ... }
...
if (!foo) { ... use orig_year .. }
So just unconditionally initialise orig_year.
Tony Cook [Thu, 3 Dec 2020 04:24:44 +0000 (15:24 +1100)]
perldelta for the Win32 symlink()/readlink()/stat() changes
Karl Williamson [Thu, 3 Dec 2020 03:54:07 +0000 (20:54 -0700)]
Document PERL_TEST_HARNESS_ASAP
which can increase the CPU occupancy when running the test suite in
parallel on a many-core system, resulting in earlier completion.
David Cantrell [Mon, 30 Nov 2020 22:50:00 +0000 (22:50 +0000)]
add note on how to write NEXTKEY when you can't just wrap around each()
Karl Williamson [Thu, 3 Dec 2020 01:56:27 +0000 (18:56 -0700)]
Revert "op.h: Restrict to core certain internal symbols"
This reverts commit
1d6cadf136bf2c85058a5359fb48b09b3ea9fe6f.
Due to cpan breakage: GH #18374 #18375 #18376
Tony Cook [Thu, 3 Dec 2020 00:00:43 +0000 (11:00 +1100)]
add more win32 stat tests
These tickets were suggested as fixed by the stat updates, some
were fixed, but some weren't.
Add tests (TODO for the unfixed) to help track them
Dan Kogai [Wed, 2 Dec 2020 22:13:45 +0000 (17:13 -0500)]
cpan/Encode: sync with CPAN version 3.08
Karl Williamson [Sun, 12 Apr 2020 21:13:25 +0000 (15:13 -0600)]
t/harness: Add option for faster test suite execution
This commit adds an environment variable, PERL_TEST_HARNESS_ASAP, which
if set to non-zero increases the parallelism in the execution of the
test suite, speeding it up on systems with multiple cores.
Normally, there are two main test sections, one for core and the second
for non-core tests, and the testing of the non-core one doesn't begin
until the core tests are complete. Within each section, there are a
number of test categories, like 're' for regular expressions, and
'JSON::PP' for the pure perl implementation of JSON.
Within each category, there are various single .t test files. Some
categories can have those be tested in parallel; some require them to be
done in a particular order, say because an earlier .t does setup for
subsequent ones. We already have this capability.
Completion of all the tests in a category is not needed before those of
another category can be started. This is how it already works.
However, the core section categories are ordered so that they begin in a
logical order for someone trying to get perl to work. First to start
are the basic sanity tests, then by roughly decreasing order of
widespread use in perl programs in the wild, with the final two
categories, porting and perf, being mainly of use to perl5 porters.
These two categories aren't started until all the tests in the earlier
categories are started. We have some long running tests in those two
categories, and generally they delay the start of the entire second
section.
If those long running tests could be started sooner, shorter tests in
the first section could be run in parallel with them, increasing the
average CPU utilization, and the second section could begin (and hence
end) earlier, shortening the total elapsed execution time of the entire
suite.
The second section has some very long running tests. JSON-PP is one of
them. If it could run in parallel with tests from the first section,
that would also speed up the completion of the suite.
The environment variable added by this commit does both things. The
basic sanity test categories in the first section continue to be started
before anything else. But then all other tests are run in decreasing
order of elapsed time they take to run, removing the boundaries between
some categories, and between the two sections.
The gain from this increases as the number of jobs run in parallel does;
slower high core platforms have the highest increase. On the old
dromedary with 24 cores, the gain is 20%, almost 2 minutes. On my more
modern box with 12 cores, it is 8%.
Karl Williamson [Sun, 12 Apr 2020 16:14:25 +0000 (10:14 -0600)]
TAP::Harness: Move timer initialization
This commit adds to blead the accepted PR
https://github.com/Perl-Toolchain-Gang/Test-Harness/pull/98
but the updated module has not been released.
This commit allows a many-core processor to run the Perl test suite more
efficiently.
Prior to this commit, the timers for counting elapsed time and CPU usage
were begun when a job's first output appears. This yields inaccurate
results. These results are saved in t/test_state for future runs so
that they can start the longest-running tests first, which leads to
using the available cores more efficiently. (If you start a long running
test after everything else is nearly done, you have to wait for it to
finish before the suite as a whole is; if you start the long ones first,
and the shortest last, you don't have to wait very long for any
stragglers to complete.) Inaccurate results here lead to this
situation, which we were often seeing in the podcheck.t test.
The worst case is if there is heavy computation at the beginning of the
test being run. podcheck, for example, examines all the pods in the
directory structure to find which links to other pods do or do not have
corresponding anchors. Output doesn't happen until the analysis is
complete. On my system, this takes over 30 seconds, but prior to this
commit, what was noted was just the time required to do the output,
about 200 milliseconds. The result was that podcheck was viewed as
being one of the shortest tests run, so was started late in the process,
and generally held up the completion of it.
This commit by itself doesn't improve the test completion very much,
because, test tests are run a whole directory at a time, and the
directory podcheck is in, for example, is run last. The next commit
addresses that.
Max Maischein [Wed, 2 Dec 2020 20:46:25 +0000 (21:46 +0100)]
fixup! Add Sevan Janiyan as author
Max Maischein [Wed, 2 Dec 2020 20:40:42 +0000 (21:40 +0100)]
Add Sevan Janiyan as author
Sevan Janiyan [Wed, 2 Dec 2020 19:50:37 +0000 (19:50 +0000)]
Detect GCC as compiler to use
On Illumos based distributions GCC is likely the compiler available on the system.
Change tested on SmartOS
Karl Williamson [Mon, 2 Nov 2020 02:35:29 +0000 (19:35 -0700)]
perlxs: Note that rpc.h is can be in different places
This replaces PR #18247
Tony Cook [Wed, 2 Dec 2020 00:43:16 +0000 (11:43 +1100)]
fix the results of my stupidity
I added these definitions late in the process, thinking I hadn't
already added them, but I had.
David Mitchell [Tue, 1 Dec 2020 16:45:58 +0000 (16:45 +0000)]
Storable: t/canonical.t: avoid stderr noise
informational text should to stdout, not stderr
David Mitchell [Tue, 1 Dec 2020 16:33:07 +0000 (16:33 +0000)]
POSIX: t/posix.t: avoid warning
Since warnings were enabled in this test file, skip one spurious warning
being generated. S_ISBLK() is being called purely to test run-time
loading; so it's being called without an arg, which now triggers an
'uninitialized value' warning.
David Mitchell [Tue, 1 Dec 2020 16:02:06 +0000 (16:02 +0000)]
Unicode-Normalize/Makefile.PL: avoid stderr
During build, output general progress information to stdout, not stderr.
David Mitchell [Tue, 1 Dec 2020 15:26:06 +0000 (15:26 +0000)]
append colon to USE_STRICT_BY_DEFAULT description
This stops autodoc.pl complaining that:
USE_STRICT_BY_DEFAULT has no documentation
David Mitchell [Tue, 1 Dec 2020 15:12:14 +0000 (15:12 +0000)]
ODBM_File.xs: silence -Wc++-compat warning
Under gcc -Wc++-compat, it warns that 'delete' is a keyword. Since this
is the name of the actual function in odbm, just temporarily disable
the warning.
David Mitchell [Tue, 1 Dec 2020 11:07:59 +0000 (11:07 +0000)]
Opcode.xs: fix compiler warning
In some debugging code it was doing a SAVEDESTRUCTOR()
to do a warn() on scope exit, but it should have used the nocontext
version of warn().
Tony Cook [Tue, 1 Dec 2020 04:29:45 +0000 (15:29 +1100)]
Implement symlink(), lstat() and readlink() on Win32
Tony Cook [Wed, 11 Nov 2020 00:46:15 +0000 (11:46 +1100)]
win32 symlink: reindent
Tony Cook [Wed, 11 Nov 2020 00:42:23 +0000 (11:42 +1100)]
win32 symlink: treats paths that look like directories as directories
Tony Cook [Mon, 2 Nov 2020 03:28:29 +0000 (14:28 +1100)]
Test-Harness: don't assume symlink succeeds
https://github.com/Perl-Toolchain-Gang/Test-Harness/pull/103
upstream which has been applied but not released.
Tony Cook [Wed, 28 Oct 2020 02:46:01 +0000 (13:46 +1100)]
t/op/taint.t: handle symlink requiring anything unavailable
like privileges, or a filesystem without symlink support
Tony Cook [Tue, 20 Oct 2020 05:12:09 +0000 (16:12 +1100)]
Win32: try to make the new stat pre-Vista compatible
Skips the win32\stat.t execute flag test for handles pre-Vista
This is intended mostly for allowing the Win2000 smoker to build and
test. If we end up dropping pre-Vista support this commit can be
removed (or reverted if it ends up in blead)
Tony Cook [Mon, 9 Nov 2020 02:52:09 +0000 (13:52 +1100)]
pre-vista support for win32_symlink
Tony Cook [Mon, 19 Oct 2020 03:26:57 +0000 (14:26 +1100)]
Win32: don't include version specific config for prebuilt config_h.*
This fixes the problem where doing a regen_config_h with a compiler
that supports stdbool.h would generate a config_h.* that would
result in a build failure on older compilers that didn't support
stdbool.h.
Tony Cook [Thu, 15 Oct 2020 04:11:13 +0000 (15:11 +1100)]
lstat(), readlink() and unlink() treat directory junctions as symlinks
Tony Cook [Thu, 15 Oct 2020 00:46:15 +0000 (11:46 +1100)]
remove ${^WIN32_SLOPPY_STAT}
The new implementation, like the UCRT implementation, always
opens the specified file.
Tony Cook [Thu, 15 Oct 2020 00:21:31 +0000 (11:21 +1100)]
win32 symlink: only use the unprivileged flag if windows is new enough
Tony Cook [Wed, 14 Oct 2020 23:38:05 +0000 (10:38 +1100)]
Win32: re-work FILETIME <=> time_t conversions
Current versions of Windows claim to support leap seconds, but the
time conversion I was using ignores that possibility.
Switch to using APIs (FileTimeToSystemTime() and SystemTimeToFileTime())
that are documented to support leap seconds that might be included
in a FILETIME.
Tony Cook [Wed, 7 Oct 2020 01:08:30 +0000 (12:08 +1100)]
File::Copy: support symlinks on Win32
Tony Cook [Wed, 7 Oct 2020 01:07:31 +0000 (12:07 +1100)]
File::Find: support Win32 symlinks
find.t, taint.t: check that symlink() works under the current
permissions/filesystem rather than assuming it will work
find.t: since symlinks are now available, an earlier test block
set $FileFileTests_OK, and the tests in this Win32 block don't use
either of the follow options, which is required for fast file tests.
taint.t: ensure we get "/" separated names to match File::Find's output
Tony Cook [Wed, 7 Oct 2020 00:53:05 +0000 (11:53 +1100)]
File::Find find.t: switch to done_testing()
Tony Cook [Wed, 7 Oct 2020 00:50:55 +0000 (11:50 +1100)]
PathTools: use PerlLIO_*() functions and chdir() on a symlink differences
Use PerlLIO_lstat() and PerlLIO_readlink() instead of directly calling
the POSIX names, so our Win32 overrides work.
For the test, unlike POSIX, changing directory via a symlink on Win32
appears to store the symlink as part of the current directory rather
so GetCurrentDirectory() fetches that rather than the hardlinked path.
Tony Cook [Wed, 14 Oct 2020 02:27:50 +0000 (13:27 +1100)]
Win32: implement our own stat(), and hence our own utime
This fixes at least two problems:
- unlike UCRT, the MSVCRT used for gcc builds has a bug converting
a FILETIME in an unlike current DST state, returning a time
offset by an hour. Fixes GH #6080
- the MSVCRT apparently uses FindFirstFile() to fetch file
information, but this doesn't follow symlinks(), so stat()
ends up returning information about the symlink(), not the
underlying file. This isn't an issue with the UCRT which
opens the file as this implementation does.
Currently this code calculates the time_t for st_*time, and the
other way for utime() using a simple multiplication and offset
between time_t and FILETIME values, but this may be incorrect
if leap seconds are enabled.
This code also requires Vista or later.
Some of this is based on code by Tomasz Konojacki (xenu).
Tony Cook [Wed, 7 Oct 2020 05:31:22 +0000 (16:31 +1100)]
Win32: implement symlink() and readlink()
The API used requires Windows Vista or later.
The API itself requires either elevated privileges or a sufficiently
recent version of Windows 10 running in "Developer Mode", so some
tests require updates.
Tony Cook [Tue, 6 Oct 2020 06:07:00 +0000 (17:07 +1100)]
Win32: add lstat(), fetch st_dev and st_ino and fetch st_nlink for fstat
We need lstat() for various modules to work well with symlinks,
and the same modules often want to check for matches on the device
and inode number.
The values we're using for st_ino match those that the Python and Rust
libraries use, and Go uses the same volume and file index values for
testing if two stat objects refer to the same file.
They aren't entirely unique, given ReFS uses 128-bit file ids, but
the API used to check for this (GetFileInformationByHandleEx() for
FileIdInfo) is only available on server operating systems, so I can't
directly test it anyway.
Karl Williamson [Tue, 1 Dec 2020 03:55:30 +0000 (20:55 -0700)]
Account for 'less' reserving an extra column
After decades of stability, the 'less' pager project decided to claim an
extra column for its own use when called with certain common options.
This commit changes some of the auto-generating tools to wrap one column
earlier to compensate, and changes podcheck to also whine on wide
verbatim text one column less. But it changes the podcheck data base
to grandfather-in all the many existing places that exceed that amount.
That means only changes made to pods after this commit will be held to
the stricter value.
Of course, what this means is those pods will wrap or truncate in these
places on an 80 column window, making them harder to read, when used
with 'less' and when it is called with the options that reserve those
two columns. Patches welcome.
I haven't seen the wrapping problem with perldoc, and haven't
investigated much.
Karl Williamson [Sat, 29 Aug 2020 16:55:02 +0000 (10:55 -0600)]
Document various CopFILEfoo functions