Closed Bug 767250 Opened 9 years ago Closed 9 years ago

redefined webrtc targets fails b2g build

Categories

(Core :: WebRTC, defect)

ARM
Gonk (Firefox OS)
defect
Not set
critical

Tracking

()

RESOLVED FIXED
mozilla16

People

(Reporter: vicamo, Assigned: jesup)

References

Details

(Whiteboard: [qa-])

Attachments

(2 files)

Imported WebRTC source code contains multiple Android.mk files that confuse gonk build system. Removing them or reassign GECKO_PATH to somewhere not under B2G topsrcdir fix this problem.

Reproduce steps:
$ cd B2G/gecko
$ git remote add mozilla git://github.com/mozilla/mozilla-central.git
$ git fetch mozilla
$ git checkout mozilla/master
$ cd ..; ./build.sh

gecko/media/webrtc/trunk/src/common_audio/resampler/Android.mk:13:
gecko/media/webrtc/trunk/src/common_audio/resampler/../../../android-webrtc.mk:
No such file or directory
build/core/base_rules.mk:170: ***
gecko/media/webrtc/trunk/src/common_audio/resampler:
MODULE.TARGET.STATIC_LIBRARIES.libwebrtc_resampler already defined by
external/webrtc/src/common_audio/resampler/main/source. Stop.
For my reference, what assumptions does the gonk build system make about Android.mk files?  In an imported project, if we end up needing those files it may be problematic to remove them.  They may no longer be needed (in preference to .gypi files), but I'd have to check each of 46 Android.mk files to be sure.

Since there are no other Android.mk files in the tree outside of media/webrtc, what's looking for Android.mk files and why?  How important is the assumption about the purpose of these files?
(In reply to Randell Jesup [:jesup] from comment #1)
> For my reference, what assumptions does the gonk build system make about
> Android.mk files?  In an imported project, if we end up needing those files
> it may be problematic to remove them.  They may no longer be needed (in
> preference to .gypi files), but I'd have to check each of 46 Android.mk
> files to be sure.

The gonk build system uses the Android build system. It scans all Android.mk files under the b2g repository and includes them all.

> Since there are no other Android.mk files in the tree outside of
> media/webrtc, what's looking for Android.mk files and why?  How important is
> the assumption about the purpose of these files?

There is no special use for these Android.mk files in gonk. If they are not used in other builds, I think it is safe to remove them.
(In reply to Randell Jesup [:jesup] from comment #1)
> For my reference, what assumptions does the gonk build system make about
> Android.mk files?  In an imported project, if we end up needing those files
> it may be problematic to remove them.  They may no longer be needed (in
> preference to .gypi files), but I'd have to check each of 46 Android.mk
> files to be sure.

Yup, that's the last thing anyone would want to do.

> Since there are no other Android.mk files in the tree outside of
> media/webrtc, what's looking for Android.mk files and why?

The Gonk(in fact, same as Android's) build system searches every first leaf Android.mk files and includes them after board config is done. So, any Android.mk files under B2G topsrcdir without a previous one in its path will be included directly. See B2G/build/main.mk line 466, 467:

466 subdir_makefiles := \
467         $(shell build/tools/findleaves.py --prune=out --prune=.repo --prune=.git $(subdirs) Android.mk)

> How important is the assumption about the purpose of these files?

I'm not sure whether or not does Fennec or other possible Android variants need them, but we may have two solutions here:

1.) Place a Android.mk in media/webrtc and invoke all-makefiles-under if we're not building B2G.
2.) Remove webrtc from B2G manifest.xml. But I'm not pretty sure what are the differences between external/webrtc and gecko/media/webrtc.
FYI. The results of above two solutions are:
1.) B2G build passed.
2.) missing *a lot* android-webrtc.mk files in gecko/media/webrtc. B2G build failed.
care to put up a patch for option 1?
I failed to find some useful variable defined only for B2G. If any, just replace "SOME_VAR_ONLY_DEFINED_FOR_B2G" with that.
Correction: I read the patch and more carefully read above, and you're saying they independently imported the webrtc.org code into external/webrtc!

So, if that's the case, the solution is to remove external/webrtc (and maybe to also do what you have above until we have it building for B2G)

Adding Chris Jones to help figure out what's up. (I haven't installed B2G source before, and the set of commands above I think assumes a working B2G repo setup - they fail for me).
Per mwu on IRC, we just need an blank Android.mk in a root dir to the offending makefiles.  Taking bug.  Should be simple
Assignee: nobody → rjesup
Attachment #635955 - Flags: review+
Note: bustage fix; I don't have a B2g/Gonk build env
FWIW I have applied the patch and confirmed that this fixes the issue.
Target Milestone: --- → mozilla16
https://hg.mozilla.org/mozilla-central/rev/83bde5a2881f
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Whiteboard: [qa-]
You need to log in before you can comment on or make changes to this bug.