Commit Graph

496 Commits

Author SHA1 Message Date
Joel Galenson
12467e54a7 Let cargo2android ensure some libraries are whole_static_libs.
Test: Use on a crate.
Change-Id: I1d6a3bdb47141d5d20af3c118fd7a05bef223a48
2021-07-13 08:55:17 -07:00
Joel Galenson
728af1ce8d Merge "Allow passing multiple crates to update_crate_tests.py" 2021-07-12 20:28:09 +00:00
Pirama Arumuga Nainar
f7f9544e36 [scripts] Get clang version from soong/scripts/get_clang_version.py
... instead of manually parsing soong/cc/config/global.go

Also hard-code clang_base in gdbclient.py to 'prebuilts/clang/host' as
it's unlikely to change in global.go.

Test: acov-llvm.py flush
Test: verify gdbclient.read_toolchain_config() in the interpreter
Change-Id: I28ed4416749edcd5d623598eb65eeb7891b657ae
2021-07-02 09:24:11 -07:00
Pirama Arumuga Nainar
a26dc346dd [scripts] Adjust FindClangDir
soong/scripts/get_clang_version.py now prints the whole prebuilt dir
(e.g. clang-r416183b1) instead of just the version number.

Test: invoke FindClangDir from the interpreter
Change-Id: I17363e6bc4a48fe6be345f87006baa4590371dc1
2021-07-02 09:24:07 -07:00
Treehugger Robot
5b65b9117d Merge "cargo2android.py: remove TEST_MAPPING generation" 2021-07-02 15:49:52 +00:00
Joel Galenson
177910448c Allow passing multiple crates to update_crate_tests.py
Currently the script can only run on a single crate at a time, and
each time it runs it re-initializes Bazel. By passing multiple crates
we can save time by only initializing Bazel once.

Test: Call with zero, one, and multiple crate arguments.
Change-Id: Ic83c16d87066a8555b736b35bc7971586ee26e16
2021-07-02 07:39:28 -07:00
Thiébaud Weksteen
198e93f61b cargo2android.py: remove TEST_MAPPING generation
Do not generate TEST_MAPPING when running cargo2android.py. Still accept
the command line argument so current users/wrappers continue working.

Bug: 192348260
Test: Run cargo2android.py manually on ahash
Change-Id: I1975119f8fdd3ae850649b105678dec92fa67518
2021-07-02 16:30:31 +02:00
Pirama Arumuga Nainar
05b20a7ebf [scripts] Fix clang path in symbol.py
Bug: http://b/187231324

Test: Verify directory returned by FindClangDir exists
Change-Id: I84d1a7b2194003409b8110772e450b1286a2ee0c
2021-06-29 13:06:03 -07:00
Pirama Arumuga Nainar
1438c6b0c3 Merge "[scripts] Remove hard-coded clang version" 2021-06-29 18:29:09 +00:00
Luke Huang
a1371afd29 Add name mapping for base64
Test: TH
Bug: 155855709
Change-Id: I1e411e2f831ede6f48822352774f6e44db5d409d
2021-06-29 18:57:33 +08:00
Elliott Hughes
a4d15f1960 Merge "Remove the shell gdbclient." 2021-06-28 22:42:00 +00:00
Elliott Hughes
75e4415780 Merge "Remove gdb-specific stuff from gdbclient.py (aka lldbclient.py)." 2021-06-28 22:41:50 +00:00
Elliott Hughes
e8f0dfb062 Merge "Remove an ART/dalvik gdb script." 2021-06-28 15:44:41 +00:00
Elliott Hughes
051439591a Remove the shell gdbclient.
Not to be confused with gdbclient.py, which lives on (albeit as a script
for running lldb rather than gdb).

Test: treehugger
Change-Id: I9d84d7c1d2f72dd6659d851b31f1ebd5f2a47384
2021-06-25 14:29:23 -07:00
Elliott Hughes
4c8e875d52 Remove gdb-specific stuff from gdbclient.py (aka lldbclient.py).
gdb is gone now.

Test: lldbclient.py -r date
Change-Id: I7fe15a43ff9144b07a1e8984b4b83477f76f06a9
2021-06-25 14:23:22 -07:00
Elliott Hughes
468c234e8a Remove an ART/dalvik gdb script.
gdb has been removed.

Test: N/A
Change-Id: I45c8e4d7a044bef64329f20ab670b5feb43ac661
2021-06-25 13:46:45 -07:00
Elliott Hughes
9059e9c9f3 Merge "Fix gdbclient to work with Python 3." 2021-06-25 20:39:38 +00:00
Pirama Arumuga Nainar
8e96f31b36 [scripts] Remove hard-coded clang version
Bug: http://b/187231324

Instead,
- For local development, invoke build/soong/scripts/get_clang_version.py
to find the current clang version.
- In CI, find llvm-cxxfilt using glob expansion.

Test: development/scripts/symbol.py unittest for local development
      python-stack_core_test on presubmit
Change-Id: Id4258dd791626508520b6a478b8a1b54495ebb11
2021-06-24 17:38:32 -07:00
Treehugger Robot
4aa6d94b08 Merge "Remove native_heapdump_viewer." 2021-06-24 23:47:46 +00:00
Elliott Hughes
09117f6915 Remove native_heapdump_viewer.
We recommend Perfetto instead.

Bug: https://github.com/android/ndk/issues/435
Test: treehugger
Change-Id: I879f7777dfb06e669aefd804bc202291a18e90fd
2021-06-24 15:44:49 -07:00
Pirama Arumuga Nainar
5fc3b704c6 Merge "[scripts] Switch symbol.py to clang-r416183b1" 2021-06-24 21:36:40 +00:00
Pirama Arumuga Nainar
6ef65993e0 [scripts] Switch symbol.py to clang-r416183b1
Bug: http://b/189328402

Test: presubmit
Change-Id: I9cc12dc8e213b755745e81b93d21c88c8ac437b2
2021-06-24 09:19:52 -07:00
Elliott Hughes
17de6ce9ce Fix gdbclient to work with Python 3.
Test: gdbclient.py -r date
Change-Id: I10616c197dd50fe653e56c2e4c39e2371445c72b
2021-06-23 18:04:27 -07:00
Joel Galenson
089f93dcec Merge "Allow adding blocks of texts to the Android.bp file." 2021-06-21 15:22:02 +00:00
Pirama Arumuga Nainar
7370ac9126 Merge "Revert "[scripts/symbol] Switch to clang-r416183d"" 2021-06-16 20:00:18 +00:00
Pirama Arumuga Nainar
e804a70bbf Revert "[scripts/symbol] Switch to clang-r416183d"
Revert "Switch to clang-r416183d"

Revert submission 1737013-switch-to-clang-r416183d

Bug: http://b/191276541
Bug: http://b/189328402

Reason for revert: Breaks renderscript_mac build
Reverted Changes:
I25142ddaa:[scripts/symbol] Switch to clang-r416183d
If11e59638:Switch to clang-r416183d

Change-Id: I7961a8d2ed933f39308b80e39833fbcb1acc77e2
2021-06-16 18:26:49 +00:00
Treehugger Robot
39fe25f1f2 Merge "[scripts/symbol] Switch to clang-r416183d" 2021-06-16 17:46:24 +00:00
Pirama Arumuga Nainar
8b3774e428 [scripts/symbol] Switch to clang-r416183d
Test: presubmit
Change-Id: I25142ddaa46446b8521382bfffd3cf12ff00bb86
2021-06-14 14:23:15 -07:00
Joel Galenson
5664f2af26 Allow adding blocks of texts to the Android.bp file.
You can either add the blocks to the toplevel of the file or into the
main module.  The blocks are given in separate files.

Test: Use both for some crates.
Change-Id: I74204867d4e348c83c7adc2a833be166956bfb7e
2021-06-14 13:44:58 -07:00
Treehugger Robot
53f2408738 Merge changes Ice2c3a8a,I5c4f16af
* changes:
  update_crate_tests: Add documentation
  update_crate_tests: Remove cwd
2021-06-14 07:43:09 +00:00
Treehugger Robot
acec66d1b0 Merge "update_crate_tests: Clean up" 2021-06-14 07:43:05 +00:00
Treehugger Robot
4d9029f5d4 Merge "update_crate_tests: Generate Bazel files" 2021-06-14 07:43:02 +00:00
Treehugger Robot
eccee76591 Merge changes I6080fa7f,I3c0477cf,I0beac6e7
* changes:
  update_crate_tests: Add init exceptions
  update_crate_tests: Use prebuilt bazel
  update_crate_tests: Use subprocess.DEVNULL
2021-06-14 07:42:54 +00:00
Thiébaud Weksteen
3604b75456 update_crate_tests: Add documentation
Test: pydoc update_crate_tests
Change-Id: Ice2c3a8ab901e38b2cf77433ec1ba6aac2360236
2021-06-10 14:27:16 +02:00
Thiébaud Weksteen
fc485b2384 update_crate_tests: Remove cwd
Env.cwd is misleading as it captures the location of the crate/package
being updated. Move the detection logic to the Package class and rename
the attribute.

There is the expectation that before running soong_ui, cwd is set to
ANDROID_BUILD_TOP; and before running write_mapping, that cwd is set to
the package directory. Add comments to capture this.

Test: update_crate_tests.py in external/rust/crates/libc
Change-Id: I5c4f16afe0b92b7c85173e4149ee17dd39c773c2
2021-06-10 14:27:10 +02:00
Thiébaud Weksteen
2e532bb1c1 update_crate_tests: Clean up
Rename the Crate class to Package as this script may also be used to
update TEST_MAPPING for the prebuilts/rust toolchain.

Inline get_tests function as one branch was never used.

Rename `create_test_mapping` to `create` as it is already a method of
TestMapping.

Test: update_crate_tests.py in external/rust/crates/libc
Test: update_crate_tests.py in prebuilts/rust
Change-Id: I06bd6d4f93223bb50fdb898980bd25fa3cea9019
2021-06-10 10:56:24 +02:00
Thiébaud Weksteen
df132d6056 update_crate_tests: Generate Bazel files
Bug: 190582745
Test: update_crate_tests.py in external/rust/crates/libc
Change-Id: If61239c5fe9ae3f8fc568eec906bf73baf603105
2021-06-10 10:56:13 +02:00
Thiébaud Weksteen
5212f8a43f update_crate_tests: Add init exceptions
Normalize the object initializations by raising exceptions and catching
them within main.

Test: update_crate_tests.py in external/rust/crates/libc
Change-Id: I6080fa7f22d740f5dd384c15ef74097e61dbb210
2021-06-10 10:54:02 +02:00
Thiébaud Weksteen
3e32afc5a6 update_crate_tests: Use prebuilt bazel
Bug: 181953100
Test: update_crate_tests.py in external/rust/crates/libc
Change-Id: I3c0477cf8d5aac0ae9e444d1b95b8670c9e2e588
2021-06-10 10:34:16 +02:00
Thiébaud Weksteen
76c4e232ad update_crate_tests: Use subprocess.DEVNULL
Test: update_crate_tests.py in external/rust/crates/libc
Change-Id: I0beac6e7e4f795bf8581f9c6448968f721da4b75
2021-06-10 10:14:23 +02:00
Joel Galenson
cb5f2f0bd7 Add a lib blocklist and an option to force rust_library_rlib.
Test: Use in some crates.
Change-Id: I5d098ce9b0f1fc37c5d8408524c0755869657992
2021-06-08 15:08:29 -07:00
Joel Galenson
3d6d1e78b5 Allow blocklisting cfgs.
Test: Use it for a crate.
Change-Id: I72e383ce58f64c7e545db3049376feea8ac006d1
2021-06-07 15:00:24 -07:00
Joel Galenson
f6b3c91d21 Allow blocklisting tests.
This allows you to give cargo2android.py a list of test files to ignore.

Test: Use on a couple crates.
Change-Id: Id9422c496de6693029754f32d9805f1cb92d33cb
2021-06-03 16:00:54 -07:00
Joel Galenson
97e414af12 Allow blocklisting dependencies.
A few crates have patches that manually remove a dependency that
cargo2android.py adds.  This option can allow us to remove those
patches.

Test: Use when running on a few crates.
Change-Id: Ie8337789ab232fb726ccfe361df489acfdd31b20
2021-06-02 15:49:04 -07:00
Joel Galenson
7e8247e2eb Abort cargo2android.py if the patch fails.
This allows the external_updater to understand that an error occurred.

The pre-patched version of the file will still exist.

Test: Run when a patch fails.
Change-Id: I59cc12eeaa751b5e3e2956060f58981d27875748
2021-05-24 15:31:08 -07:00
Joel Galenson
5774c85c70 Raise an exception if we encountered an error.
This allows the caller to handle it if they wish.

Test: Call with an error.
Change-Id: Ia2e0d38e8e486a2b78e42d154654332e88909e9f
2021-05-24 15:31:08 -07:00
Roland Levillain
1f1a79d97d Merge "Print the coverage report location at the end of acov-llvm.py report." 2021-05-21 19:28:39 +00:00
Roland Levillain
d2f1236a6e Print the coverage report location at the end of acov-llvm.py report.
This makes it easier to identify the directory where the coverage
report data of the latest `acov-llvm.py report` was written,
especially when the current directory already contains previous
coverage reports.

Test: acov-llvm.py report
Bug: 160401633
Change-Id: I96fc860940f5be11c4c3b702dfce74226afabfce
2021-05-21 17:36:13 +01:00
Julien Desprez
59189ecc35 Merge "Attempt to run python-stack_core_test" 2021-05-21 01:04:24 +00:00
Treehugger Robot
0b1aa4958f Merge "When cargo errors, print an error about cargo.out." 2021-05-18 04:05:19 +00:00