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

Problem and "solution" for building 5.10.0 with win32+mingw+dmake #9246

Closed
p5pRT opened this issue Mar 9, 2008 · 9 comments
Closed

Problem and "solution" for building 5.10.0 with win32+mingw+dmake #9246

p5pRT opened this issue Mar 9, 2008 · 9 comments

Comments

@p5pRT
Copy link

p5pRT commented Mar 9, 2008

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

Searchable as RT51562$

@p5pRT
Copy link
Author

p5pRT commented Mar 9, 2008

From k.a.skotheim@usit.uio.no

Created by kjetilsk@usit.uio.no

Problem and "solution" for building perl-5.10.0 with Win32+MinGW+dmake

' ' ' ' ' ' ' ' ' ' ' ' Problem​: ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '

C​:\download\perl-5.10.0\win32> dmake -f makefile.mk
.
.
.
.
.
..\miniperl.exe -I..\lib ..\mkppport
'cd"' is not recognized as an internal or external command,
operable program or batch file.
'cd"' is not recognized as an internal or external command,
operable program or batch file.
WARNING​: no such directory​: \ext\Time\HiRes
WARNING​: no such directory​: \ext\Win32API\File
xcopy /f /r /i /d /y ..\*.h ..\lib\CORE\*.*
0 File(s) copied
..\miniperl.exe -I..\lib buildext.pl dmake -S perldll.def ..\ext --dynamic
'cd"' is not recognized as an internal or external command,
operable program or batch file.
\..\miniperl.exe \..\win32\bin\pl2bat.pl \..\win32\bin\pl2bat.pl
'\..\miniperl.exe' is not recognized as an internal or external command,
operable program or batch file.
'cd"' is not recognized as an internal or external command,
operable program or batch file.
Cannot cd to
dmake​: Error code 130, while making 'Extensions'

C​:\download\perl-5.10.0\win32>

As you can see the problem started in mkppport with​:
'cd"' is not recognized...

' ' ' ' ' ' ' ' ' ' ' ' A solution, sort of​: ' ' ' ' ' ' ' ' ' ' ' ' ' ' '
' ' '

The complaint about 'cd"' came from sub _os2_cwd in lib/Cwd.pm

What is it doing in _os2_cwd?

I changed​:

*_NT_cwd = defined &Win32​::GetCwd ? \&_win32_cwd : \&_os2_cwd;

To​:

*_NT_cwd = \&_win32_cwd;

On line 681 in lib/Cwd.pm

I understand that this is not a correct solition for the os2-folks, but it
got me through all three stages​:

dmake -f makefile.mk
dmake -f makefile.mk test (with some minor fails)
dmake -f makefile.mk install

I did not have the same problem building 5.8.8 on the same computer using
the same tools (mingw+dmake) yesterday.

Keep up the good work! Perl is fantastic!

Perl Info

Flags:
     category=install
     severity=critical

Site configuration information for perl 5.10.0:

Configured by Tarzan at Sun Mar  9 16:32:06 2008.

Summary of my perl5 (revision 5 version 10 subversion 0) configuration:
   Platform:
     osname=MSWin32, osvers=5.1, archname=MSWin32-x86-multi-thread
     uname=''
     config_args='undef'
     hint=recommended, useposix=true, d_sigaction=undef
     useithreads=define, usemultiplicity=define
     useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef
     use64bitint=undef, use64bitall=undef, uselongdouble=undef
     usemymalloc=n, bincompat5005=undef
   Compiler:
     cc='gcc', ccflags =' -s -O2 -DWIN32 -DHAVE_DES_FCRYPT   
-DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -fno-strict-aliasing  
-DPERL_MSVCRT_READFIX',
     optimize='-s -O2',
     cppflags='-DWIN32'
     ccversion='', gccversion='3.4.5', gccosandvers=''
     intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=1234
     d_longlong=undef, longlongsize=8, d_longdbl=define, longdblsize=12
     ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='long long',  
lseeksize=8
     alignbytes=8, prototype=define
   Linker and Libraries:
     ld='g++', ldflags ='-s -L"u:\perl510\lib\CORE" -L"C:\MinGW\lib"'
     libpth=C:\MinGW\lib
     libs=-lmsvcrt -lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool  
-lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid  
-lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32
     perllibs=-lmsvcrt -lmoldname -lkernel32 -luser32 -lgdi32 -lwinspool  
-lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -lnetapi32 -luuid  
-lws2_32 -lmpr -lwinmm -lversion -lodbc32 -lodbccp32
     libc=-lmsvcrt, so=dll, useshrplib=true, libperl=libperl510.a
     gnulibc_version=''
   Dynamic Linking:
     dlsrc=dl_win32.xs, dlext=dll, d_dlsymun=undef, ccdlflags=' '
     cccdlflags=' ', lddlflags='-mdll -s -L"u:\perl510\lib\CORE"  
-L"C:\MinGW\lib"'

Locally applied patches:



@INC for perl 5.10.0:
     u:/perl510/lib
     u:/perl510/site/lib
     .


Environment for perl 5.10.0:
     HOME (unset)
     LANG (unset)
     LANGUAGE (unset)
     LD_LIBRARY_PATH (unset)
     LOGDIR (unset)
     PATH=C:\MinGW\bin;C:\Program Files\ActiveState Perl Dev Kit  
7.1\bin;C:\Program Files\ActiveState Komodo IDE  
4.2\;C:\oraclexe\app\oracle\product\10.2.0\server\bin;C:\Perl\bin\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program  
Files\Network Associates\PGPNT;C:\Program  
Files\QuickTime\QTSystem\;C:\Program Files\Microsoft Network Monitor  
3\;C:\MinGW\bin;C:\Program Files\ActiveState Perl Dev Kit  
7.1\bin;C:\Program Files\ActiveState Komodo IDE  
4.2\;C:\oraclexe\app\oracle\product\10.2.0\server\bin;C:\Perl\bin\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program  
Files\Network Associates\PGPNT;C:\Program  
Files\QuickTime\QTSystem\;C:\Program Files\Microsoft Network Monitor  
3\;C:\PROGRA~1\COMMON~1\MUVEET~1\030625
     PERL5DB=BEGIN { require 'perl5db.pl'; }
     PERL_BADLANG (unset)
     SHELL (unset)




@p5pRT
Copy link
Author

p5pRT commented Mar 10, 2008

From @jandubois

On Sun, 09 Mar 2008, Kjetil Skotheim (via RT) wrote​:

' ' ' ' ' ' ' ' ' ' ' ' Problem​: ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '

C​:\download\perl-5.10.0\win32> dmake -f makefile.mk
.
..\miniperl.exe -I..\lib ..\mkppport
'cd"' is not recognized as an internal or external command,
operable program or batch file.
[...]

As you can see the problem started in mkppport with​:
'cd"' is not recognized...

' ' ' ' ' ' ' ' ' ' ' ' A solution, sort of​: ' ' ' ' ' ' ' ' ' ' ' ' ' ' '

The complaint about 'cd"' came from sub _os2_cwd in lib/Cwd.pm

What is it doing in _os2_cwd?

The code should indeed run through _win32_cwd instead of _os2_cwd,
but that should not really matter in reality, as the code that is
being executed under miniperl is virtually the same. The only difference
is that the OS/2 version executed `cmd /c cd` instead of just `cd`.

The real question is​: where does the spurious double-quote come from?
Your output would indicate that you are trying to execute `cd"`, but I
cannot find this in the official sources.

Cheers,
-Jan

@p5pRT
Copy link
Author

p5pRT commented Mar 10, 2008

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

@p5pRT
Copy link
Author

p5pRT commented Jul 28, 2009

From b244145@tyldd.com

On Sun Mar 09 21​:30​:57 2008, jdb wrote​:

On Sun, 09 Mar 2008, Kjetil Skotheim (via RT) wrote​:

' ' ' ' ' ' ' ' ' ' ' ' Problem​: ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' '

C​:\download\perl-5.10.0\win32> dmake -f makefile.mk
.
..\miniperl.exe -I..\lib ..\mkppport
'cd"' is not recognized as an internal or external command,
operable program or batch file.
[...]

As you can see the problem started in mkppport with​:
'cd"' is not recognized...

' ' ' ' ' ' ' ' ' ' ' ' A solution, sort of​: ' ' ' ' ' ' ' ' ' ' ' '
' ' '

The complaint about 'cd"' came from sub _os2_cwd in lib/Cwd.pm

What is it doing in _os2_cwd?

The code should indeed run through _win32_cwd instead of _os2_cwd,
but that should not really matter in reality, as the code that is
being executed under miniperl is virtually the same. The only difference
is that the OS/2 version executed `cmd /c cd` instead of just `cd`.

The real question is​: where does the spurious double-quote come from?
Your output would indicate that you are trying to execute `cd"`, but I
cannot find this in the official sources.

the cd" comes from _os2_cwd

sub _os2_cwd {
  $ENV{'PWD'} = `cmd /c cd`;
  chomp $ENV{'PWD'};
  $ENV{'PWD'} =~ s​:\\​:/​:g ;
  return $ENV{'PWD'};
}

i believe perl adds "" quotes when invoking the shell,
and miniperl messes up

  D​:\>cmd "/c cd"
'cd"' is not recognized as an internal or external command,
operable program or batch file.

Since miniperl doesn't have dynaloader, doesn't have Win32, better patch
would be

  *_NT_cwd = $^O eq 'os2' ? \&_os2_cwd : \&_win32_cwd ;

since $^O eq 'os2' is already used other places in Cwd

@p5pRT
Copy link
Author

p5pRT commented Oct 22, 2009

From @kmx

Hi Jan and Kjetil,

I have experienced exactly the same problem with Cwd while building
5.11.1 for Win32 with mingw compiler.

1) I propose slightly different patch that is IMHO a little bit safer.
See attached cwd_patch.diff

2) The question remains why this peace of code ...

my $d=`cmd /c cd`;
print $d;

... works on 5.8.9/Win32 however does not work on 5.10|5.11/Win32 - was
it intentional change of behaviour?

--
kmx

@p5pRT
Copy link
Author

p5pRT commented Oct 22, 2009

From @kmx

cwd_patch.diff
diff -r -u perl-5.11.1.orig/cpan/Cwd/Cwd.pm perl-5.11.1/cpan/Cwd/Cwd.pm
--- perl-5.11.1.orig/cpan/Cwd/Cwd.pm    2009-10-20 15:40:16.000000000 +0200
+++ perl-5.11.1/cpan/Cwd/Cwd.pm 2009-10-22 13:55:26.828948900 +0200
@@ -747,6 +747,13 @@
     return $ENV{'PWD'};
 }

+sub _win32_cwd_simple {
+    $ENV{'PWD'} = `cd`;
+    chomp $ENV{'PWD'};
+    $ENV{'PWD'} =~ s:\\:/:g ;
+    return $ENV{'PWD'};
+}
+
 sub _win32_cwd {
     if (eval 'defined &DynaLoader::boot_DynaLoader') {
        $ENV{'PWD'} = Win32::GetCwd();
@@ -758,7 +765,7 @@
     return $ENV{'PWD'};
 }

-*_NT_cwd = defined &Win32::GetCwd ? \&_win32_cwd : \&_os2_cwd;
+*_NT_cwd = defined &Win32::GetCwd ? \&_win32_cwd : \&_win32_cwd_simple;

 sub _dos_cwd {
     if (!defined &Dos::GetCwd) {

@p5pRT
Copy link
Author

p5pRT commented Jan 15, 2010

From @kmx

I have just noticed a post by uservolk(at)mail.ru to p5p list exactly on
issue discussed in this RT.

The important conclusion I have discovered when dealing with this
"maybe-bug" was that it happens if you have in your PATH variable "bin"
directory from MSYS environment - e.g. c​:\MSYS\bin - before your
c​:\windows\system32 dir (where cmd.exe exists).

The problem is that the file "c​:\MSYS\bin\cmd" (in fact script) is
executed instead of real cmd.exe (from system32 dir) and this causes the
described problem.

Anyway I still think that a patch I have proposed in my previous post to
#51562 is worth considering.

--
kmx

@p5pRT
Copy link
Author

p5pRT commented Oct 4, 2010

From @cpansprout

On Thu Oct 22 05​:08​:29 2009, kmxx wrote​:

See attached cwd_patch.diff

Thank you. Applied as 8440aeb.

@p5pRT
Copy link
Author

p5pRT commented Oct 4, 2010

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

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

No branches or pull requests

1 participant