Re: otp_build installer_win32 problems with visual studio 2017
Dan Gudmundsson <[email protected]> Fri, 28 Apr 2017 08:01:34 +0000
| Newsgroups | gmane.comp.lang.erlang.patches |
|---|---|
| Message-ID | <CANX4uuOJWQd_S1CascFXgfo-qzxBuBP2WoAsat+UMJqyovUkMQ@mail.gmail.com> |
--===============5748685859106235571== Content-Type: multipart/alternative; boundary=001a113c584810ec96054e357c49 --001a113c584810ec96054e357c49 Content-Type: text/plain; charset=UTF-8 A github pull request with the changes would be best way for us to review this. /Dan On Tue, Apr 25, 2017 at 4:25 PM Michael Stellar <[email protected]> wrote: > Hello, > > I don't know if either this question should be belong in > erlang-questions but i wanted to gather info or direction from erlang > windows developer specifically, since i have a fair practice and might > be known that it's better to use newest/newer msvc/windows c++ > compiler for it's better in assemblies generation and might be have > less bug in it for assemblies generation, so for those reasoning i > have been able to compile latest github vanilla using either msvc 2015 > or msvc 2017 using cygwin x64, i haven't test thorough-fully all of > the erlang functionality whether it's working fine in these newer > compiler. > > The used .bash_profile for msvc 2017 enterprise will be attached below > (some minor adjustments might be needed), other changes that needed to > compile is : > #Edit C:\cygwin64\home\Prodigy\src\otp\lib\wx\c_src\egl_impl.h , line 114 > ###############START OF CHANGES################################## > #elif defined(WIN32) && defined(_MSC_VER) > #if _MSC_VER == 1900 || _MSC_VER == 1910 > typedef int int32_t; > typedef __int64 int64_t; > typedef unsigned __int64 uint64_t; > #elif _MSC_VER < 1900 > typedef long int int32_t; > typedef __int64 int64_t; > typedef unsigned __int64 uint64_t; > #endif > ###############END OF CHANGES################################## > > and > > ##ON LINE 4371 in erts/configure.in add the following > ############### CHANGE INTO THE FOLLOWING > ################################## > AC_EGREP_CPP(yes,[ > ###############END OF CHANGES################################## > > The only last remaining problem is > src\otp\erts\etc\win32\nsis\find_redist.sh seems failed to finding > "vcredist_x64.exe"which is located in "C:\Program Files > (x86)\Microsoft Visual > Studio\2017\Enterprise\VC\Redist\MSVC\14.10.25008". > > The cl.exe for msvc 2017 enterprise is located in " C:\Program Files > (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64" > > Based on INSTAL_WIN32.md direction of recommending visual studio 12.0 > or 2013, the cl.exe location for msvc 2013 x64 is "C:\Program Files > (x86)\Microsoft Visual Studio 12.0\VC\bin\amd64". > > And the vcredist_x64.exe for msvc 2013 is "C:\Program Files > (x86)\Microsoft Visual Studio 12.0\VC\redist\1033". > > Based on these informations, and my noob attempt at sh shell scripting > i have got the following : > ###############START OF MODIFIED > find_redist.sh################################## > #! /bin/sh > # > # %CopyrightBegin% > # > # Copyright Ericsson AB 2007-2016. All Rights Reserved. > # > # Licensed under the Apache License, Version 2.0 (the "License"); > # you may not use this file except in compliance with the License. > # You may obtain a copy of the License at > # > # http://www.apache.org/licenses/LICENSE-2.0 > # > # Unless required by applicable law or agreed to in writing, software > # distributed under the License is distributed on an "AS IS" BASIS, > # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. > # See the License for the specific language governing permissions and > # limitations under the License. > # > # %CopyrightEnd% > # > > # first find some tool we know exists, i.e. cl.exe > lookup_prog_in_path () > { > PROG=$1 > save_ifs=$IFS > IFS=: > for p in $PATH; do > # In cygwin the programs are not always executable and have .exe suffix... > if [ "X$TARGET" = "Xwin32" ]; then > if [ -f $p/$PROG.exe ]; then > echo $p/$PROG > break; > fi > else > if [ -x $p/$PROG ]; then > echo $p/$PROG > break; > fi > fi > done > IFS=$save_ifs > } > > remove_path_element() > { > EL=$1 > PA=$2 > ACC="" > save_ifs=$IFS > IFS=/ > set $PA > N=$# > while [ $N -gt 1 ]; do > if [ '!' -z "$1" ]; then > ACC="${ACC}/$1" > fi > N=`expr $N - 1` > shift > done > UP=`echo $1 | tr [:lower:] [:upper:]` > ELUP=`echo $EL | tr [:lower:] [:upper:]` > IFS=$save_ifs > if [ "$UP" = "$ELUP" ]; then > echo "$ACC" > else > echo "${ACC}/$1" > fi > #echo "ACC=$ACC" >&2 > #echo "1=$1" >&2 > } > add_path_element() > { > EL=$1 > PA=$2 > > ELUP=`echo $EL | tr [:lower:] [:upper:]` > #echo "PA=$PA" >&2 > for x in ${PA}/*; do > #echo "X=$x" >&2 > UP=`basename "$x" | tr [:lower:] [:upper:]` > #echo "UP=$UP" >&2 > if [ "$UP" = "$ELUP" ]; then > echo "$x" > return 0; > fi > done > echo "$PA" > } > > > CLPATH=`lookup_prog_in_path cl` > > if [ -z "$CLPATH" ]; then > echo "Can not locate cl.exe and vcredist_x86/x64.exe - OK if using > mingw" >&2 > exit 1 > fi > > # Look to see if it's 64bit > XX=`remove_path_element cl "$CLPATH"` > YY=`remove_path_element x64 "$XX"` > if [ "$YY" != "$XX" ]; then > AMD64DIR=true > VCREDIST=vcredist_x64 > COMPONENTS="cl x64 hostx64 bin 14.10.25017 msvc tools vc" > else > AMD64DIR=false > VCREDIST=vcredist_x86 > COMPONENTS="cl bin vc" > fi > > if [ X"$1" = X"-n" ]; then > echo $VCREDIST.exe > exit 0 > fi > > # echo $CLPATH > BPATH=$CLPATH > for x in $COMPONENTS; do > # echo $x > NBPATH=`remove_path_element $x "$BPATH"` > if [ "$NBPATH" = "$BPATH" ]; then > echo "Failed to locate $VCREDIST.exe because cl.exe was in an > unexpected location" >&2 > exit 2 > fi > BPATH="$NBPATH" > done > BPATH_LIST=$BPATH > > # rc.exe is in the Microsoft SDK directory of VS2008 > RCPATH=`lookup_prog_in_path rc` > fail=false > if [ '!' -z "$RCPATH" ]; then > BPATH=$RCPATH > allow_fail=false > if [ $AMD64DIR = true ]; then > COMPONENTS="rc x64 bin @ANY v6.0A v7.0A v7.1" > else > COMPONENTS="rc bin @ANY v6.0A v7.0A v7.1" > fi > for x in $COMPONENTS; do > if [ $x = @ANY ]; then > allow_fail=true > else > NBPATH=`remove_path_element $x "$BPATH"` > if [ $allow_fail = false -a "$NBPATH" = "$BPATH" ]; then > fail=true > break; > fi > BPATH="$NBPATH" > fi > done > if [ $fail = false ]; then > BPATH_LIST="$BPATH_LIST $BPATH" > fi > fi > # echo "BPATH_LIST=$BPATH_LIST" > > # Frantic search through two roots with different > # version directories. We want to be very specific about the > # directory structures as we wouldnt want to find the wrong > # redistributables... > > #echo $BPATH_LIST > for BP in $BPATH_LIST; do > for verdir in "sdk v2.0" "sdk v3.5" "v6.0A" "v7.0" "v7.0A" "v7.1" > "VC redist 1033" "VC Redist MSVC 14.10.25008"; do > BPATH=$BP > fail=false > allow_fail=false > for x in $verdir @ANY bootstrapper packages $VCREDIST Redist VC @ALL > $VCREDIST.exe; do > #echo "x=$x" > #echo "BPATH=$BPATH" > #echo "allow_fail=$allow_fail" > if [ $x = @ANY ]; then > allow_fail=true > elif [ $x = @ALL ]; then > allow_fail=false > else > NBPATH=`add_path_element $x "$BPATH"` > if [ $allow_fail = false -a "$NBPATH" = "$BPATH" ]; then > fail=true > break; > fi > BPATH="$NBPATH" > fi > done > if [ $fail = false ]; then > break; > fi > done > if [ $fail = false ]; then > echo $BPATH > exit 0 > fi > done > > # shortcut for locating $VCREDIST.exe is to put it into $ERL_TOP > if [ -f $ERL_TOP/$VCREDIST.exe ]; then > echo $ERL_TOP/$VCREDIST.exe > exit 0 > fi > > # or $ERL_TOP/.. to share across multiple builds > if [ -f $ERL_TOP/../$VCREDIST.exe ]; then > echo $ERL_TOP/../$VCREDIST.exe > exit 0 > fi > > echo "Failed to locate $VCREDIST.exe because directory structure was > unexpected" >&2 > exit 3 > > ###############END OF MODIFIED > find_redist.sh################################## > > When running "./otp_build installer_win32" i have got the following > error "Failed to locate vcredist_x64.exe because cl.exe was in an > unexpected location". > > > Any of erlang windows developer wanted to add some more info about > these problems?. > > Cheers, > > > Michael > _______________________________________________ > erlang-patches mailing list > [email protected] > http://erlang.org/mailman/listinfo/erlang-patches > --001a113c584810ec96054e357c49 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr">A github pull request with the changes would be best way f= or us to review this.<div dir=3D"ltr"><div><br><div>/Dan</div></div></div><= br><div class=3D"gmail_quote"><div dir=3D"ltr">On Tue, Apr 25, 2017 at 4:25= PM Michael Stellar <<a href=3D"mailto:[email protected]" target=3D"= _blank">[email protected]</a>> wrote:<br></div><blockquote class=3D"= gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-= left:1ex">Hello,<br> <br> =C2=A0 =C2=A0 =C2=A0 =C2=A0I don't know if either this question should = be belong in<br> erlang-questions but i wanted to gather info or direction from erlang<br> windows developer specifically, since i have a fair practice and might<br> be known that it's better to use newest/newer msvc/windows c++<br> compiler for it's better in assemblies generation and might be have<br> less bug in it for assemblies generation, so for those reasoning i<br> have been able to compile latest github vanilla using either msvc 2015<br> or msvc 2017 using cygwin x64, i haven't test thorough-fully all of<br> the erlang functionality whether it's working fine in these newer<br> compiler.<br> <br> The used .bash_profile for msvc 2017 enterprise will be attached below<br> (some minor adjustments might be needed), other changes that needed to<br> compile is :<br> #Edit C:\cygwin64\home\Prodigy\src\otp\lib\wx\c_src\egl_impl.h , line 114<b= r> ###############START OF CHANGES##################################<br> #elif defined(WIN32) && defined(_MSC_VER)<br> #if _MSC_VER =3D=3D 1900 || _MSC_VER =3D=3D 1910<br> typedef int int32_t;<br> typedef __int64 int64_t;<br> typedef unsigned __int64 uint64_t;<br> #elif _MSC_VER < 1900<br> typedef long int int32_t;<br> typedef __int64 int64_t;<br> typedef unsigned __int64 uint64_t;<br> #endif<br> ###############END OF CHANGES##################################<br> <br> and<br> <br> ##ON LINE 4371 in erts/<a href=3D"http://configure.in" rel=3D"noreferrer" t= arget=3D"_blank">configure.in</a> add the following<br> ############### CHANGE INTO THE FOLLOWING #################################= #<br> AC_EGREP_CPP(yes,[<br> ###############END OF CHANGES##################################<br> <br> The only last remaining problem is<br> src\otp\erts\etc\win32\nsis\find_redist.sh seems failed to finding<br> "vcredist_x64.exe"which is located in "C:\Program Files<br> (x86)\Microsoft Visual<br> Studio\2017\Enterprise\VC\Redist\MSVC\14.10.25008".<br> <br> The cl.exe for msvc 2017 enterprise is located in " C:\Program Files<b= r> (x86)\Microsoft Visual Studio 14.0\VC\bin\amd64"<br> <br> Based on INSTAL_WIN32.md direction of recommending visual studio 12.0<br> or 2013, the cl.exe location for msvc 2013 x64 is "C:\Program Files<br= > (x86)\Microsoft Visual Studio 12.0\VC\bin\amd64".<br> <br> And the vcredist_x64.exe for msvc 2013 is "C:\Program Files<br> (x86)\Microsoft Visual Studio 12.0\VC\redist\1033".<br> <br> Based on these informations, and my noob attempt at sh shell scripting<br> i have got the following :<br> ###############START OF MODIFIED<br> find_redist.sh##################################<br> #! /bin/sh<br> #<br> # %CopyrightBegin%<br> #<br> # Copyright Ericsson AB 2007-2016. All Rights Reserved.<br> #<br> # Licensed under the Apache License, Version 2.0 (the "License");= <br> # you may not use this file except in compliance with the License.<br> # You may obtain a copy of the License at<br> #<br> #=C2=A0 =C2=A0 =C2=A0<a href=3D"http://www.apache.org/licenses/LICENSE-2.0"= rel=3D"noreferrer" target=3D"_blank">http://www.apache.org/licenses/LICENS= E-2.0</a><br> #<br> # Unless required by applicable law or agreed to in writing, software<br> # distributed under the License is distributed on an "AS IS" BASI= S,<br> # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.<= br> # See the License for the specific language governing permissions and<br> # limitations under the License.<br> #<br> # %CopyrightEnd%<br> #<br> <br> # first find some tool we know exists, i.e. cl.exe<br> lookup_prog_in_path ()<br> {<br> =C2=A0 =C2=A0 PROG=3D$1<br> =C2=A0 =C2=A0 save_ifs=3D$IFS<br> =C2=A0 =C2=A0 IFS=3D:<br> =C2=A0 =C2=A0 for p in $PATH; do<br> # In cygwin the programs are not always executable and have .exe suffix...<= br> if [ "X$TARGET" =3D "Xwin32" ]; then<br> =C2=A0 =C2=A0if [ -f $p/$PROG.exe ]; then<br> echo $p/$PROG<br> break;<br> =C2=A0 =C2=A0fi<br> else<br> =C2=A0 =C2=A0if [ -x $p/$PROG ]; then<br> echo $p/$PROG<br> break;<br> =C2=A0 =C2=A0fi<br> fi<br> =C2=A0 =C2=A0 done<br> =C2=A0 =C2=A0 IFS=3D$save_ifs<br> }<br> <br> remove_path_element()<br> {<br> =C2=A0 =C2=A0 EL=3D$1<br> =C2=A0 =C2=A0 PA=3D$2<br> =C2=A0 =C2=A0 ACC=3D""<br> =C2=A0 =C2=A0 save_ifs=3D$IFS<br> =C2=A0 =C2=A0 IFS=3D/<br> =C2=A0 =C2=A0 set $PA<br> =C2=A0 =C2=A0 N=3D$#<br> =C2=A0 =C2=A0 while [ $N -gt 1 ]; do<br> if [ '!' -z "$1" ]; then<br> =C2=A0 =C2=A0ACC=3D"${ACC}/$1"<br> fi<br> N=3D`expr $N - 1`<br> shift<br> =C2=A0 =C2=A0 done<br> =C2=A0 =C2=A0 UP=3D`echo $1 | tr [:lower:] [:upper:]`<br> =C2=A0 =C2=A0 ELUP=3D`echo $EL | tr [:lower:] [:upper:]`<br> =C2=A0 =C2=A0 IFS=3D$save_ifs<br> =C2=A0 =C2=A0 if [ "$UP" =3D "$ELUP" ]; then<br> echo "$ACC"<br> =C2=A0 =C2=A0 else<br> echo "${ACC}/$1"<br> =C2=A0 =C2=A0 fi<br> =C2=A0 =C2=A0 #echo "ACC=3D$ACC" >&2<br> =C2=A0 =C2=A0 #echo "1=3D$1" >&2<br> }<br> add_path_element()<br> {<br> =C2=A0 =C2=A0 EL=3D$1<br> =C2=A0 =C2=A0 PA=3D$2<br> <br> =C2=A0 =C2=A0 ELUP=3D`echo $EL | tr [:lower:] [:upper:]`<br> =C2=A0 =C2=A0 #echo "PA=3D$PA" >&2<br> =C2=A0 =C2=A0 for x in ${PA}/*; do<br> #echo "X=3D$x" >&2<br> UP=3D`basename "$x" | tr [:lower:] [:upper:]`<br> #echo "UP=3D$UP" >&2<br> if [ "$UP" =3D "$ELUP" ]; then<br> =C2=A0 =C2=A0echo "$x"<br> =C2=A0 =C2=A0return 0;<br> fi<br> =C2=A0 =C2=A0 done<br> =C2=A0 =C2=A0 echo "$PA"<br> }<br> <br> <br> CLPATH=3D`lookup_prog_in_path cl`<br> <br> if [ -z "$CLPATH" ]; then<br> =C2=A0 =C2=A0 echo "Can not locate cl.exe and vcredist_x86/x64.exe - O= K if using<br> mingw" >&2<br> =C2=A0 =C2=A0 exit 1<br> fi<br> <br> # Look to see if it's 64bit<br> XX=3D`remove_path_element cl "$CLPATH"`<br> YY=3D`remove_path_element x64 "$XX"`<br> if [ "$YY" !=3D "$XX" ]; then<br> =C2=A0 =C2=A0 AMD64DIR=3Dtrue<br> =C2=A0 =C2=A0 VCREDIST=3Dvcredist_x64<br> =C2=A0 =C2=A0 COMPONENTS=3D"cl x64 hostx64 bin 14.10.25017 msvc tools = vc"<br> else<br> =C2=A0 =C2=A0 AMD64DIR=3Dfalse<br> =C2=A0 =C2=A0 VCREDIST=3Dvcredist_x86<br> =C2=A0 =C2=A0 COMPONENTS=3D"cl bin vc"<br> fi<br> <br> if [ X"$1" =3D X"-n" ]; then<br> =C2=A0 =C2=A0 echo $VCREDIST.exe<br> =C2=A0 =C2=A0 exit 0<br> fi<br> <br> # echo $CLPATH<br> BPATH=3D$CLPATH<br> for x in $COMPONENTS; do<br> =C2=A0 =C2=A0 # echo $x<br> =C2=A0 =C2=A0 NBPATH=3D`remove_path_element $x "$BPATH"`<br> =C2=A0 =C2=A0 if [ "$NBPATH" =3D "$BPATH" ]; then<br> echo "Failed to locate $VCREDIST.exe because cl.exe was in an<br> unexpected location" >&2<br> exit 2<br> =C2=A0 =C2=A0 fi<br> =C2=A0 =C2=A0 BPATH=3D"$NBPATH"<br> done<br> BPATH_LIST=3D$BPATH<br> <br> # rc.exe is in the Microsoft SDK directory of VS2008<br> RCPATH=3D`lookup_prog_in_path rc`<br> fail=3Dfalse<br> if [ '!' -z "$RCPATH" ]; then<br> =C2=A0 =C2=A0 BPATH=3D$RCPATH<br> =C2=A0 =C2=A0 allow_fail=3Dfalse<br> =C2=A0 =C2=A0 if [ $AMD64DIR =3D true ]; then<br> COMPONENTS=3D"rc x64 bin @ANY v6.0A v7.0A v7.1"<br> =C2=A0 =C2=A0 else<br> COMPONENTS=3D"rc bin @ANY v6.0A v7.0A v7.1"<br> =C2=A0 =C2=A0 fi<br> =C2=A0 =C2=A0 for x in $COMPONENTS; do<br> if [ $x =3D @ANY ]; then<br> =C2=A0 =C2=A0allow_fail=3Dtrue<br> else<br> =C2=A0 =C2=A0NBPATH=3D`remove_path_element $x "$BPATH"`<br> =C2=A0 =C2=A0if [ $allow_fail =3D false -a "$NBPATH" =3D "$B= PATH" ]; then<br> fail=3Dtrue<br> break;<br> =C2=A0 =C2=A0fi<br> =C2=A0 =C2=A0BPATH=3D"$NBPATH"<br> fi<br> =C2=A0 =C2=A0 done<br> =C2=A0 =C2=A0 if [ $fail =3D false ]; then<br> BPATH_LIST=3D"$BPATH_LIST $BPATH"<br> =C2=A0 =C2=A0 fi<br> fi<br> # echo "BPATH_LIST=3D$BPATH_LIST"<br> <br> # Frantic search through two roots with different<br> # version directories. We want to be very specific about the<br> # directory structures as we wouldnt want to find the wrong<br> # redistributables...<br> <br> #echo $BPATH_LIST<br> for BP in $BPATH_LIST; do<br> =C2=A0 =C2=A0 for verdir in "sdk v2.0" "sdk v3.5" "= ;v6.0A" "v7.0" "v7.0A" "v7.1"<br> "VC redist 1033" "VC Redist MSVC 14.10.25008"; do<br> BPATH=3D$BP<br> fail=3Dfalse<br> allow_fail=3Dfalse<br> for x in $verdir @ANY bootstrapper packages $VCREDIST Redist VC @ALL<br> $VCREDIST.exe; do<br> =C2=A0 =C2=A0#echo "x=3D$x"<br> =C2=A0 =C2=A0#echo "BPATH=3D$BPATH"<br> =C2=A0 =C2=A0#echo "allow_fail=3D$allow_fail"<br> =C2=A0 =C2=A0if [ $x =3D @ANY ]; then<br> allow_fail=3Dtrue<br> =C2=A0 =C2=A0elif [ $x =3D @ALL ]; then<br> allow_fail=3Dfalse<br> =C2=A0 =C2=A0else<br> NBPATH=3D`add_path_element $x "$BPATH"`<br> if [ $allow_fail =3D false -a "$NBPATH" =3D "$BPATH" ];= then<br> =C2=A0 =C2=A0fail=3Dtrue<br> =C2=A0 =C2=A0break;<br> fi<br> BPATH=3D"$NBPATH"<br> =C2=A0 =C2=A0fi<br> done<br> if [ $fail =3D false ]; then<br> =C2=A0 =C2=A0break;<br> fi<br> =C2=A0 =C2=A0 done<br> =C2=A0 =C2=A0 if [ $fail =3D false ]; then<br> echo $BPATH<br> exit 0<br> =C2=A0 =C2=A0 fi<br> done<br> <br> # shortcut for locating $VCREDIST.exe is to put it into $ERL_TOP<br> if [ -f $ERL_TOP/$VCREDIST.exe ]; then<br> =C2=A0 =C2=A0 echo $ERL_TOP/$VCREDIST.exe<br> =C2=A0 =C2=A0 exit 0<br> fi<br> <br> # or $ERL_TOP/.. to share across multiple builds<br> if [ -f $ERL_TOP/../$VCREDIST.exe ]; then<br> =C2=A0 =C2=A0 echo $ERL_TOP/../$VCREDIST.exe<br> =C2=A0 =C2=A0 exit 0<br> fi<br> <br> echo "Failed to locate $VCREDIST.exe because directory structure was<b= r> unexpected" >&2<br> exit 3<br> <br> ###############END OF MODIFIED find_redist.sh##############################= ####<br> <br> When running "./otp_build installer_win32" i have got the followi= ng<br> error "Failed to locate vcredist_x64.exe because cl.exe was in an<br> unexpected location".<br> <br> <br> Any of erlang windows developer wanted to add some more info about<br> these problems?.<br> <br> Cheers,<br> <br> <br> Michael<br> _______________________________________________<br> erlang-patches mailing list<br> <a href=3D"mailto:[email protected]" target=3D"_blank">erlang-patch= [email protected]</a><br> <a href=3D"http://erlang.org/mailman/listinfo/erlang-patches" rel=3D"norefe= rrer" target=3D"_blank">http://erlang.org/mailman/listinfo/erlang-patches</= a><br> </blockquote></div></div> --001a113c584810ec96054e357c49-- --===============5748685859106235571== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ erlang-patches mailing list [email protected] http://erlang.org/mailman/listinfo/erlang-patches --===============5748685859106235571==--