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
Need to change Cygwin built-in Cwd::cwd #8345
Comments
From jerry@hedden.usPathTools 3.16 introduced the following change: - Apparently the version of File::Path that ships with perl 5.8.5 However, the Cygwin version of Perl has its own built-in Cwd::cwd. The |
From jerry@hedden.uscwd_patch.txt--- perl-5.8.8/cygwin/cygwin.c 2006-01-06 18:04:58.000000000 -0500
+++ perl-5.8.8/cygwin/cygwin.c.fixed 2006-02-24 17:21:34.000000000 -0500
@@ -143,8 +143,6 @@
dXSARGS;
char *cwd;
- if(items != 0)
- Perl_croak(aTHX_ "Usage: Cwd::cwd()");
if((cwd = getcwd(NULL, -1))) {
ST(0) = sv_2mortal(newSVpv(cwd, 0));
free(cwd);
|
From @ysthOn Fri, Feb 24, 2006 at 02:32:58PM -0800, Jerry D. Hedden wrote:
I'd rather see the broken calls, whatever they are, fixed. I don't see |
The RT System itself - Status changed from 'new' to 'open' |
From jerry@hedden.us
Yitzchak Scott-Thoennes replied:
Since PathTools 3.16 hasn't yet been integrated into blead, my patch may |
From @ysthOn Fri, Feb 24, 2006 at 03:55:11PM -0700, Jerry D. Hedden wrote:
Well, sooner or later, blead should be synched with the CPAN PathTools. |
From jerry@hedden.usJerry D. Hedden wrote:
Yitzchak Scott-Thoennes replied:
Jerry D. Hedden replied:
Yitzchak Scott-Thoennes replied:
'make test' on PathTools-3.16 fails: /usr/bin/perl.exe "-MExtUtils::Command::MM" "-e" "test_harness(0, t/cwd.t 255 65280 30 24 80.00% 19-30 Running the failed test with 'perl -Mblib t/cwd.t': 1..30 The 'Usage:' line indicates the failure. This comes from the newly { Hope that helps. |
From @ysthOn Fri, Mar 03, 2006 at 06:44:54AM -0700, Jerry D. Hedden wrote:
That indicates it didn't find the Cwd from the new PathTools; is that what
Blech. So they are specifically testing that a bad call fails. |
From @kenahoo
That was me introducing the test. I did it because there's code in the wild that calls cwd() In short, I wouldn't call it a "bad call". There's no good reason why such a call should die. See http://rt.cpan.org/Ticket/Display.html?id=17175 for one example of cwd() being called -Ken |
From @rurbanAttached patch fixes this legacy issue, allowing Cwd->cwd(). There are also documentation updates. |
From @rurbanbug#38628-maint.patchdifforig perl-5.8.8/cygwin/cygwin.c perl-5.8.8/t/lib/cygwin.t perl-5.8.8/README.cygwin
2007-07-08 Reini Urban <rurban@x-ray.at>
diff -ub perl-5.8.8/cygwin/cygwin.c.orig perl-5.8.8/cygwin/cygwin.c
--- perl-5.8.8/cygwin/cygwin.c.orig 2007-07-08 11:35:14.289500000 +0000
+++ perl-5.8.8/cygwin/cygwin.c 2007-07-08 13:23:24.570750000 +0000
@@ -143,7 +143,10 @@
dXSARGS;
char *cwd;
- if(items != 0)
+ /* See http://rt.perl.org/rt3/Ticket/Display.html?id=38628
+ There is Cwd->cwd() usage in the wild, and previous versions didn't die.
+ */
+ if(items > 1)
Perl_croak(aTHX_ "Usage: Cwd::cwd()");
if((cwd = getcwd(NULL, -1))) {
ST(0) = sv_2mortal(newSVpv(cwd, 0));
@@ -194,7 +197,6 @@
XSRETURN_UNDEF;
}
-
void
init_os_extras(void)
{
@@ -203,8 +205,8 @@
dTHX;
newXS("Cwd::cwd", Cygwin_cwd, file);
- newXS("Cygwin::winpid_to_pid", XS_Cygwin_winpid_to_pid, file);
- newXS("Cygwin::pid_to_winpid", XS_Cygwin_pid_to_winpid, file);
+ newXSproto("Cygwin::winpid_to_pid", XS_Cygwin_winpid_to_pid, file, "$");
+ newXSproto("Cygwin::pid_to_winpid", XS_Cygwin_pid_to_winpid, file, "$");
if ((cv = get_cv("Win32CORE::bootstrap", 0))) {
dSP;
diff -ub perl-5.8.8/t/lib/cygwin.t.orig perl-5.8.8/t/lib/cygwin.t
--- perl-5.8.8/t/lib/cygwin.t.orig 2005-02-11 09:58:30.000000000 +0000
+++ perl-5.8.8/t/lib/cygwin.t 2007-07-08 13:22:53.664500000 +0000
@@ -9,7 +9,7 @@
}
}
-use Test::More tests => 4;
+use Test::More tests => 5;
is(Cygwin::winpid_to_pid(Cygwin::pid_to_winpid($$)), $$,
"perl pid translates to itself");
@@ -29,3 +29,7 @@
is(Cygwin::winpid_to_pid($catwinpid), $catpid, "winpid to pid");
is(Cygwin::pid_to_winpid($catpid), $catwinpid, "pid to winpid");
close($cat);
+
+use Cwd;
+ok(Cwd->cwd(), "bug#38628 legacy");
+
diff -ub perl-5.8.8/README.cygwin.orig perl-5.8.8/README.cygwin
--- perl-5.8.8/README.cygwin.orig 2005-06-03 08:33:15.000000000 +0000
+++ perl-5.8.8/README.cygwin 2007-07-08 13:39:50.820750000 +0000
@@ -27,11 +27,11 @@
system calls and environment these programs expect. More information
about this project can be found at:
- http://www.cygwin.com/
+ F<http://www.cygwin.com/>
A recent net or commercial release of Cygwin is required.
-At the time this document was last updated, Cygwin 1.5.2 was current.
+At the time this document was last updated, Cygwin 1.5.24 was current.
=head2 Cygwin Configuration
@@ -143,9 +143,10 @@
BerkeleyDB is available for Cygwin.
-NOTE: The BerkeleyDB library only completely works on NTFS partitions.
+NOTE: The BerkeleyDB library only completely works on NTFS partitions
+and db-4.3 is flawed.
-=item * C<-lcygipc> (C<use IPC::SysV>)
+=item * C<cygserver> (C<use IPC::SysV>)
A port of SysV IPC is available for Cygwin.
@@ -292,7 +293,7 @@
wait until the C<make install> process to install the I<ld2> script,
this is because the remainder of the C<make> refers to I<ld2> without
fully specifying its path and does this from multiple subdirectories.
-The assumption is that $installbin is in your current C<PATH>. If this
+The assumption is that I<$installbin> is in your current C<PATH>. If this
is not the case C<make> will fail at some point. If this happens,
just manually copy I<ld2> from the source directory to somewhere in
your C<PATH>.
@@ -303,7 +304,7 @@
make test 2>&1 | tee log.make-test
- cd t;./perl harness 2>&1 | tee ../log.harness
+ cd t; ./perl harness 2>&1 | tee ../log.harness
The same tests are run both times, but more information is provided when
running as C<./perl harness>.
@@ -323,8 +324,8 @@
have a F<.{com,bat,exe}> extension or begin with C<#!>, directories are
always readable and executable). On WinNT with the I<ntea> C<CYGWIN>
setting, the additional mode bits are stored as extended file attributes.
-On WinNT with the I<ntsec> C<CYGWIN> setting, permissions use the standard
-WinNT security descriptors and access control lists. Without one of
+On WinNT with the default I<ntsec> C<CYGWIN> setting, permissions use the
+standard WinNT security descriptors and access control lists. Without one of
these options, these tests will fail (listing not updated yet):
Failed Test List of failed
@@ -356,7 +357,7 @@
run Configure with the -Ui_ndbm and -Ui_dbm options to prevent
NDBM_File and ODBM_File being built.
-With NTFS (and CYGWIN=ntsec), there should be no problems even if
+With NTFS (and no CYGWIN=nontsec), there should be no problems even if
perl was built on FAT.
=head2 C<fork()> failures in io_* tests
@@ -395,12 +396,18 @@
contains a backslash or drive letter is a Win32 pathname (and not subject
to the translations applied to POSIX style pathnames).
+Pathnames may not contain Unicode characters. C<Cygwin> still uses the
+ANSI API calls and no Unicode calls because of newlib deficiencies.
+There's an unofficial unicode patch for cygwin at
+F<http://www.okisoft.co.jp/esc/utf8-cygwin/>
+
=item * Text/Binary
When a file is opened it is in either text or binary mode. In text mode
a file is subject to CR/LF/Ctrl-Z translations. With Cygwin, the default
mode for an C<open()> is determined by the mode of the mount that underlies
-the file. Perl provides a C<binmode()> function to set binary mode on files
+the file.
+Perl provides a C<binmode()> function to set binary mode on files
that otherwise would be treated as text. C<sysopen()> with the C<O_TEXT>
flag sets text mode on files that otherwise would be treated as binary:
@@ -487,7 +494,7 @@
=item C<Cwd::cwd>
-Returns current working directory.
+Returns the current working directory.
=item C<Cygwin::pid_to_winpid>
@@ -610,8 +617,9 @@
Steven Morlock <newspost@morlock.net>,
Sebastien Barre <Sebastien.Barre@utc.fr>,
Teun Burgers <burgers@ecn.nl>,
-Gerrit P. Haase <gp@familiehaase.de>.
+Gerrit P. Haase <gp@familiehaase.de>,
+Reini Urban <rurban@x-ray.at>.
=head1 HISTORY
-Last updated: 2005-02-11
+Last updated: 2007-07-08
|
From @rurbanbug#38628-blead.patchdifforig perl-5.9.5/cygwin/cygwin.c perl-5.9.5/README.cygwin perl-5.9.5/t/lib/cygwin.t
2007-07-08 Reini Urban <rurban@x-ray.at>
diff -ub perl-5.9.5/cygwin/cygwin.c.orig perl-5.9.5/cygwin/cygwin.c
--- perl-5.9.5/cygwin/cygwin.c.orig 2007-07-07 13:40:25.000000000 +0000
+++ perl-5.9.5/cygwin/cygwin.c 2007-07-08 13:48:14.930125000 +0000
@@ -144,7 +144,10 @@
dXSARGS;
char *cwd;
- if(items != 0)
+ /* See http://rt.perl.org/rt3/Ticket/Display.html?id=38628
+ There is Cwd->cwd() usage in the wild, and previous versions didn't die.
+ */
+ if(items > 1)
Perl_croak(aTHX_ "Usage: Cwd::cwd()");
if((cwd = getcwd(NULL, -1))) {
ST(0) = sv_2mortal(newSVpv(cwd, 0));
@@ -193,7 +196,6 @@
XSRETURN_UNDEF;
}
-
void
init_os_extras(void)
{
@@ -202,8 +204,8 @@
void *handle;
newXS("Cwd::cwd", Cygwin_cwd, file);
- newXS("Cygwin::winpid_to_pid", XS_Cygwin_winpid_to_pid, file);
- newXS("Cygwin::pid_to_winpid", XS_Cygwin_pid_to_winpid, file);
+ newXSproto("Cygwin::winpid_to_pid", XS_Cygwin_winpid_to_pid, file, "$");
+ newXSproto("Cygwin::pid_to_winpid", XS_Cygwin_pid_to_winpid, file, "$");
/* Initialize Win32CORE if it has been statically linked. */
handle = dlopen(NULL, RTLD_LAZY);
diff -ub perl-5.9.5/README.cygwin.orig perl-5.9.5/README.cygwin
--- perl-5.9.5/README.cygwin.orig 2007-07-07 13:40:24.000000000 +0000
+++ perl-5.9.5/README.cygwin 2007-07-08 13:46:53.367625000 +0000
@@ -27,11 +27,11 @@
system calls and environment these programs expect. More information
about this project can be found at:
- http://www.cygwin.com/
+ F<http://www.cygwin.com/>
A recent net or commercial release of Cygwin is required.
-At the time this document was last updated, Cygwin 1.5.2 was current.
+At the time this document was last updated, Cygwin 1.5.24 was current.
=head2 Cygwin Configuration
@@ -143,9 +143,10 @@
BerkeleyDB is available for Cygwin.
-NOTE: The BerkeleyDB library only completely works on NTFS partitions.
+NOTE: The BerkeleyDB library only completely works on NTFS partitions
+and db-4.3 is flawed.
-=item * C<-lcygipc> (C<use IPC::SysV>)
+=item * C<cygserver> (C<use IPC::SysV>)
A port of SysV IPC is available for Cygwin.
@@ -276,15 +277,6 @@
make 2>&1 | tee log.make
-=head2 Errors on Cygwin
-
-Errors like these are normal:
-
- ...
- make: [extra.pods] Error 1 (ignored)
- ...
- make: [extras.make] Error 1 (ignored)
-
=head2 ld2 on Cygwin
During C<make>, I<ld2> will be created and installed in your $installbin
@@ -292,7 +284,7 @@
wait until the C<make install> process to install the I<ld2> script,
this is because the remainder of the C<make> refers to I<ld2> without
fully specifying its path and does this from multiple subdirectories.
-The assumption is that $installbin is in your current C<PATH>. If this
+The assumption is that I<$installbin> is in your current C<PATH>. If this
is not the case C<make> will fail at some point. If this happens,
just manually copy I<ld2> from the source directory to somewhere in
your C<PATH>.
@@ -303,7 +295,7 @@
make test 2>&1 | tee log.make-test
- cd t;./perl harness 2>&1 | tee ../log.harness
+ cd t; ./perl harness 2>&1 | tee ../log.harness
The same tests are run both times, but more information is provided when
running as C<./perl harness>.
@@ -323,8 +315,8 @@
have a F<.{com,bat,exe}> extension or begin with C<#!>, directories are
always readable and executable). On WinNT with the I<ntea> C<CYGWIN>
setting, the additional mode bits are stored as extended file attributes.
-On WinNT with the I<ntsec> C<CYGWIN> setting, permissions use the standard
-WinNT security descriptors and access control lists. Without one of
+On WinNT with the default I<ntsec> C<CYGWIN> setting, permissions use the
+standard WinNT security descriptors and access control lists. Without one of
these options, these tests will fail (listing not updated yet):
Failed Test List of failed
@@ -356,7 +348,7 @@
run Configure with the -Ui_ndbm and -Ui_dbm options to prevent
NDBM_File and ODBM_File being built.
-With NTFS (and CYGWIN=ntsec), there should be no problems even if
+With NTFS (and no CYGWIN=nontsec), there should be no problems even if
perl was built on FAT.
=head2 C<fork()> failures in io_* tests
@@ -395,12 +387,18 @@
contains a backslash or drive letter is a Win32 pathname (and not subject
to the translations applied to POSIX style pathnames).
+Pathnames may not contain Unicode characters. C<Cygwin> still uses the
+ANSI API calls and no Unicode calls because of newlib deficiencies.
+There's an unofficial unicode patch for cygwin at
+F<http://www.okisoft.co.jp/esc/utf8-cygwin/>
+
=item * Text/Binary
When a file is opened it is in either text or binary mode. In text mode
a file is subject to CR/LF/Ctrl-Z translations. With Cygwin, the default
mode for an C<open()> is determined by the mode of the mount that underlies
-the file. Perl provides a C<binmode()> function to set binary mode on files
+the file.
+Perl provides a C<binmode()> function to set binary mode on files
that otherwise would be treated as text. C<sysopen()> with the C<O_TEXT>
flag sets text mode on files that otherwise would be treated as binary:
@@ -475,6 +473,7 @@
200 [main] perl 377147 sync_with_child: child -395691(0xB8) died before initialization with status code 0x1
1370 [main] perl 377147 sync_with_child: *** child state child loading dlls
+This has been solved since 5.8.7 be using -Wl,--enable-auto-image-base for all shared libraries.
Use the rebase utility to resolve the conflicting dll addresses. The
rebase package is included in the Cygwin netrelease. Use setup.exe from
F<http://www.cygwin.com/setup.exe> to install it and run rebaseall.
@@ -487,7 +486,7 @@
=item C<Cwd::cwd>
-Returns current working directory.
+Returns the current working directory.
=item C<Cygwin::pid_to_winpid>
@@ -610,8 +609,9 @@
Steven Morlock <newspost@morlock.net>,
Sebastien Barre <Sebastien.Barre@utc.fr>,
Teun Burgers <burgers@ecn.nl>,
-Gerrit P. Haase <gp@familiehaase.de>.
+Gerrit P. Haase <gp@familiehaase.de>,
+Reini Urban <rurban@x-ray.at>.
=head1 HISTORY
-Last updated: 2005-02-11
+Last updated: 2007-07-08
diff -ub perl-5.9.5/t/lib/cygwin.t.orig perl-5.9.5/t/lib/cygwin.t
--- perl-5.9.5/t/lib/cygwin.t.orig 2007-07-07 13:40:24.000000000 +0000
+++ perl-5.9.5/t/lib/cygwin.t 2007-07-08 13:52:33.195750000 +0000
@@ -9,7 +9,7 @@
}
}
-use Test::More tests => 4;
+use Test::More tests => 5;
is(Cygwin::winpid_to_pid(Cygwin::pid_to_winpid($$)), $$,
"perl pid translates to itself");
@@ -29,3 +29,6 @@
is(Cygwin::winpid_to_pid($catwinpid), $catpid, "winpid to pid");
is(Cygwin::pid_to_winpid($catpid), $catwinpid, "pid to winpid");
close($cat);
+
+use Cwd;
+ok(Cwd->cwd(), "bug#38628 legacy");
|
From @smpetersOn Sun Jul 08 06:54:04 2007, rurban wrote:
Is this patch still needed? Steve Peters |
From jerry@hedden.usOn Fri, Nov 7, 2008 at 1:37 PM, Steve Peters via RT
The patches have been applied in blead, 5.10.x and 5.8.x. |
From @smpetersOn Fri Nov 07 11:03:49 2008, jerry@hedden.us wrote:
Excellent! This ticket can be closed. Steve |
@smpeters - Status changed from 'open' to 'resolved' |
From @rurban2008/11/7 Steve Peters via RT <perlbug-followup@perl.org>:
Thanks Jerry and Steve. -- |
Migrated from rt.perl.org#38628 (status was 'resolved')
Searchable as RT38628$
The text was updated successfully, but these errors were encountered: