On Thu Apr 13 16:10:32 2017, JKEENAN wrote:
Show quoted text> For reference, am attaching tarball of the most recent version which I
> asked Charlie Gonzalez to test. This is equivalent to the 'functions-
> not-available-on-windows' branch on github at commit
> cc7e62208eabdd8597823024b7649d0c0981986f.
So I now have a hypothesis on what is happening. While working on 2.12_003 and _004, I was trying to boost the extent to which t/*.t exercises the File-Path source code under lib/. In other words, I was trying to boost the coverage ratio. I know that I did boost coverage by a lot. That was accomplished by adding more tests for every nook and cranny under mkpath(), rmtree(), etc.
But in the process of so doing, I probably added tests for combinations of arguments which are implausible on Windows. Note that in master, the points at which we call getpwnam() and getgrnam() are these:
#####
sub mkpath {
my $old_style = !( @_ and __is_arg( $_[-1] ) );
my $data;
my $paths;
if ($old_style) {
my ( $verbose, $mode );
( $paths, $verbose, $mode ) = @_;
$paths = [$paths] unless UNIVERSAL::isa( $paths, 'ARRAY' );
$data->{verbose} = $verbose;
$data->{mode} = defined $mode ? $mode : oct '777';
}
else {
my %args_permitted = map { $_ => 1 } ( qw|
chmod
error
group
mask
mode
owner
uid
user
verbose
| );
...
$data->{owner} = delete $data->{user} if exists $data->{user};
$data->{owner} = delete $data->{uid} if exists $data->{uid};
if ( exists $data->{owner} and $data->{owner} =~ /\D/ ) {
my $uid = ( getpwnam $data->{owner} )[2];
if ( defined $uid ) {
$data->{owner} = $uid;
}
else {
_error( $data,
"unable to map $data->{owner} to a uid, ownership not changed"
);
delete $data->{owner};
}
}
if ( exists $data->{group} and $data->{group} =~ /\D/ ) {
my $gid = ( getgrnam $data->{group} )[2];
if ( defined $gid ) {
$data->{group} = $gid;
}
else {
_error( $data,
"unable to map $data->{group} to a gid, group ownership not changed"
);
delete $data->{group};
}
}
...
}
}
#####
So getpwnam() is only encountered if $data{owner} exists and is a non-numeric string. Similarly, getgrnam() is only encountered if $data{group} exists and is a non-numeric string. If these conditions do not obtain, then Perl never has to ask, "Are getpwnam() and/or getgrnam() implemented on this system?" And if on Windows no one would ever pass 'owner', 'user', 'uid' or 'group' in the hashref which is the optional final argument to make_path(), then no user on Windows would ever encounter this error. The only time these built-in functions would be encountered in the not-so-real-world of testing would be in t/Path.t.
So, Charlie, can you run the following command from the latest tarball that I sent you and post the output?
#####
prove -vb t/Path.t 1>t_Path_t_output.txt 2>&1
#####
That way, I'll be able to see the exact test at which we're getting the fatal error.
Thank you very much.
Jim Keenan