mumble-voip / mumble-releng

Mumble Release Engineering
Other
17 stars 21 forks source link

build-all.bash - CMake fails when generating NMake files for protobuf #64

Closed snaiperskaya96 closed 3 years ago

snaiperskaya96 commented 6 years ago

It just fails when it gets to protobuf (so all the other dependencies just work) while building for win32-static. I haven't really found anything around about the issue.

I'm running win10 64x with the latest(-ish) creator update (1709).

I have both, VS2017 and VS2015 (update 3) installed. I firstly had VS2017 installed, then installed VS2015 to build mumble. Not sure if this may cause any trouble

 cmd /c 'C:\MumbleBuild\win32-static-1.3.x-2017-07-21-957dd83-868\cmake\bin\cmake.exe' -G 'NMake Makefiles' -DCMAKE_BU
ILD_TYPE=RelWithDebInfo '-DCMAKE_INSTALL_PREFIX=C:\MumbleBuild\win32-static-1.3.x-2017-07-21-957dd83-868\protobuf' -Dpr
otobuf_MSVC_STATIC_RUNTIME=off
-- The C compiler identification is MSVC 19.0.24215.1
-- The CXX compiler identification is MSVC 19.0.24215.1
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe -- broken
CMake Error at C:/MumbleBuild/win32-static-1.3.x-2017-07-21-957dd83-868/cmake/share/cmake-3.7/Modules/CMakeTestCCompiler.cmake:51 (message):
  The C compiler "C:/Program Files (x86)/Microsoft Visual Studio
  14.0/VC/bin/cl.exe" is not able to compile a simple test program.

  It fails with the following output:

   Change Dir: C:/MumbleBuild/win32-static-1.3.x-2017-07-21-957dd83-868.build/protobuf-3.2.0/cmake/CMakeFiles/CMakeTmp

  Run Build Command:"nmake" "/NOLOGO" "cmTC_cace6\fast"

        "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\nmake.exe" -f
  CMakeFiles\cmTC_cace6.dir\build.make /nologo -L
  CMakeFiles\cmTC_cace6.dir\build

  Building C object CMakeFiles/cmTC_cace6.dir/testCCompiler.c.obj

        C:\PROGRA~2\MICROS~1.0\VC\bin\cl.exe
  @C:\MumbleBuild\win32-static-1.3.x-2017-07-21-957dd83-868\cygwin\tmp\nm9CCB.tmp

  testCCompiler.c

  Linking C executable cmTC_cace6.exe

        C:\MumbleBuild\win32-static-1.3.x-2017-07-21-957dd83-868\cmake\bin\cmake.exe
  -E vs_link_exe --intdir=CMakeFiles\cmTC_cace6.dir --manifests --
  C:\PROGRA~2\MICROS~1.0\VC\bin\link.exe /nologo
  @CMakeFiles\cmTC_cace6.dir\objects1.rsp
  @C:\MumbleBuild\win32-static-1.3.x-2017-07-21-957dd83-868\cygwin\tmp\nm9D2A.tmp

  RC Pass 1 failed to run.

  NMAKE : fatal error U1077:
  'C:\MumbleBuild\win32-static-1.3.x-2017-07-21-957dd83-868\cmake\bin\cmake.exe'
  : return code '0xffffffff'

  Stop.

  NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio
  14.0\VC\BIN\nmake.exe"' : return code '0x2'

  Stop.

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:12 (project)

-- Configuring incomplete, errors occurred!
See also "C:/MumbleBuild/win32-static-1.3.x-2017-07-21-957dd83-868.build/protobuf-3.2.0/cmake/CMakeFiles/CMakeOutput.log".
See also "C:/MumbleBuild/win32-static-1.3.x-2017-07-21-957dd83-868.build/protobuf-3.2.0/cmake/CMakeFiles/CMakeError.log
".

CMake logs attached CMakeError.log CMakeOutput.log

mkrautz commented 6 years ago

I think you're hit by this problem: https://gitlab.kitware.com/cmake/cmake/issues/16849

This is judging purely from the RC Pass 1 failed to run. line in CMakeError.log.

But I don't understand the reasoning in the CMake issue.

Anyway, can you check if you have CMake in your PATH?

From the Cygwin shell, try where.exe rc.exe... On my system, I get:

C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A\Bin\RC.Exe
C:\Program Files (x86)\Windows Kits\10\bin\x86\rc.exe
mkrautz commented 6 years ago

Also, since this is win32-static (not win64-static) it's trying to use the XP toolset, which uses the Win 7.1A SDK. We explicitly include that in PATH. As you can see from my PATH, it gets rc.exe from the 7.1A SDK.

If you DO have rc.exe in your PATH, please try the VERBOSE env var that is suggested in the CMake issue. Perhaps that will tell us something new.

Thanks.

snaiperskaya96 commented 6 years ago

Thanks for the answer mkrautz. Looks like i don't have RC.exe in my path, will try to install the win7.1a sdk and will be back to you.

mkrautz commented 6 years ago

Hm, the Win7.1A SDK should be installed by Visual Studio 2015. It's called Windows XP compatibility (or something like that) in the installer. So don't install it manually (I don't think it's available standalone) -- do it via the VS2015 installer.

snaiperskaya96 commented 6 years ago

For now i've got it from here https://www.microsoft.com/en-us/download/confirmation.aspx?id=8279. It looks like RC.exe is in there but by default the installer points to "Program Files" rather than "Program Files(x86)" which makes me think it's the 32bit version (might be okay for the win32 build i guess). Tomorrow I will check if it works this way otherwise i can just, as you said, install it via VS2015.

mkrautz commented 6 years ago

The 7.1A SDK shipped with VS2015 is, to my knowledge, not equivalent to that one. It's modified to work with newer toolchains, etc.

I am also not sure that it's actually "7.1a"? EDIT: What I mean to say here is: I am not sure the one you downloaded is 7.1a. I think it might just be 7.1? (or similar)

Anyway. if you build win64-static instead, it should not rely on the XP-compatible SDK. Then it'll use the Windows 10 SDK.

snaiperskaya96 commented 6 years ago

Okay, good news, i made it, thank you. Win32 build:

Win64 build:

        "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\nmake.exe" -f Makefile.Release

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

        "C:\Program Files (x86)\Windows Kits\10\\bin\x64\rc.exe" -DWIN32 -DWIN64 -DUSE_BUILDENV -DRESTRICT= -DUSE_MINHOOK -DNDEBUG -D_WINDLL -fo release\mumble_ol.res mumble_ol.rc
'C:\Program' is not recognized as an internal or external command,
operable program or batch file.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Windows Kits\10\\bin\x64\rc.exe' : return code '0x1'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.

Edit: Update on the error above Actually that path was empty, it doesn't have any .exe into there, i made a symlink (mklink /J "C:\Program Files (x86)\Windows Kits\10\bin\x64" "C:\Program Files (x86)\Windows Kits\10\bin\10.0.16299.0\x64") and now it compiles correctly without errors

jj777 commented 4 years ago

Hi, just for more info - I'm trying to set up a Mumble env on Windows using the instructions in win32-static/README, I found the error (in the original post) was related to this:

https://stackoverflow.com/questions/43847542/rc-exe-no-longer-found-in-vs-2015-command-prompt

I went back and feeling like this was a setup issue I re-ran the VS2015 Update 3 setup and told it to add

Windows and Web Development -> Universal Windows App Development Tools -> Tools (1.4.1) and Windows 10 SDK (10.0.14393)

Doing this fixed this it for me.

Kissaki commented 3 years ago

So the issue was a package not having been installed.

Our docs should include this information if it is missing, but as we migrated away in 1.4, have new docs for it, and this ticket has been stale for quite a while, I am closing it.