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

Build failure with some MSBuild versions #4

Closed
ispysoftware opened this issue Mar 30, 2020 · 14 comments
Closed

Build failure with some MSBuild versions #4

ispysoftware opened this issue Mar 30, 2020 · 14 comments
Assignees
Labels
bug Something isn't working wontfix This will not be worked on

Comments

@ispysoftware
Copy link

ispysoftware commented Mar 30, 2020

Source is cloned to a ubuntu instance and webrtc depot tools are installed and added to path. Modified the unity.msbuildproj file for Release and Targets is LinuxX64;WinX64.

Calling msbuild unity.msbuildproj is returning:

gn.py: Could not find checkout in any parent of the current path. This must be run inside a checkout.

I copied the buildtools and build directory over from the webrtc directory (which is all building fine) and it passed this step and is now failing saying the gn gen command is malformed (error is "I have no idea what this is", pointing at:

target_os=/linux/
-----------^

what am i missing here? Was I supposed to copy the directories over?

removing the " and just calling target_os=linux then results in the output in the console
showing

--root="/home/user/pixiv/webrtc/sdk/dotnet/unity/"../../..

which is obviously returning "error: Unterminated quoted string"

@akihikodaki
Copy link
Contributor

Please follow the build instruction at https://webrtc.googlesource.com/src/+/refs/heads/master/docs/native-code/development/index.md. You can checkout this repository after that.

@akihikodaki akihikodaki self-assigned this Mar 30, 2020
@akihikodaki akihikodaki added the question Further information is requested label Mar 30, 2020
@ispysoftware
Copy link
Author

i've done all of that. The main webrtc repo is building fine.
The problem is your instructions say to checkout the src directory from your repo but don't say where to do it on the local file system - if you checkout the repo to a new folder the build doesn't work. Do you do it in a sub directory of the main webrtc checkout?

The command to build the project also fails using msbuild, what's the magic sauce to get the build working? It's encoding quotes all over the place and generating garbled commands. Is there a switch to pass to msbuild? What's the command line?

@akihikodaki
Copy link
Contributor

The problem is your instructions say to checkout the src directory from your repo but don't say where to do it on the local file system - if you checkout the repo to a new folder the build doesn't work. Do you do it in a sub directory of the main webrtc checkout?

This repository is a fork of the main webrtc repo. You can run:

git fetch git@github.com:pixiv/webrtc.git
git checkout FETCH_HEAD

at the src directory of the original WebRTC checkout.

The command to build the project also fails using msbuild, what's the magic sauce to get the build working? It's encoding quotes all over the place and generating garbled commands. Is there a switch to pass to msbuild? What's the command line?

Read the PropertyGroup node of the MSBuild project for possible configuration options. Targets property is what you are likely to modify in this case. It includes all targets, which takes so long to build, and it cannot build for iOS on Linux anyway. Specify only the targets you actually need and reduce time it costs for debugging.

@ispysoftware
Copy link
Author

"Source is cloned to a ubuntu instance and webrtc depot tools are installed and added to path. Modified the unity.msbuildproj file for Release and Targets is LinuxX64;WinX64."

How are you building the unity.msbuildproj project? could you share your command line? msbuild is changing every \ to a /, not escaping the quotes and the build is failling immediately.

@akihikodaki
Copy link
Contributor

How are you building the unity.msbuildproj project? could you share your command line? msbuild is changing every \ to a /, not escaping the quotes and the build is failling immediately.

I'm sorry, it is not your fault. I reproduced the bug with:

Microsoft (R) Build Engine version 16.5.0-ci for Mono

However, I cannot reproduce the bug with:

Microsoft (R) Build Engine version 16.4.0+e901037fe for .NET Core

I'll reopen this issue.

@akihikodaki akihikodaki reopened this Mar 30, 2020
@akihikodaki akihikodaki changed the title Build instructions Build failure with some MSBuild versions Mar 30, 2020
@ispysoftware
Copy link
Author

are there any other dependencies? I called dotnet msbuild and it's now failing with:
"keyerror: 'WINDOWSSDKDIR'"

@ispysoftware
Copy link
Author

ispysoftware commented Mar 30, 2020

/sdk/c_headers_test.c is referencing multiple files that don't exist in the repo.. need to remove

#include "sdk/c/api/task_queue/queued_task.h"
#include "sdk/c/api/task_queue/task_queue_base.h"
#include "sdk/c/api/task_queue/task_queue_factory.h"

from the file

@ispysoftware
Copy link
Author

ispysoftware commented Mar 30, 2020

Looks like crosscompiling for Windows on Linux is not supported without manually setting up the windows SDK. Can't find any info about how to do that. Would be good to have some in the instructions.

So I setup a build environment on windows but it's erroring out with lots of code errors.

If you have any pointers on how to get the cross compile for windows working i'd love to hear them. It's looking for GYP_MSVS_OVERRIDE_PATH and WINDOWSSDKDIR.

@akihikodaki akihikodaki added bug Something isn't working and removed question Further information is requested labels Mar 31, 2020
@akihikodaki
Copy link
Contributor

Looks like crosscompiling for Windows on Linux is not supported without manually setting up the windows SDK. Can't find any info about how to do that. Would be good to have some in the instructions.

So I setup a build environment on windows but it's erroring out with lots of code errors.

If you have any pointers on how to get the cross compile for windows working i'd love to hear them. It's looking for GYP_MSVS_OVERRIDE_PATH and WINDOWSSDKDIR.

I actually cross-compile for Windows on Linux. Follow the instructions of Chrome/win. The procedure is basically same with one of WebRTC.
https://chromium.googlesource.com/chromium/src.git/+/master/docs/win_cross.md

@ispysoftware
Copy link
Author

should link to that page in the instructions. Also note that
export DEPOT_TOOLS_WIN_TOOLCHAIN_BASE_URL=<path/to/sdk/zip/file>
should be
export DEPOT_TOOLS_WIN_TOOLCHAIN_BASE_URL=<path/to/sdk/zip/folder>
.. cost me 6 hours of debugging!

@ispysoftware
Copy link
Author

ispysoftware commented Apr 3, 2020

where you have [MarshalAs(UnmanagedType.SysUInt)] - that isn't working on dotnet, should just be able to pass these in as IntPtr or U4.

@andreysorokin
Copy link

It seems that for this ms build version, the problem persists, at least on Mac Os:

Microsoft (R) Build Engine version 16.5.0-ci for Mono

`
"gn gen "--args=is_debug=false rtc_enable_symbol_export=true target_os=/"mac/" target_cpu=/"x64/""

`
What is the recommended approach? Switch to 16.4.0?

@akihikodaki
Copy link
Contributor

I'm sorry for replying comments in this issue late, too.

should link to that page in the instructions. Also note that
export DEPOT_TOOLS_WIN_TOOLCHAIN_BASE_URL=<path/to/sdk/zip/file>
should be
export DEPOT_TOOLS_WIN_TOOLCHAIN_BASE_URL=<path/to/sdk/zip/folder>
.. cost me 6 hours of debugging!

This project aims to minimize differences from the upstream while providing key features, namely .NET bindings and improved iOS support. Therefore, it will not contain any instructions which are not present in the upstream documentation.
It's not good that the upstream does not provide any instructions for cross-compiling. The upstream apparently expects developers to have some knowledge of Chromium infrastructure 😕

It seems that for this ms build version, the problem persists, at least on Mac Os:

Microsoft (R) Build Engine version 16.5.0-ci for Mono

`
"gn gen "--args=is_debug=false rtc_enable_symbol_export=true target_os=/"mac/" target_cpu=/"x64/""

`
What is the recommended approach? Switch to 16.4.0?

Use .NET Core. An issue of MSBuild indicates the bug (or the intentional behavior) is in its Mono support.
dotnet/msbuild#3468

akihikodaki pushed a commit that referenced this issue May 21, 2020
…nnects.

This fixes a bug where transport_overhead_bytes_per_packet_ is sometimes
not set and therefore not included in the BWE.

(cherry picked from commit b4cdd62)

Bug: webrtc:11359, chromium:1053421
Change-Id: Id3593299c6bcd7ce3c44a7b148c202240b3f1981
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168525
Reviewed-by: Christoffer Rodbro <crodbro@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Commit-Queue: Jakob Ivarsson <jakobi@webrtc.org>
Cr-Original-Commit-Position: refs/heads/master@{#30522}
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/168723
Cr-Commit-Position: refs/branch-heads/4044@{#4}
Cr-Branched-From: be99ee8-refs/heads/master@{#30432}
akihikodaki pushed a commit that referenced this issue Jan 8, 2021
New params have recently been added, but ToString() was not updated.

(cherry picked from commit ab4a492)

Bug: chromium:1135177
Change-Id: I2115ccb08d29e860a658284d096e48da17daaedd
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/186267
Commit-Queue: Alessio Bazzica <alessiob@webrtc.org>
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Cr-Original-Commit-Position: refs/heads/master@{#32283}
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/187480
Reviewed-by: Per Åhgren <peah@webrtc.org>
Reviewed-by: Minyue Li <minyue@webrtc.org>
Cr-Commit-Position: refs/branch-heads/4280@{#4}
Cr-Branched-From: 75b9ab6-refs/heads/master@{#32272}
@akihikodaki
Copy link
Contributor

Since we are not going to fix this issue anytime soon, I explicitly noted that Mono shouldn't be used for building with commit 91aeeca and thereby I'm closing this issue.

Use .NET Core if you run into a problem when building with Mono. Open another issue otherwise.

@akihikodaki akihikodaki added the wontfix This will not be worked on label Jan 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants