Commit Graph

501 Commits

Author SHA1 Message Date
Patrick Rohr
b1726f7019 gn2bp: delete obsolete version in p/m/C
This code has moved to external/cronet/android/tools/gn2bp.

Test: none
Change-Id: I3e95de24f01f01c937a223ae6cf501bc505f9de2
2023-03-29 16:23:45 -07:00
Mohannad Farrag
8c5b578a0d gn2bp: Turn off allocator_shims for musl only
* I've investigated turning off `allocator_shims` globally for all of Cronet but
this didn't sound like a good option. allocator_shims are used for security measures,
where sometimes malloc caller forget to check for NULL which happens on oom. allocator_shims would
instantly kill the app instead of depending on the caller to do the validity check.
* The solution here was to manually remove the files and add them to `android` and `glibc` only so allocator_shims
is never compiled for musl.
* Chromium does not support musl so there's no flag for `musl` with allocator_shims.

Test: mma
Change-Id: I2a63b14482a526d06a089647e6f61eea9f1691dc
2023-03-24 11:37:22 +00:00
Mohannad Farrag
16ba062336 gn2bp: Remove soong_namespace
* This was causing the infra to ignore the modules and masking build errors.

Test: TH
Change-Id: Ic5aa3557353488d5370f4d9c4240954820bfe52b
2023-03-23 12:14:04 +00:00
Chidera Olibie
fb94c31fc0 Merge "Do not jarjar tests if explicitly excluded." 2023-03-23 08:26:47 +00:00
Motomu Utsumi
136f5106af gn2bp: Restrict visibility
Bug: 273656868
Test: ./update_results.sh, TH
Change-Id: Ieb8285b0308495c0cf2d9281ed54714280b7ebb0
2023-03-23 11:00:03 +09:00
Chidera Olibie
694295717c Do not jarjar tests if explicitly excluded.
Test: m
Change-Id: I0ebd5f2d5566d12a1cf0136fcf3e588899757b7c
2023-03-20 23:05:40 +00:00
Chidera Olibie
26076f9ee6 Add cronet_tests target
Test: m cronet_aml_components_cronet_android_cronet_tests__testing
Bug: 267353182
Change-Id: Ib2f555e3d36a5590387a282f4ce8c2ecca2f66d0
2023-03-20 22:28:01 +00:00
Mohannad Farrag
1e68691ac2 gn2bp: Add boringssl change to gn2bp generator
Test: None
Change-Id: I5c32d3ec6e0e7351650896b96dd9f2755fe9ca1b
2023-03-20 19:02:56 +00:00
Chidera Olibie
32f47411d0 [Cronet] Remove static_libs from genrules
Also adds soong_namespace to bp: cc: aosp/2493857

Test: th
Bug: 274094720
Change-Id: Iddcfee5da5d155708ba164783242c9e1e13b070d
2023-03-20 18:48:57 +00:00
Mohannad Farrag
aa9159f937 gn2bp: Fix some protos include_dirs
* Some net files have different include_dirs for protos generated. If the generated file is at A/B/C/src/D/E. The net file expect the
export include dir to be A/B/C/src/

Test: None
Change-Id: I9ebe54094ea6bd2b00645be2bf724889dbcb3c1f
2023-03-14 14:43:01 +00:00
Mohannad Farrag
b6016b6ba4 gn2bp: Fix action_foreach with GnRunBinary
* Remove the python3 calls and replace them with the binary right away.
* Fix action_foreach where sources can be used with {{source_file_name}}

Test: None
Change-Id: I0c2e6fd5135de70339168b9ba5d3b7f3a6866fdc
2023-03-14 14:31:01 +00:00
Mohannad Farrag
cf3a6e698e gn2bp: Remove sqlite from net_unittests
Apply https://chromium-review.googlesource.com/c/chromium/src/+/4166159

Test: None
Change-Id: I297718dddd86a838367e86b8a0449d23114439b6
2023-03-14 14:30:41 +00:00
Mohannad Farrag
c1d95117d3 Revert "gn2bp: Convert cc_objects to cc_static_library"
This reverts commit 379d79d1b0.

Reason for revert: This is breaking the symbols of test library.

Test: None
Change-Id: I3a2e8a9a6ec6ce04038ed34489ece6a1ca053cef
2023-03-14 11:02:48 +00:00
Motomu Utsumi
5eff4fbbcf gn2bp: Update desc json and Android.bp.swp
For manual Android.bp change in aosp/2475845

Bug: 265674359
Test: ./update_results.sh
Change-Id: Ie94708167479a67a52bbc1c7fd629a8206585cfd
2023-03-14 15:54:17 +09:00
Stefano Duo
f5954480f5 gn2bp: Add an helper to drop unneeded third_party dependencies
Use a more expressive always_disable function to disable unneeded
third_party dependencies.

Test: Android.bp.swp output is equivalent
Change-Id: Ib21646dfa076fc6f745b7871851744d6ed18eaf3
2023-03-13 13:28:35 +00:00
Stefano Duo
170dc8e82c gn2bp: Drop upstream boringssl build rules in favor of local Android.bp
Due to AOSP's FIPS requirements, AOSP-Cronet's BoringSSL must be
built differently than Chromium-Cronet's BoringSSL. The downstream way
of building BoringSSL is manually mantained in
//external/cronet/third_party/boringssl. So, whenever a target depends
on upstream's boringssl translate that to the downstream custom target.

Test: m && CtsNetHttpTestCases
Change-Id: I34a69de79397c35358745388be433934c203d2b2
2023-03-13 13:28:35 +00:00
Chidera Olibie
25957f5872 Remove module for creating license for gn2bp script
The license file has moved to external/cronet/Android.extras.bp
in aosp/2469561

Test: m
Change-Id: I2b99de4970a8bf8275195b73b9ad603477bcaf24
2023-03-10 19:54:53 +00:00
Mohannad Farrag
379d79d1b0 gn2bp: Convert cc_objects to cc_static_library
* cc_objects are more like source-sets. However, they are not commonly used in AOSP which makes it risky to rely on them.
* Clang native code coverage is not working for cc_objects. Which is needed for the dashboard.

Size Delta to .SO
x64: -0.1MB
x86: 0MB
arm: 0MB
arm64: 0MB

Test: m
Bug: 270027426
Change-Id: I1d74e0293dac91334bded73b0e89465b7af7480c
2023-03-02 11:33:19 +00:00
Mohannad Farrag
5d17632032 gn2bp: Move cronet_aml_api_java to Android.extras.bp
Test: mma
Change-Id: Ia195d7d8505933167478c2f7c116709e1d17a31f
2023-02-27 18:42:23 +00:00
Mohannad Farrag
1413126366 gn2bp: Update desc_*.json due to overwriting
desc_*.json has been overwritten by https://android-review.git.corp.google.com/c/platform/packages/modules/Connectivity/+/2429636/5

Test: None
Change-Id: I4ffc7c9fa48aaf8f9842871b5d07f69eaeeaeeea
2023-02-22 18:42:52 +00:00
Mohannad Farrag
5b8779110f gn2bp: Only compile x64 for host machines
* The generated desc_*.json files except the compiling(not target) cpu architecture to be x64. which
  was an issue because Soong tries to compile for both x32 and x64.

Test: mma
Change-Id: I6be5ed045a25e4020e69bf0157f919f43e68e2c0
2023-02-22 18:42:18 +00:00
Mohannad Farrag
b5aa8ea1c8 gn2bp: Change stem for test targets
* Stem should be the name of the target under GN build system as this is the one expected in the source code
as seen here https://source.chromium.org/chromium/chromium/src/+/main:components/cronet/android/test/javatests/src/org/chromium/net/CronetTestRule.java;l=244?q=loadLibrary%5C(%5C%22cronet_tests&ss=chromium%2Fchromium%2Fsrc

Test: None
Change-Id: I758b9b265d0187c93b4fc8ab48491cc5f7a5a750
2023-02-22 18:41:47 +00:00
Mohannad Farrag
5127480bb5 gn2bp: Duplicate cronet_aml_java for testing
Test: None
Change-Id: Ib7cd19697ac39362cc67ad97e4c6bcf1c516e287
2023-02-22 18:41:41 +00:00
Mohannad Farrag
f27cd35ddc gn2bp: Duplicate genrules that affect the JNI/Jarjar
* Most of the genrules doesn't affect the JNI/jajar. Only genrules that uses
the following scripts must be jarjared
  * //base/android/jni_generator/jni_generator.py
  * //base/android/jni_generator/jni_registration_generator.py

Test: None
Change-Id: I2f750e151002b8b21fa2bfd557ad1bbaf5110dff
2023-02-22 18:40:59 +00:00
Mohannad Farrag
edb2fd014b gn2bp: Duplicate modules reachable from test targets
* The current testing situation for Cronet is dire due to the presence of Cronet on the platform,
As cronet is on the platform, we can't run any unit-tests as they'll link against the platform version
and not the statically-linked cronet. We could avoid this by jarjaring the code however this is impossible.

* It's impossible to jar-jar the code as the C++ code which does JNI expects jar-jared java classes. So the
only possible solution here would be to duplicate the C++ modules, one for testing(with no jarjar) and another
for platform(with jarjar)

* Java sources/actions are not collected for testing modules until a proper solution has been figured out.

Test: None
Change-Id: I20bbad13d83e9e3c7956f028f3f0493b24d0f8bc
2023-02-22 18:34:49 +00:00
Mohannad Farrag
fc05430542 gn2bp: Prevent collection of source files for testing modules
Test: none
Change-Id: I72a2a23021b01bbf7a78fd458405340349503ea5
2023-02-22 18:34:08 +00:00
Mohannad Farrag
6f8b0bfe1d gn2bp: Add cronet_unittests_android to the generated Android.bp
* This is a test suite containing 90 unit tests which passes currently on AOSP. using a custom test runner that will be pushed
in upcoming commits

Test: m
Change-Id: Ifa2aa82c5a36ab5b5f9f91dc52dfe803a429a074
2023-02-22 18:32:57 +00:00
Mohannad Farrag
752afc0974 Merge changes I549d78ba,I2a3bbe64,Id48dabf8
* changes:
  gn2bp: Add linker script to modules
  gn2bp: Add missing linker flags
  gn2bp: Fix C++ warning showing up as errors when compiling cronet tests
2023-02-22 17:57:17 +00:00
Mohannad Farrag
3015f6bcac Merge "gn2bp: Fix arch-dependent cc_genrule" 2023-02-22 17:56:56 +00:00
Mohannad Farrag
6c84e98b7c Merge "gn2bp: Fix actionSanitizer for gn_run_binary" 2023-02-22 17:56:46 +00:00
Mohannad Farrag
d5f026395a Merge "gn2bp: Extract aidl srcs and include dirs" 2023-02-22 17:56:07 +00:00
Mohannad Farrag
0bf6a696a6 gn2bp: Add linker script to modules
Test: m
Change-Id: I549d78baf94b1abec07782df006269ba00e2776c
2023-02-22 13:00:23 +00:00
Mohannad Farrag
875d83b140 gn2bp: Add missing linker flags
* Tests usually shim memory allocations for metrics purposes through linker flags.

Test: m
Change-Id: I2a3bbe648f155469721cf1df25439ca60afee6b5
2023-02-22 12:56:14 +00:00
Mohannad Farrag
6f59224b16 gn2bp: Fix C++ warning showing up as errors when compiling cronet tests
Test: m
Change-Id: Id48dabf893fb7dc7698973f8d52a802134d77e82
2023-02-22 12:55:10 +00:00
Mohannad Farrag
75bc2b175b gn2bp: Fix arch-dependent cc_genrule
* The cmd of the `cc_genrule` is now arch-dependent. So we no longer generate a genrule for each arch.
  The propagation of the arch-dependent genrule was broken due to an old if-statement.

Test: m
Change-Id: I4b9b522c429f32fe74d141b00bd856f6c39498d7
2023-02-22 12:54:54 +00:00
Mohannad Farrag
631b5c5703 gn2bp: Fix actionSanitizer for gn_run_binary
* This is a python script that runs a binary on files to generate output files for testing.
* The python script is not really needed as we can run the binary right away.

Test: m
Change-Id: I3be64e7f51380f2c028dec3168c924451076db95
2023-02-22 12:54:06 +00:00
Mohannad Farrag
cdbfeb8c45 gn2bp: Extract aidl srcs and include dirs
* Aidl `local_include_dirs` was hardcoded. This change should handle extracting the srcs and local include dirs for any
aidl action.

Test: m
Change-Id: I7893dd3897f292f96c1934b192d20b97c26c54cb
2023-02-22 12:41:41 +00:00
Mohannad Farrag
9749911bef gn2bp: Add Android.extras.bp support
Test: TH
Change-Id: I66bbbb17446ea1f87e07b3d63d2c4e1ffa9d1a51
2023-02-22 11:36:52 +00:00
Motomu Utsumi
925a9d508e gn2bp: Add unwind related cflags to cflag_allowlist
Bug: 265913942
Test: ./update_results.sh
Change-Id: I264449b31972e963e7833b0647d5f0634e92756f
2023-02-13 03:48:47 +00:00
Motomu Utsumi
8d9a62269c gn2bp: Update args.gn in gen_desc_json
Update gen_desc_json to use the same args.gn with release build job
args.gn was taken from following build job
https://ci.chromium.org/ui/p/chrome/builders/ci/cronet-arm/13133/overview
https://ci.chromium.org/ui/p/chrome/builders/ci/cronet-arm_64/13142/overview
https://ci.chromium.org/ui/p/chrome/builders/ci/cronet-x64/13110/overview
https://ci.chromium.org/ui/p/chrome/builders/ci/cronet-x86/13106/overview

Update desc json and Android.bp following args.gn update.

Bug: 265913942
Test: ./update_results.sh
Change-Id: I676431180e9d25e75612c84b6ce6c03585aed1af
2023-02-13 03:48:17 +00:00
Treehugger Robot
e3e84d0fc3 Merge "gn2bp: Add use_nss_certs = false to gen_desc_json" 2023-02-10 15:18:28 +00:00
Treehugger Robot
39fd1af819 Merge "gn2bp: Update desc.json & Android.bp after trimming third-parties" 2023-02-10 10:48:41 +00:00
Mohannad Farrag
a6f43306c0 gn2bp: Add use_nss_certs = false to gen_desc_json
nss_certs are only used for host net unittestings.
Android.bp is not affected because the tests are not pulled-in yet.

Test: None
Change-Id: Idef23174d1ecd89c2db90318bfb0cf67a4e70145
2023-02-10 10:29:14 +00:00
Mohannad Farrag
5ae53722a7 gn2bp: Update desc.json & Android.bp after trimming third-parties
for more context: crrev.com/c/4218341

Test: None
Change-Id: If0e600b0660aa691d5f15e93bed1f21dfcdd9054
2023-02-09 16:07:10 +00:00
Motomu Utsumi
d87f3191ec gn2bp: Remove duplicated cflags from default.cflags
They are in cflag_allowlist so don't need to be in default

Bug: 265913942
Test: ./update_resutls.sh
Change-Id: Ia3ed3c1f2d1c784832d01405706eb2f30db725a9
2023-02-09 17:54:12 +09:00
Motomu Utsumi
cac340ffa6 gn2bp: Pass additional cflags to reduce cronet library size
Bug: 265913942
Test: ./update_results.sh
Change-Id: Ib802862d1ccab4b8cc2906a0f08aa2d3bddef9e2
2023-02-09 17:54:02 +09:00
Motomu Utsumi
ea38e4eb22 gn2bp: Pass ldflags to reduce cronet library size
Bug: 265913942
Test: ./update_results.sh
Change-Id: I650f354c7523b0649a190cb33dbd0dd0795c14d9
2023-02-09 17:53:54 +09:00
Motomu Utsumi
3ff52fe6d2 gn2bp: Make ldflags target specific
Bug: 265913942
Test: ./update_results.sh
Change-Id: Ia7184e9b765240afa76ea2f15089e5ab00e6e560
2023-02-09 17:53:46 +09:00
Motomu Utsumi
9a21955bab gn2bp: Make ldflags arch specific
Bug: 265913942
Test: ./update_results.sh
Change-Id: I5908b7afcba663ebf2a5710264447f9c5506daab
2023-02-09 17:53:38 +09:00
Mohannad Farrag
0e2a1e1289 gn2bp: Update Cronet license.
Test: TH
Change-Id: I944fc3e1ce1fa4598d11f2de821ddf013dc83077
2023-01-31 18:51:29 +00:00