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

Fix cwd_enoent test in Perl #20541

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
From 8508806268d1abe6c533393333ad151e12adfc2d Mon Sep 17 00:00:00 2001
From: Slaven Rezic <srezic@cpan.org>
Date: Wed, 3 Oct 2018 10:07:32 -0400
Subject: [PATCH] Accept also ESTALE (fix for RT #133534)

ESTALE may occur in some environments when accessing a
now non-existing directory, e.g. when using NFS or in docker
containers.
---
dist/PathTools/t/cwd_enoent.t | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/dist/PathTools/t/cwd_enoent.t b/dist/PathTools/t/cwd_enoent.t
index 8f3a1fb1fb3e..510c65ed0c9a 100644
--- a/dist/PathTools/t/cwd_enoent.t
+++ b/dist/PathTools/t/cwd_enoent.t
@@ -2,7 +2,7 @@ use warnings;
use strict;

use Config;
-use Errno qw(ENOENT);
+use Errno qw();
use File::Temp qw(tempdir);
use Test::More;

@@ -19,6 +19,7 @@ unless(mkdir("$tmp/testdir") && chdir("$tmp/testdir") && rmdir("$tmp/testdir")){
plan tests => 8;
require Cwd;

+my @acceptable_errnos = (&Errno::ENOENT, (defined &Errno::ESTALE ? &Errno::ESTALE : ()));
foreach my $type (qw(regular perl)) {
SKIP: {
skip "_perl_abs_path() not expected to work", 4
@@ -36,12 +37,14 @@ foreach my $type (qw(regular perl)) {
$res = Cwd::getcwd();
$eno = 0+$!;
is $res, undef, "$type getcwd result on non-existent directory";
- is $eno, ENOENT, "$type getcwd errno on non-existent directory";
+ ok((grep { $eno == $_ } @acceptable_errnos), "$type getcwd errno on non-existent directory")
+ or diag "Got errno code $eno, expected " . join(", ", @acceptable_errnos);
$! = 0;
$res = Cwd::abs_path(".");
$eno = 0+$!;
is $res, undef, "$type abs_path result on non-existent directory";
- is $eno, ENOENT, "$type abs_path errno on non-existent directory";
+ ok((grep { $eno == $_ } @acceptable_errnos), "$type abs_path errno on non-existent directory")
+ or diag "Got errno code $eno, expected " . join(", ", @acceptable_errnos);
}
}

14 changes: 12 additions & 2 deletions easybuild/easyconfigs/p/Perl/Perl-5.32.1-FCC-4.5.0.eb
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,12 @@ exts_list = [
('File::Spec', '3.75', {
'source_tmpl': 'PathTools-%(version)s.tar.gz',
'source_urls': ['https://cpan.metacpan.org/authors/id/X/XS/XSAWYERX'],
'checksums': ['a558503aa6b1f8c727c0073339081a77888606aa701ada1ad62dd9d8c3f945a2'],
'patches': ['PathTools-3.75_fix-cwd_enoent-test.patch'],
'checksums': [
'a558503aa6b1f8c727c0073339081a77888606aa701ada1ad62dd9d8c3f945a2',
{'PathTools-3.75_fix-cwd_enoent-test.patch':
'7a456a99d9b04a36359f3623f0deef8fe7f472c742f99cdcf0215c50afbbe7b1'},
],
}),
('Test::Simple', '1.302183', {
'source_tmpl': 'Test-Simple-%(version)s.tar.gz',
Expand Down Expand Up @@ -1667,7 +1672,12 @@ exts_list = [
('Cwd', '3.75', {
'source_tmpl': 'PathTools-%(version)s.tar.gz',
'source_urls': ['https://cpan.metacpan.org/authors/id/X/XS/XSAWYERX'],
'checksums': ['a558503aa6b1f8c727c0073339081a77888606aa701ada1ad62dd9d8c3f945a2'],
'patches': ['PathTools-3.75_fix-cwd_enoent-test.patch'],
'checksums': [
'a558503aa6b1f8c727c0073339081a77888606aa701ada1ad62dd9d8c3f945a2',
{'PathTools-3.75_fix-cwd_enoent-test.patch':
'7a456a99d9b04a36359f3623f0deef8fe7f472c742f99cdcf0215c50afbbe7b1'},
],
}),
('MIME::Base64', '3.16', {
'source_tmpl': 'MIME-Base64-%(version)s.tar.gz',
Expand Down
14 changes: 12 additions & 2 deletions easybuild/easyconfigs/p/Perl/Perl-5.32.1-GCCcore-10.3.0.eb
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,12 @@ exts_list = [
('File::Spec', '3.75', {
'source_tmpl': 'PathTools-%(version)s.tar.gz',
'source_urls': ['https://cpan.metacpan.org/authors/id/X/XS/XSAWYERX'],
'checksums': ['a558503aa6b1f8c727c0073339081a77888606aa701ada1ad62dd9d8c3f945a2'],
'patches': ['PathTools-3.75_fix-cwd_enoent-test.patch'],
'checksums': [
'a558503aa6b1f8c727c0073339081a77888606aa701ada1ad62dd9d8c3f945a2',
{'PathTools-3.75_fix-cwd_enoent-test.patch':
'7a456a99d9b04a36359f3623f0deef8fe7f472c742f99cdcf0215c50afbbe7b1'},
],
}),
('Test::Simple', '1.302183', {
'source_tmpl': 'Test-Simple-%(version)s.tar.gz',
Expand Down Expand Up @@ -1673,7 +1678,12 @@ exts_list = [
('Cwd', '3.75', {
'source_tmpl': 'PathTools-%(version)s.tar.gz',
'source_urls': ['https://cpan.metacpan.org/authors/id/X/XS/XSAWYERX'],
'checksums': ['a558503aa6b1f8c727c0073339081a77888606aa701ada1ad62dd9d8c3f945a2'],
'patches': ['PathTools-3.75_fix-cwd_enoent-test.patch'],
'checksums': [
'a558503aa6b1f8c727c0073339081a77888606aa701ada1ad62dd9d8c3f945a2',
{'PathTools-3.75_fix-cwd_enoent-test.patch':
'7a456a99d9b04a36359f3623f0deef8fe7f472c742f99cdcf0215c50afbbe7b1'},
],
}),
('MIME::Base64', '3.16', {
'source_tmpl': 'MIME-Base64-%(version)s.tar.gz',
Expand Down
14 changes: 12 additions & 2 deletions easybuild/easyconfigs/p/Perl/Perl-5.34.0-GCCcore-11.2.0.eb
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,12 @@ exts_list = [
('File::Spec', '3.75', {
'source_tmpl': 'PathTools-%(version)s.tar.gz',
'source_urls': ['https://cpan.metacpan.org/authors/id/X/XS/XSAWYERX'],
'checksums': ['a558503aa6b1f8c727c0073339081a77888606aa701ada1ad62dd9d8c3f945a2'],
'patches': ['PathTools-3.75_fix-cwd_enoent-test.patch'],
'checksums': [
'a558503aa6b1f8c727c0073339081a77888606aa701ada1ad62dd9d8c3f945a2',
{'PathTools-3.75_fix-cwd_enoent-test.patch':
'7a456a99d9b04a36359f3623f0deef8fe7f472c742f99cdcf0215c50afbbe7b1'},
],
}),
('Test::Simple', '1.302186', {
'source_tmpl': 'Test-Simple-%(version)s.tar.gz',
Expand Down Expand Up @@ -1670,7 +1675,12 @@ exts_list = [
('Cwd', '3.75', {
'source_tmpl': 'PathTools-%(version)s.tar.gz',
'source_urls': ['https://cpan.metacpan.org/authors/id/X/XS/XSAWYERX'],
'checksums': ['a558503aa6b1f8c727c0073339081a77888606aa701ada1ad62dd9d8c3f945a2'],
'patches': ['PathTools-3.75_fix-cwd_enoent-test.patch'],
'checksums': [
'a558503aa6b1f8c727c0073339081a77888606aa701ada1ad62dd9d8c3f945a2',
{'PathTools-3.75_fix-cwd_enoent-test.patch':
'7a456a99d9b04a36359f3623f0deef8fe7f472c742f99cdcf0215c50afbbe7b1'},
],
}),
('MIME::Base64', '3.16', {
'source_tmpl': 'MIME-Base64-%(version)s.tar.gz',
Expand Down
14 changes: 12 additions & 2 deletions easybuild/easyconfigs/p/Perl/Perl-5.34.1-GCCcore-11.3.0.eb
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,12 @@ exts_list = [
('File::Spec', '3.75', {
'source_tmpl': 'PathTools-%(version)s.tar.gz',
'source_urls': ['https://cpan.metacpan.org/authors/id/X/XS/XSAWYERX'],
'checksums': ['a558503aa6b1f8c727c0073339081a77888606aa701ada1ad62dd9d8c3f945a2'],
'patches': ['PathTools-3.75_fix-cwd_enoent-test.patch'],
'checksums': [
'a558503aa6b1f8c727c0073339081a77888606aa701ada1ad62dd9d8c3f945a2',
{'PathTools-3.75_fix-cwd_enoent-test.patch':
'7a456a99d9b04a36359f3623f0deef8fe7f472c742f99cdcf0215c50afbbe7b1'},
],
}),
('Test::Simple', '1.302190', {
'source_tmpl': 'Test-Simple-%(version)s.tar.gz',
Expand Down Expand Up @@ -1775,7 +1780,12 @@ exts_list = [
('Cwd', '3.75', {
'source_tmpl': 'PathTools-%(version)s.tar.gz',
'source_urls': ['https://cpan.metacpan.org/authors/id/X/XS/XSAWYERX'],
'checksums': ['a558503aa6b1f8c727c0073339081a77888606aa701ada1ad62dd9d8c3f945a2'],
'patches': ['PathTools-3.75_fix-cwd_enoent-test.patch'],
'checksums': [
'a558503aa6b1f8c727c0073339081a77888606aa701ada1ad62dd9d8c3f945a2',
{'PathTools-3.75_fix-cwd_enoent-test.patch':
'7a456a99d9b04a36359f3623f0deef8fe7f472c742f99cdcf0215c50afbbe7b1'},
],
}),
('MIME::Base64', '3.16', {
'source_tmpl': 'MIME-Base64-%(version)s.tar.gz',
Expand Down
14 changes: 12 additions & 2 deletions easybuild/easyconfigs/p/Perl/Perl-5.36.0-GCCcore-12.1.0.eb
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,12 @@ exts_list = [
('File::Spec', '3.75', {
'source_tmpl': 'PathTools-%(version)s.tar.gz',
'source_urls': ['https://cpan.metacpan.org/authors/id/X/XS/XSAWYERX'],
'checksums': ['a558503aa6b1f8c727c0073339081a77888606aa701ada1ad62dd9d8c3f945a2'],
'patches': ['PathTools-3.75_fix-cwd_enoent-test.patch'],
'checksums': [
'a558503aa6b1f8c727c0073339081a77888606aa701ada1ad62dd9d8c3f945a2',
{'PathTools-3.75_fix-cwd_enoent-test.patch':
'7a456a99d9b04a36359f3623f0deef8fe7f472c742f99cdcf0215c50afbbe7b1'},
],
}),
('Test::Simple', '1.302191', {
'source_tmpl': 'Test-Simple-%(version)s.tar.gz',
Expand Down Expand Up @@ -1767,7 +1772,12 @@ exts_list = [
('Cwd', '3.75', {
'source_tmpl': 'PathTools-%(version)s.tar.gz',
'source_urls': ['https://cpan.metacpan.org/authors/id/X/XS/XSAWYERX'],
'checksums': ['a558503aa6b1f8c727c0073339081a77888606aa701ada1ad62dd9d8c3f945a2'],
'patches': ['PathTools-3.75_fix-cwd_enoent-test.patch'],
'checksums': [
'a558503aa6b1f8c727c0073339081a77888606aa701ada1ad62dd9d8c3f945a2',
{'PathTools-3.75_fix-cwd_enoent-test.patch':
'7a456a99d9b04a36359f3623f0deef8fe7f472c742f99cdcf0215c50afbbe7b1'},
],
}),
('MIME::Base64', '3.16', {
'source_tmpl': 'MIME-Base64-%(version)s.tar.gz',
Expand Down
14 changes: 12 additions & 2 deletions easybuild/easyconfigs/p/Perl/Perl-5.36.0-GCCcore-12.2.0.eb
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,12 @@ exts_list = [
('File::Spec', '3.75', {
'source_tmpl': 'PathTools-%(version)s.tar.gz',
'source_urls': ['https://cpan.metacpan.org/authors/id/X/XS/XSAWYERX'],
'checksums': ['a558503aa6b1f8c727c0073339081a77888606aa701ada1ad62dd9d8c3f945a2'],
'patches': ['PathTools-3.75_fix-cwd_enoent-test.patch'],
'checksums': [
'a558503aa6b1f8c727c0073339081a77888606aa701ada1ad62dd9d8c3f945a2',
{'PathTools-3.75_fix-cwd_enoent-test.patch':
'7a456a99d9b04a36359f3623f0deef8fe7f472c742f99cdcf0215c50afbbe7b1'},
],
}),
('Test::Simple', '1.302191', {
'source_tmpl': 'Test-Simple-%(version)s.tar.gz',
Expand Down Expand Up @@ -1775,7 +1780,12 @@ exts_list = [
('Cwd', '3.75', {
'source_tmpl': 'PathTools-%(version)s.tar.gz',
'source_urls': ['https://cpan.metacpan.org/authors/id/X/XS/XSAWYERX'],
'checksums': ['a558503aa6b1f8c727c0073339081a77888606aa701ada1ad62dd9d8c3f945a2'],
'patches': ['PathTools-3.75_fix-cwd_enoent-test.patch'],
'checksums': [
'a558503aa6b1f8c727c0073339081a77888606aa701ada1ad62dd9d8c3f945a2',
{'PathTools-3.75_fix-cwd_enoent-test.patch':
'7a456a99d9b04a36359f3623f0deef8fe7f472c742f99cdcf0215c50afbbe7b1'},
],
}),
('MIME::Base64', '3.16', {
'source_tmpl': 'MIME-Base64-%(version)s.tar.gz',
Expand Down
7 changes: 6 additions & 1 deletion easybuild/easyconfigs/p/Perl/Perl-5.36.1-GCCcore-12.3.0.eb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,12 @@ exts_list = [
('File::Spec', '3.75', {
'source_tmpl': 'PathTools-%(version)s.tar.gz',
'source_urls': ['https://cpan.metacpan.org/authors/id/X/XS/XSAWYERX'],
'checksums': ['a558503aa6b1f8c727c0073339081a77888606aa701ada1ad62dd9d8c3f945a2'],
'patches': ['PathTools-3.75_fix-cwd_enoent-test.patch'],
'checksums': [
'a558503aa6b1f8c727c0073339081a77888606aa701ada1ad62dd9d8c3f945a2',
{'PathTools-3.75_fix-cwd_enoent-test.patch':
'7a456a99d9b04a36359f3623f0deef8fe7f472c742f99cdcf0215c50afbbe7b1'},
],
}),
('IO::File', '1.51', {
'source_tmpl': 'IO-%(version)s.tar.gz',
Expand Down
7 changes: 6 additions & 1 deletion easybuild/easyconfigs/p/Perl/Perl-5.36.1-GCCcore-13.1.0.eb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,12 @@ exts_list = [
('File::Spec', '3.75', {
'source_tmpl': 'PathTools-%(version)s.tar.gz',
'source_urls': ['https://cpan.metacpan.org/authors/id/X/XS/XSAWYERX'],
'checksums': ['a558503aa6b1f8c727c0073339081a77888606aa701ada1ad62dd9d8c3f945a2'],
'patches': ['PathTools-3.75_fix-cwd_enoent-test.patch'],
'checksums': [
'a558503aa6b1f8c727c0073339081a77888606aa701ada1ad62dd9d8c3f945a2',
{'PathTools-3.75_fix-cwd_enoent-test.patch':
'7a456a99d9b04a36359f3623f0deef8fe7f472c742f99cdcf0215c50afbbe7b1'},
],
}),
('IO::File', '1.51', {
'source_tmpl': 'IO-%(version)s.tar.gz',
Expand Down
7 changes: 6 additions & 1 deletion easybuild/easyconfigs/p/Perl/Perl-5.38.0-GCCcore-13.2.0.eb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,12 @@ exts_list = [
('File::Spec', '3.75', {
'source_tmpl': 'PathTools-%(version)s.tar.gz',
'source_urls': ['https://cpan.metacpan.org/authors/id/X/XS/XSAWYERX'],
'checksums': ['a558503aa6b1f8c727c0073339081a77888606aa701ada1ad62dd9d8c3f945a2'],
'patches': ['PathTools-3.75_fix-cwd_enoent-test.patch'],
'checksums': [
'a558503aa6b1f8c727c0073339081a77888606aa701ada1ad62dd9d8c3f945a2',
{'PathTools-3.75_fix-cwd_enoent-test.patch':
'7a456a99d9b04a36359f3623f0deef8fe7f472c742f99cdcf0215c50afbbe7b1'},
],
}),
('IO::File', '1.51', {
'source_tmpl': 'IO-%(version)s.tar.gz',
Expand Down
7 changes: 6 additions & 1 deletion easybuild/easyconfigs/p/Perl/Perl-5.38.0.eb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,12 @@ exts_list = [
('File::Spec', '3.75', {
'source_tmpl': 'PathTools-%(version)s.tar.gz',
'source_urls': ['https://cpan.metacpan.org/authors/id/X/XS/XSAWYERX'],
'checksums': ['a558503aa6b1f8c727c0073339081a77888606aa701ada1ad62dd9d8c3f945a2'],
'patches': ['PathTools-3.75_fix-cwd_enoent-test.patch'],
'checksums': [
'a558503aa6b1f8c727c0073339081a77888606aa701ada1ad62dd9d8c3f945a2',
{'PathTools-3.75_fix-cwd_enoent-test.patch':
'7a456a99d9b04a36359f3623f0deef8fe7f472c742f99cdcf0215c50afbbe7b1'},
],
}),
('IO::File', '1.51', {
'source_tmpl': 'IO-%(version)s.tar.gz',
Expand Down