Last Comment Bug 771981 - media/webrtc doesn't build on *BSD or other non-standard platforms
: media/webrtc doesn't build on *BSD or other non-standard platforms
Product: Core
Classification: Components
Component: WebRTC (show other bugs)
: Trunk
: x86 OpenBSD
-- normal (vote)
: mozilla16
Assigned To: Randell Jesup [:jesup]
: Maire Reavy [:mreavy] Please needinfo me
Depends on: 757637 771248
  Show dependency treegraph
Reported: 2012-07-08 22:51 PDT by Landry Breuil (:gaston)
Modified: 2012-07-27 10:20 PDT (History)
5 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

Don't build webrtc except for Linux/Mac/Windows; don't check for chrome dlls on windows (2.93 KB, patch)
2012-07-09 08:45 PDT, Randell Jesup [:jesup]
benjamin: review+
Details | Diff | Splinter Review

Description User image Landry Breuil (:gaston) 2012-07-08 22:51:24 PDT
Since landing of webrtc in bugs 749889/757637 + it being enabled by default in 771248, my openbsd builds started failing with 

Updating projects from gyp files...
/bin/sh: python: not found
Traceback (most recent call last):
  File "/var/buildslave-mozilla/mozilla-central-amd64/build/media/webrtc/trunk/build/gyp_chromium", line 171, in <module>
  File "/var/buildslave-mozilla/mozilla-central-amd64/build/media/webrtc/trunk/tools/gyp/pylib/gyp/", line 471, in main
  File "/var/buildslave-mozilla/mozilla-central-amd64/build/media/webrtc/trunk/tools/gyp/pylib/gyp/", line 111, in Load
    depth, generator_input_info, check, circular_check)
  File "/var/buildslave-mozilla/mozilla-central-amd64/build/media/webrtc/trunk/tools/gyp/pylib/gyp/", line 2289, in Load
    depth, check)
  File "/var/buildslave-mozilla/mozilla-central-amd64/build/media/webrtc/trunk/tools/gyp/pylib/gyp/", line 387, in LoadTargetBuildFile
  File "/var/buildslave-mozilla/mozilla-central-amd64/build/media/webrtc/trunk/tools/gyp/pylib/gyp/", line 932, in ProcessVariablesAndConditionsInDict
    variables, build_file, 'variables')
  File "/var/buildslave-mozilla/mozilla-central-amd64/build/media/webrtc/trunk/tools/gyp/pylib/gyp/", line 939, in ProcessVariablesAndConditionsInDict
    expanded = ExpandVariables(value, is_late, variables, build_file)
  File "/var/buildslave-mozilla/mozilla-central-amd64/build/media/webrtc/trunk/tools/gyp/pylib/gyp/", line 696, in ExpandVariables
    (contents, p.returncode))
Exception: Call to 'python ./tools/win/supalink/' returned exit status 127. while trying to load /var/buildslave-mozilla/mozilla-central-amd64/build/media/webrtc/trunk/peerconnection.gyp
configure: error: failed to generate WebRTC Makefiles

(see for the full configure log)

This is because the internals of gyp don't reuse PYTHON from the build system; On OpenBSD there's no such 'python' in $PATH, only python2.7, and i've been using mk_add_options PYTHON=/usr/local/bin/python2.7 in .mozconfig since the build system started relying more and more on python. This has worked fine so far, and i'd hate to do a non-standard python2.7->python symlink.

The failure comes from media/webrtc/trunk/build/common.gypi:527
 'incremental_chrome_dll%': '<!(python <(DEPTH)/tools/win/supalink/',

(why is this code ever called on *nix ?) adding $PYTHON here of course doesn't work.. another option would be to reuse the one from virtualenv :

Creating Python virtualenv
New python executable in ./_virtualenv/bin/python2.7
Also creating executable in ./_virtualenv/bin/python

Unfortunately i'm offline until the 15 so i can't fix it now myself, but it'd be nice if this could be fixed before next aurora uplift...
Comment 1 User image Landry Breuil (:gaston) 2012-07-09 02:21:10 PDT
And after some fiddling and tweaking in media/webrtc/trunk/build/common.gypi :

-    'incremental_chrome_dll%': '<!(python <(DEPTH)/tools/win/supalink/',
+    'conditions': [
+    ['OS=="win"', {
+        'incremental_chrome_dll%': '<!(python <(DEPTH)/tools/win/supalink/',
+    }]],

And workarounding a build failure in libvpx (reopened #750447), it appears to me like webrtc doesnt build at all on OpenBSD should be only enabled on platforms that explicitely support it for now on. Ie Linux/Mac/Win.

On OpenBSD (and likely every other BSD) the linux codepath is taken in modules/audio_device/main/source/linux, and it fails to build since it tries to include alsa headers, which are of course linux-only. That'll need some time to get that code to compile & run on !linux, so in the meantime m-c shouldnt try to build webrtc on 'unsupported' platforms...

Note that the issue with 'incremental_chrome_dll%': '<!(python <(DEPTH)/tools/win/supalink/' remains to be fixed..
Comment 2 User image Randell Jesup [:jesup] 2012-07-09 06:51:55 PDT
Taking bug, likely will disable on other *nix's for now - though if we made it detect ALSA vs Pulse, and Pulse is on *BSD, it might be ok.

The python thing is easy.
Comment 3 User image Randell Jesup [:jesup] 2012-07-09 08:45:29 PDT
Created attachment 640237 [details] [diff] [review]
Don't build webrtc except for Linux/Mac/Windows; don't check for chrome dlls on windows

Try build running at  Already looking green for linux and Mac.  Feel free to try this on a *BSD
Comment 4 User image Randell Jesup [:jesup] 2012-07-09 09:04:29 PDT
Comment on attachment 640237 [details] [diff] [review]
Don't build webrtc except for Linux/Mac/Windows; don't check for chrome dlls on windows

Yes, I'll get rid of the spurious blank line. :-)  Try running, see previous comment.
Comment 5 User image bugmenot 2012-07-09 10:27:41 PDT
Why not encourage people to port it by explicitly asking for --disable-webrtc similar to --disable-necko-wifi ?

And Alsa works at least on FreeBSD with OSS plugin.
Comment 6 User image Randell Jesup [:jesup] 2012-07-09 11:24:55 PDT
Green on all platforms in try; checked build logs to make sure it built for linux/mac/win.

I'll defer to the build peers on which way this should work; I'll note that we (Mozilla webrtc team) don't have cycles to work on porting the core webrtc code to other OS's at this moment, though someone could contribute patches back to  Thus I'd rather avoid pain for anyone on a non-standard platform we're not ready to help with.  If someone gets it working (it can be done, might be easy!), we'll happily help take the patch and get it upstreamed as needed.
Comment 7 User image Benjamin Smedberg [:bsmedberg] 2012-07-09 11:27:34 PDT
Comment on attachment 640237 [details] [diff] [review]
Don't build webrtc except for Linux/Mac/Windows; don't check for chrome dlls on windows

That seems deterministic enough.
Comment 9 User image Ryan VanderMeulen [:RyanVM] 2012-07-09 18:03:09 PDT
Comment 10 User image Landry Breuil (:gaston) 2012-07-15 12:05:04 PDT
Thanks jesup for handling this, i've had a successful unpatched build on the 14 so it solved the issue for me. I'll try to work on porting webrtc to openbsd (at least getting it build fine) when time permits.

Note You need to log in before you can comment on or make changes to this bug.