Closed Bug 771981 Opened 9 years ago Closed 9 years ago

media/webrtc doesn't build on *BSD or other non-standard platforms


(Core :: WebRTC, defect)

Not set





(Reporter: gaston, Assigned: jesup)



(Whiteboard: [qa-])


(1 file)

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...
Depends on: 771248
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..
Depends on: 757637
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.
Component: Build Config → WebRTC
Try build running at  Already looking green for linux and Mac.  Feel free to try this on a *BSD
Assignee: nobody → rjesup
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.
Attachment #640237 - Flags: review?(benjamin)
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.
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 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.
Attachment #640237 - Flags: review?(benjamin) → review+
Summary: media/webrtc doesn't reuse PYTHON env var → media/webrtc doesn't build on *BSD or other non-standard platforms
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla16
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.
Whiteboard: [qa-]
You need to log in before you can comment on or make changes to this bug.