Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[libdatachannel] Add new port #13704

Merged
merged 15 commits into from Nov 23, 2020

Conversation

Nemirtingas
Copy link
Contributor

@Nemirtingas Nemirtingas commented Sep 24, 2020

Describe the pull request

  • What does your PR fix? Fixes [New Port Request] libdatachannel #13487, I'm also creating a port for libjuice.

  • Which triplets are supported/not supported?
    I tested on lwindows x86, x64 static library, static CRT, it works.
    I tested on linux, windows x86, x64 static library, it works.
    I tested on linux, windows x86, x64 dynamic library, it doesn't work, I didn't figure out how to add usrsctp to the CMake path, find_package(usrsctp CONFIG) doesn't work.

  • Have you updated the CI baseline? No ?

  • Does your PR follow the maintainer guide?
    The base CMake file builds 2 distinct libraries for static (which is not exported) and dynamic library. I've patched the CMakeLists.txt to build only the shared library and set it static if static library is picked in vcpkg.

This is my first port, please review carefully,

@JackBoosY JackBoosY added the category:new-port The issue is requesting a new library to be added; consider making a PR! label Sep 24, 2020
ports/libdatachannel/CONTROL Outdated Show resolved Hide resolved
ports/libdatachannel/CONTROL Outdated Show resolved Hide resolved
ports/libdatachannel/usage Outdated Show resolved Hide resolved
ports/libdatachannel/portfile.cmake Outdated Show resolved Hide resolved
@Nemirtingas
Copy link
Contributor Author

I've modified the files the way you asked.

@Nemirtingas Nemirtingas changed the title libdatachannel port [libdatachannel] Add new port Sep 26, 2020
@ras0219-msft
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@Nemirtingas
Copy link
Contributor Author

I'm updating this lib to version 0.9.2. It needs an updated usrsctp port.
Also the usrsctp port doesn't export any library and there is no usage file.

@JackBoosY
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

No pipelines are associated with this pull request.

@JackBoosY
Copy link
Contributor

@BillyONeal Our CI seems has problems, can you please take a look?

@BillyONeal
Copy link
Member

@JackBoosY CI is failing because this port adds Build-Depends: libjuice but libjuice is not a port.

@JackBoosY
Copy link
Contributor

We doesn't include port libjuice yet, please add it first.

@Nemirtingas
Copy link
Contributor Author

We doesn't include port libjuice yet, please add it first.

Its in progress: #13703

@JackBoosY JackBoosY added depends:different-pr This PR or Issue depends on a PR which has been filed and removed requires:author-response labels Oct 13, 2020
@Nemirtingas
Copy link
Contributor Author

libjuice has been merged, I'll work on this now.

@Nemirtingas
Copy link
Contributor Author

Can someone look at the fail logs ? I've built the port on Windows and Linux, everything seems fine.

Copy link
Member

@BillyONeal BillyONeal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Nemirtingas Looks like there's a dependency you didn't declare (see below).

I also observe that you have an "srtp" feature but aren't responding to the feature in portfile.cmake at all.

 [1/2] cmd /c "cd .. && "D:/downloads/tools/cmake-3.18.4-windows/cmake-3.18.4-win32-x86/bin/cmake.exe" "D:/buildtrees/libdatachannel/src/v0.9.4-4b1512394f.clean" "-DNO_WEBSOCKET=OFF" "-DNO_EXAMPLES=ON" "-DNO_TESTS=ON" "-DCMAKE_SYSTEM_NAME=WindowsStore" "-DCMAKE_SYSTEM_VERSION=10.0" "-DBUILD_SHARED_LIBS=ON" "-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=C:/a/1/s/scripts/toolchains/windows.cmake" "-DVCPKG_TARGET_TRIPLET=arm-uwp" "-DVCPKG_SET_CHARSET_FLAG=ON" "-DVCPKG_PLATFORM_TOOLSET=v142" "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY=ON" "-DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=TRUE" "-DCMAKE_VERBOSE_MAKEFILE=ON" "-DVCPKG_APPLOCAL_DEPS=OFF" "-DCMAKE_TOOLCHAIN_FILE=C:/a/1/s/scripts/buildsystems/vcpkg.cmake" "-DCMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION=ON" "-DVCPKG_CXX_FLAGS=" "-DVCPKG_CXX_FLAGS_RELEASE=" "-DVCPKG_CXX_FLAGS_DEBUG=" "-DVCPKG_C_FLAGS=" "-DVCPKG_C_FLAGS_RELEASE=" "-DVCPKG_C_FLAGS_DEBUG=" "-DVCPKG_CRT_LINKAGE=dynamic" "-DVCPKG_LINKER_FLAGS=" "-DVCPKG_LINKER_FLAGS_RELEASE=" "-DVCPKG_LINKER_FLAGS_DEBUG=" "-DVCPKG_TARGET_ARCHITECTURE=arm" "-DCMAKE_INSTALL_LIBDIR:STRING=lib" "-DCMAKE_INSTALL_BINDIR:STRING=bin" "-D_VCPKG_ROOT_DIR=C:/a/1/s" "-D_VCPKG_INSTALLED_DIR=D:/installed" "-DVCPKG_MANIFEST_INSTALL=OFF" "-AARM" "-G" "Visual Studio 16 2019" "-DCMAKE_BUILD_TYPE=Release" "-DCMAKE_INSTALL_PREFIX=D:/packages/libdatachannel_arm-uwp""
FAILED: ../CMakeCache.txt 
cmd /c "cd .. && "D:/downloads/tools/cmake-3.18.4-windows/cmake-3.18.4-win32-x86/bin/cmake.exe" "D:/buildtrees/libdatachannel/src/v0.9.4-4b1512394f.clean" "-DNO_WEBSOCKET=OFF" "-DNO_EXAMPLES=ON" "-DNO_TESTS=ON" "-DCMAKE_SYSTEM_NAME=WindowsStore" "-DCMAKE_SYSTEM_VERSION=10.0" "-DBUILD_SHARED_LIBS=ON" "-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=C:/a/1/s/scripts/toolchains/windows.cmake" "-DVCPKG_TARGET_TRIPLET=arm-uwp" "-DVCPKG_SET_CHARSET_FLAG=ON" "-DVCPKG_PLATFORM_TOOLSET=v142" "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY=ON" "-DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=TRUE" "-DCMAKE_VERBOSE_MAKEFILE=ON" "-DVCPKG_APPLOCAL_DEPS=OFF" "-DCMAKE_TOOLCHAIN_FILE=C:/a/1/s/scripts/buildsystems/vcpkg.cmake" "-DCMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION=ON" "-DVCPKG_CXX_FLAGS=" "-DVCPKG_CXX_FLAGS_RELEASE=" "-DVCPKG_CXX_FLAGS_DEBUG=" "-DVCPKG_C_FLAGS=" "-DVCPKG_C_FLAGS_RELEASE=" "-DVCPKG_C_FLAGS_DEBUG=" "-DVCPKG_CRT_LINKAGE=dynamic" "-DVCPKG_LINKER_FLAGS=" "-DVCPKG_LINKER_FLAGS_RELEASE=" "-DVCPKG_LINKER_FLAGS_DEBUG=" "-DVCPKG_TARGET_ARCHITECTURE=arm" "-DCMAKE_INSTALL_LIBDIR:STRING=lib" "-DCMAKE_INSTALL_BINDIR:STRING=bin" "-D_VCPKG_ROOT_DIR=C:/a/1/s" "-D_VCPKG_INSTALLED_DIR=D:/installed" "-DVCPKG_MANIFEST_INSTALL=OFF" "-AARM" "-G" "Visual Studio 16 2019" "-DCMAKE_BUILD_TYPE=Release" "-DCMAKE_INSTALL_PREFIX=D:/packages/libdatachannel_arm-uwp""
-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.
-- The CXX compiler identification is MSVC 19.27.29111.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.27.29110/bin/Hostx64/arm/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - not found
-- Found Threads: TRUE  
-- Could NOT find SRTP (missing: SRTP_INCLUDE_DIRS SRTP_LIBRARIES HAVE_SRTP_SRTP_H SRTP_VERSION) 
-- LibSRTP NOT found, compiling WITHOUT media transport
CMake Error at D:/downloads/tools/cmake-3.18.4-windows/cmake-3.18.4-win32-x86/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:165 (message):
  Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the
  system variable OPENSSL_ROOT_DIR (missing: OPENSSL_CRYPTO_LIBRARY
  OPENSSL_INCLUDE_DIR)
Call Stack (most recent call first):
  D:/downloads/tools/cmake-3.18.4-windows/cmake-3.18.4-win32-x86/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:458 (_FPHSA_FAILURE_MESSAGE)
  D:/downloads/tools/cmake-3.18.4-windows/cmake-3.18.4-win32-x86/share/cmake-3.18/Modules/FindOpenSSL.cmake:486 (find_package_handle_standard_args)
  C:/a/1/s/scripts/buildsystems/vcpkg.cmake:536 (_find_package)
  CMakeLists.txt:190 (find_package)


-- Configuring incomplete, errors occurred!
See also "D:/buildtrees/libdatachannel/arm-uwp-rel/CMakeFiles/CMakeOutput.log".
See also "D:/buildtrees/libdatachannel/arm-uwp-rel/CMakeFiles/CMakeError.log".
[2/2] cmd /c "cd ../../arm-uwp-dbg && "D:/downloads/tools/cmake-3.18.4-windows/cmake-3.18.4-win32-x86/bin/cmake.exe" "D:/buildtrees/libdatachannel/src/v0.9.4-4b1512394f.clean" "-DNO_WEBSOCKET=OFF" "-DNO_EXAMPLES=ON" "-DNO_TESTS=ON" "-DCMAKE_SYSTEM_NAME=WindowsStore" "-DCMAKE_SYSTEM_VERSION=10.0" "-DBUILD_SHARED_LIBS=ON" "-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=C:/a/1/s/scripts/toolchains/windows.cmake" "-DVCPKG_TARGET_TRIPLET=arm-uwp" "-DVCPKG_SET_CHARSET_FLAG=ON" "-DVCPKG_PLATFORM_TOOLSET=v142" "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY=ON" "-DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=TRUE" "-DCMAKE_VERBOSE_MAKEFILE=ON" "-DVCPKG_APPLOCAL_DEPS=OFF" "-DCMAKE_TOOLCHAIN_FILE=C:/a/1/s/scripts/buildsystems/vcpkg.cmake" "-DCMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION=ON" "-DVCPKG_CXX_FLAGS=" "-DVCPKG_CXX_FLAGS_RELEASE=" "-DVCPKG_CXX_FLAGS_DEBUG=" "-DVCPKG_C_FLAGS=" "-DVCPKG_C_FLAGS_RELEASE=" "-DVCPKG_C_FLAGS_DEBUG=" "-DVCPKG_CRT_LINKAGE=dynamic" "-DVCPKG_LINKER_FLAGS=" "-DVCPKG_LINKER_FLAGS_RELEASE=" "-DVCPKG_LINKER_FLAGS_DEBUG=" "-DVCPKG_TARGET_ARCHITECTURE=arm" "-DCMAKE_INSTALL_LIBDIR:STRING=lib" "-DCMAKE_INSTALL_BINDIR:STRING=bin" "-D_VCPKG_ROOT_DIR=C:/a/1/s" "-D_VCPKG_INSTALLED_DIR=D:/installed" "-DVCPKG_MANIFEST_INSTALL=OFF" "-AARM" "-G" "Visual Studio 16 2019" "-DCMAKE_BUILD_TYPE=Debug" "-DCMAKE_INSTALL_PREFIX=D:/packages/libdatachannel_arm-uwp/debug""
FAILED: ../../arm-uwp-dbg/CMakeCache.txt 
cmd /c "cd ../../arm-uwp-dbg && "D:/downloads/tools/cmake-3.18.4-windows/cmake-3.18.4-win32-x86/bin/cmake.exe" "D:/buildtrees/libdatachannel/src/v0.9.4-4b1512394f.clean" "-DNO_WEBSOCKET=OFF" "-DNO_EXAMPLES=ON" "-DNO_TESTS=ON" "-DCMAKE_SYSTEM_NAME=WindowsStore" "-DCMAKE_SYSTEM_VERSION=10.0" "-DBUILD_SHARED_LIBS=ON" "-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=C:/a/1/s/scripts/toolchains/windows.cmake" "-DVCPKG_TARGET_TRIPLET=arm-uwp" "-DVCPKG_SET_CHARSET_FLAG=ON" "-DVCPKG_PLATFORM_TOOLSET=v142" "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON" "-DCMAKE_FIND_PACKAGE_NO_SYSTEM_PACKAGE_REGISTRY=ON" "-DCMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP=TRUE" "-DCMAKE_VERBOSE_MAKEFILE=ON" "-DVCPKG_APPLOCAL_DEPS=OFF" "-DCMAKE_TOOLCHAIN_FILE=C:/a/1/s/scripts/buildsystems/vcpkg.cmake" "-DCMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION=ON" "-DVCPKG_CXX_FLAGS=" "-DVCPKG_CXX_FLAGS_RELEASE=" "-DVCPKG_CXX_FLAGS_DEBUG=" "-DVCPKG_C_FLAGS=" "-DVCPKG_C_FLAGS_RELEASE=" "-DVCPKG_C_FLAGS_DEBUG=" "-DVCPKG_CRT_LINKAGE=dynamic" "-DVCPKG_LINKER_FLAGS=" "-DVCPKG_LINKER_FLAGS_RELEASE=" "-DVCPKG_LINKER_FLAGS_DEBUG=" "-DVCPKG_TARGET_ARCHITECTURE=arm" "-DCMAKE_INSTALL_LIBDIR:STRING=lib" "-DCMAKE_INSTALL_BINDIR:STRING=bin" "-D_VCPKG_ROOT_DIR=C:/a/1/s" "-D_VCPKG_INSTALLED_DIR=D:/installed" "-DVCPKG_MANIFEST_INSTALL=OFF" "-AARM" "-G" "Visual Studio 16 2019" "-DCMAKE_BUILD_TYPE=Debug" "-DCMAKE_INSTALL_PREFIX=D:/packages/libdatachannel_arm-uwp/debug""
-- Selecting Windows SDK version 10.0.19041.0 to target Windows 10.0.
-- The CXX compiler identification is MSVC 19.27.29111.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Enterprise/VC/Tools/MSVC/14.27.29110/bin/Hostx64/arm/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Looking for C++ include pthread.h
-- Looking for C++ include pthread.h - not found
-- Found Threads: TRUE  
-- Could NOT find SRTP (missing: SRTP_INCLUDE_DIRS SRTP_LIBRARIES HAVE_SRTP_SRTP_H SRTP_VERSION) 
-- LibSRTP NOT found, compiling WITHOUT media transport
CMake Error at D:/downloads/tools/cmake-3.18.4-windows/cmake-3.18.4-win32-x86/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:165 (message):
  Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the
  system variable OPENSSL_ROOT_DIR (missing: OPENSSL_CRYPTO_LIBRARY
  OPENSSL_INCLUDE_DIR)
Call Stack (most recent call first):
  D:/downloads/tools/cmake-3.18.4-windows/cmake-3.18.4-win32-x86/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:458 (_FPHSA_FAILURE_MESSAGE)
  D:/downloads/tools/cmake-3.18.4-windows/cmake-3.18.4-win32-x86/share/cmake-3.18/Modules/FindOpenSSL.cmake:486 (find_package_handle_standard_args)
  C:/a/1/s/scripts/buildsystems/vcpkg.cmake:536 (_find_package)
  CMakeLists.txt:190 (find_package)


-- Configuring incomplete, errors occurred!
See also "D:/buildtrees/libdatachannel/arm-uwp-dbg/CMakeFiles/CMakeOutput.log".
See also "D:/buildtrees/libdatachannel/arm-uwp-dbg/CMakeFiles/CMakeError.log".
ninja: build stopped: subcommand failed.

@BillyONeal BillyONeal added requires:author-response and removed depends:different-pr This PR or Issue depends on a PR which has been filed labels Oct 23, 2020
@Nemirtingas
Copy link
Contributor Author

Nemirtingas commented Oct 23, 2020

Thank you very much, I'll take a look.
For SRTP yes, there is no feature variable, the library checks for SRTP, if its available, it will add it by default.
https://github.com/paullouisageneau/libdatachannel/blob/2eb523e2eac2ce646ea66f886925f7516a280add/CMakeLists.txt#L165-L166

@Nemirtingas
Copy link
Contributor Author

This looks promising now.

@BillyONeal
Copy link
Member

For SRTP yes, there is no feature variable, the library checks for SRTP, if its available, it will add it by default.

I see, that needs to be patched to avoid the auto-detection -- ports should not be substantially different depending on whether other ports are installed, since it affects binary caching. That is, on one system, if someone does:

vcpkg install srtp
vcpkg install libdatachannel[core]

and on another system they do:

vcpkg install libdatachannel[core]
vcpkg install srtp

what they have should be identical, but it isn't if the library in question is doing autodetection.

Why do we have to add extra parameters to use vcpkg.json ?

The "extra parameters" have nothing to do with vcpkg.json, the problem also exists in the CONTROL universe. (All I did to mint that vcpkg.json was vcpkg format-manifest path\to\CONTROL)

@Nemirtingas
Copy link
Contributor Author

Nemirtingas commented Oct 25, 2020

I see, that needs to be patched to avoid the auto-detection -- ports should not be substantially different depending on whether other ports are installed, since it affects binary caching.

The libdatachannel maintainer added a flag for SRTP on his latest version. But the latest version also needs latest libjuice. I'll have to update libjuice before merging libdatachannel.
#14213

The "extra parameters" have nothing to do with vcpkg.json, the problem also exists in the CONTROL universe. (All I did to mint that vcpkg.json was vcpkg format-manifest path\to\CONTROL)

I had to set VCPKG_FEATURE_FLAGS=-manifests.

Warning: manifest-root detected at /vcpkg_libdatachannel/ports/libdatachannel, but manifests are not enabled.
If you wish to use manifest mode, you may do one of the following:
    * Add the `manifests` feature flag to the comma-separated environment
      variable `VCPKG_FEATURE_FLAGS`.
    * Add the `manifests` feature flag to the `--feature-flags` option.
    * Pass your manifest directory to the `--x-manifest-root` option.
If you wish to silence this error and use classic mode, you can:
    * Add the `-manifests` feature flag to `VCPKG_FEATURE_FLAGS`.
    * Add the `-manifests` feature flag to `--feature-flags`.

@Nemirtingas
Copy link
Contributor Author

libdatachannel has been updated to v0.10.1 and waiting for the libjuice update.

@NancyLi1013
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@JackBoosY
Copy link
Contributor

@BillyONeal Do you have any other questions?

@strega-nil strega-nil merged commit 9555c11 into microsoft:master Nov 23, 2020
@strega-nil
Copy link
Contributor

Thanks @Nemirtingas :)

@Nemirtingas
Copy link
Contributor Author

No probs. This library has great potential for webrtc. Google's implementation is too troublesome to setup.

@Nemirtingas Nemirtingas deleted the libdatachannel_port branch February 24, 2021 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:new-port The issue is requesting a new library to be added; consider making a PR!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[New Port Request] libdatachannel
7 participants