|
|
Created:
4 years, 4 months ago by ehmaldonado_webrtc Modified:
4 years, 4 months ago CC:
webrtc-reviews_webrtc.org, tterriberry_mozilla.com, sakal Base URL:
https://chromium.googlesource.com/external/webrtc.git@master Target Ref:
refs/pending/heads/master Project:
webrtc Visibility:
Public. |
DescriptionAdd libjingle_peerconnection_unittest to GN targets.
BUG=webrtc:6037
NOTRY=True
Committed: https://crrev.com/3651d8f97f58b029f757f07b381821e6990daf81
Cr-Commit-Position: refs/heads/master@{#13703}
Patch Set 1 #
Total comments: 5
Patch Set 2 : Addressed comments #
Total comments: 8
Patch Set 3 : It compiles! #Messages
Total messages: 22 (8 generated)
ehmaldonado@webrtc.org changed reviewers: + kjellander@webrtc.org
It's failing with a bunch of errors like. I'm trying to follow https://cs.chromium.org/chromium/src/third_party/webrtc/examples/BUILD.gn but I don't really know what I'm doing anymore. $ gn gen out/Default --args='is_debug=false target_os="android" target_cpu="arm"' ERROR Unresolved dependencies. //webrtc/api:libjingle_peerconnection_android_unittest_apk__create__package_resources(//build/toolchain/android:arm) needs //webrtc/api:libjingle_peerconnection_unittest_java(//build/toolchain/android:arm) //webrtc/api:libjingle_peerconnection_android_unittest_apk__create__package_resources(//build/toolchain/android:arm) needs //webrtc/api:libjingle_peerconnection_unittest_resources(//build/toolchain/android:arm) //webrtc/api:libjingle_peerconnection_android_unittest__isolate__write_deps(//build/toolchain/android:arm) needs //webrtc/api:libjingle_peerconnection_unittest_java(//build/toolchain/android:arm) //webrtc/api:libjingle_peerconnection_android_unittest_java__lint(//build/toolchain/android:arm) needs //webrtc/api:libjingle_peerconnection_unittest_resources(//build/toolchain/android:arm) //webrtc/api:libjingle_peerconnection_android_unittest__apk__create_incremental__package(//build/toolchain/android:arm) needs //webrtc/api:libjingle_peerconnection_unittest_java(//build/toolchain/android:arm) ....
I think I found the errors for you. Generation worked for me when fixing them. https://codereview.webrtc.org/2226093003/diff/1/webrtc/api/BUILD.gn File webrtc/api/BUILD.gn (right): https://codereview.webrtc.org/2226093003/diff/1/webrtc/api/BUILD.gn#newcode405 webrtc/api/BUILD.gn:405: if (is_android && !build_with_chromium) { Since you're inside the rtc_include_tests condition, this code is already excluded from Chromium, so you can remove the "&& !build_with_chromium" part here. https://codereview.webrtc.org/2226093003/diff/1/webrtc/api/BUILD.gn#newcode411 webrtc/api/BUILD.gn:411: ":libjingle_peerconnection_unittest_java", Change to :libjingle_peerconnection_android_unittest_java https://codereview.webrtc.org/2226093003/diff/1/webrtc/api/BUILD.gn#newcode412 webrtc/api/BUILD.gn:412: ":libjingle_peerconnection_unittest_resources", :libjingle_peerconnection_android_unittest_resources https://codereview.webrtc.org/2226093003/diff/1/webrtc/api/BUILD.gn#newcode436 webrtc/api/BUILD.gn:436: ":libjingle_peerconnection_unittest_resources", :libjingle_peerconnection_android_unittest_resources https://codereview.webrtc.org/2226093003/diff/1/webrtc/api/BUILD.gn#newcode456 webrtc/api/BUILD.gn:456: ":libjingle_peerconnection_unittest_java", :libjingle_peerconnection_android_unittest_java
Description was changed from ========== IN PROGRESS: Add libjingle_peerconnection_unittest to GN targets. BUG= ========== to ========== IN PROGRESS: Add libjingle_peerconnection_unittest to GN targets. BUG=webrtc:6037 ==========
On 2016/08/09 11:10:16, kjellander_webrtc wrote: > I think I found the errors for you. Generation worked for me when fixing them. > > https://codereview.webrtc.org/2226093003/diff/1/webrtc/api/BUILD.gn > File webrtc/api/BUILD.gn (right): > > https://codereview.webrtc.org/2226093003/diff/1/webrtc/api/BUILD.gn#newcode405 > webrtc/api/BUILD.gn:405: if (is_android && !build_with_chromium) { > Since you're inside the rtc_include_tests condition, this code is already > excluded from Chromium, so you can remove the > "&& !build_with_chromium" part here. > > https://codereview.webrtc.org/2226093003/diff/1/webrtc/api/BUILD.gn#newcode411 > webrtc/api/BUILD.gn:411: ":libjingle_peerconnection_unittest_java", > Change to :libjingle_peerconnection_android_unittest_java > > https://codereview.webrtc.org/2226093003/diff/1/webrtc/api/BUILD.gn#newcode412 > webrtc/api/BUILD.gn:412: ":libjingle_peerconnection_unittest_resources", > :libjingle_peerconnection_android_unittest_resources > > https://codereview.webrtc.org/2226093003/diff/1/webrtc/api/BUILD.gn#newcode436 > webrtc/api/BUILD.gn:436: ":libjingle_peerconnection_unittest_resources", > :libjingle_peerconnection_android_unittest_resources > > https://codereview.webrtc.org/2226093003/diff/1/webrtc/api/BUILD.gn#newcode456 > webrtc/api/BUILD.gn:456: ":libjingle_peerconnection_unittest_java", > :libjingle_peerconnection_android_unittest_java Done, thanks! GN now executes, but ninja fails with: ../../webrtc/api/androidtests/AndroidManifest.xml:24: error: Error: No resource found that matches the given name (at 'icon' with value '@drawable/ic_launcher'). ../../webrtc/api/androidtests/AndroidManifest.xml:24: error: Error: No resource found that matches the given name (at 'label' with value '@string/app_name').
On 2016/08/09 11:10:16, kjellander_webrtc wrote: > I think I found the errors for you. Generation worked for me when fixing them. > > https://codereview.webrtc.org/2226093003/diff/1/webrtc/api/BUILD.gn > File webrtc/api/BUILD.gn (right): > > https://codereview.webrtc.org/2226093003/diff/1/webrtc/api/BUILD.gn#newcode405 > webrtc/api/BUILD.gn:405: if (is_android && !build_with_chromium) { > Since you're inside the rtc_include_tests condition, this code is already > excluded from Chromium, so you can remove the > "&& !build_with_chromium" part here. > > https://codereview.webrtc.org/2226093003/diff/1/webrtc/api/BUILD.gn#newcode411 > webrtc/api/BUILD.gn:411: ":libjingle_peerconnection_unittest_java", > Change to :libjingle_peerconnection_android_unittest_java > > https://codereview.webrtc.org/2226093003/diff/1/webrtc/api/BUILD.gn#newcode412 > webrtc/api/BUILD.gn:412: ":libjingle_peerconnection_unittest_resources", > :libjingle_peerconnection_android_unittest_resources > > https://codereview.webrtc.org/2226093003/diff/1/webrtc/api/BUILD.gn#newcode436 > webrtc/api/BUILD.gn:436: ":libjingle_peerconnection_unittest_resources", > :libjingle_peerconnection_android_unittest_resources > > https://codereview.webrtc.org/2226093003/diff/1/webrtc/api/BUILD.gn#newcode456 > webrtc/api/BUILD.gn:456: ":libjingle_peerconnection_unittest_java", > :libjingle_peerconnection_android_unittest_java Done, thanks! GN now executes, but ninja fails with: ../../webrtc/api/androidtests/AndroidManifest.xml:24: error: Error: No resource found that matches the given name (at 'icon' with value '@drawable/ic_launcher'). ../../webrtc/api/androidtests/AndroidManifest.xml:24: error: Error: No resource found that matches the given name (at 'label' with value '@string/app_name').
On 2016/08/09 11:49:52, ehmaldonado_webrtc wrote: > On 2016/08/09 11:10:16, kjellander_webrtc wrote: > > I think I found the errors for you. Generation worked for me when fixing them. > > > > https://codereview.webrtc.org/2226093003/diff/1/webrtc/api/BUILD.gn > > File webrtc/api/BUILD.gn (right): > > > > https://codereview.webrtc.org/2226093003/diff/1/webrtc/api/BUILD.gn#newcode405 > > webrtc/api/BUILD.gn:405: if (is_android && !build_with_chromium) { > > Since you're inside the rtc_include_tests condition, this code is already > > excluded from Chromium, so you can remove the > > "&& !build_with_chromium" part here. > > > > https://codereview.webrtc.org/2226093003/diff/1/webrtc/api/BUILD.gn#newcode411 > > webrtc/api/BUILD.gn:411: ":libjingle_peerconnection_unittest_java", > > Change to :libjingle_peerconnection_android_unittest_java > > > > https://codereview.webrtc.org/2226093003/diff/1/webrtc/api/BUILD.gn#newcode412 > > webrtc/api/BUILD.gn:412: ":libjingle_peerconnection_unittest_resources", > > :libjingle_peerconnection_android_unittest_resources > > > > https://codereview.webrtc.org/2226093003/diff/1/webrtc/api/BUILD.gn#newcode436 > > webrtc/api/BUILD.gn:436: ":libjingle_peerconnection_unittest_resources", > > :libjingle_peerconnection_android_unittest_resources > > > > https://codereview.webrtc.org/2226093003/diff/1/webrtc/api/BUILD.gn#newcode456 > > webrtc/api/BUILD.gn:456: ":libjingle_peerconnection_unittest_java", > > :libjingle_peerconnection_android_unittest_java > > Done, thanks! > GN now executes, but ninja fails with: > ../../webrtc/api/androidtests/AndroidManifest.xml:24: error: Error: No resource > found that matches the given name (at 'icon' with value > '@drawable/ic_launcher'). > ../../webrtc/api/androidtests/AndroidManifest.xml:24: error: Error: No resource > found that matches the given name (at 'label' with value '@string/app_name'). Hmm, I'm able to build the libjingle_peerconnection_android_unittest_apk target, but when I build 'all' (i.e. not specifying a target) I get the same error as you. I'll dig some more later, have to get home now.
On 2016/08/09 15:01:56, kjellander_webrtc wrote: > On 2016/08/09 11:49:52, ehmaldonado_webrtc wrote: > > On 2016/08/09 11:10:16, kjellander_webrtc wrote: > > > I think I found the errors for you. Generation worked for me when fixing > them. > > > > > > https://codereview.webrtc.org/2226093003/diff/1/webrtc/api/BUILD.gn > > > File webrtc/api/BUILD.gn (right): > > > > > > > https://codereview.webrtc.org/2226093003/diff/1/webrtc/api/BUILD.gn#newcode405 > > > webrtc/api/BUILD.gn:405: if (is_android && !build_with_chromium) { > > > Since you're inside the rtc_include_tests condition, this code is already > > > excluded from Chromium, so you can remove the > > > "&& !build_with_chromium" part here. > > > > > > > https://codereview.webrtc.org/2226093003/diff/1/webrtc/api/BUILD.gn#newcode411 > > > webrtc/api/BUILD.gn:411: ":libjingle_peerconnection_unittest_java", > > > Change to :libjingle_peerconnection_android_unittest_java > > > > > > > https://codereview.webrtc.org/2226093003/diff/1/webrtc/api/BUILD.gn#newcode412 > > > webrtc/api/BUILD.gn:412: ":libjingle_peerconnection_unittest_resources", > > > :libjingle_peerconnection_android_unittest_resources > > > > > > > https://codereview.webrtc.org/2226093003/diff/1/webrtc/api/BUILD.gn#newcode436 > > > webrtc/api/BUILD.gn:436: ":libjingle_peerconnection_unittest_resources", > > > :libjingle_peerconnection_android_unittest_resources > > > > > > > https://codereview.webrtc.org/2226093003/diff/1/webrtc/api/BUILD.gn#newcode456 > > > webrtc/api/BUILD.gn:456: ":libjingle_peerconnection_unittest_java", > > > :libjingle_peerconnection_android_unittest_java > > > > Done, thanks! > > GN now executes, but ninja fails with: > > ../../webrtc/api/androidtests/AndroidManifest.xml:24: error: Error: No > resource > > found that matches the given name (at 'icon' with value > > '@drawable/ic_launcher'). > > ../../webrtc/api/androidtests/AndroidManifest.xml:24: error: Error: No > resource > > found that matches the given name (at 'label' with value '@string/app_name'). > > Hmm, I'm able to build the libjingle_peerconnection_android_unittest_apk target, > but when I build 'all' (i.e. not specifying a target) I get the same error as > you. > > I'll dig some more later, have to get home now. Just a short update. I can repro when building the libjingle_peerconnection_android_unittest__apk__process_resources target part of the android_apk template here: https://cs.chromium.org/chromium/src/build/config/android/rules.gni?rcl=0&l=1657 I think we need to better understand how all that template stuff works, and how it processes the AndroidManifest.xml to check for the existence of all its files. It's entirely possible the resources have been missing all the time and that GYP just didn't have any similar check. +sakal in case you can help out some here (you did some other Android targets).
sakal@webrtc.org changed reviewers: + sakal@webrtc.org
I tested with following changes and it worked. https://codereview.webrtc.org/2226093003/diff/20001/webrtc/api/BUILD.gn File webrtc/api/BUILD.gn (right): https://codereview.webrtc.org/2226093003/diff/20001/webrtc/api/BUILD.gn#newco... webrtc/api/BUILD.gn:404: android_apk("libjingle_peerconnection_android_unittest_apk") { This target is not needed. There is no application apk. Please remove. https://codereview.webrtc.org/2226093003/diff/20001/webrtc/api/BUILD.gn#newco... webrtc/api/BUILD.gn:418: android_library("libjingle_peerconnection_android_unittest_java") { This is not needed either. I created it for AppRTCDemo so I can share code between the application apk and the test apk. Move java files directly to libjingle_peerconnection_android_unittest. https://codereview.webrtc.org/2226093003/diff/20001/webrtc/api/BUILD.gn#newco... webrtc/api/BUILD.gn:439: android_resources("libjingle_peerconnection_android_unittest_resources") { I would move this target below libjingle_peerconnection_android_unittest. From the style guide: Other targets should be in “some order that makes sense.” Usually more important targets will be first, and unit tests will follow the corresponding target. If there's no clear ordering, consider alphabetical order. https://codereview.webrtc.org/2226093003/diff/20001/webrtc/api/BUILD.gn#newco... webrtc/api/BUILD.gn:441: custom_package = "org.webrtc" This should be "org.webrtc.test". Resources are for the test apk directly. https://codereview.webrtc.org/2226093003/diff/20001/webrtc/api/BUILD.gn#newco... webrtc/api/BUILD.gn:448: java_files = [ "androidtests/src/org/webrtc/PeerConnectionTest.java" ] Add rest of the java files here. https://codereview.webrtc.org/2226093003/diff/20001/webrtc/api/BUILD.gn#newco... webrtc/api/BUILD.gn:450: apk_under_test = ":libjingle_peerconnection_android_unittest_apk" This target does not test an apk. Please remove this line. https://codereview.webrtc.org/2226093003/diff/20001/webrtc/api/BUILD.gn#newco... webrtc/api/BUILD.gn:453: ":libjingle_peerconnection_android_unittest_java", Remove this dependency and add "//base:base_java", "//webrtc/base:base_java" and ":libjingle_peerconnection_android_unittest_resources". https://codereview.webrtc.org/2226093003/diff/20001/webrtc/api/BUILD.gn#newco... webrtc/api/BUILD.gn:455: ] Add: shared_libraries = [ ":libjingle_peerconnection_so" ]
On 2016/08/10 07:56:58, sakal wrote: > I tested with following changes and it worked. > > https://codereview.webrtc.org/2226093003/diff/20001/webrtc/api/BUILD.gn > File webrtc/api/BUILD.gn (right): > > https://codereview.webrtc.org/2226093003/diff/20001/webrtc/api/BUILD.gn#newco... > webrtc/api/BUILD.gn:404: > android_apk("libjingle_peerconnection_android_unittest_apk") { > This target is not needed. There is no application apk. Please remove. > > https://codereview.webrtc.org/2226093003/diff/20001/webrtc/api/BUILD.gn#newco... > webrtc/api/BUILD.gn:418: > android_library("libjingle_peerconnection_android_unittest_java") { > This is not needed either. I created it for AppRTCDemo so I can share code > between the application apk and the test apk. Move java files directly to > libjingle_peerconnection_android_unittest. > > https://codereview.webrtc.org/2226093003/diff/20001/webrtc/api/BUILD.gn#newco... > webrtc/api/BUILD.gn:439: > android_resources("libjingle_peerconnection_android_unittest_resources") { > I would move this target below libjingle_peerconnection_android_unittest. From > the style guide: > Other targets should be in “some order that makes sense.” Usually more important > targets will be first, and unit tests will follow the corresponding target. If > there's no clear ordering, consider alphabetical order. > > https://codereview.webrtc.org/2226093003/diff/20001/webrtc/api/BUILD.gn#newco... > webrtc/api/BUILD.gn:441: custom_package = "org.webrtc" > This should be "org.webrtc.test". Resources are for the test apk directly. > > https://codereview.webrtc.org/2226093003/diff/20001/webrtc/api/BUILD.gn#newco... > webrtc/api/BUILD.gn:448: java_files = [ > "androidtests/src/org/webrtc/PeerConnectionTest.java" ] > Add rest of the java files here. > > https://codereview.webrtc.org/2226093003/diff/20001/webrtc/api/BUILD.gn#newco... > webrtc/api/BUILD.gn:450: apk_under_test = > ":libjingle_peerconnection_android_unittest_apk" > This target does not test an apk. Please remove this line. > > https://codereview.webrtc.org/2226093003/diff/20001/webrtc/api/BUILD.gn#newco... > webrtc/api/BUILD.gn:453: ":libjingle_peerconnection_android_unittest_java", > Remove this dependency and add "//base:base_java", "//webrtc/base:base_java" and > ":libjingle_peerconnection_android_unittest_resources". > > https://codereview.webrtc.org/2226093003/diff/20001/webrtc/api/BUILD.gn#newco... > webrtc/api/BUILD.gn:455: ] > Add: shared_libraries = [ ":libjingle_peerconnection_so" ] Done. Thank you sakal!
lgtm
Description was changed from ========== IN PROGRESS: Add libjingle_peerconnection_unittest to GN targets. BUG=webrtc:6037 ========== to ========== Add libjingle_peerconnection_unittest to GN targets. BUG=webrtc:6037 ==========
It passes all tests on a device.
Description was changed from ========== Add libjingle_peerconnection_unittest to GN targets. BUG=webrtc:6037 ========== to ========== Add libjingle_peerconnection_unittest to GN targets. BUG=webrtc:6037 NOTRY=True ==========
On 2016/08/10 09:28:46, ehmaldonado_webrtc wrote: > It passes all tests on a device. Great (that's what I wanted to know before approving). LGTM. I removed "IN PROGRESS: " from the CL title as well (you have to edit in two places when changing it, just editing the first line in the description doesn't update the title). I also added NOTRY=True, so feel free to submit if the trybots are passing.
The CQ bit was checked by ehmaldonado@webrtc.org
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.webrtc.org/...
Message was sent while issue was closed.
Description was changed from ========== Add libjingle_peerconnection_unittest to GN targets. BUG=webrtc:6037 NOTRY=True ========== to ========== Add libjingle_peerconnection_unittest to GN targets. BUG=webrtc:6037 NOTRY=True ==========
Message was sent while issue was closed.
Committed patchset #3 (id:40001)
Message was sent while issue was closed.
Description was changed from ========== Add libjingle_peerconnection_unittest to GN targets. BUG=webrtc:6037 NOTRY=True ========== to ========== Add libjingle_peerconnection_unittest to GN targets. BUG=webrtc:6037 NOTRY=True Committed: https://crrev.com/3651d8f97f58b029f757f07b381821e6990daf81 Cr-Commit-Position: refs/heads/master@{#13703} ==========
Message was sent while issue was closed.
Patchset 3 (id:??) landed as https://crrev.com/3651d8f97f58b029f757f07b381821e6990daf81 Cr-Commit-Position: refs/heads/master@{#13703} |