open-webrtc-toolkit / owt-client-native

Open WebRTC Toolkit client SDK for native Windows/Linux/iOS applications.
https://01.org/open-webrtc-toolkit
Apache License 2.0
391 stars 180 forks source link

./src/base/ios/BUILD.gn contains two errors that avoid building #514

Closed andreasunterhuber closed 3 years ago

andreasunterhuber commented 3 years ago

Build details

Problem

@jianjunz The file ./src/base/ios/BUILD.gn contains an invalid import file and two unset variables. This causes the build process to stop with an error. Google itself replaced the file with a new version (https://chromium.googlesource.com/chromium/src/base/+/refs/heads/master/ios/BUILD.gn)

Fix

from:

# Copyright 2020 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//build/buildflag_header.gni")
import("//ios/build/chrome_build.gni")

buildflag_header("ios_multi_window_buildflags") {
  header = "multi_window_buildflags.h"
  header_dir = "base/ios"
  flags = [
    "IOS_MULTIWINDOW_ENABLED=$ios_enable_multi_window",
    "IOS_SCENE_STARTUP_ENABLED=$ios_enable_scene_startup",
  ]
}

to:

# Copyright 2020 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//build/buildflag_header.gni")

buildflag_header("ios_multi_window_buildflags") {
  header = "multi_window_buildflags.h"
  header_dir = "base/ios"
  flags = [
    "IOS_MULTIWINDOW_ENABLED=true",
    "IOS_SCENE_STARTUP_ENABLED=true",
  ]
}
belveder79 commented 3 years ago

I can confirm that the proposed fix works for me...

jianjunz commented 3 years ago

Hi,

It looks like this issue cannot be reproduced on the latest master branch. I understand these two variables were removed recently, but they should be there in the version we depend on.

belveder79 commented 3 years ago

well I cloned it yesterday evening and it was there... just synced it again now (18:00 Vienna time, May 8) - same thing...

used the fix, then I ran into an other issue linked to the chromium build files itself which might be worth mentioning on the build docs:

DON'T BUILD FROM HFS+ PARTITIONS

I tried to build off a HFS+ partition, and it seems that the cp -Rc ... command tends to fail at almost the very last stage (clonefile for Info.plist to WebRTC.framework)... so I moved to APFS which worked...

belveder79 commented 3 years ago

arm64 builds... simulator fails...

[137/137] STAMP obj/third_party/webrtc/modules/modules_tests.stamp
ninja: Entering directory `out/Debug-simulator-x64'
[18/70] CXX obj/third_party/webrtc/pc/rtc_pc_unittests_arch_executable_sources/dtls_transport_unittest.o
FAILED: obj/third_party/webrtc/pc/rtc_pc_unittests_arch_executable_sources/dtls_transport_unittest.o 
clang++ -MMD -MF obj/third_party/webrtc/pc/rtc_pc_unittests_arch_executable_sources/dtls_transport_unittest.o.d -DCR_XCODE_VERSION=1240 -DCR_CLANG_REVISION=\"llvmorg-12-init-11060-g118c3f3c-1\" -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D_DEBUG -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DWEBRTC_ENABLE_PROTOBUF=1 -DWEBRTC_INCLUDE_INTERNAL_AUDIO_DEVICE -DRTC_ENABLE_VP9 -DHAVE_SCTP -DHAVE_WEBRTC_VIDEO -DLOGGING_INSIDE_WEBRTC -DWEBRTC_ENABLE_AVX2 -DWEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS=1 -DWEBRTC_POSIX -DWEBRTC_MAC -DWEBRTC_IOS -DABSL_ALLOCATOR_NOTHROW=1 -DABSL_FLAGS_STRIP_NAMES=0 -DGTEST_API_= -DGTEST_HAS_POSIX_RE=0 -DGTEST_LANG_CXX11=1 -DGTEST_HAS_TR1_TUPLE=0 -DGTEST_HAS_ABSL=1 -DHAVE_SCTP -DUNIT_TEST -DPACKAGE_STRING=\"libsrtp2\ 2.1.0-pre\" -DPACKAGE_VERSION=\"2.1.0-pre\" -DHAVE_CONFIG_H -DOPENSSL -DHAVE_STDLIB_H -DHAVE_STRING_H -DHAVE_STDINT_H -DHAVE_INTTYPES_H -DHAVE_INT16_T -DHAVE_INT32_T -DHAVE_INT8_T -DHAVE_UINT16_T -DHAVE_UINT32_T -DHAVE_UINT64_T -DHAVE_UINT8_T -DHAVE_ARPA_INET_H -DHAVE_NETINET_IN_H -DHAVE_SYS_TYPES_H -DHAVE_UNISTD_H -DOPENSSL_NO_ASM -I../../third_party/libsrtp/srtp -I../.. -Igen -I../../third_party/webrtc -Igen/third_party/webrtc -I../../third_party/abseil-cpp -I../../third_party/libyuv/include -I../../third_party/googletest/custom -I../../third_party/googletest/src/googlemock/include -I../../third_party/googletest/custom -I../../third_party/googletest/src/googletest/include -I../../third_party/abseil-cpp -I../../third_party/libsrtp -I../../third_party/libsrtp/config -I../../third_party/libsrtp/include -I../../third_party/libsrtp/crypto/include -I../../third_party/boringssl/src/include -fno-delete-null-pointer-checks -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -fcolor-diagnostics -fmerge-all-constants -target x86_64-apple-ios9.0-simulator -Wno-builtin-macro-redefined -D__DATE__= -D__TIME__= -D__TIMESTAMP__= -Xclang -fdebug-compilation-dir -Xclang . -no-canonical-prefixes -Wall -Werror -Wextra -Wimplicit-fallthrough -Wunreachable-code -Wthread-safety -Wextra-semi -Wunguarded-availability -Wundeclared-selector -Wno-range-loop-analysis -Wno-missing-field-initializers -Wno-unused-parameter -Wno-c++11-narrowing -Wno-unneeded-internal-declaration -Wno-undefined-var-template -O0 -fno-omit-frame-pointer -g2 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Wno-shorten-64-to-32 -Wno-inconsistent-missing-override -Wno-undefined-bool-conversion -Wno-tautological-undefined-compare -std=c++14 -fno-trigraphs -Wno-trigraphs -fno-exceptions -fno-rtti -c ../../third_party/webrtc/pc/dtls_transport_unittest.cc -o obj/third_party/webrtc/pc/rtc_pc_unittests_arch_executable_sources/dtls_transport_unittest.o
In file included from ../../third_party/webrtc/pc/dtls_transport_unittest.cc:11:
In file included from ../../third_party/webrtc/pc/dtls_transport.h:14:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:3033:32: error: no matching constructor for initialization of 'cricket::FakeIceTransport'
    return unique_ptr<_Tp>(new _Tp(_VSTD::forward<_Args>(__args)...));
                               ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../third_party/webrtc/p2p/base/fake_dtls_transport.h:59:32: note: in instantiation of function template specialization 'std::__1::make_unique<cricket::FakeIceTransport, const std::__1::basic_string<char> &, int &>' requested here
      : FakeDtlsTransport(std::make_unique<FakeIceTransport>(name, component)) {
                               ^
../../third_party/webrtc/p2p/base/fake_ice_transport.h:28:7: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 2 were provided
class FakeIceTransport : public IceTransportInternal {
      ^
../../third_party/webrtc/p2p/base/fake_ice_transport.h:30:12: note: candidate constructor not viable: requires at least 3 arguments, but 2 were provided
  explicit FakeIceTransport(const std::string& name,
           ^
In file included from ../../third_party/webrtc/pc/dtls_transport_unittest.cc:11:
In file included from ../../third_party/webrtc/pc/dtls_transport.h:14:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:3033:32: error: allocating an object of abstract class type 'cricket::FakeDtlsTransport'
    return unique_ptr<_Tp>(new _Tp(_VSTD::forward<_Args>(__args)...));
                               ^
../../third_party/webrtc/pc/dtls_transport_unittest.cc:59:35: note: in instantiation of function template specialization 'std::__1::make_unique<cricket::FakeDtlsTransport, char const (&)[6], const int &>' requested here
    auto cricket_transport = std::make_unique<FakeDtlsTransport>(
                                  ^
../../third_party/webrtc/p2p/base/packet_transport_internal.h:34:30: note: unimplemented pure virtual method 'media_type' in 'FakeDtlsTransport'
  virtual cricket::MediaType media_type() const = 0;
                             ^
2 errors generated.
[19/70] CXX obj/third_party/webrtc/pc/rtc_pc_unittests_arch_executable_sources/ice_transport_unittest.o
FAILED: obj/third_party/webrtc/pc/rtc_pc_unittests_arch_executable_sources/ice_transport_unittest.o 
clang++ -MMD -MF obj/third_party/webrtc/pc/rtc_pc_unittests_arch_executable_sources/ice_transport_unittest.o.d -DCR_XCODE_VERSION=1240 -DCR_CLANG_REVISION=\"llvmorg-12-init-11060-g118c3f3c-1\" -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D_DEBUG -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DWEBRTC_ENABLE_PROTOBUF=1 -DWEBRTC_INCLUDE_INTERNAL_AUDIO_DEVICE -DRTC_ENABLE_VP9 -DHAVE_SCTP -DHAVE_WEBRTC_VIDEO -DLOGGING_INSIDE_WEBRTC -DWEBRTC_ENABLE_AVX2 -DWEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS=1 -DWEBRTC_POSIX -DWEBRTC_MAC -DWEBRTC_IOS -DABSL_ALLOCATOR_NOTHROW=1 -DABSL_FLAGS_STRIP_NAMES=0 -DGTEST_API_= -DGTEST_HAS_POSIX_RE=0 -DGTEST_LANG_CXX11=1 -DGTEST_HAS_TR1_TUPLE=0 -DGTEST_HAS_ABSL=1 -DHAVE_SCTP -DUNIT_TEST -DPACKAGE_STRING=\"libsrtp2\ 2.1.0-pre\" -DPACKAGE_VERSION=\"2.1.0-pre\" -DHAVE_CONFIG_H -DOPENSSL -DHAVE_STDLIB_H -DHAVE_STRING_H -DHAVE_STDINT_H -DHAVE_INTTYPES_H -DHAVE_INT16_T -DHAVE_INT32_T -DHAVE_INT8_T -DHAVE_UINT16_T -DHAVE_UINT32_T -DHAVE_UINT64_T -DHAVE_UINT8_T -DHAVE_ARPA_INET_H -DHAVE_NETINET_IN_H -DHAVE_SYS_TYPES_H -DHAVE_UNISTD_H -DOPENSSL_NO_ASM -I../../third_party/libsrtp/srtp -I../.. -Igen -I../../third_party/webrtc -Igen/third_party/webrtc -I../../third_party/abseil-cpp -I../../third_party/libyuv/include -I../../third_party/googletest/custom -I../../third_party/googletest/src/googlemock/include -I../../third_party/googletest/custom -I../../third_party/googletest/src/googletest/include -I../../third_party/abseil-cpp -I../../third_party/libsrtp -I../../third_party/libsrtp/config -I../../third_party/libsrtp/include -I../../third_party/libsrtp/crypto/include -I../../third_party/boringssl/src/include -fno-delete-null-pointer-checks -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -fcolor-diagnostics -fmerge-all-constants -target x86_64-apple-ios9.0-simulator -Wno-builtin-macro-redefined -D__DATE__= -D__TIME__= -D__TIMESTAMP__= -Xclang -fdebug-compilation-dir -Xclang . -no-canonical-prefixes -Wall -Werror -Wextra -Wimplicit-fallthrough -Wunreachable-code -Wthread-safety -Wextra-semi -Wunguarded-availability -Wundeclared-selector -Wno-range-loop-analysis -Wno-missing-field-initializers -Wno-unused-parameter -Wno-c++11-narrowing -Wno-unneeded-internal-declaration -Wno-undefined-var-template -O0 -fno-omit-frame-pointer -g2 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Wno-shorten-64-to-32 -Wno-inconsistent-missing-override -Wno-undefined-bool-conversion -Wno-tautological-undefined-compare -std=c++14 -fno-trigraphs -Wno-trigraphs -fno-exceptions -fno-rtti -c ../../third_party/webrtc/pc/ice_transport_unittest.cc -o obj/third_party/webrtc/pc/rtc_pc_unittests_arch_executable_sources/ice_transport_unittest.o
In file included from ../../third_party/webrtc/pc/ice_transport_unittest.cc:11:
In file included from ../../third_party/webrtc/pc/ice_transport.h:14:
In file included from ../../third_party/webrtc/api/ice_transport_interface.h:14:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string:504:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/string_view:175:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__string:57:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/algorithm:643:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:3033:32: error: no matching constructor for initialization of 'cricket::FakeIceTransport'
    return unique_ptr<_Tp>(new _Tp(_VSTD::forward<_Args>(__args)...));
                               ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../third_party/webrtc/pc/ice_transport_unittest.cc:30:12: note: in instantiation of function template specialization 'std::__1::make_unique<cricket::FakeIceTransport, char const (&)[5], int, nullptr_t>' requested here
      std::make_unique<cricket::FakeIceTransport>("name", 0, nullptr);
           ^
../../third_party/webrtc/p2p/base/fake_ice_transport.h:30:12: note: candidate constructor not viable: no known conversion from 'int' to 'cricket::MediaType' for 2nd argument
  explicit FakeIceTransport(const std::string& name,
           ^
../../third_party/webrtc/p2p/base/fake_ice_transport.h:28:7: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 3 were provided
class FakeIceTransport : public IceTransportInternal {
      ^
1 error generated.
[20/70] CXX obj/third_party/webrtc/pc/rtc_pc_unittests_arch_executable_sources/composite_rtp_transport_test.o
FAILED: obj/third_party/webrtc/pc/rtc_pc_unittests_arch_executable_sources/composite_rtp_transport_test.o 
clang++ -MMD -MF obj/third_party/webrtc/pc/rtc_pc_unittests_arch_executable_sources/composite_rtp_transport_test.o.d -DCR_XCODE_VERSION=1240 -DCR_CLANG_REVISION=\"llvmorg-12-init-11060-g118c3f3c-1\" -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D_DEBUG -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DWEBRTC_ENABLE_PROTOBUF=1 -DWEBRTC_INCLUDE_INTERNAL_AUDIO_DEVICE -DRTC_ENABLE_VP9 -DHAVE_SCTP -DHAVE_WEBRTC_VIDEO -DLOGGING_INSIDE_WEBRTC -DWEBRTC_ENABLE_AVX2 -DWEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS=1 -DWEBRTC_POSIX -DWEBRTC_MAC -DWEBRTC_IOS -DABSL_ALLOCATOR_NOTHROW=1 -DABSL_FLAGS_STRIP_NAMES=0 -DGTEST_API_= -DGTEST_HAS_POSIX_RE=0 -DGTEST_LANG_CXX11=1 -DGTEST_HAS_TR1_TUPLE=0 -DGTEST_HAS_ABSL=1 -DHAVE_SCTP -DUNIT_TEST -DPACKAGE_STRING=\"libsrtp2\ 2.1.0-pre\" -DPACKAGE_VERSION=\"2.1.0-pre\" -DHAVE_CONFIG_H -DOPENSSL -DHAVE_STDLIB_H -DHAVE_STRING_H -DHAVE_STDINT_H -DHAVE_INTTYPES_H -DHAVE_INT16_T -DHAVE_INT32_T -DHAVE_INT8_T -DHAVE_UINT16_T -DHAVE_UINT32_T -DHAVE_UINT64_T -DHAVE_UINT8_T -DHAVE_ARPA_INET_H -DHAVE_NETINET_IN_H -DHAVE_SYS_TYPES_H -DHAVE_UNISTD_H -DOPENSSL_NO_ASM -I../../third_party/libsrtp/srtp -I../.. -Igen -I../../third_party/webrtc -Igen/third_party/webrtc -I../../third_party/abseil-cpp -I../../third_party/libyuv/include -I../../third_party/googletest/custom -I../../third_party/googletest/src/googlemock/include -I../../third_party/googletest/custom -I../../third_party/googletest/src/googletest/include -I../../third_party/abseil-cpp -I../../third_party/libsrtp -I../../third_party/libsrtp/config -I../../third_party/libsrtp/include -I../../third_party/libsrtp/crypto/include -I../../third_party/boringssl/src/include -fno-delete-null-pointer-checks -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -fcolor-diagnostics -fmerge-all-constants -target x86_64-apple-ios9.0-simulator -Wno-builtin-macro-redefined -D__DATE__= -D__TIME__= -D__TIMESTAMP__= -Xclang -fdebug-compilation-dir -Xclang . -no-canonical-prefixes -Wall -Werror -Wextra -Wimplicit-fallthrough -Wunreachable-code -Wthread-safety -Wextra-semi -Wunguarded-availability -Wundeclared-selector -Wno-range-loop-analysis -Wno-missing-field-initializers -Wno-unused-parameter -Wno-c++11-narrowing -Wno-unneeded-internal-declaration -Wno-undefined-var-template -O0 -fno-omit-frame-pointer -g2 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Wno-shorten-64-to-32 -Wno-inconsistent-missing-override -Wno-undefined-bool-conversion -Wno-tautological-undefined-compare -std=c++14 -fno-trigraphs -Wno-trigraphs -fno-exceptions -fno-rtti -c ../../third_party/webrtc/pc/composite_rtp_transport_test.cc -o obj/third_party/webrtc/pc/rtc_pc_unittests_arch_executable_sources/composite_rtp_transport_test.o
../../third_party/webrtc/pc/composite_rtp_transport_test.cc:261:28: error: variable type 'rtc::FakePacketTransport' is an abstract class
  rtc::FakePacketTransport remote("remote");
                           ^
../../third_party/webrtc/p2p/base/packet_transport_internal.h:34:30: note: unimplemented pure virtual method 'media_type' in 'FakePacketTransport'
  virtual cricket::MediaType media_type() const = 0;
                             ^
../../third_party/webrtc/pc/composite_rtp_transport_test.cc:272:28: error: variable type 'rtc::FakePacketTransport' is an abstract class
  rtc::FakePacketTransport remote("remote");
                           ^
../../third_party/webrtc/pc/composite_rtp_transport_test.cc:285:28: error: variable type 'rtc::FakePacketTransport' is an abstract class
  rtc::FakePacketTransport remote("remote");
                           ^
../../third_party/webrtc/pc/composite_rtp_transport_test.cc:298:28: error: variable type 'rtc::FakePacketTransport' is an abstract class
  rtc::FakePacketTransport remote("remote");
                           ^
../../third_party/webrtc/pc/composite_rtp_transport_test.cc:309:28: error: variable type 'rtc::FakePacketTransport' is an abstract class
  rtc::FakePacketTransport remote("remote");
                           ^
../../third_party/webrtc/pc/composite_rtp_transport_test.cc:322:28: error: variable type 'rtc::FakePacketTransport' is an abstract class
  rtc::FakePacketTransport remote("remote");
                           ^
../../third_party/webrtc/pc/composite_rtp_transport_test.cc:335:28: error: variable type 'rtc::FakePacketTransport' is an abstract class
  rtc::FakePacketTransport remote("remote");
                           ^
../../third_party/webrtc/pc/composite_rtp_transport_test.cc:349:28: error: variable type 'rtc::FakePacketTransport' is an abstract class
  rtc::FakePacketTransport remote("remote");
                           ^
../../third_party/webrtc/pc/composite_rtp_transport_test.cc:363:28: error: variable type 'rtc::FakePacketTransport' is an abstract class
  rtc::FakePacketTransport remote("remote");
                           ^
../../third_party/webrtc/pc/composite_rtp_transport_test.cc:377:28: error: variable type 'rtc::FakePacketTransport' is an abstract class
  rtc::FakePacketTransport remote("remote");
                           ^
In file included from ../../third_party/webrtc/pc/composite_rtp_transport_test.cc:11:
In file included from ../../third_party/webrtc/pc/composite_rtp_transport.h:14:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:3033:32: error: allocating an object of abstract class type 'rtc::FakePacketTransport'
    return unique_ptr<_Tp>(new _Tp(_VSTD::forward<_Args>(__args)...));
                               ^
../../third_party/webrtc/pc/composite_rtp_transport_test.cc:36:18: note: in instantiation of function template specialization 'std::__1::make_unique<rtc::FakePacketTransport, char const (&)[15]>' requested here
            std::make_unique<rtc::FakePacketTransport>(kTransportName)),
                 ^
In file included from ../../third_party/webrtc/pc/composite_rtp_transport_test.cc:11:
In file included from ../../third_party/webrtc/pc/composite_rtp_transport.h:14:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:3033:32: error: allocating an object of abstract class type 'rtc::FakePacketTransport'
    return unique_ptr<_Tp>(new _Tp(_VSTD::forward<_Args>(__args)...));
                               ^
../../third_party/webrtc/pc/composite_rtp_transport_test.cc:40:18: note: in instantiation of function template specialization 'std::__1::make_unique<rtc::FakePacketTransport, char const (&)[20]>' requested here
            std::make_unique<rtc::FakePacketTransport>(kRtcpTransportName)),
                 ^
12 errors generated.
[22/70] CXX obj/third_party/webrtc/pc/rtc_pc_unittests_arch_executable_sources/rtp_transport_unittest.o
FAILED: obj/third_party/webrtc/pc/rtc_pc_unittests_arch_executable_sources/rtp_transport_unittest.o 
clang++ -MMD -MF obj/third_party/webrtc/pc/rtc_pc_unittests_arch_executable_sources/rtp_transport_unittest.o.d -DCR_XCODE_VERSION=1240 -DCR_CLANG_REVISION=\"llvmorg-12-init-11060-g118c3f3c-1\" -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D_DEBUG -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DWEBRTC_ENABLE_PROTOBUF=1 -DWEBRTC_INCLUDE_INTERNAL_AUDIO_DEVICE -DRTC_ENABLE_VP9 -DHAVE_SCTP -DHAVE_WEBRTC_VIDEO -DLOGGING_INSIDE_WEBRTC -DWEBRTC_ENABLE_AVX2 -DWEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS=1 -DWEBRTC_POSIX -DWEBRTC_MAC -DWEBRTC_IOS -DABSL_ALLOCATOR_NOTHROW=1 -DABSL_FLAGS_STRIP_NAMES=0 -DGTEST_API_= -DGTEST_HAS_POSIX_RE=0 -DGTEST_LANG_CXX11=1 -DGTEST_HAS_TR1_TUPLE=0 -DGTEST_HAS_ABSL=1 -DHAVE_SCTP -DUNIT_TEST -DPACKAGE_STRING=\"libsrtp2\ 2.1.0-pre\" -DPACKAGE_VERSION=\"2.1.0-pre\" -DHAVE_CONFIG_H -DOPENSSL -DHAVE_STDLIB_H -DHAVE_STRING_H -DHAVE_STDINT_H -DHAVE_INTTYPES_H -DHAVE_INT16_T -DHAVE_INT32_T -DHAVE_INT8_T -DHAVE_UINT16_T -DHAVE_UINT32_T -DHAVE_UINT64_T -DHAVE_UINT8_T -DHAVE_ARPA_INET_H -DHAVE_NETINET_IN_H -DHAVE_SYS_TYPES_H -DHAVE_UNISTD_H -DOPENSSL_NO_ASM -I../../third_party/libsrtp/srtp -I../.. -Igen -I../../third_party/webrtc -Igen/third_party/webrtc -I../../third_party/abseil-cpp -I../../third_party/libyuv/include -I../../third_party/googletest/custom -I../../third_party/googletest/src/googlemock/include -I../../third_party/googletest/custom -I../../third_party/googletest/src/googletest/include -I../../third_party/abseil-cpp -I../../third_party/libsrtp -I../../third_party/libsrtp/config -I../../third_party/libsrtp/include -I../../third_party/libsrtp/crypto/include -I../../third_party/boringssl/src/include -fno-delete-null-pointer-checks -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -fcolor-diagnostics -fmerge-all-constants -target x86_64-apple-ios9.0-simulator -Wno-builtin-macro-redefined -D__DATE__= -D__TIME__= -D__TIMESTAMP__= -Xclang -fdebug-compilation-dir -Xclang . -no-canonical-prefixes -Wall -Werror -Wextra -Wimplicit-fallthrough -Wunreachable-code -Wthread-safety -Wextra-semi -Wunguarded-availability -Wundeclared-selector -Wno-range-loop-analysis -Wno-missing-field-initializers -Wno-unused-parameter -Wno-c++11-narrowing -Wno-unneeded-internal-declaration -Wno-undefined-var-template -O0 -fno-omit-frame-pointer -g2 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Wno-shorten-64-to-32 -Wno-inconsistent-missing-override -Wno-undefined-bool-conversion -Wno-tautological-undefined-compare -std=c++14 -fno-trigraphs -Wno-trigraphs -fno-exceptions -fno-rtti -c ../../third_party/webrtc/pc/rtp_transport_unittest.cc -o obj/third_party/webrtc/pc/rtc_pc_unittests_arch_executable_sources/rtp_transport_unittest.o
../../third_party/webrtc/pc/rtp_transport_unittest.cc:86:28: error: variable type 'rtc::FakePacketTransport' is an abstract class
  rtc::FakePacketTransport fake_rtcp("fake_rtcp");
                           ^
../../third_party/webrtc/p2p/base/packet_transport_internal.h:34:30: note: unimplemented pure virtual method 'media_type' in 'FakePacketTransport'
  virtual cricket::MediaType media_type() const = 0;
                             ^
../../third_party/webrtc/pc/rtp_transport_unittest.cc:88:28: error: variable type 'rtc::FakePacketTransport' is an abstract class
  rtc::FakePacketTransport fake_rtp("fake_rtp");
                           ^
../../third_party/webrtc/pc/rtp_transport_unittest.cc:100:28: error: variable type 'rtc::FakePacketTransport' is an abstract class
  rtc::FakePacketTransport fake_rtcp("fake_rtcp");
                           ^
../../third_party/webrtc/pc/rtp_transport_unittest.cc:102:28: error: variable type 'rtc::FakePacketTransport' is an abstract class
  rtc::FakePacketTransport fake_rtp("fake_rtp");
                           ^
../../third_party/webrtc/pc/rtp_transport_unittest.cc:114:28: error: variable type 'rtc::FakePacketTransport' is an abstract class
  rtc::FakePacketTransport fake_rtp("fake_rtp");
                           ^
../../third_party/webrtc/pc/rtp_transport_unittest.cc:124:28: error: variable type 'rtc::FakePacketTransport' is an abstract class
  rtc::FakePacketTransport fake_rtp("fake_rtp");
                           ^
../../third_party/webrtc/pc/rtp_transport_unittest.cc:137:28: error: variable type 'rtc::FakePacketTransport' is an abstract class
  rtc::FakePacketTransport fake_rtp("fake_rtp");
                           ^
../../third_party/webrtc/pc/rtp_transport_unittest.cc:151:28: error: variable type 'rtc::FakePacketTransport' is an abstract class
  rtc::FakePacketTransport fake_rtp("fake_rtp");
                           ^
../../third_party/webrtc/pc/rtp_transport_unittest.cc:180:28: error: variable type 'rtc::FakePacketTransport' is an abstract class
  rtc::FakePacketTransport fake_rtcp("fake_rtcp");
                           ^
../../third_party/webrtc/pc/rtp_transport_unittest.cc:212:28: error: variable type 'rtc::FakePacketTransport' is an abstract class
  rtc::FakePacketTransport fake_rtcp("fake_rtcp");
                           ^
../../third_party/webrtc/pc/rtp_transport_unittest.cc:213:28: error: variable type 'rtc::FakePacketTransport' is an abstract class
  rtc::FakePacketTransport fake_rtp("fake_rtp");
                           ^
../../third_party/webrtc/pc/rtp_transport_unittest.cc:235:28: error: variable type 'rtc::FakePacketTransport' is an abstract class
  rtc::FakePacketTransport fake_rtp("fake_rtp");
                           ^
../../third_party/webrtc/pc/rtp_transport_unittest.cc:259:28: error: variable type 'rtc::FakePacketTransport' is an abstract class
  rtc::FakePacketTransport fake_rtp("fake_rtp");
                           ^
../../third_party/webrtc/pc/rtp_transport_unittest.cc:282:28: error: variable type 'rtc::FakePacketTransport' is an abstract class
  rtc::FakePacketTransport fake_rtp("fake_rtp");
                           ^
../../third_party/webrtc/pc/rtp_transport_unittest.cc:306:28: error: variable type 'rtc::FakePacketTransport' is an abstract class
  rtc::FakePacketTransport fake_rtp("fake_rtp");
                           ^
15 errors generated.
[24/70] CXX obj/third_party/webrtc/pc/rtc_pc_unittests_arch_executable_sources/jsep_transport_controller_unittest.o
FAILED: obj/third_party/webrtc/pc/rtc_pc_unittests_arch_executable_sources/jsep_transport_controller_unittest.o 
clang++ -MMD -MF obj/third_party/webrtc/pc/rtc_pc_unittests_arch_executable_sources/jsep_transport_controller_unittest.o.d -DCR_XCODE_VERSION=1240 -DCR_CLANG_REVISION=\"llvmorg-12-init-11060-g118c3f3c-1\" -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D_DEBUG -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DWEBRTC_ENABLE_PROTOBUF=1 -DWEBRTC_INCLUDE_INTERNAL_AUDIO_DEVICE -DRTC_ENABLE_VP9 -DHAVE_SCTP -DHAVE_WEBRTC_VIDEO -DLOGGING_INSIDE_WEBRTC -DWEBRTC_ENABLE_AVX2 -DWEBRTC_NON_STATIC_TRACE_EVENT_HANDLERS=1 -DWEBRTC_POSIX -DWEBRTC_MAC -DWEBRTC_IOS -DABSL_ALLOCATOR_NOTHROW=1 -DABSL_FLAGS_STRIP_NAMES=0 -DGTEST_API_= -DGTEST_HAS_POSIX_RE=0 -DGTEST_LANG_CXX11=1 -DGTEST_HAS_TR1_TUPLE=0 -DGTEST_HAS_ABSL=1 -DHAVE_SCTP -DUNIT_TEST -DPACKAGE_STRING=\"libsrtp2\ 2.1.0-pre\" -DPACKAGE_VERSION=\"2.1.0-pre\" -DHAVE_CONFIG_H -DOPENSSL -DHAVE_STDLIB_H -DHAVE_STRING_H -DHAVE_STDINT_H -DHAVE_INTTYPES_H -DHAVE_INT16_T -DHAVE_INT32_T -DHAVE_INT8_T -DHAVE_UINT16_T -DHAVE_UINT32_T -DHAVE_UINT64_T -DHAVE_UINT8_T -DHAVE_ARPA_INET_H -DHAVE_NETINET_IN_H -DHAVE_SYS_TYPES_H -DHAVE_UNISTD_H -DOPENSSL_NO_ASM -I../../third_party/libsrtp/srtp -I../.. -Igen -I../../third_party/webrtc -Igen/third_party/webrtc -I../../third_party/abseil-cpp -I../../third_party/libyuv/include -I../../third_party/googletest/custom -I../../third_party/googletest/src/googlemock/include -I../../third_party/googletest/custom -I../../third_party/googletest/src/googletest/include -I../../third_party/abseil-cpp -I../../third_party/libsrtp -I../../third_party/libsrtp/config -I../../third_party/libsrtp/include -I../../third_party/libsrtp/crypto/include -I../../third_party/boringssl/src/include -fno-delete-null-pointer-checks -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -fcolor-diagnostics -fmerge-all-constants -target x86_64-apple-ios9.0-simulator -Wno-builtin-macro-redefined -D__DATE__= -D__TIME__= -D__TIMESTAMP__= -Xclang -fdebug-compilation-dir -Xclang . -no-canonical-prefixes -Wall -Werror -Wextra -Wimplicit-fallthrough -Wunreachable-code -Wthread-safety -Wextra-semi -Wunguarded-availability -Wundeclared-selector -Wno-range-loop-analysis -Wno-missing-field-initializers -Wno-unused-parameter -Wno-c++11-narrowing -Wno-unneeded-internal-declaration -Wno-undefined-var-template -O0 -fno-omit-frame-pointer -g2 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Wno-shorten-64-to-32 -Wno-inconsistent-missing-override -Wno-undefined-bool-conversion -Wno-tautological-undefined-compare -std=c++14 -fno-trigraphs -Wno-trigraphs -fno-exceptions -fno-rtti -c ../../third_party/webrtc/pc/jsep_transport_controller_unittest.cc -o obj/third_party/webrtc/pc/rtc_pc_unittests_arch_executable_sources/jsep_transport_controller_unittest.o
../../third_party/webrtc/pc/jsep_transport_controller_unittest.cc:50:30: error: non-virtual member function marked 'override' hides virtual member function
      IceTransportInit init) override {
                             ^
../../third_party/webrtc/api/ice_transport_interface.h:89:53: note: hidden overloaded virtual function 'webrtc::IceTransportFactory::CreateIceTransport' declared here: different number of parameters (4 vs 3)
  virtual rtc::scoped_refptr<IceTransportInterface> CreateIceTransport(
                                                    ^
In file included from ../../third_party/webrtc/pc/jsep_transport_controller_unittest.cc:11:
In file included from ../../third_party/webrtc/pc/jsep_transport_controller.h:14:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/map:479:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__tree:15:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:3033:32: error: no matching constructor for initialization of 'cricket::FakeIceTransport'
    return unique_ptr<_Tp>(new _Tp(_VSTD::forward<_Args>(__args)...));
                               ^   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../third_party/webrtc/p2p/base/fake_dtls_transport.h:59:32: note: in instantiation of function template specialization 'std::__1::make_unique<cricket::FakeIceTransport, const std::__1::basic_string<char> &, int &>' requested here
      : FakeDtlsTransport(std::make_unique<FakeIceTransport>(name, component)) {
                               ^
../../third_party/webrtc/p2p/base/fake_ice_transport.h:28:7: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 2 were provided
class FakeIceTransport : public IceTransportInternal {
      ^
../../third_party/webrtc/p2p/base/fake_ice_transport.h:30:12: note: candidate constructor not viable: requires at least 3 arguments, but 2 were provided
  explicit FakeIceTransport(const std::string& name,
           ^
In file included from ../../third_party/webrtc/pc/jsep_transport_controller_unittest.cc:11:
In file included from ../../third_party/webrtc/pc/jsep_transport_controller.h:14:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/map:479:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__tree:15:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:3033:32: error: allocating an object of abstract class type 'cricket::FakeDtlsTransport'
    return unique_ptr<_Tp>(new _Tp(_VSTD::forward<_Args>(__args)...));
                               ^
../../third_party/webrtc/pc/jsep_transport_controller_unittest.cc:61:17: note: in instantiation of function template specialization 'std::__1::make_unique<cricket::FakeDtlsTransport, cricket::FakeIceTransport *>' requested here
    return std::make_unique<FakeDtlsTransport>(
                ^
../../third_party/webrtc/p2p/base/packet_transport_internal.h:34:30: note: unimplemented pure virtual method 'media_type' in 'FakeDtlsTransport'
  virtual cricket::MediaType media_type() const = 0;
                             ^
In file included from ../../third_party/webrtc/pc/jsep_transport_controller_unittest.cc:11:
In file included from ../../third_party/webrtc/pc/jsep_transport_controller.h:14:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/map:479:
In file included from /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/__tree:15:
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../include/c++/v1/memory:3033:32: error: allocating an object of abstract class type 'webrtc::FakeIceTransportFactory'
    return unique_ptr<_Tp>(new _Tp(_VSTD::forward<_Args>(__args)...));
                               ^
../../third_party/webrtc/pc/jsep_transport_controller_unittest.cc:71:40: note: in instantiation of function template specialization 'std::__1::make_unique<webrtc::FakeIceTransportFactory>' requested here
    fake_ice_transport_factory_ = std::make_unique<FakeIceTransportFactory>();
                                       ^
../../third_party/webrtc/api/ice_transport_interface.h:89:53: note: unimplemented pure virtual method 'CreateIceTransport' in 'FakeIceTransportFactory'
  virtual rtc::scoped_refptr<IceTransportInterface> CreateIceTransport(
                                                    ^
4 errors generated.
[27/70] CXX obj/third_party/webrtc/pc/rtc_pc_unittests_arch_executable_sources/media_session_unittest.o
ninja: build stopped: subcommand failed.
andreasunterhuber commented 3 years ago

@jianjunz thanks for your feedback, but I can confirm, that it's still a problem with current master branch (version: 16ad48f470183246b4c697bbb42712ccf094eba3). But i adopted the fix to correctly include the file chrome_build.gni:

FIX: of file ./src/base/ios/BUILD.gn and change to:

# Copyright 2020 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

import("//build/buildflag_header.gni")
import("//build/config/chrome_build.gni")

buildflag_header("ios_multi_window_buildflags") {
  header = "multi_window_buildflags.h"
  header_dir = "base/ios"
  flags = [
    "IOS_MULTIWINDOW_ENABLED=true",
    "IOS_SCENE_STARTUP_ENABLED=true",
  ]
}

Can you approve @jianjunz ?

andreasunterhuber commented 3 years ago

variable type 'rtc::FakePacketTransport' is an abstract class

and other errors during unit tests...

@belveder79 I can confirm that I have the same error after fixing the ./src/base/ios/BUILD.gn file and running the build script. You can build anyway (ignore the unit-test errors) by changing the scripts/build.py script at line 156. @jianjunz of course - this is no permanent solution, because if tests fail ... the builded framework will fail to in the App.

From:

# Run unit tests on simulator. Return True if all tests are passed.
def runtest(ssl_root):
  print('Start running unit tests.')
  # Build app targets checks link issue.
  if not ninjabuild(TEST_ARCH, TEST_SCHEME, SDK_TARGETS + APP_TARGETS + TEST_TARGETS):
    return False
  for test_target in TEST_TARGETS:
    if subprocess.call(['./iossim', '-d', TEST_SIMULATOR_DEVICE, '-s',
        getsdkversion(), '%s.app'%test_target],
        cwd=getoutputpath(TEST_ARCH, TEST_SCHEME)):
      return False
  return True

To:

# Run unit tests on simulator. Return True if all tests are passed.
def runtest(ssl_root):
  # print('Start running unit tests.')
  # # Build app targets checks link issue.
  # if not ninjabuild(TEST_ARCH, TEST_SCHEME, SDK_TARGETS + APP_TARGETS + TEST_TARGETS):
  #   return False
  # for test_target in TEST_TARGETS:
  #   if subprocess.call(['./iossim', '-d', TEST_SIMULATOR_DEVICE, '-s',
  #       getsdkversion(), '%s.app'%test_target],
  #       cwd=getoutputpath(TEST_ARCH, TEST_SCHEME)):
  #     return False
  return True
jianjunz commented 3 years ago

Thanks for your fix. Since src/base/ios/BUILD.gn is pulled from https://chromium.googlesource.com/chromium/src/base/, we'll need to create a patch for src/base, and apply it by scripts/prepare_dev.py during gclient sync.

BTW, I still cannot reproduce the BUILD.gn issue. I'm considering to clean my environment and build the SDK from scratch.

build.py accepts an argument --skip_tests to skip unit tests. It could be a workaround for unit test errors. I just found that unit tests were disabled by QA. So CI doesn't detect the error.

andreasunterhuber commented 3 years ago

Thanks for your fix. Since src/base/ios/BUILD.gn is pulled from https://chromium.googlesource.com/chromium/src/base/, we'll need to create a patch for src/base, and apply it by scripts/prepare_dev.py during gclient sync.

If you need a patch, there it is (inside pulled folder "base"):

diff --git a/ios/BUILD.gn b/ios/BUILD.gn
index 3f4a982f6..c3b6ecf12 100644
--- a/ios/BUILD.gn
+++ b/ios/BUILD.gn
@@ -3,13 +3,13 @@
 # found in the LICENSE file.

 import("//build/buildflag_header.gni")
-import("//ios/build/chrome_build.gni")
+import("//build/config/chrome_build.gni")

 buildflag_header("ios_multi_window_buildflags") {
   header = "multi_window_buildflags.h"
   header_dir = "base/ios"
   flags = [
-    "IOS_MULTIWINDOW_ENABLED=$ios_enable_multi_window",
-    "IOS_SCENE_STARTUP_ENABLED=$ios_enable_scene_startup",
+    "IOS_MULTIWINDOW_ENABLED=true",
+    "IOS_SCENE_STARTUP_ENABLED=true",
   ]
 }
andreasunterhuber commented 3 years ago

@jianjunz do you plan to include this patch?

jianjunz commented 3 years ago

I tired a clean build, but still cannot reproduce your issue. I also checked //ios/build/chrome_build.gni is there in the version OWT is using. Two unset variables are defined in this file. I guess you probably missed target_os = ['ios'] in .gclient file? src/ios directory only exists when checkout_ios is true.

andreasunterhuber commented 3 years ago

@jianjunz you are completely right 😮 I saw @taste1981 changed in the last commit https://github.com/open-webrtc-toolkit/owt-client-native/commit/56a0f5499021b170d9e7b8726b9bb8ac2bf252da#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5R75 the Readme.md and added Replace the last line of .gclient with target_os=["ios"] - so iOS is not standard anymore. Build is running smoothly now. Closing this issue 💪