perl11 / cperl

A perl5 with classes, types, compilable, company friendly, security
http://perl11.org/
Other
142 stars 17 forks source link

windows smoker #44

Closed rurban closed 8 years ago

rurban commented 9 years ago

appveyor only supports Visual Studio 2014 and 2015, but perl5 only supports the older msvc versions. mingw smoking failed so far on appveyor.

bulk88 commented 9 years ago

VC 2014 doesn't exist. Do you mean VC 2013? P5P 5.22.0 and P5P 5.20.0 officially supports VC 2013 so cperl does too. VC 2015 wont be P5P supported for a long time if ever due to MS libc being rewritten from scratch by MS in C++ for no good reason for the 2015 release. P5P blead doesnt support VC 2015.

The appveyor failure which I am copyign below I can easily reproduce.

Build started
git config --global core.autocrlf input
git clone -q --depth=1 https://github.com/perl11/cperl.git C:\projects\cperl
git fetch -q origin +refs/pull/48/merge:
git checkout -qf FETCH_HEAD
cd win32
call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64
nmake WIN64=1 CCTYPE=MSVC120

Microsoft (R) Program Maintenance Utility Version 14.00.23026.0
Copyright (C) Microsoft Corporation. All rights reserved.

del /f config.h
Could Not Find C:\projects\cperl\win32\config.h
copy config_H.vc config.h
1 file(s) copied.
if not exist ".\mini" mkdir ".\mini"
cl -c -nologo -GF -W3 -I..\lib\CORE -I.\include -I. -I.. -DWIN32 -D_CONSOLE -DNO_STRICT -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -DPERLDLL -DPERL_CORE -O1 -MD -Zi -DNDEBUG -GL -DPERL_EXTERNAL_GLOB -DPERL_IS_MINIPERL -Fo.\mini\av.obj ..\av.c
av.c
c:\projects\cperl\perl.h(679): fatal error C1083: Cannot open include file: 'sys/types.h': No such file or directory 
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\cl.EXE"' : return code '0x2'
Stop.
Command exited with code 2

my reproduction

C:\sources\cperl\win32>set INCLUDE=

C:\sources\cperl\win32>dmake test  CCTYPE=MSVC70
dmake:  makefile.mk:  line 1309:  Warning: -- Duplicate target [mini\dump.obj]
dmake:  makefile.mk:  line 1309:  Warning: -- Duplicate target [mini\pp_sys.obj]

dmake:  makefile.mk:  line 1309:  Warning: -- Duplicate target [mini\toke.obj]
dmake:  makefile.mk:  line 1309:  Warning: -- Duplicate target [mini\utf8.obj]
dmake:  makefile.mk:  line 1330:  Warning: -- Duplicate target [mini\dump.obj]
dmake:  makefile.mk:  line 1330:  Warning: -- Duplicate target [mini\pp_sys.obj]

dmake:  makefile.mk:  line 1330:  Warning: -- Duplicate target [mini\toke.obj]
dmake:  makefile.mk:  line 1330:  Warning: -- Duplicate target [mini\utf8.obj]
dmake:  makefile.mk:  line 1334:  Warning: -- Duplicate target [..\dump.obj]
dmake:  makefile.mk:  line 1334:  Warning: -- Duplicate target [..\pp_sys.obj]
dmake:  makefile.mk:  line 1334:  Warning: -- Duplicate target [..\toke.obj]
dmake:  makefile.mk:  line 1334:  Warning: -- Duplicate target [..\utf8.obj]
if not exist ".\mini" mkdir ".\mini"
if exist config.h del /f config.h
copy config_H.vc config.h
        1 file(s) copied.
rem. > .\mini\.exists
cl -c -nologo -GF -W3 -I.\include -I. -I.. -DWIN32 -D_CONSOLE -DNO_STRICT -DPERL
DLL -DPERL_CORE                  -O1 -MD -Zi -DNDEBUG -GL  -DPERL_EXTERNAL_GLOB
-DPERL_IS_MINIPERL -Fomini\toke.obj -Fdmini\toke.pdb ..\toke.c
toke.c
c:\sources\cperl\perl.h(679) : fatal error C1083: Cannot open include file: 'sys
/types.h': No such file or directory
dmake:  Error code 130, while making 'mini\toke.obj'

C:\sources\cperl\win32>

something isn't right with

call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64
nmake WIN64=1 CCTYPE=MSVC120

The env vars are never actually set in the parent console. The "call" looks suspicious and maybe wrong but I dont have time to research it this minue.

rurban commented 9 years ago

I try to configure a win32 smoker.

appveyor offers only Visual Studio 2014 CTP4, whatever that means and Visual Studio 2015. Also mingw, but I couldn't get it to install the needed dev packages.

bulk88 commented 9 years ago

CTP = MS term for beta/alpha release. Very unusual for anyone to use a beta compiler but if that is all we have to work with, might as well try it. Maybe CTP4 doesn't have enough of the libc changes to break Perl 5.22 unlike 2015 Gold.

I think I know why the INCLUDE env var is screwed up. Each line in appveyor config file runs in its own console/env. You have to set the env vars and run the make tool in the same command line.

example

"C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\bin\vcvars32.bat" & dmake CCTYPE=MSVC70

use nmake instead obviously.

More detailed testing of the theory. Notice cl and link alone printed nothing (they fatally errored with popups that dlls were missing) but worked fine after the env vars were set.

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\Documents and Settings\Owner>cd C:\sources\cperl\win32

C:\sources\cperl\win32>dmakepath

C:\sources\cperl\win32>set PATH=C:\sperl\c\bin;C:\Program Files\Windows Resource
 Kits\Tools\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32\wbem;C:\Program
Files\ActiveState Perl Dev Kit 8.0\bin;C:\Program Files\ActiveState Komodo IDE 4
;C:\Perl\site\bin;C:\Perl\bin;C:\Program Files\Microsoft Visual Studio .NET 2003
\Vc7\bin;C:\Program Files\Common Files\Compuware;C:\Program Files\Common Files\C
ompuware\NMShared;C:\Program Files\Compuware\DevPartner Studio\Analysis;C:\Progr
am Files\Git\cmd;C:\Program Files\TortoiseGit\bin;C:\Program Files\OpenVPN\bin;C
:\Program Files\PDFtk\bin\;C:\Program Files\LLVM\bin;C:\Program Files\Intel\WiFi
\bin\

C:\sources\cperl\win32>cl

C:\sources\cperl\win32>link

C:\sources\cperl\win32>"C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\b
in\vcvars32.bat" & dmake CCTYPE=MSVC70

C:\sources\cperl\win32>"C:\Program Files\Microsoft Visual Studio .NET 2003\Commo
n7\Tools\vsvars32.bat"
Setting environment for using Microsoft Visual Studio .NET 2003 tools.
(If you have another version of Visual Studio or Visual C++ installed and wish
to use its tools from the command line, run vcvars32.bat for that version.)
dmake:  makefile.mk:  line 1309:  Warning: -- Duplicate target [mini\dump.obj]
dmake:  makefile.mk:  line 1309:  Warning: -- Duplicate target [mini\pp_sys.obj]

dmake:  makefile.mk:  line 1309:  Warning: -- Duplicate target [mini\toke.obj]
dmake:  makefile.mk:  line 1309:  Warning: -- Duplicate target [mini\utf8.obj]
dmake:  makefile.mk:  line 1330:  Warning: -- Duplicate target [mini\dump.obj]
dmake:  makefile.mk:  line 1330:  Warning: -- Duplicate target [mini\pp_sys.obj]

dmake:  makefile.mk:  line 1330:  Warning: -- Duplicate target [mini\toke.obj]
dmake:  makefile.mk:  line 1330:  Warning: -- Duplicate target [mini\utf8.obj]
dmake:  makefile.mk:  line 1334:  Warning: -- Duplicate target [..\dump.obj]
dmake:  makefile.mk:  line 1334:  Warning: -- Duplicate target [..\pp_sys.obj]
dmake:  makefile.mk:  line 1334:  Warning: -- Duplicate target [..\toke.obj]
dmake:  makefile.mk:  line 1334:  Warning: -- Duplicate target [..\utf8.obj]
if not exist ".\mini" mkdir ".\mini"
if exist config.h del /f config.h
copy config_H.vc config.h
        1 file(s) copied.
rem. > .\mini\.exists
cl -c -nologo -GF -W3 -I.\include -I. -I.. -DWIN32 -D_CONSOLE -DNO_STRICT -DPERL
DLL -DPERL_CORE                  -O1 -MD -Zi -DNDEBUG -GL  -DPERL_EXTERNAL_GLOB
-DPERL_IS_MINIPERL -Fomini\toke.obj -Fdmini\toke.pdb ..\toke.c
toke.c
cl -c -nologo -GF -W3 -I.\include -I. -I.. -DWIN32 -D_CONSOLE -DNO_STRICT -DPERL
DLL -DPERL_CORE                  -O1 -MD -Zi -DNDEBUG -GL  -DPERL_EXTERNAL_GLOB
-DPERL_IS_MINIPERL -Fomini\regcomp.obj -Fdmini\regcomp.pdb ..\regcomp.c
regcomp.c
cl -c -nologo -GF -W3 -I.\include -I. -I.. -DWIN32 -D_CONSOLE -DNO_STRICT -DPERL
DLL -DPERL_CORE                  -O1 -MD -Zi -DNDEBUG -GL  -DPERL_EXTERNAL_GLOB
-DPERL_IS_MINIPERL -Fomini\regexec.obj -Fdmini\regexec.pdb ..\regexec.c
regexec.c
cl -c -nologo -GF -W3 -I.\include -I. -I.. -DWIN32 -D_CONSOLE -DNO_STRICT -DPERL
DLL -DPERL_CORE                  -O1 -MD -Zi -DNDEBUG -GL  -DPERL_EXTERNAL_GLOB
-DPERL_IS_MINIPERL -Fomini\op.obj -Fdmini\op.pdb ..\op.c
op.c
op.c(8594) : warning C4244: 'function' : conversion from 'cv_flags_t' to 'char',
 possible loss of data
cl -c -nologo -GF -W3 -I.\include -I. -I.. -DWIN32 -D_CONSOLE -DNO_STRICT -DPERL
DLL -DPERL_CORE                  -O1 -MD -Zi -DNDEBUG -GL  -DPERL_EXTERNAL_GLOB
-DPERL_IS_MINIPERL -Fomini\sv.obj -Fdmini\sv.pdb ..\sv.c
sv.c
cl -c -nologo -GF -W3 -I.\include -I. -I.. -DWIN32 -D_CONSOLE -DNO_STRICT -DPERL
DLL -DPERL_CORE                  -O1 -MD -Zi -DNDEBUG -GL  -DPERL_EXTERNAL_GLOB
-DPERL_IS_MINIPERL -Fomini\pp.obj -Fdmini\pp.pdb ..\pp.c
pp.c
cl -c -nologo -GF -W3 -I.\include -I. -I.. -DWIN32 -D_CONSOLE -DNO_STRICT -DPERL
DLL -DPERL_CORE                  -O1 -MD -Zi -DNDEBUG -GL  -DPERL_EXTERNAL_GLOB
-DPERL_IS_MINIPERL -Fomini\pp_ctl.obj -Fdmini\pp_ctl.pdb ..\pp_ctl.c
pp_ctl.c
cl -c -nologo -GF -W3 -I.\include -I. -I.. -DWIN32 -D_CONSOLE -DNO_STRICT -DPERL
DLL -DPERL_CORE                  -O1 -MD -Zi -DNDEBUG -GL  -DPERL_EXTERNAL_GLOB
-DPERL_IS_MINIPERL -Fomini\pp_sys.obj -Fdmini\pp_sys.pdb ..\pp_sys.c
pp_sys.c
cl -c -nologo -GF -W3 -I.\include -I. -I.. -DWIN32 -D_CONSOLE -DNO_STRICT -DPERL
DLL -DPERL_CORE                  -O1 -MD -Zi -DNDEBUG -GL  -DPERL_EXTERNAL_GLOB
-DPERL_IS_MINIPERL -Fomini\pp_pack.obj -Fdmini\pp_pack.pdb ..\pp_pack.c
pp_pack.c
cl -c -nologo -GF -W3 -I.\include -I. -I.. -DWIN32 -D_CONSOLE -DNO_STRICT -DPERL
DLL -DPERL_CORE                  -O1 -MD -Zi -DNDEBUG -GL  -DPERL_EXTERNAL_GLOB
-DPERL_IS_MINIPERL -Fomini\pp_hot.obj -Fdmini\pp_hot.pdb ..\pp_hot.c
pp_hot.c
cl -c -nologo -GF -W3 -I.\include -I. -I.. -DWIN32 -D_CONSOLE -DNO_STRICT -DPERL
DLL -DPERL_CORE                  -O1 -MD -Zi -DNDEBUG -GL  -DPERL_EXTERNAL_GLOB
-DPERL_IS_MINIPERL -Fomini\gv.obj -Fdmini\gv.pdb ..\gv.c
gv.c
Caught SIGINT. Trying to quit ...
dmake:  Warning: -- Internal Warning: finished pid 2012 is not in pq!?
C:\sources\cperl\win32>
bulk88 commented 9 years ago

Looking at http://www.appveyor.com/docs/installed-software#visual-studio-2013 says they support 2013. Why are you saying you only have a VC 2014 CTP/Beta and 2015 available?

rurban commented 9 years ago

Interesting, thanks. It's not in their pulldown menu. I'll try them via yaml.

rurban commented 9 years ago

Here we have it. Their documentation is wrong: https://ci.appveyor.com/project/rurban/cperl/build/5.22.1.144 Job: Build worker image 'Visual Studio 2013' not found

bulk88 commented 9 years ago
Visual Studio Community 2015 RTM with Visual Studio 2015 SDK are installed on a separate build worker image called Visual Studio 2015. You can select build worker image in "OS" dropdown on Environment tab of project settings or if you use appveyor.yml add that line:

From that paragraph, it sounds like all VC versions EXCEPT 2015 are on some other unnamed image. VC 2015 is in a image just by itself. Sounds like the licensing deal is "all legacy VC versions come together when appveyor bought the MSDN Super Pro Extra Archive Plus license from MS" while 2015 is "current VC version is only available in a license by itself", hence 2 different images. VC 2013 would be a legacy version since it isnt current.

nwellnhof commented 8 years ago

The standard Appveyor image comes with the Windows SDK that includes MSVC 10 (from Visual Studio 2010). But IIRC, you must provide your own .bat or .cmd file to set up the compiler and run the build. Running something like

call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64

from appveyor.yml doesn't keep the environment variables for subsequent commands. Here's the setup we use for Apache Clownfish:

https://github.com/apache/lucy-clownfish/blob/master/appveyor.yml https://github.com/apache/lucy-clownfish/blob/master/devel/bin/appveyor-build.bat

rurban commented 8 years ago

Thanks, looks a bit better now. See https://ci.appveyor.com/project/rurban/cperl/build/5.22.2.575/job/qyhmf52pr0ewm4jk

bulk88 commented 8 years ago
NMAKE : fatal error U1077: '..\miniperl.exe' : return code '0xc0000005'

0xc0000005=SEGV

I tried building cperl on Win32 with master branch at https://github.com/perl11/cperl/commit/35e5d0c861976bbaceafd6bbd2e17e5347f7f8c0 , miniperl didn't segv but ext/Config is C syntax erroring again.

rurban commented 8 years ago

Without WIN64=1 it builds miniperl.exe, cperl522.lib and perl.exe, thanks! https://ci.appveyor.com/project/rurban/cperl/build/job/8204qcsrxo0b6u2m

ext/Config/Config_xs.in(930) : warning C4129: 'p' : unrecognized character escape sequence
ext/Config/Config_xs.in(957) : error C2059: syntax error : ','
ext/Config/Config_xs.in(411) : fatal error C1013: compiler limit : too many open parentheses
rurban commented 8 years ago

Handling the Config error in #78 I'll close this, 32bit and mingw support maybe later.