Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Win32]cpan/autodie/t/utime.t fails tests 2 & 4. #14918

Closed
p5pRT opened this issue Sep 21, 2015 · 7 comments
Closed

[Win32]cpan/autodie/t/utime.t fails tests 2 & 4. #14918

p5pRT opened this issue Sep 21, 2015 · 7 comments

Comments

@p5pRT
Copy link

p5pRT commented Sep 21, 2015

Migrated from rt.perl.org#126133 (status was 'resolved')

Searchable as RT126133$

@p5pRT
Copy link
Author

p5pRT commented Sep 21, 2015

From @sisyphus

Hi,

For quite some time (up to and including current 5.23.3)
cpan/autodie/t/utime.t has been failing tests 2 and 4 for me on Windows 7.

Seems that this happens because cpan/autodie/t/touch_me unpacks for me as a
readonly file.
If I turn its readonly flag off, all tests pass.

The utime documentation says this​:

[quote]
... if the first two elements of the list are
"undef", the utime(2) syscall from your C library is called with a null
second argument. On most systems, this will set the file's access and
modification times to the current time (i.e., equivalent to the example
above) and will work even on files you don't own provided you have write
permission
[end quote]

That possibly applies to the test 2 failure, where the first 2 arguments are
undef.
But in test 4 the first 2 arguments are defined.

So ... is it a bug in the perl source distro that cpan/autodie/t/touch_me
unpacks as a readonly file ?
Or is that a bug in the way I'm unpacking the source ?
Or is there more to these test failures than just the readonly flag being on
for cpan/autodie/t/touch_me ?

Here is the test output when touch_me is readonly​:

#########################################
C​:\_32\comp\perl-5.23.3-ld>perl cpan\autodie\t\utime.t
1..4
ok 1 - 'exception thrown for utime' isa 'autodie​::exception'
not ok 2 - We can utime a file just fine.
# Failed test 'We can utime a file just fine.'
# at cpan\autodie\t\utime.t line 16.
# Can't utime(undef, undef,
'C​:\_32\comp\perl-5.23.3-ld\cpan\autodie\t\touch_me'
)​: Permission denied at cpan\autodie\t\utime.t line 15
ok 3 - 'utime exception on single failure.' isa 'autodie​::exception'
not ok 4 - utime fails correctly on a 'true' failure.
# Failed test 'utime fails correctly on a 'true' failure.'
# at cpan\autodie\t\utime.t line 20.
# got​: '0'
# expected​: '1'
Can't utime('1442829690', '1407691077',
'C​:\_32\comp\perl-5.23.3-ld\cpan\autodie
\t\touch_me')​: Permission denied at cpan\autodie\t\utime.t line 24
# Looks like you failed 2 tests of 4.
# Looks like your test exited with 13 just after 4.
#########################################

Cheers,
Rob

@p5pRT
Copy link
Author

p5pRT commented Sep 22, 2015

From @tonycoz

On Mon Sep 21 06​:09​:46 2015, sisyphus wrote​:

Hi,

For quite some time (up to and including current 5.23.3)
cpan/autodie/t/utime.t has been failing tests 2 and 4 for me on
Windows 7.

Seems that this happens because cpan/autodie/t/touch_me unpacks for me
as a
readonly file.
If I turn its readonly flag off, all tests pass.

It looks like a conflict between perl's packaging and autodie's tests.

In a git checkout the file is writable, but in the archive all files are read-only by default, with some exceptions listed in Porting/makerel.

Try the attached patch, you'll need to run Porting/makerel to build a dist to test.

Tony

@p5pRT
Copy link
Author

p5pRT commented Sep 22, 2015

From @tonycoz

0001-perl-126133-autodie-touches-its-touch_me-make-it-wri.patch
From aa8dcd33efcc39b304bed1c6b2e55c5339a5a0ba Mon Sep 17 00:00:00 2001
From: Tony Cook <tony@develop-help.com>
Date: Tue, 22 Sep 2015 10:52:10 +1000
Subject: [perl #126133] autodie touches its touch_me, make it writable

autodie's utime.t touches touch_me, in a git checkout that's fine
since the file is writable, but in a distribution, all files are
read-only by default, and on Win32 the utime() call the test expects
to succeed fails.
---
 Porting/makerel | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Porting/makerel b/Porting/makerel
index a2160fb..07ffa40 100755
--- a/Porting/makerel
+++ b/Porting/makerel
@@ -148,6 +148,7 @@ my @writables = qw(
     perlapi.c
     cpan/Devel-PPPort/module2.c
     cpan/Devel-PPPort/module3.c
+    cpan/autodie/t/touch_me
     reentr.c
     reentr.h
     regcharclass.h
-- 
2.1.4

@p5pRT
Copy link
Author

p5pRT commented Sep 22, 2015

The RT System itself - Status changed from 'new' to 'open'

@p5pRT
Copy link
Author

p5pRT commented Sep 22, 2015

From @sisyphus

-----Original Message-----
From​: Tony Cook via RT
Sent​: Tuesday, September 22, 2015 11​:03 AM
To​: OtherRecipients of perl Ticket #126133​:
Cc​: perl5-porters@​perl.org
Subject​: [perl #126133] [Win32]cpan/autodie/t/utime.t fails tests 2 & 4.

On Mon Sep 21 06​:09​:46 2015, sisyphus wrote​:

Hi,

For quite some time (up to and including current 5.23.3)
cpan/autodie/t/utime.t has been failing tests 2 and 4 for me on Windows
7.

Seems that this happens because cpan/autodie/t/touch_me unpacks for me as
a readonly file.
If I turn its readonly flag off, all tests pass.

It looks like a conflict between perl's packaging and autodie's tests.

In a git checkout the file is writable, but in the archive all files are
read-only by default, with some exceptions listed in Porting/makerel.

Try the attached patch, you'll need to run Porting/makerel to build a dist
to test.

Thanks Tony.
I created the distro by running Porting/makerel in Cygwin - worked fine,
touch_me is now unpacked as writable, and the autodie/t/utime.t script now
passes all tests.

I also added win32/GNUmakefile to @​writables in Porting/makerel prior to
creating the release distro - which also worked, unpacking win32/GNUmakefile
as writable.
I'm requesting that it, too, be added to @​writables (which already contains
the win32 makefiles for the other flavours of make).

Here's the actual makerel patch that I used​:

Inline Patch
--- \_64\comp\perl-5.23.3-ld\Porting\makerel    2015-09-22 17:01:00 +1000
+++ makerel     2015-09-22 16:34:37 +1000
@@ -148,12 +148,14 @@
     perlapi.c
     cpan/Devel-PPPort/module2.c
     cpan/Devel-PPPort/module3.c
+    cpan/autodie/t/touch_me
     reentr.c
     reentr.h
     regcharclass.h
     regnodes.h
     warnings.h
     lib/warnings.pm
+    win32/GNUmakefile
     win32/Makefile
     win32/Makefile.ce
     win32/makefile.mk

Cheers,
Rob 

@p5pRT
Copy link
Author

p5pRT commented Sep 23, 2015

From @tonycoz

On Tue Sep 22 00​:39​:00 2015, sisyphus wrote​:

-----Original Message-----
From​: Tony Cook via RT
Sent​: Tuesday, September 22, 2015 11​:03 AM
To​: OtherRecipients of perl Ticket #126133​:
Cc​: perl5-porters@​perl.org
Subject​: [perl #126133] [Win32]cpan/autodie/t/utime.t fails tests 2 & 4.

On Mon Sep 21 06​:09​:46 2015, sisyphus wrote​:

Hi,

For quite some time (up to and including current 5.23.3)
cpan/autodie/t/utime.t has been failing tests 2 and 4 for me on Windows
7.

Seems that this happens because cpan/autodie/t/touch_me unpacks for me as
a readonly file.
If I turn its readonly flag off, all tests pass.

It looks like a conflict between perl's packaging and autodie's tests.

In a git checkout the file is writable, but in the archive all files are
read-only by default, with some exceptions listed in Porting/makerel.

Try the attached patch, you'll need to run Porting/makerel to build a dist
to test.

Thanks Tony.
I created the distro by running Porting/makerel in Cygwin - worked fine,
touch_me is now unpacked as writable, and the autodie/t/utime.t script now
passes all tests.

I also added win32/GNUmakefile to @​writables in Porting/makerel prior to
creating the release distro - which also worked, unpacking win32/GNUmakefile
as writable.
I'm requesting that it, too, be added to @​writables (which already contains
the win32 makefiles for the other flavours of make).

Here's the actual makerel patch that I used​:

--- \_64\comp\perl-5.23.3-ld\Porting\makerel 2015-09-22 17​:01​:00 +1000
+++ makerel 2015-09-22 16​:34​:37 +1000
@​@​ -148,12 +148,14 @​@​
perlapi.c
cpan/Devel-PPPort/module2.c
cpan/Devel-PPPort/module3.c
+ cpan/autodie/t/touch_me
reentr.c
reentr.h
regcharclass.h
regnodes.h
warnings.h
lib/warnings.pm
+ win32/GNUmakefile
win32/Makefile
win32/Makefile.ce
win32/makefile.mk

Applied with the addition of win32/GNUmakefile as e120c24.

Tony

@p5pRT p5pRT closed this as completed Sep 23, 2015
@p5pRT
Copy link
Author

p5pRT commented Sep 23, 2015

@tonycoz - Status changed from 'open' to 'resolved'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant