engine icon indicating copy to clipboard operation
engine copied to clipboard

Can't build on win 10, vs2019

Open Andrysky opened this issue 3 years ago • 13 comments

win 10, vs2019

step to reproduce

cd C:\git\github\
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"
git clone --recurse-submodules [email protected]:openssl/openssl.git
cd openssl
git checkout openssl-3.0
perl Configure VC-WIN64A
nmake
nmake test
cd gost-engine
mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release -DOPENSSL_ROOT_DIR=C:\git\github\openssl\ -DOPENSSL_ENGINES_DIR=C:\git\github\openssl\engines\ ..

- fail

C:\git\github\openssl\gost-engine\gost_pmeth.c(39,17): error C2220: the following warning is treated as an error [C:\git\github\openssl\gost-engine\build\gost_core.vcxproj]
C:\git\github\openssl\gost-engine\gost_md.c(54,45): error C2059: syntax error: ':' [C:\git\github\openssl\gost-engine\build\gost_core.vcxproj]
etc

ninja also doesn't work

cd C:\git\github\openssl\gost-engine\
mkdir cmake-build-ninja
cd cmake-build-ninja
cmake -DCMAKE_BUILD_TYPE=Release -DOPENSSL_ROOT_DIR=C:\git\github\openssl\ -DOPENSSL_ENGINES_DIR=C:\git\github\openssl\engines\ -G=Ninja ..

CMake Error:
  Running
   'C:/PROGRA~2/MICROS~2/2019/COMMUN~1/Common7/IDE/COMMON~1/MICROS~1/CMake/Ninja/ninja.exe' '-C' 'C:/git/github/openssl/gost-engine/cmake-build-ninja' '-t' 'recompact'
  failed with:
   ninja: error: build.ninja:876: multiple rules generate bin/gost.dll [-w dupbuild=err]

Andrysky avatar Nov 29 '21 12:11 Andrysky

What warning, BTW?

beldmit avatar Nov 29 '21 14:11 beldmit

What warning, BTW?

https://gist.github.com/Andrysky/a1cd1054a5f35bcdb7f076514eb16ab5

Andrysky avatar Nov 29 '21 18:11 Andrysky

OK, try commenting out the line https://github.com/gost-engine/engine/blob/5a399b81e811c28c016fbc0315a9c78593eda1f9/gosthash2012_ref.h#L15

beldmit avatar Nov 29 '21 19:11 beldmit

+- the same https://gist.github.com/Andrysky/265d8ee02ac404540ac3a61c8b308f91

about ninja and multiple rules generate bin/gost.dll https://github.com/gost-engine/engine/blob/master/CMakeLists.txt#L335 https://github.com/gost-engine/engine/blob/master/CMakeLists.txt#L343 for what reasons the shared library is declared twice? - it's like the same thing ..

Andrysky avatar Nov 29 '21 20:11 Andrysky

Please turn off -Werror.

beldmit avatar Nov 29 '21 20:11 beldmit

/WX - disabled:

C:\git\github\openssl\gost-engine\gost_md.c(54,45): error C2059: syntax error: ':' [C:\git\github\openssl\gost-engine\build\gost_core.vcxproj]
C:\git\github\openssl\gost-engine\gost_md.c(67,5): error C2059: syntax error: 'if' [C:\git\github\openssl\gost-engine\build\gost_core.vcxproj]
C:\git\github\openssl\gost-engine\gost_md.c(69,6): error C2143: syntax error: missing '{' before '->' [C:\git\github\openssl\gost-engine\build\gost_core.vcxproj]
C:\git\github\openssl\gost-engine\gost_md.c(69,6): error C2059: syntax error: '->' [C:\git\github\openssl\gost-engine\build\gost_core.vcxproj]
C:\git\github\openssl\gost-engine\gost_md.c(70,5): error C2059: syntax error: 'return' [C:\git\github\openssl\gost-engine\build\gost_core.vcxproj]
C:\git\github\openssl\gost-engine\gost_md.c(71,1): error C2059: syntax error: '}' [C:\git\github\openssl\gost-engine\build\gost_core.vcxproj]
C:\git\github\openssl\gost-engine\gost_crypt.c(91,22): error C2059: syntax error: ':' [C:\git\github\openssl\gost-engine\build\gost_core.vcxproj]
C:\git\github\openssl\gost-engine\gost_crypt.c(104,9): error C2059: syntax error: ':' [C:\git\github\openssl\gost-engine\build\gost_core.vcxproj]C:\git\github\openssl\gost-engine\gost_crypt.c(106,5): error C2181: illegal else without matching if [C:\git\github\openssl\gost-engine\build\gost_core.vcxproj]
C:\git\github\openssl\gost-engine\gost_crypt.c(110,60): error C2059: syntax error: ':' [C:\git\github\openssl\gost-engine\build\gost_core.vcxproj]
C:\git\github\openssl\gost-engine\gost_crypt.c(123,6): error C2143: syntax error: missing '{' before '->' [C:\git\github\openssl\gost-engine\build\gost_core.vcxproj]
C:\git\github\openssl\gost-engine\gost_crypt.c(123,6): error C2059: syntax error: '->' [C:\git\github\openssl\gost-engine\build\gost_core.vcxproj]
C:\git\github\openssl\gost-engine\gost_crypt.c(124,5): error C2059: syntax error: 'return' [C:\git\github\openssl\gost-engine\build\gost_core.vcxproj]
C:\git\github\openssl\gost-engine\gost_crypt.c(125,1): error C2059: syntax error: '}' [C:\git\github\openssl\gost-engine\build\gost_core.vcxproj]

Andrysky avatar Nov 29 '21 20:11 Andrysky

@vt-alt sorry, I don't understand this macro

https://github.com/gost-engine/engine/blob/5a399b81e811c28c016fbc0315a9c78593eda1f9/gost_md.c#L39

And I'm afraid, the compiler also doesn't.

beldmit avatar Nov 29 '21 21:11 beldmit

@vt-alt sorry, I don't understand this macro

https://github.com/gost-engine/engine/blob/5a399b81e811c28c016fbc0315a9c78593eda1f9/gost_md.c#L39

And I'm afraid, the compiler also doesn't.

Do you mean ternary operator? Perhaps, MSVC does not understand it.

vt-alt avatar Nov 29 '21 21:11 vt-alt

#define TPL(st,field) ( \
    ((st)->field) ?: TPL_VAL(st,field) \
)

Could be replaced with

#define TPL(st,field) ( \
    ((st)->field) ? ((st)->field) : TPL_VAL(st,field) \
)

vt-alt avatar Nov 29 '21 21:11 vt-alt

Somewhen I need to setup the github CI scenario for Windows build...

beldmit avatar Nov 29 '21 21:11 beldmit

Somewhen I need to setup the github CI scenario for Windows build...

Thought about this today too. ;)

vt-alt avatar Nov 29 '21 21:11 vt-alt

This OPEN issue is from 2021. Any updates? Cheers.

sfhacker avatar Apr 08 '23 06:04 sfhacker

I still don't have any access to Windows development machine. The patches are welcome.

beldmit avatar Apr 08 '23 07:04 beldmit