This allows you to give cargo2android.py a list of test files to ignore.
Test: Use on a couple crates.
Change-Id: Id9422c496de6693029754f32d9805f1cb92d33cb
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
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
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
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
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
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
Ensure that the script works on buildbots.
Test: adb shell debuggerd -b <pid> | development/scripts/stack
Change-Id: I3fd4a0ed78ff3245d1ab2f6e842446888c5c7b8b
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
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
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
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
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
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
This test looks like it basically never passed without this.
Test: Run cargo2android.py and see timeout.
Change-Id: Ic7ef5576efb84d78130dd45db67e50ebe41f6d9a
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
The path where the tests are uploaded by atest differs from the
path to unstripped binaries in the out directory. As a result,
the script can't symbolize the parts of the stack trace that
correspond to code in the test binary. Add a fixup to use the
correct path.
Test: Used the script on example crashes in framework and vendor
device tests - appears to work and give correct line numbers.
Change-Id: I5470e6342afb801ac596cbc0c0bf067850b1e09a
Change the license detection logic to return if a dual-license was
found. Update the metadata comment as discussed in b/179902335.
Add unit tests for add_module_license and decide_license_type.
Bug: 179902335
Test: atest --host add3prf_test; manually run add3prf.py in {ahash,
libloading, parking_lot, ring}
Change-Id: I3184b5cf0955d124170b9e5987308507bdef6e9a
If the TEST_MAPPING cannot be generated, print the reason, but
exit without error. It's not uncommon for the output of cargo2android
to fail to build e.g. if a new depencency is not satisfied, so we can
fall back to the previous TEST_MAPPING, or run update_crate_tests
locally once all dependencies are present.
Bug: 179132533
Test: tools/external_updater/updater.sh update rust/crates/textwrap
Test: tools/external_updater/updater.sh update rust/crates/libc
Change-Id: I4802c77332d1ab1d6604d48c47365f40bdbd1122
Allow this script to accept a path to the crate being updated.
This allows it to be run separately from cargo2android.
Also, fail gracefully on error. TEST_MAPPING update failures should
not block crate updates.
Test: tools/external_updater/updater.sh update rust/crates/libc
Bug: 179132533
Change-Id: I3a4229f479ab3d2793df16b470f0a0632b9ee495
The aidl tests and ChromeOS tests are not intended to be run in
presubmit, so exclude them.
Test: run cargo2android in external/rust/crates/libc.
Change-Id: I1ed92ed6e88886e3fea38612325ce5349db0fb69
This is important because:
1. Some crates do not have their own tests enabled in presubmit.
2. As much as possible, we try to stick with one version of each
crate. This often results in using different versions of
dependencies than a crate has specified in its Cargo.toml.
Ensuring that a crate's tests continue to pass when its dependencies
are upgraded improves our confidence that the update is safe.
The underlying implementation uses the new Bazel queryview
to query modules and reverse dependencies.
Bug: 168167373
Test: Run cargo2android.py on a number of crates including rusqlite,
scopeguard, lock_api.
Change-Id: Id24f2d3267cf8d5e0369ece2442f8971d4ab1343
Followup to aosp/1548356 to remove the now unused host parameter to add_test.
Test: Manually run script and verify the output.
Change-Id: Id00e56a2dc5523a44dc3cb473702c1ae8785d3db
Instead of generating TEST_MAPPING entries for host tests, we add a
test_options section to its Android.bp entry.
Fixes: 176097100
Test: Manually run cargo2android on a few crates and verify the output
Change-Id: Ia57a53dad6910410c7e7aab6d592fba79720f998
Add support for using lldb with vscode.
Test: lldbclient.py --setup-forwarding vscode -r dalvikvm
Bug: 176158605
Change-Id: I92a08b3b02a27a14be586582fe57acdd670a9ada
We no longer have the rust_library_shared and rust_library_static module
types. They've been renamed to rust_ffi_* instead. This brings
cargo2android.py up to date.
Bug: 175155132
Test: cargo2android's Android.bp for libquiche contains rust_ffi modules
Change-Id: I01bb8b4e56c41d36481ffd363f96aecb770d7cb8
Replace all references to gcc tools with llvm tools. This change still
uses c++filt until llvm-cxxfilt is put in the prebuilts.
Test: Ran a backtrace through this script and the old script and verified
Test: no major differences.
Test: Ran unittests for symbol.py and stack_core.py.
Change-Id: Ic31c1a0707dae11c5037f9637943cd7932badf46