Commit Graph

524 Commits

Author SHA1 Message Date
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
Joel Galenson
6bf54e3abb When cargo errors, print an error about cargo.out.
Currently if cargo produces an error it's not obvious how to debug it.
Add a message telling the user to look at the cargo.out file, which
has its output.

Test: Ran on crates with and without errors
Change-Id: Ib681a8e87f60467c7425aed5f7e5277a0603bcc8
2021-05-17 10:54:50 -07:00
Roland Levillain
d203b9e692 Fix adb root invocations in script acov-llvm.py.
Test: acov-llvm.py clean-device
Bug: 160401633
Change-Id: Ie41e13a7ab81994b8fed91ac07e32c6b90b91e74
2021-05-13 16:20:54 +01:00
Julien Desprez
fd06c732e1 Attempt to run python-stack_core_test
Test: presubmit
Bug: 185900237
Change-Id: I7c41545d4e1fbdeebd729615b5b12ee64ba6a8b9
2021-05-06 09:17:45 -07:00
Pirama Arumuga Nainar
4851047a4c Merge "Send coverage flush signal to only processes that handle signal 37." 2021-05-04 03:54:46 +00:00
Pirama Arumuga Nainar
beb6fb7493 Send coverage flush signal to only processes that handle signal 37.
Bug: http://b/160401633

Also:
- fix regexp to find clang prebuilt version to allow a suffix.
- call `adb root` before any operation.

Test: acov-llvm.py flush
Change-Id: I9287610ee2ccfec165b0a0bc2e3b24e0eb84ca31
2021-04-30 15:06:39 -07:00
Joel Galenson
367360cdaf Do not write out the --no-test-mapping option.
This option is only intended to be temporary, so if it is used it
should not "propagate" itself by being added to the Android.bp header
or the config file.

Test: Do not see it in the header or config file.
Change-Id: Ibb18c76bdab26aa47b38ac75ea3c410ddc612856
2021-04-29 14:33:13 -07:00
David Srbecky
ec44e57e10 Merge "Make the stack script python3.5 compatible." 2021-04-29 16:48:07 +00:00
David Srbecky
fd1e41623d Make the stack script python3.5 compatible.
Ensure that the script works on buildbots.

Test: adb shell debuggerd -b <pid> | development/scripts/stack
Change-Id: I3fd4a0ed78ff3245d1ab2f6e842446888c5c7b8b
2021-04-27 22:24:36 +01:00
Joel Galenson
d9c4de6fe3 Let cargo2android.py generate apex_available and min_sdk_version.
This commit adds an --apex-available option to cargo2android.py.  It
takes in multiple strings that are included in the generated block.

It also adds --min-sdk-version.

Test: Use flags.
Change-Id: I319a32fc5e8be11015ba4484b0ab1665ee457326
2021-04-26 11:34:15 -07:00
Joel Galenson
0fbdafe016 Allow cargo2android.py to use a config file instead of command-line options.
The command-line options to c2a are already long and will only get
longer as new arguments are added.  This allows it to load them from a
config file.  For simplicity of implementation, the config file
supplements the command-line arguments and uses the same format they
do, although it ideally will replace them over time.

This also adds an option to dump the current set of command-line
arguments to a config file and exit.  This is intended to ease
migration over to the config file: for a given crate, we can call c2a
with its command-line arguments plus this new flag to generate the
config file and then use just that instead.

Test: Dump and load some config files.
Change-Id: I63b29dd20bcff5d5832dbd380d7c6eb273547ed0
2021-04-26 11:33:52 -07:00
Krzysztof Kosiński
b136111f17 Upgrade the 'stack' script to python3.
Also hook up the test to Android.bp.

Test: unit test
Test: Ran with a tombstone file as parameter.
Test: Ran pasting in stack to stdin.
Change-Id: I25f40569cc49b7487553611bcc25d061179bfa8d
2021-04-09 13:21:32 -07:00
Thiébaud Weksteen
a5a728b4c8 cargo2android: Use cfgs property
Test: Run cargo2android on multiple crates, verify Android.bp
Bug: 183727250
Change-Id: I087ffb0de33db7a09735d2e9c668d991c9f5bb49
2021-04-08 14:23:49 +02:00
Treehugger Robot
ad8e4d2a7e Merge "NFC: Refactor a string so we can add a comment to it." 2021-04-07 22:15:50 +00:00
Joel Galenson
4d82acfeee Merge "Add a cargo2android flag to disable generating TEST_MAPPING." 2021-04-07 21:41:15 +00:00
Treehugger Robot
dddc6e0873 Merge "Fix cargo2android's license block preservation" 2021-04-07 21:39:51 +00:00
Joel Galenson
3f42f80970 NFC: Refactor a string so we can add a comment to it.
Test: Run cargo2android.py
Change-Id: Id833bd3292a4cd9f8c348aee9725e0924d826d97
2021-04-07 12:42:17 -07:00
Joel Galenson
cf4ebb00a6 Add a cargo2android flag to disable generating TEST_MAPPING.
Generating a TEST_MAPPING file uses Bazel, which can be quite slow
(multiple minutes).  Add a flag to allow skipping it.  This is off by
default as it ideally will only be used for debugging.

Test: Run all four configurations of --tests and this flag.
Change-Id: I08bde29ea298fcf677addd86f6d953b6695e147f
2021-04-07 08:39:51 -07:00
Joel Galenson
d9d13b8309 Fix cargo2android's license block preservation
The code that preserves license blocks currently also preserves
genrules if they come before a rust_ rule, causing them to be
duplicated.  Let's fix that.

Test: Upgrade some crates
Change-Id: Ie4f62cd04c2f1dd0de788db0ca5e77502fb3b4c8
2021-04-07 08:20:58 -07:00
Treehugger Robot
dbde427be6 Merge "Add Ring test timeout." 2021-04-06 20:55:52 +00:00
Joel Galenson
4f9d11f6b1 Sort Rust TEST_MAPPING tests.
We currently seem to emit TEST_MAPPING files in an arbitrary order,
which causes diffs to look confusing even when nothing has changed.
Let's sort them by the test name, which is both stable and easier to
read.

Test: Run cargo2android multiple times and see no TEST_MAPPING diff.
Change-Id: I398aa84a4891380e4292223445bd53959c024421
2021-04-06 10:18:21 -07:00
Joel Galenson
a0d4c5e5a5 Add Ring test timeout.
This test looks like it basically never passed without this.

Test: Run cargo2android.py and see timeout.
Change-Id: Ic7ef5576efb84d78130dd45db67e50ebe41f6d9a
2021-04-06 09:36:47 -07:00
Pirama Arumuga Nainar
c41549f3d2 Add acov-llvm.py script
Bug: http://b/160401633

This is a tool for gathering coverage information from a device and
generating an LLVM coverage report from that information.  See top of
the file for usage instructions.

Also redirect acov users to acov-llvm when CLANG_COVERAGE is set.

Test: acov-llvm.py wih clean-device, flush and report subcommands.

Change-Id: I5dba3a669bb6ac2797093903536f346228625c05
2021-03-30 14:58:06 -07:00