microsoft / MixedReality-WebRTC

MixedReality-WebRTC is a collection of components to help mixed reality app developers integrate audio and video real-time communication into their application and improve their collaborative experience
https://microsoft.github.io/MixedReality-WebRTC/
MIT License
908 stars 283 forks source link

Unable to build from source #568

Closed sananbintahir closed 4 years ago

sananbintahir commented 4 years ago

I've been trying to build the library from source. I've installed all of the pre-requisites, according to the documentation. When I run,

.\build.ps1 -BuildConfig Release -BuildArch x64 -BuildPlatform Win32

It runs successfully, with the powershell showing:

[INFO] -   [Build]   - mergeLibs                      - Merging libs is finished (builder.py:254)
[DEBUG] -  [Utility] - popd                           - popd C:\mr-webrtc\tools\build (utility.py:395)
[INFO] -   [Build]   - run                            - Running build for target: webrtc; platform: win; cpu: x64;
                                                        configuration: release, finished successfully! (builder.py:93)

===================================== Script execution STARTED =====================================

===================================== Prepare webrtc win x64 release STARTED =====================================

====================================== Prepare webrtc win x64 release ENDED ======================================

===================================== Build webrtc win x64 release STARTED =====================================

====================================== Build webrtc win x64 release ENDED ======================================

========================================= SUMMARY =========================================

ACTION: build
     SUCCESSFUL: webrtc   win   x64   release      execution time: 0:05:05.914000

-------------------------------------------------------------------------------------------
ACTION: prepare
     SUCCESSFUL: webrtc   win   x64   release      execution time: 0:00:06.363000

-------------------------------------------------------------------------------------------
Total execution time: 0:05:50.096000

However, when I try to build Microsoft.MixedReality.WebRTC.sln, it gives me an error, stating that The webrtc.lib file was not found for configuration 'Release' platform 'x64'. This generally indicates that libwebrtc was not built locally. I can't find the webrtc.lib on disk either. Is there something that I'm missing?

djee-ms commented 4 years ago

Hi @sananbintahir,

The fact it took so little time probably means it didn't build anything. The script unfortunately sometimes returns success even though the build fails; this is due to the chain of commands (PS => MSBuild => Python => gn => ninja; 3 different teams across 2 companies here) not always propagating errors correctly. Please check toward the beginning of the logs, I suspect you have an error that prevents the build from starting, like wrong Python version (needs 2.x, recommended latest 2.7) or missing Windows SDK Debugging Tools (see Prerequisites here).

Obirry commented 4 years ago

@djee-ms Excuse me, I'd like to ask a question about hololens2.

Obirry commented 4 years ago

@djee-ms It works normally in the unity editor, but I had a problem running on hololens2, it displays "unable to load DLL 'mrwebrtc'" on hololens2. What is the cause of this problem?Forgive me for the bad English expression...

djee-ms commented 4 years ago

@WilsonDEGithub I already replied to your other issue #569, please don't hijack other user's issues with unrelated questions, it makes the discussion difficult to follow. It was 3 hours ago too.

sananbintahir commented 4 years ago

@djee-ms I've had a look at the logs, the prerequisites seem to be fine, the build starts off with,

Windows SDK 1803 10.0.17134 (April 2018)   : OK
Windows SDK 1809 10.0.17763 (October 2018) : OK
[INFO             ] - [System         ] - __updateDepotToolsPath         - Adding depot tools path 'C:\mr-webrtc\external\webrtc-uwp-sdk\scripts\..\.\webrtc\xplatform\depot_tools' to the PATH. (system.py:424)
[INFO             ] - [System         ] - __determineVisualStudioPath    - Visual studio path is C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise (system.py:487)
[DEBUG            ] - [System         ] - __determineVisualStudioPath    - MSVC tools path is C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC (system.py:488)
[DEBUG            ] - [System         ] - __determineVisualStudioPath    - MSVC tools bin path is C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\VC\Tools\MSVC\14.16.27023\bin\Hostx64 (system.py:489)
[INFO             ] - [Main           ] - main                           - Root logger is created (run.py:275)
[DEBUG            ] - [System         ] - checkVSDebugTools              - Windows SDK Debug Tools path is C:\Program Files (x86)\Windows Kits\10\Debuggers\ (system.py:196)
[DEBUG            ] - [System         ] - checkIfPlatformsAreSupported   - Checking if specified platforms are supported. (system.py:243)
[DEBUG            ] - [Utility        ] - pushd                          - pushd C:\mr-webrtc\external\webrtc-uwp-sdk\scripts\..\.\webrtc\xplatform\webrtc (utility.py:386)
[DEBUG            ] - [System         ] - downloadClangClIfMissing       - Clang-cl.exe is found. (system.py:519)
[DEBUG            ] - [Utility        ] - pushd                          - pushd build\util (utility.py:386)
[DEBUG            ] - [Utility        ] - popd                           - popd C:\mr-webrtc\external\webrtc-uwp-sdk\webrtc\xplatform\webrtc (utility.py:395)
DEBUG:Utility:popd C:\mr-webrtc\external\webrtc-uwp-sdk\webrtc\xplatform\webrtc
[DEBUG            ] - [Utility        ] - popd                           - popd C:\mr-webrtc\tools\build (utility.py:395)
[INFO             ] - [Prepare        ] - run                            - Runnning preparation for target: webrtc; platform: win; cpu: x64; configuration: release (prepare.py:100)
[DEBUG            ] - [Utility        ] - pushd                          - pushd C:\mr-webrtc\external\webrtc-uwp-sdk\scripts\..\.\webrtc\xplatform\webrtc (utility.py:386)
[DEBUG            ] - [Prepare        ] - __prepareOutputFolder          - Copying .\out\webrtc_win_x64_release\args.gn file to C:\mr-webrtc\external\webrtc-uwp-sdk\scripts\..\.\webrtc\windows\templates\gns\args.gn (prepare.py:170)
[DEBUG            ] - [Prepare        ] - __prepareOutputFolder          - Updating args.gn file. Target OS: win; Target CPU: x64 (prepare.py:175)
[DEBUG            ] - [Prepare        ] - __generateProjects             - Output path: .\out\webrtc_win_x64_release (prepare.py:204)
[INFO             ] - [Prepare        ] - __generateProjects             - Generating webrtc projects ... (prepare.py:205)

The only place I see warnings are here, maybe this could be the issue?

C:\mr-webrtc\external\webrtc-uwp-sdk\scripts\..\.\webrtc\xplatform\depot_tools\ninja.exe rtc_base:rtc_json (utility.py:572)
[INFO             ] - [Build          ] - buildTargets                   - Successfully finished building target rtc_base:rtc_json (builder.py:199)
[INFO             ] - [Build          ] - mergeLibs                      - Merging libs for cpu x64 (builder.py:212)
[WARNING          ] - [Utility        ] - getFilesWithExtensionsInFolder - Folder /uwp_x86 doesn't exist! (utility.py:422)
[WARNING          ] - [Utility        ] - getFilesWithExtensionsInFolder - Folder /uwp_x64 doesn't exist! (utility.py:422)
[WARNING          ] - [Utility        ] - getFilesWithExtensionsInFolder - Folder /uwp_arm doesn't exist! (utility.py:422)
[WARNING          ] - [Utility        ] - getFilesWithExtensionsInFolder - Folder /win_clang_x64 doesn't exist! (utility.py:422)
[DEBUG            ] - [Build          ] - mergeLibs                      - Creating webrtc0.lib library (builder.py:236)
sananbintahir commented 4 years ago

Maybe worth noting is that initially, I was getting Exception: Visual Studio Version 2017 (from GYP_MSVS_VERSION) not found. (even though I had the MSVC v141 - VS 2017 C++ x64/x86 build tools toolchain from Visual Studio 2017). To fix that I installed visual studio 2017 IDE and set GYP_MSVS_VERSION=2017 in the powershell.

djee-ms commented 4 years ago

That looks all good. The webrtc.lib file should be generated in external\webrtc-uwp-sdk\webrtc\xplatform\webrtc\out\webrtc_win_x64_release\obj, please check the file is there.

sananbintahir commented 4 years ago

Yup, the file's there. I just tried doing everything again with the release/2.0 branch instead of master. It takes just as long for build.ps1 to complete, but this time when I run Microsoft.MixedReality.WebRTC.sln, it continues the build, logs show 6 succeeded and 2 failed. I've since closed the project so I'm not sure which 2 failed. I'll try again.

sananbintahir commented 4 years ago

So after a few more tries, here is what I have noticed:

In the release/2.0 branch, the error in my original post does not occur. When building Microsoft.MixedReality.WebRTC.sln, it runs through but fails to build two projects, Microsoft.MixedReality.WebRTC.Tests, because of the following error:

CS0266  Cannot implicitly convert type 
'System.Collections.Generic.IReadOnlyList<Microsoft.MixedReality.WebRTC.VideoCaptureDevice>' to 
'System.Collections.Generic.List<Microsoft.MixedReality.WebRTC.VideoCaptureDevice>'. An explicit conversion 
exists (are you missing a cast?)

and Microsoft.MixedReality.WebRTC.TestAppUWP with,

Severity    Code    Description Project File    Line    Suppression State
Error       Loading assembly "C:\Program Files (x86)\Microsoft SDKs\UWPNuGetPackages\runtime.win10-x64-aot.microsoft.netcore.universalwindowsplatform\6.2.10\runtimes\win10-x64-aot\lib\uap10.0.15138\System.Linq.dll" failed. System.IO.FileNotFoundException: Could not load file or assembly 'System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
File name: 'System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
   at System.ModuleHandle.ResolveType(RuntimeModule module, Int32 typeToken, IntPtr* typeInstArgs, Int32 typeInstCount, IntPtr* methodInstArgs, Int32 methodInstCount, ObjectHandleOnStack type)
   at System.ModuleHandle.ResolveTypeHandleInternal(RuntimeModule module, Int32 typeToken, RuntimeTypeHandle[] typeInstantiationContext, RuntimeTypeHandle[] methodInstantiationContext)
   at System.Reflection.RuntimeModule.ResolveType(Int32 metadataToken, Type[] genericTypeArguments, Type[] genericMethodArguments)
   at System.Reflection.CustomAttribute.FilterCustomAttributeRecord(CustomAttributeRecord caRecord, MetadataImport scope, Assembly& lastAptcaOkAssembly, RuntimeModule decoratedModule, MetadataToken decoratedToken, RuntimeType attributeFilterType, Boolean mustBeInheritable, Object[] attributes, IList derivedAttributes, RuntimeType& attributeType, IRuntimeMethodInfo& ctor, Boolean& ctorHasParameters, Boolean& isVarArg)
   at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeModule decoratedModule, Int32 decoratedMetadataToken, Int32 pcaCount, RuntimeType attributeFilterType, Boolean mustBeInheritable, IList derivedAttributes, Boolean isDecoratedTargetSecurityTransparent)
   at System.Reflection.CustomAttribute.GetCustomAttributes(RuntimeAssembly assembly, RuntimeType caType)
   at System.Attribute.GetCustomAttributes(Assembly element, Type attributeType, Boolean inherit)
   at System.Attribute.GetCustomAttribute(Assembly element, Type attributeType, Boolean inherit)
   at System.Reflection.CustomAttributeExtensions.GetCustomAttribute[T](Assembly element)
   at Microsoft.Build.Tasks.ProcessResourceFiles.ReadAssemblyResources(String name, String outFileOrDir)

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog]. Microsoft.MixedReality.WebRTC.TestAppUWP            

On master, the error in my initial post is always present, even though the webrtc.lib is present in external\webrtc-uwp-sdk\webrtc\xplatform\webrtc\out\webrtc_win_x64_release\obj

sananbintahir commented 4 years ago

I've also tried to build the base chromium library, based on this README but that also fails at one point, with the following error,

Running hooks:  89% (26/29) msan_chained_origins
________ running 'vpython src/third_party/depot_tools/download_from_google_storage.py --no_resume --no_auth --bucket chromium-instrumented-libraries -s src/third_party/instrumented_libraries/binaries/msan-chained-origins-trusty.tgz.sha1' in '/mnt/c/base/webrtc'
0> Failed to fetch file gs://chromium-instrumented-libraries/0185d9b6c6fdfbcfffa61d8ac9f19e8879c4dee2 for src/third_party/instrumented_libraries/binaries/msan-chained-origins-trusty.tgz, skipping. [Err: [E2020-09-07T14:38:30.264504+02:00 21331 0 annotate.go:241] original error: no such package: infra/python/wheels/cffi/linux-amd64_cp32_abi3
[E2020-09-07T14:38:30.264542+02:00 21331 0 annotate.go:241]
[E2020-09-07T14:38:30.264551+02:00 21331 0 annotate.go:241] goroutine 68:
[E2020-09-07T14:38:30.264557+02:00 21331 0 annotate.go:241] #0 go.chromium.org/luci/cipd/client/cipd/client.go:1690 - cipd.(*clientImpl).humanErr()
[E2020-09-07T14:38:30.264564+02:00 21331 0 annotate.go:241] #1 go.chromium.org/luci/cipd/client/cipd/client.go:743 - cipd.(*clientImpl).ResolveVersion()
[E2020-09-07T14:38:30.264570+02:00 21331 0 annotate.go:241] #2 go.chromium.org/luci/cipd/client/cipd/resolver.go:176 - cipd.(*Resolver).resolveVersion.func1()
[E2020-09-07T14:38:30.264577+02:00 21331 0 annotate.go:241] #3 go.chromium.org/luci/common/sync/promise/promise.go:84 - promise.(*Promise).runGen()
[E2020-09-07T14:38:30.264582+02:00 21331 0 annotate.go:241] #4 runtime/asm_amd64.s:1374 - runtime.goexit()
[E2020-09-07T14:38:30.264586+02:00 21331 0 annotate.go:241]
[E2020-09-07T14:38:30.264591+02:00 21331 0 annotate.go:241] goroutine 67:
[E2020-09-07T14:38:30.264595+02:00 21331 0 annotate.go:241] From frame 0 to 0, the following wrappers were found:
[E2020-09-07T14:38:30.264601+02:00 21331 0 annotate.go:241]   internal reason: MultiError 2/2: following first non-nil error.
[E2020-09-07T14:38:30.264606+02:00 21331 0 annotate.go:241]
[E2020-09-07T14:38:30.264612+02:00 21331 0 annotate.go:241] #0 go.chromium.org/luci/cipd/client/cipd/ensure/file.go:255 - ensure.(*File).Resolve.func1.1()
[E2020-09-07T14:38:30.264633+02:00 21331 0 annotate.go:241]   reason: failed to resolve infra/python/wheels/cffi/linux-amd64_cp32_abi3@version:1.10.0 (line 0)
[E2020-09-07T14:38:30.264641+02:00 21331 0 annotate.go:241]
[E2020-09-07T14:38:30.264646+02:00 21331 0 annotate.go:241] #1 go.chromium.org/luci/common/sync/parallel/runner.go:51 - parallel.(*WorkItem).execute()
[E2020-09-07T14:38:30.264651+02:00 21331 0 annotate.go:241] #2 go.chromium.org/luci/common/sync/parallel/runner.go:149 - parallel.(*Runner).dispatchLoopBody.func2()
[E2020-09-07T14:38:30.264656+02:00 21331 0 annotate.go:241] #3 runtime/asm_amd64.s:1374 - runtime.goexit()
[E2020-09-07T14:38:30.264676+02:00 21331 0 annotate.go:241]
[E2020-09-07T14:38:30.264684+02:00 21331 0 annotate.go:241] goroutine 1:
[E2020-09-07T14:38:30.264688+02:00 21331 0 annotate.go:241] #0 go.chromium.org/luci/vpython/venv/config.go:183 - venv.(*Config).makeEnv()
[E2020-09-07T14:38:30.264693+02:00 21331 0 annotate.go:241]   reason: failed to resolve packages
[E2020-09-07T14:38:30.264713+02:00 21331 0 annotate.go:241]
[E2020-09-07T14:38:30.264721+02:00 21331 0 annotate.go:241] #1 go.chromium.org/luci/vpython/venv/venv.go:163 - venv.With()
[E2020-09-07T14:38:30.264726+02:00 21331 0 annotate.go:241] #2 go.chromium.org/luci/vpython/run.go:62 - vpython.Run()
[E2020-09-07T14:38:30.264731+02:00 21331 0 annotate.go:241] #3 go.chromium.org/luci/vpython/application/application.go:320 - application.(*application).mainImpl()
[E2020-09-07T14:38:30.264751+02:00 21331 0 annotate.go:241] #4 go.chromium.org/luci/vpython/application/application.go:408 - application.(*Config).Main.func1()
[E2020-09-07T14:38:30.264759+02:00 21331 0 annotate.go:241] #5 go.chromium.org/luci/vpython/application/support.go:46 - application.run()
[E2020-09-07T14:38:30.264764+02:00 21331 0 annotate.go:241] #6 go.chromium.org/luci/vpython/application/application.go:407 - application.(*Config).Main()
[E2020-09-07T14:38:30.264768+02:00 21331 0 annotate.go:241] #7 vpython/main.go:106 - main.mainImpl()
[E2020-09-07T14:38:30.264790+02:00 21331 0 annotate.go:241] #8 vpython/main.go:112 - main.main()
[E2020-09-07T14:38:30.264798+02:00 21331 0 annotate.go:241] #9 runtime/proc.go:204 - runtime.main()
[E2020-09-07T14:38:30.264803+02:00 21331 0 annotate.go:241] #10 runtime/asm_amd64.s:1374 - runtime.goexit()
]
Failed to fetch file gs://chromium-instrumented-libraries/0185d9b6c6fdfbcfffa61d8ac9f19e8879c4dee2 for src/third_party/instrumented_libraries/binaries/msan-chained-origins-trusty.tgz. [Err: [E2020-09-07T14:38:30.264504+02:00 21331 0 annotate.go:241] original error: no such package: infra/python/wheels/cffi/linux-amd64_cp32_abi3
[E2020-09-07T14:38:30.264542+02:00 21331 0 annotate.go:241]
[E2020-09-07T14:38:30.264551+02:00 21331 0 annotate.go:241] goroutine 68:
[E2020-09-07T14:38:30.264557+02:00 21331 0 annotate.go:241] #0 go.chromium.org/luci/cipd/client/cipd/client.go:1690 - cipd.(*clientImpl).humanErr()
[E2020-09-07T14:38:30.264564+02:00 21331 0 annotate.go:241] #1 go.chromium.org/luci/cipd/client/cipd/client.go:743 - cipd.(*clientImpl).ResolveVersion()
[E2020-09-07T14:38:30.264570+02:00 21331 0 annotate.go:241] #2 go.chromium.org/luci/cipd/client/cipd/resolver.go:176 - cipd.(*Resolver).resolveVersion.func1()
[E2020-09-07T14:38:30.264577+02:00 21331 0 annotate.go:241] #3 go.chromium.org/luci/common/sync/promise/promise.go:84 - promise.(*Promise).runGen()
[E2020-09-07T14:38:30.264582+02:00 21331 0 annotate.go:241] #4 runtime/asm_amd64.s:1374 - runtime.goexit()
[E2020-09-07T14:38:30.264586+02:00 21331 0 annotate.go:241]
[E2020-09-07T14:38:30.264591+02:00 21331 0 annotate.go:241] goroutine 67:
[E2020-09-07T14:38:30.264595+02:00 21331 0 annotate.go:241] From frame 0 to 0, the following wrappers were found:
[E2020-09-07T14:38:30.264601+02:00 21331 0 annotate.go:241]   internal reason: MultiError 2/2: following first non-nil error.
[E2020-09-07T14:38:30.264606+02:00 21331 0 annotate.go:241]
[E2020-09-07T14:38:30.264612+02:00 21331 0 annotate.go:241] #0 go.chromium.org/luci/cipd/client/cipd/ensure/file.go:255 - ensure.(*File).Resolve.func1.1()
[E2020-09-07T14:38:30.264633+02:00 21331 0 annotate.go:241]   reason: failed to resolve infra/python/wheels/cffi/linux-amd64_cp32_abi3@version:1.10.0 (line 0)
[E2020-09-07T14:38:30.264641+02:00 21331 0 annotate.go:241]
[E2020-09-07T14:38:30.264646+02:00 21331 0 annotate.go:241] #1 go.chromium.org/luci/common/sync/parallel/runner.go:51 - parallel.(*WorkItem).execute()
[E2020-09-07T14:38:30.264651+02:00 21331 0 annotate.go:241] #2 go.chromium.org/luci/common/sync/parallel/runner.go:149 - parallel.(*Runner).dispatchLoopBody.func2()
[E2020-09-07T14:38:30.264656+02:00 21331 0 annotate.go:241] #3 runtime/asm_amd64.s:1374 - runtime.goexit()
[E2020-09-07T14:38:30.264676+02:00 21331 0 annotate.go:241]
[E2020-09-07T14:38:30.264684+02:00 21331 0 annotate.go:241] goroutine 1:
[E2020-09-07T14:38:30.264688+02:00 21331 0 annotate.go:241] #0 go.chromium.org/luci/vpython/venv/config.go:183 - venv.(*Config).makeEnv()
[E2020-09-07T14:38:30.264693+02:00 21331 0 annotate.go:241]   reason: failed to resolve packages
[E2020-09-07T14:38:30.264713+02:00 21331 0 annotate.go:241]
[E2020-09-07T14:38:30.264721+02:00 21331 0 annotate.go:241] #1 go.chromium.org/luci/vpython/venv/venv.go:163 - venv.With()
[E2020-09-07T14:38:30.264726+02:00 21331 0 annotate.go:241] #2 go.chromium.org/luci/vpython/run.go:62 - vpython.Run()
[E2020-09-07T14:38:30.264731+02:00 21331 0 annotate.go:241] #3 go.chromium.org/luci/vpython/application/application.go:320 - application.(*application).mainImpl()
[E2020-09-07T14:38:30.264751+02:00 21331 0 annotate.go:241] #4 go.chromium.org/luci/vpython/application/application.go:408 - application.(*Config).Main.func1()
[E2020-09-07T14:38:30.264759+02:00 21331 0 annotate.go:241] #5 go.chromium.org/luci/vpython/application/support.go:46 - application.run()
[E2020-09-07T14:38:30.264764+02:00 21331 0 annotate.go:241] #6 go.chromium.org/luci/vpython/application/application.go:407 - application.(*Config).Main()
[E2020-09-07T14:38:30.264768+02:00 21331 0 annotate.go:241] #7 vpython/main.go:106 - main.mainImpl()
[E2020-09-07T14:38:30.264790+02:00 21331 0 annotate.go:241] #8 vpython/main.go:112 - main.main()
[E2020-09-07T14:38:30.264798+02:00 21331 0 annotate.go:241] #9 runtime/proc.go:204 - runtime.main()
[E2020-09-07T14:38:30.264803+02:00 21331 0 annotate.go:241] #10 runtime/asm_amd64.s:1374 - runtime.goexit()
]
Downloading 1 files took 32.391122 second(s)
Error: Command 'vpython src/third_party/depot_tools/download_from_google_storage.py --no_resume --no_auth --bucket chromium-instrumented-libraries -s src/third_party/instrumented_libraries/binaries/msan-chained-origins-trusty.tgz.sha1' returned non-zero exit status 1 in /mnt/c/base/webrtc
Hook 'vpython src/third_party/depot_tools/download_from_google_storage.py --no_resume --no_auth --bucket chromium-instrumented-libraries -s src/third_party/instrumented_libraries/binaries/msan-chained-origins-trusty.tgz.sha1' took 34.24 secs
./checkout.sh exited with code 2. Run with -v to get more info.
sananbintahir commented 4 years ago

@djee-ms I also only now noticed, the full error says,

2>C:\mr-webrtc-master\tools\build\mrwebrtc\uwp\mrwebrtc-uwp.vcxproj(244,5): error : The webrtc.lib file was not found for configuration 'Release' platform 'x64'. This generally indicates that libwebrtc was not built locally. Run "tools\build\build.ps1 -BuildConfig Release -BuildArch x64 -BuildPlatform UWP" to build it. See https://microsoft.github.io/MixedReality-WebRTC/manual/building-windows.html for more details. Missing file: C:\mr-webrtc-master\tools\build\mrwebrtc\..\..\..\external\webrtc-uwp-sdk\webrtc\xplatform\webrtc\out\webrtc_winuwp_x64_release\obj\webrtc.lib

which means it's not searching for the file in the external folder at the root of the project

djee-ms commented 4 years ago

CS0266 Cannot implicitly convert type 'System.Collections.Generic.IReadOnlyList' to 'System.Collections.Generic.List'. An explicit conversion exists (are you missing a cast?)

Known bug, fixed on master. You can fix locally by replacing with the correct type IReadOnlyList<>.

Error Loading assembly "C:\Program Files (x86)\Microsoft SDKs\UWPNuGetPackages\runtime.win10-x64-aot.microsoft.netcore.universalwindowsplatform\6.2.10\runtimes\win10-x64-aot\lib\uap10.0.15138\System.Linq.dll" failed. System.IO.FileNotFoundException: Could not load file or assembly 'System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. File name: 'System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'

Known Visual Studio bug, reported to the VS team but they didn't fix. As a workaround you can switch to another platform or config and back, that generally fixes it for some reason. There's nothing we can do about it, but it's quite annoying even for me.

I've also tried to build the base chromium library

It doesn't build for UWP, we are using a specific commit, and with some custom changes. You won't do anything with a custom chromium library, this is a waste of time.

Missing file: C:\mr-webrtc-master\tools\build\mrwebrtc\..\..\..\external\webrtc-uwp-sdk\webrtc\xplatform\webrtc\out\webrtc_winuwp_x64_release\obj\webrtc.lib

If I am not mistaken, this is exactly the file I asked you to confirm the presence of, as the part tools\build\mrwebrtc\..\..\.. cancels out, so it does search from the root of the repository. So is it or is it not on disk?

sananbintahir commented 4 years ago

If I am not mistaken, this is exactly the file I asked you to confirm the presence of, as the part tools\build\mrwebrtc\..\..\.. cancels out, so it does search from the root of the repository. So is it or is it not on disk?

@djee-ms Yes, it is on the disk.

It doesn't build for UWP, we are using a specific commit, and with some custom changes. You won't do anything with a custom chromium library, this is a waste of time.

I want to build for android from source too, don't I need to compile the chromium library for that?

djee-ms commented 4 years ago

If the file is on disk but Visual Studio complains it's not then it looks like a Visual Studio bug. Though I am a bit sceptical, I have never seen this kind of bug, each time I had this kind of issue it was a (possibly subtle) misconfiguration.

I want to build for android from source too

You didn't mention any platform but I assumed Windows given you used build.ps1. Android has a completely different build process, because it cannot be cross-compiled from Windows (or using WSL2, but it's technically Linux not Windows). The build script for that is build.sh. I have not seen this error before, but we are building internally for release from sources using this script and had no issue last time we tried. It's possible the Google servers were down, or there was a change on their side. Could you please try again today see if that's a network/server issue during download, or if there's actually a local issue?

sananbintahir commented 4 years ago

@djee-ms I've tried it again. Same result. If it was a visual studio bug, or a misconfiguration, then I would expect the same result on the release/2.0 branch.

So currently, on master, I always get,

The webrtc.lib file was not found for configuration 'Release' platform 'x64'. This generally indicates that libwebrtc was not built locally

On the release/2.0 branch, the build succeeds, but with a lot of warnings along the lines of,

2>Org.WebRtc.WrapperGlue.lib(impl_org_webRtc_EventQueue.obj) : warning LNK4099: PDB 'Org.WebRtc.WrapperGlue.pdb' was not found with 'Org.WebRtc.WrapperGlue.lib(impl_org_webRtc_EventQueue.obj)' or at 'C:\mr-webrtc-2.0\bin\UWP\x86\Release\Org.WebRtc.WrapperGlue.pdb'; linking object as if no debug info
2>Org.WebRtc.WrapperGlue.lib(impl_org_webRtc_WebRtcLib.obj) : warning LNK4099: PDB 'Org.WebRtc.WrapperGlue.pdb' was not found with 'Org.WebRtc.WrapperGlue.lib(impl_org_webRtc_WebRtcLib.obj)' or at 'C:\mr-webrtc-2.0\bin\UWP\x86\Release\Org.WebRtc.WrapperGlue.pdb'; linking object as if no debug info
2>Org.WebRtc.WrapperGlue.lib(impl_org_webRtc_WebRtcFactory.obj) : warning LNK4099: PDB 'Org.WebRtc.WrapperGlue.pdb' was not found with 'Org.WebRtc.WrapperGlue.lib(impl_org_webRtc_WebRtcFactory.obj)' or at 'C:\mr-webrtc-2.0\bin\UWP\x86\Release\Org.WebRtc.WrapperGlue.pdb'; linking object as if no debug info
2>Org.WebRtc.WrapperGlue.lib(impl_org_webRtc_WebRtcLibConfiguration.obj) : warning LNK4099: PDB 'Org.WebRtc.WrapperGlue.pdb' was not found with 'Org.WebRtc.WrapperGlue.lib(impl_org_webRtc_WebRtcLibConfiguration.obj)' or at 'C:\mr-webrtc-2.0\bin\UWP\x86\Release\Org.WebRtc.WrapperGlue.pdb'; linking object as if no debug info
2>webrtc.lib(builtin_audio_encoder_factory.obj) : warning LNK4099: PDB 'builtin_audio_encoder_factory_cc.pdb' was not found with 'webrtc.lib(builtin_audio_encoder_factory.obj)' or at 'C:\mr-webrtc-2.0\bin\UWP\x86\Release\builtin_audio_encoder_factory_cc.pdb'; linking object as if no debug info
2>webrtc.lib(builtin_audio_decoder_factory.obj) : warning LNK4099: PDB 'builtin_audio_decoder_factory_cc.pdb' was not found with 'webrtc.lib(builtin_audio_decoder_factory.obj)' or at 'C:\mr-webrtc-2.0\bin\UWP\x86\Release\builtin_audio_decoder_factory_cc.pdb'; linking object as if no debug info
2>webrtc.lib(audio_format.obj) : warning LNK4099: PDB 'audio_codecs_api_cc.pdb' was not found with 'webrtc.lib(audio_format.obj)' or at 'C:\mr-webrtc-2.0\bin\UWP\x86\Release\audio_codecs_api_cc.pdb'; linking object as if no debug info
2>webrtc.lib(audio_encoder.obj) : warning LNK4099: PDB 'audio_codecs_api_cc.pdb' was not found with 'webrtc.lib(audio_encoder.obj)' or at 'C:\mr-webrtc-2.0\bin\UWP\x86\Release\audio_codecs_api_cc.pdb'; linking object as if no debug info
2>webrtc.lib(audio_decoder.obj) : warning LNK4099: PDB 'audio_codecs_api_cc.pdb' was not found with 'webrtc.lib(audio_decoder.obj)' or at 'C:\mr-webrtc-2.0\bin\UWP\x86\Release\audio_codecs_api_cc.pdb'; linking object as if no debug info
2>webrtc.lib(audio_codec_pair_id.obj) : warning LNK4099: PDB 'audio_codecs_api_cc.pdb' was not found with 'webrtc.lib(audio_codec_pair_id.obj)' or at 'C:\mr-webrtc-2.0\bin\UWP\x86\Release\audio_codecs_api_cc.pdb'; linking object as if no debug info
2>webrtc.lib(audio_frame.obj) : warning LNK4099: PDB 'audio_frame_api_cc.pdb' was not found with 'webrtc.lib(audio_frame.obj)' or at 'C:\mr-webrtc-2.0\bin\UWP\x86\Release\audio_frame_api_cc.pdb'; linking object as if no debug info

Android has a completely different build process because it cannot be cross-compiled from Windows (or using WSL2, but it's technically Linux, not Windows).

I'm really confused about how building android from source works, there's no documentation on the website, and the ReadMe files are also pretty confusing for me. I thought compilation with WSL2 was possible. Could you give me a general rundown of what I need to do to build android from source?

sananbintahir commented 4 years ago

@djee-ms I have now tried it on two different machines. Master does not build from sources. Same error every time. I can't use the release 2.0 version because the master has some recent changes that I need for my application. Are you able to build it?

djee-ms commented 4 years ago

All Windows variants build fine on CI (nevermind the failing test on x86), I tested locally 3 different Windows variants and also Android Release on a VM, everything builds fine. @fibann also tried and reported everything builds fine on master.

djee-ms commented 4 years ago

Wait a second, you ran .\build.ps1 -BuildConfig Release -BuildArch x64 -BuildPlatform Win32 to build the Windows Desktop variant, but your error is in the UWP variant. You need to build it too with .\build.ps1 -BuildConfig Release -BuildArch x64 -BuildPlatform UWP, that's probably why it doesn't find it.

sananbintahir commented 4 years ago

@djee-ms Trying to run .\build.ps1 -BuildConfig Release -BuildArch x64 -BuildPlatform UWP gives me,

Pythoning //build/vs_toolchain.py took 503ms
Pythoning C:/Python27/python.exe C:/mr-webrtc-2.0/external/webrtc-uwp-sdk/webrtc/xplatform/webrtc/build/toolchain/win/setup_toolchain.py "C:\Program Files (x86)/Microsoft Visual Studio/2017/Enterprise" "C:\Program Files (x86)\Windows Kits\10" "C:\WINDOWS\System32;C:\WINDOWS/SysWOW64" win arm environment.arm
Traceback (most recent call last):
  File "C:/mr-webrtc-2.0/external/webrtc-uwp-sdk/webrtc/xplatform/webrtc/build/toolchain/win/setup_toolchain.py", line 293, in <module>
    main()
  File "C:/mr-webrtc-2.0/external/webrtc-uwp-sdk/webrtc/xplatform/webrtc/build/toolchain/win/setup_toolchain.py", line 275, in main
    assert vc_lib_path
AssertionError
Pythoning //build/toolchain/win/setup_toolchain.py took 1160ms
ERROR at //build/config/win/BUILD.gn:369:27: Script returned non-zero exit code.
  vcvars_toolchain_data = exec_script("../../toolchain/win/setup_toolchain.py",
                          ^----------
Current dir: C:/mr-webrtc-2.0/external/webrtc-uwp-sdk/webrtc/xplatform/webrtc/out/webrtc_winuwp_arm_release/
Command: C:/Python27/python.exe C:/mr-webrtc-2.0/external/webrtc-uwp-sdk/webrtc/xplatform/webrtc/build/toolchain/win/setup_toolchain.py "C:\Program Files (x86)/Microsoft Visual Studio/2017/Enterprise" "C:\Program Files (x86)\Windows Kits\10" "C:\WINDOWS\System32;C:\WINDOWS/SysWOW64" winuwp arm none
Returned 1 and printed out:

vc_bin_dir = "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Tools\\MSVC\\14.16.27023\\bin\\HostX64\\x64"
include_flags_I = "\"/I..\\..\\..\\..\\..\\..\\..\\..\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Tools\\MSVC\\14.16.27023\\ATLMFC\\include\" \"/I..\\..\\..\\..\\..\\..\\..\\..\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Tools\\MSVC\\14.16.27023\\include\" \"/I..\\..\\..\\..\\..\\..\\..\\..\\Program Files (x86)\\Windows Kits\\NETFXSDK\\4.6.1\\include\\um\" \"/I..\\..\\..\\..\\..\\..\\..\\..\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17134.0\\ucrt\" \"/I..\\..\\..\\..\\..\\..\\..\\..\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17134.0\\shared\" \"/I..\\..\\..\\..\\..\\..\\..\\..\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17134.0\\um\" \"/I..\\..\\..\\..\\..\\..\\..\\..\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17134.0\\winrt\" \"/I..\\..\\..\\..\\..\\..\\..\\..\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17134.0\\cppwinrt\""
include_flags_imsvc = "\"-imsvc..\\..\\..\\..\\..\\..\\..\\..\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Tools\\MSVC\\14.16.27023\\ATLMFC\\include\" \"-imsvc..\\..\\..\\..\\..\\..\\..\\..\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Enterprise\\VC\\Tools\\MSVC\\14.16.27023\\include\" \"-imsvc..\\..\\..\\..\\..\\..\\..\\..\\Program Files (x86)\\Windows Kits\\NETFXSDK\\4.6.1\\include\\um\" \"-imsvc..\\..\\..\\..\\..\\..\\..\\..\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17134.0\\ucrt\" \"-imsvc..\\..\\..\\..\\..\\..\\..\\..\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17134.0\\shared\" \"-imsvc..\\..\\..\\..\\..\\..\\..\\..\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17134.0\\um\" \"-imsvc..\\..\\..\\..\\..\\..\\..\\..\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17134.0\\winrt\" \"-imsvc..\\..\\..\\..\\..\\..\\..\\..\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17134.0\\cppwinrt\""

See //build/config/BUILDCONFIG.gn:547:5: which caused the file to be included.
    "//build/config/win:default_crt",
    ^-------------------------------
Traceback (most recent call last):
  File "C:/mr-webrtc-2.0/external/webrtc-uwp-sdk/webrtc/xplatform/webrtc/build/toolchain/win/setup_toolchain.py", line 293, in <module>
    main()
  File "C:/mr-webrtc-2.0/external/webrtc-uwp-sdk/webrtc/xplatform/webrtc/build/toolchain/win/setup_toolchain.py", line 275, in main
    assert vc_lib_path
AssertionError
[ERROR            ] - [Utility        ] - runSubprocess                  - None (utility.py:588)
[ERROR            ] - [Utility        ] - runSubprocess                  - Subprocess execution has failed! (utility.py:598)
[ERROR            ] - [Prepare        ] - __generateProjects             - Projects generation has failed! (prepare.py:212)
[DEBUG            ] - [Utility        ] - popd                           - popd C:\mr-webrtc-2.0\tools\build (utility.py:395)

===================================== Script execution STARTED =====================================

===================================== Prepare webrtc winuwp arm release STARTED =====================================

====================================== Failed preparing webrtc winuwp arm release ENDED ======================================

Build cannot run because preparation has failed for webrtc winuwp arm release

====================================== Build not run for webrtc winuwp arm release ENDED ======================================

========================================= SUMMARY =========================================

ACTION: prepare
         FAILED: webrtc   winuwp   arm   release      execution time: 0:00:01.782000

-------------------------------------------------------------------------------------------
Total execution time: 0:00:02.031000
Aborting build due to error while building core WebRTC
djee-ms commented 4 years ago

Do you have Python 2.7 as the default python version?

sananbintahir commented 4 years ago

Yes, specifically 2.7.18, I tried cloning the repo and trying again, this time it went further but failed at the end with

Done Building Project "C:\mr-webrtc\external\webrtc-uwp-sdk\webrtc\windows\projects\msvc\Org.WebRtc.WrapperGlue.Universal\Org.WebRtc.WrapperGlue.vcxproj" (default targets).

C:\mr-webrtc\external\webrtc-uwp-sdk\webrtc\windows\projects\msvc\Org.WebRtc.Universal\Org.WebRtc.vcxproj(836,5): error : This project references NuGet package(s) that are
missing on this computer. Use NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is ..\..\..
\solutions\packages\Microsoft.Windows.CppWinRT.1.0.190109.2\build\native\Microsoft.Windows.CppWinRT.props.
Done Building Project "C:\mr-webrtc\external\webrtc-uwp-sdk\webrtc\windows\projects\msvc\Org.WebRtc.Universal\Org.WebRtc.vcxproj" (Build target(s)) -- FAILED.

Build FAILED.

"C:\mr-webrtc\external\webrtc-uwp-sdk\webrtc\windows\projects\msvc\Org.WebRtc.Universal\Org.WebRtc.vcxproj" (Build target) (1) ->
"C:\mr-webrtc\external\webrtc-uwp-sdk\webrtc\windows\projects\msvc\Org.WebRtc.WrapperGlue.Universal\Org.WebRtc.WrapperGlue.vcxproj" (default target) (2) ->
(ClCompile target) ->
  c:\mr-webrtc\external\webrtc-uwp-sdk\webrtc\xplatform\webrtc\sdk\windows\wrapper\impl_org_webrtc_customaudiomixerrequestmuteevent.cpp(72): warning C4100: 'mute': unrefere
nced formal parameter [C:\mr-webrtc\external\webrtc-uwp-sdk\webrtc\windows\projects\msvc\Org.WebRtc.WrapperGlue.Universal\Org.WebRtc.WrapperGlue.vcxproj]
  c:\mr-webrtc\external\webrtc-uwp-sdk\webrtc\xplatform\webrtc\sdk\windows\wrapper\impl_org_webrtc_webrtclib.cpp(281): warning C4100: 'port': unreferenced formal parameter
[C:\mr-webrtc\external\webrtc-uwp-sdk\webrtc\windows\projects\msvc\Org.WebRtc.WrapperGlue.Universal\Org.WebRtc.WrapperGlue.vcxproj]

"C:\mr-webrtc\external\webrtc-uwp-sdk\webrtc\windows\projects\msvc\Org.WebRtc.Universal\Org.WebRtc.vcxproj" (Build target) (1) ->
(EnsureNuGetPackageBuildImports target) ->
  C:\mr-webrtc\external\webrtc-uwp-sdk\webrtc\windows\projects\msvc\Org.WebRtc.Universal\Org.WebRtc.vcxproj(836,5): error : This project references NuGet package(s) that ar
e missing on this computer. Use NuGet Package Restore to download them.  For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is ..\..\
..\solutions\packages\Microsoft.Windows.CppWinRT.1.0.190109.2\build\native\Microsoft.Windows.CppWinRT.props.

    2 Warning(s)
    1 Error(s)
sananbintahir commented 4 years ago

@djee-ms It still takes just 5-6 minutes for the libwebrtc build to "succeed" for me. I noticed on the CI it takes 20+ minutes. Is this normal?

djee-ms commented 4 years ago

This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them.

You need to restore the NuGet packages before building.

I noticed on the CI it takes 20+ minutes

CI times are widely variable due to Azure agents sometimes getting delayed for no reason, or somehow getting faster download/build for reason I don't know. 6 vs. 20 is ballpark the same. 6min incremental building sounds good to me.

sananbintahir commented 4 years ago

Can now successfully build from sources. Thanks for the help.