aisouard / libwebrtc

:package: Google's WebRTC implementation in a single static library.
https://axel.isouard.fr/libwebrtc
Apache License 2.0
641 stars 190 forks source link

Cmake fails when WEBRTC_REVISION is set on Windows and Linux #29

Closed juliao closed 7 years ago

juliao commented 7 years ago

Hi, I am using the HEAD version and stuck while setting a specific revision.

Using the cmake-gui 3.7.1 and VisualStudio 2015 x64 on Windows 8.1, I got the following messages when set WEBRTC_REVISION to 9660627c9dc3a9e53b66e6baa5417e16b964a744.

   Entering             D:/_Projects/libwebrtc/Targets
CMake Error at CMakeModules/LibWebRTCCommand.cmake:22 (add_dependencies):
  add_dependencies called with incorrect number of arguments
Call Stack (most recent call first):
  Targets/CMakeLists.txt:42 (libwebrtc_command)

   Returning to         D:/_Projects/libwebrtc
Configuring incomplete, errors occurred!

And in Ubuntu 16.04 x64 with cmake 3.5.1, I got the following messages while running this command:

juliao@server:~/tmp/libwebrtc2/build$ cmake -DWEBRTC_REVISION=9660627c9dc3a9e53b66e6baa5417e16b964a744 ..
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found Git: /usr/bin/git (found version "2.7.4")
-- Found DepotTools: /home/juliao/webrtc/depot_tools/gclient
-- Found PythonInterp: /usr/bin/python (found version "2.7.12")
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
-- Found X11: /usr/lib/x86_64-linux-gnu/libX11.so
-- Looking for __i386__
-- Looking for __i386__ - not found
-- Looking for __x86_64__
-- Looking for __x86_64__ - found
-- Looking for __arm__
-- Looking for __arm__ - not found
-- Looking for __aarch64__
-- Looking for __aarch64__ - not found
-- Looking for __mips__
-- Looking for __mips__ - not found
CMake Error at CMakeModules/LibWebRTCCommand.cmake:22 (add_dependencies):
  add_dependencies called with incorrect number of arguments
Call Stack (most recent call first):
  Targets/CMakeLists.txt:42 (libwebrtc_command)

-- Configuring incomplete, errors occurred!
See also "/home/juliao/tmp/libwebrtc2/build/CMakeFiles/CMakeOutput.log".
See also "/home/juliao/tmp/libwebrtc2/build/CMakeFiles/CMakeError.log".

Edit: Previously I pasted the wrong message from linux, because I was on the wrong commit. I am now on the commit b66819521811789959abd5b500b0d7df2bcdb46f.

Thank you.

aisouard commented 7 years ago

Hello, thank you for the report. The issue has been fixed quickly in bc67c8f, I'm testing under Windows right now.

juliao commented 7 years ago

It is working now, I tested in Linux and Windows, thank you for the quick fix.

Edit: Actually just the cmake pass worked in Windows, I got an error compiling in VisualStudio 2015, see the attached log. The build in Linux works fine.

build_vs2015.txt

Best regards.

thedracle commented 7 years ago

Any details on the least recent version of WebRTC the build scripts are compatible with?

I'm trying to go back to an early revision: 75c8fb4b2c138b99f6bb7ffa6e2f415594116eed

And it is bombing out on the webrtc-update-clang steps because certain scripts are missing.

aisouard commented 7 years ago

@thedracle I've removed support for older revisions needing to retrieve the whole Chromium repository. See #19 and https://groups.google.com/forum/#!searchin/discuss-webrtc/chromium/discuss-webrtc/xAp2t1EDbDY/Q9-kn6U_DgAJ

I'll take a deeper look tonight and tell if I can add support to retrieve revisions older than December 22nd 2016: https://chromium.googlesource.com/external/webrtc/+/177567c518b121731e507e9b9c4049c4dc96e4c8

It wouldn't be the same as before, since it was just cloning a minimalist version of the Chromium repository, it will simply call sync_chromium.py instead.

thedracle commented 7 years ago

@aisouard

Awesome, this is an incredibly useful tool, and is saving me an enormous amount of time.

I'm simply having some issues with the master build that weren't occurring in the build hash (Deployed and used in production now), so this is at least a starting point for me to bisect where it started breaking.

Thanks for the details, and for this project.

aisouard commented 7 years ago

Your welcome, I'm glad to see that this project is useful for you :)

30 has been opened to track the backward compatibility progress.

aisouard commented 7 years ago

@juliao, just saw your edit!

8>    CMake Error at cmake_install.cmake:38 (file):
8>      file INSTALL cannot find
8>      "D:/_Projects/libwebrtc/build/libwebrtc/Release/webrtc.lib".

Did you try to delete the build folder and regenerate a clean Visual Studio project ? Cleaning the whole Visual Studio solution should be enough.

juliao commented 7 years ago

Hi, I did a new git clone and submodules init and update, but in that specific commit (9660627c9dc3a9e53b66e6baa5417e16b964a744) this error occurs. I tested with the default config, without setting WEBRTC_REVISION and works, except that I have to hit REBUILD_ALL one time, because an error always occur, this was happening before, just in VisualStudio, I hit the BUILD_ALL and after all code is downloaded, the error occurs, so I hit REBUILD_ALL and the compile time starts and finish without errors. Attached you can see the log of this happening, first the BUILD_ALL and then the REBUILD_ALL.

I realized that I don't need to use this specific commit on Windows, I can use the HEAD of 57 which is working, I will use this commit only on Linux, that is now working after your fix.

Since the default config don't build in the first time, just after a rebuild, maybe there is some problem. I am using the Visual Studio Enterprise 2015 Update 3, let me know if you wish I make some test.

Thank you.

1-default_config-build.txt 2-default_config-rebuild.txt

aisouard commented 7 years ago

I have the same issue, the webrtc-vs-toolchain is failing with the following error:

9>  IOError: [Errno 2] No such file or directory: 'C:\\Program Files (x86)\\Windows Kits\\10\\Debuggers\\x64\\cdb.exe'
9>  ERROR at //build/toolchain/win/BUILD.gn:38:3: Script returned non-zero exit code.
9>    exec_script("../../vs_toolchain.py",
9>    ^----------

Happening in Debug mode, with the latest depot_tools.

aisouard commented 7 years ago

Things have changed since December 8, 2016: https://chromium.googlesource.com/chromium/src/+/master/docs/windows_build_instructions.md#Visual-Studio

Install the Windows SDK 10, and choose Debugging Tools For Windows when you install this in order to get windbg and cdb. The latter is required for the build to succeed as some tests use it for symbolizing crash dumps.

I'm installing the Windows Driver Kit, then I'll update the README.md file with new instructions for Windows.

aisouard commented 7 years ago

Fixed in 80281d8afa0415a5fc097f92cfd677ab8a6af5d3