If you passed --no-pkg-vers to cargo2android.py, it would still
generate cargo_pkg_version with an empty string. Instead, simply
don't generate anything.
Test: Use with and without argument.
Change-Id: I544e4789312ccc3481da73c78f0f2cae2ad6619c
Modify the library lookup code to try and find the various places
that a library might really exist in the symbols directory. This
is for atest which can run executables in different locations
than the actual where the symbolized file exists.
Test: Ran using /data/local/tmp, /data/local/tests,
Test: /data/local/tests/vendor, /data/local/tests/unrestricted and
Test: verified the correct library was found.
Test: Used tombstones crash data and verified all libraries
Test: still found properly.
Test: Ran atest CtsBionicTestCases and verified the symbolized
Test: binary could be found using a real tombstone crash.
Test: Did the same as above, but changed the path in the tombstone
Test: crash data from /data/local/tmp to /data/local/tests and
Test: /data/local/tests/unrestricted.
Change-Id: Iaa121823ef6142eaf9f7de3232b147bd7389bea5
This is the one remaining feature in vendor/google/tools/stack that
isn't in the "One True" stack script.
Bug: http://b/199390145
Test: manual
Change-Id: I9dd832f6fb5767c3ad3263c1ffc7dfdb0103e535
The existing code only adds it to things without defaults. This adds
it to the defaults module itself, which should not overlap the
existing code.
Test: Run and see new entries.
Change-Id: Iaf3d0b47193bb1f54cdc605c88c2cd68034d963a
The previous commit to this file allowed it to create and upload a
commit when a TEST_MAPPING file changed. But it did not handle the
case where the TEST_MAPPING file did not previously exist. This fixes
that.
Test: Run script.
Change-Id: Id7b9e778c2b084f7ea2e4005a173c1fedeccd6c7
This will make it easier to run it on many crates and upload all of
the changes. It puts the uploaded CLs in a topic to save resources.
If the script does not change a TEST_MAPPING, it does not upload
anything.
Test: Run on a subset of crates.
Change-Id: I47b4756d968c54d7d810c8a19a8a7419aebc6e15
This argument has already been deprecated, but now there should be no
more uses of it. Let's remove it and the remaining logic.
Test: Run the updater.
Change-Id: I8ab6f6fadba3b462567237d18ddc02cc4c22e62f
When generating a config file from a commandline, cargo2android.py
should not dump the --config argument, as the point of the dump is to
generate a config file to use. This would not normally matter, but it
could help in scripts.
Test: Run and do not see --config in the dumped file.
Change-Id: Idc2911ba674e67272c9cf836c89607e10ca0dddd
Image support doesn't make sense for test modules.
Bug: 178565008
Test: Generate rustc-demangle-capi
Change-Id: Ie5a1d85f9828e0c105c3a3e994b22ef7664fe1db
staticlib and cdylib crate types generally want to export header files
for use by C code. Allow the location of these headers to be provided to
c2a for inclusion in blueprint.
Bug: 178565008
Test: Generate rustc-demangle-capi
Change-Id: I0aa9acfb081ea39a7e13315bfc8029d06b8f55d3
We no longer use the --dependencies argument, but it is still used in
a number of places. Let's remove its functionality but keep the
command-line option as a no-op so we can remove the uses over time.
Test: Run on crate that uses the option.
Change-Id: I954f68faf11d1a926f0ccf070afa8332385e3671
Only run cargo metadata on the main crate, not all of its dependencies.
Pass it the --format-version argument to avoid a warning and be
future-proof.
Test: Run.
Change-Id: Icdf88bc3b633d18266772ae813fc04b529b95765
Older versions of Python's subprocess do not have capture_output, so
just get stdout directly.
Also pass the full path to cargo in case it is not on PATH.
Test: Run
Change-Id: I368e905a93b344bca6635c6ab7a60def809e88d5
If there are multiple packages present in the workspace, attempt
to determine what the current package is by checking the emitted
crate_name value against the package name. If this still fails, a new
`--no-pkg-vers` flag is added to skip this behavior.
Bug: 196803495
Test: New logic finds package if package.name is used for crate_name
Test: New flag prevents emitting the pkg version.
Change-Id: I152e94a0520f09f37622a6cec340ae35842d56ea
This parses a module's Cargo.toml file for package version number,
setting it to cargo_pkg_version. Also sets cargo_env_compat true by
default.
Bug: 171011485
Test: generated Android.bp includes cargo_env_compat, cargo_pkg_version.
Change-Id: Ibb8021633719650e2021b90806374a5d3c6a161a
The branch needs to be specified in our generated OWNERS file or some
tooling will fail to find the correct OWNERS file.
Bug: 191797059
Test: New OWNERS file works as expected.
Change-Id: I91f2af6c5f489daee859b66ae0bd3c19a0bc0a3b
Some tests load data from files. These files thus need to be copied
to the correct location on the host/device so that the tests can
access them. This adds an option to cargo2android.py so that it can
generate these data properties.
Bug: 171710847
Test: Use for a crate.
Change-Id: I14a1ad8aca4625cc5f09807d19ffd7499fcf3689
Adds flags to emit vendor_available and vendor_ramdisk_available flags
to generated modules.
Bug: 194078853
Test: Calling script with new flags generates intended properties.
Change-Id: I4f7a6870b4f210b6627054c98962f50e98bc3e03
The test blocklist was failing when multiple tests were merged into
one. To fix this, when merging tests we prefer ones that are not
blocklisted.
Fixes: 193790055
Test: Run on the previously failing crate and another.
Change-Id: I53d1179bebef824ce80ac4f977015b04a26f8607
This patch ensures that rust_defaults for tests have _tests in the
name. This can make the Android.bp file a bit more readable.
Test: Run on a crate and build it.
Change-Id: I5d034c456052b892bd01c3c041b2572bc9364692
... 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
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
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
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
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
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