Commit Graph

33645 Commits

Author SHA1 Message Date
Treehugger Robot
085867a244 Merge "Fix adb_py module." 2023-01-19 01:23:54 +00:00
Dan Albert
dcf513a013 Fix adb_py module.
Apparently these tests are used, they are just defined in
//packages/modules/adb, so atest can't find them here.

Bug: http://b/265846006
Test: ran adb_integration_test_device
Change-Id: If1d82280ab51e80497d235f55582688b78c00f5b
2023-01-18 22:23:38 +00:00
Frederick Mayle
c72989659a Merge "cargo_embargo: new cargo2android tool" 2023-01-18 21:31:44 +00:00
Frederick Mayle
77eb4ba473 cargo_embargo: new cargo2android tool
A fork of cargo2android, initially aimed at big imports like crosvm.

* Faster run time when there are many packages (30 min -> 1 min for
  crosvm).

* `--reuse-cargo-out` feature allows iterating on most of the config
  with sub second run time.

* Most options can be specified per-package.

Bug: 261486161
Test: ran on crosvm and checked diffs
Change-Id: Iaf3f4732e828a6f8b281f0e63fe1e0e1e9e98631
2023-01-18 11:48:09 -08:00
Hsin-Yi Chen
160df5c455 Merge "Add a field for arrays of unknown bound" 2023-01-18 02:12:17 +00:00
Dan Albert
bf8030234b Merge changes from topic "restructure-adb.py"
* changes:
  Fix tests.
  Make this a proper python package.
  Remove python 2 garbage.
  Add type information to adb module.
2023-01-17 18:50:50 +00:00
Shaju Mathew
4e13a43693 Merge "Add py.typed file to export types to dependents." 2023-01-17 15:25:34 +00:00
Hsin-Yi Chen
3a51bf53f1 Add a field for arrays of unknown bound
The ABI tools do not diff the array length. They cannot distinguish
between arrays of unknown bound (e.g., int foo[]) and arrays of zero
length (e.g., int bar[0]). To implement array diff, this commit adds
"is_of_unknown_bound" field to the ABI dumps. It defaults to false so
that it can be omitted for common cases.

Test: ./test.py ; update prebuilts/clang-tools and build
Bug: 255702405
Change-Id: I5db163eb62e95fa01377ef7202e70cc2a0e89524
2023-01-16 17:36:38 +08:00
Dan Albert
808c90cf8d Fix tests.
Bug: None
Test: pytest
Change-Id: Ibe4259750a8d6f1800b5f659a80b301226d6929d
2023-01-13 14:30:19 -08:00
Dan Albert
91e796d227 Make this a proper python package.
Python is picky about directory structure. Ever since python 3 the tests
have not been able to run because the import won't work. This fixes that
problem.

Bug: None
Test: None
Change-Id: I4a626f130e4ca3cd2c9b69804083dfe6daffb5f7
2023-01-13 14:30:19 -08:00
Dan Albert
ac3c9fd05e Remove python 2 garbage.
This code hasn't worked since the python 3 switch, because `unicode`
doesn't exist any more. The problems that this code worked around were
all python 2 problems as well, so it's no longer needed.

Bug: None
Test: ran test.py on windows and mac
Change-Id: Ifacaed5cddc6c9ee9d9d9872c2f2851150ace468
2023-01-13 14:30:18 -08:00
Dan Albert
316dbf5332 Add type information to adb module.
mypy still complains about a few things here, but that looks to be
mostly coming from code that is very, very dead in python 3.

The tests don't run, and haven't since the python 3 switch. Will try to
revive those next, but it likely requires moving files around to fix the
package structure (source needs to go in a subdirectory to make a real
package, as do the tests).

Bug: None
Test: mypy . && pylint .
Change-Id: Ide55a41babecbd6684b73787b17e7f5fdb81c090
2023-01-13 14:30:18 -08:00
Hsin-Yi Chen
e07e343451 Merge "Fix the bug that generates multiple definition of references" 2023-01-10 03:08:11 +00:00
Nataniel Borges
20b563e65e Merge "Update winscope proxy to version 1.0" 2023-01-09 12:36:09 +00:00
Nataniel Borges
7353794edc Update winscope proxy to version 1.0
Bug: 264573983
Change-Id: Ie7e14b11c3b3a866a649b4e013a60fe542d3d754
Test: open winscope and proxy and dump wm and sf states
2023-01-09 12:14:09 +00:00
Hsin-Yi Chen
6e5894f6a2 Fix the bug that generates multiple definition of references
If a type ID is persent in local_to_global_type_id_map,
ModuleMerger functions should report that was_newly_added_ = false.

Test: ./test.py ; update prebuilts/clang-tools and build
Bug: 255702405
Change-Id: I0fbe68ebbc6b8df3ea4ae36a017d0bb61bc7d553
2023-01-07 16:24:43 +08:00
Treehugger Robot
a8802bc47a Merge "Revert "Provide a script to update the generated Android.bp"" 2023-01-03 05:19:58 +00:00
Justin Yun
699b519ec1 Revert "Provide a script to update the generated Android.bp"
This reverts commit c7c0e42748.

Reason for revert: This workaround is no longer required.

Change-Id: If85cb87c2af02b321bfa484bdfe791ede144d490
2023-01-02 07:12:19 +00:00
Hsin-Yi Chen
25a02ee161 Merge "Determine struct extensions before calling IRDiffDumper" 2022-12-30 09:55:24 +00:00
Hsin-Yi Chen
a062a6cf35 Determine struct extensions before calling IRDiffDumper
This commit moves the functions that determine struct extensions from
ir_diff_representation.cpp to abi_diff_helpers.cpp. The functions
are called before IRDiffDumper so that the IR and the dumper do not
include the diff logic.

Test: ./test.py
Bug: 259148872
Change-Id: I93aaa3028bf6a30312f0b0e5b1ef5f6ae1041f21
2022-12-30 16:33:48 +08:00
Shuo Wang Hsu
eb91e5586a Merge "Support building crate variants." 2022-12-29 19:29:01 +00:00
Shuo Wang Hsu
be3f0d9d11 Support building crate variants.
The cargo2android.json config file now supports the key "variants" with
a list of entries containing keys and build name suffix. Each entry
will produce a different library (or binary). Keys supplied for each
variant will overwrite any existing ones specified in the config file.

See an example of the protobuf crate on aosp/2368788.

Test: None
Change-Id: Iaca67c7f22718c27b3cb118d9794f1ff01d31c84
2022-12-28 15:39:42 -08:00
Hsin-Yi Chen
82b8191b50 Merge "Allow extending qualifiers of function parameters and return values" 2022-12-28 09:31:24 +00:00
Hsin-Yi Chen
e77c10f563 Allow extending qualifiers of function parameters and return values
`header-abi-diff --allow-extensions` allows function parameters to be
more qualified, and return types to be less qualified. The ABI tools
follows the qualifier conversion rules in C++.

The ABI tool only allows extending the qualifiers of the functions that
have corresponding symbols. The qualifiers of the other types, such as
function pointers, class members, and global variables, must be
identical between the old and new ABIs.

Test: ./test.py
Bug: 259148872
Change-Id: I227f6ed774cc88009713acce955e35f1c3cff1ca
2022-12-28 10:19:00 +08:00
Yu Liu
a3871b8183 Merge "Explicitly search header files in abi dumper." 2022-12-16 22:23:27 +00:00
Dan Albert
16a9f493c9 Add py.typed file to export types to dependents.
There isn't any type info yet, but this is a prereq for exporting that
data.

https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-library-stubs-or-py-typed-marker

Bug: None
Test: None
Change-Id: I9fa7a540a57ff76a4f8dcded92456b8c4be09dad
2022-12-16 11:59:17 -08:00
Yu Liu
0d3029fb87 Explicitly search header files in abi dumper.
Bug: None
Test: Manual
Change-Id: Ie72e0c4490ab9e29152fcdc45e48ca9724e31f7d
2022-12-15 21:48:11 -08:00
Bob Badour
fd964def39 Merge "[LSC] Add LOCAL_LICENSE_KINDS to development" 2022-12-16 00:59:40 +00:00
Bob Badour
0b10b71586 [LSC] Add LOCAL_LICENSE_KINDS to development
Added SPDX-license-identifier-Apache-2.0 to:
  apps/OBJViewer/Android.bp
  samples/HeavyWeight/Android.bp
  samples/MySampleRss/Android.bp
  tools/ndk/Android.bp
  tools/ndk/ndkabidump/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all
Change-Id: I6d275d857a5774e34b7156ecadb66f8c09337a53
2022-12-15 07:19:34 -08:00
Treehugger Robot
dff4dc6240 Merge "Revert "Revert "Add tools for updating NDK ABI dumps.""" 2022-12-15 01:00:57 +00:00
Hsin-Yi Chen
5eef9c8c1a Merge "Refactor DiffStatus into a class" 2022-12-14 11:46:01 +00:00
Hsin-Yi Chen
4a0b74b22a Refactor DiffStatus into a class
DiffStatus is a class that exposes constants and member functions.
AbiDiffHelper calls the member functions to determine how to report the
diff. The actual value of a DiffStatus object is encapsulated so that
developers can define new status without changing existing logic.

Test: ./test.py
Bug: 259148872
Change-Id: I2c3be62046aa01d68c84690cb158f8fc7a5b474b
2022-12-14 10:06:13 +08:00
Hsin-Yi Chen
9f8239f8d4 Merge "Assert the output file of header-abi-diff" 2022-12-14 02:05:06 +00:00
Treehugger Robot
af6aef5d2b Merge "update_crate_tests.py: update location of bazel binary" 2022-12-13 16:22:35 +00:00
Jeff Vander Stoep
2f3afc25d5 update_crate_tests.py: update location of bazel binary
The binary for bazel moved from tools/bazel to build/bazel/bin/bazel.

Test: run update_crate_tests.py in a Rust crate. Verify results.
Change-Id: I2e586b59876bfd7146cd92efc90055828bf60eac
2022-12-13 15:43:05 +01:00
Hsin-Yi Chen
98d1ee8c04 Assert the output file of header-abi-diff
Test: ./test.py
Bug: 259148872
Change-Id: Ie4270b3fe8c76a63d0b82f246e012d7ca2622fd4
2022-12-13 18:22:34 +08:00
Hsin-Yi Chen
42aa38f51e Merge "Do not remove reference dumps before building new dumps" 2022-12-12 01:43:17 +00:00
Xin Li
6b64fd4b02 Merge "Merge Android 13 QPR1" 2022-12-09 21:51:12 +00:00
Xin Li
85f2ac7cae Merge Android 13 QPR1
Bug: 261731544
Merged-In: I5be6e32d05aa219ae787cb5a3242a2cc4f9e87f4
Change-Id: If803f4950c21576bfafaa4d6b63742537450c7e4
2022-12-09 10:23:06 -08:00
Hsin-Yi Chen
231fe7b57a Do not remove reference dumps before building new dumps
Adding or removing the dump files cause soong to regenerate the
ninja files, which takes a few minutes for every product.
create_reference_dumps.py makes "findlsdumps" and the lsdumps paths.
These targets do not trigger ABI diff. Thus it is not necessary to
remove the reference dumps before building new dumps.

Test: ./create_reference_dumps.py
Bug: 255702405
Change-Id: I4f4a43476d7a9c46d41ef237b846547ed41c7c04
2022-12-09 11:47:19 +08:00
Dan Albert
38d34af365 Revert "Revert "Add tools for updating NDK ABI dumps.""
Can't figure out how to get the tests to work when built by soong, so
just removing for now.

This reverts commit d97284de03.

Test: that was the problem
Change-Id: I4bb8c3a81f529fabbc1663b48f93f153db23aa5d
2022-12-08 23:47:14 +00:00
Jeffrey Vander Stoep
565dec33c0 Merge "Revert "Add tools for updating NDK ABI dumps."" am: dee56b4eb4
Original change: https://android-review.googlesource.com/c/platform/development/+/2335563

Change-Id: Iec567b23b897e13e1993f2d541bcdc0502da6867
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-08 11:03:24 +00:00
Jeffrey Vander Stoep
dee56b4eb4 Merge "Revert "Add tools for updating NDK ABI dumps."" 2022-12-08 10:31:02 +00:00
Jeffrey Vander Stoep
d97284de03 Revert "Add tools for updating NDK ABI dumps."
This reverts commit 32ebcacc08.

Reason for revert: b/261768629

Bug: 261768629
Change-Id: I5be6e32d05aa219ae787cb5a3242a2cc4f9e87f4
2022-12-08 10:14:25 +00:00
Treehugger Robot
4805e505f0 Merge "Add tools for updating NDK ABI dumps." am: 40301565fe
Original change: https://android-review.googlesource.com/c/platform/development/+/1550381

Change-Id: I2fd43760072c48316397d30178487471d24558bb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-07 20:50:47 +00:00
Treehugger Robot
40301565fe Merge "Add tools for updating NDK ABI dumps." 2022-12-07 20:17:14 +00:00
Dan Albert
32ebcacc08 Add tools for updating NDK ABI dumps.
Builds and copies the current NDK ABI definitions to
prebuilts/abi-dumps/ndk.

Test: mypy ndk
Test: pylint ndk
Test: pytest
Test: ./update_ndk_abi.sh && m ndk
Bug: http://b/156513478
Change-Id: Idf850c7a2a7b02d096943c24989bc12de692af13
2022-12-07 18:10:00 +00:00
Pirama Arumuga Nainar
4c47b7fd89 Merge "Now ignoring adb shell service return error code in acov-llvm.py" am: 1c18adc4e1
Original change: https://android-review.googlesource.com/c/platform/development/+/2328192

Change-Id: I68ab77dcce1349de8dee3c18bdf2b5e020e8252e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-12-06 20:15:09 +00:00
Pirama Arumuga Nainar
1c18adc4e1 Merge "Now ignoring adb shell service return error code in acov-llvm.py" 2022-12-06 19:32:37 +00:00
Shaju Mathew
91f544f227 Now ignoring adb shell service return error code in acov-llvm.py
Bug: 261529166

Ignore failures when sending the flush signal.  Some processes may have
exited after we run `adb shell ps` but before we could send the flush signal.

Test: Successful run of coverage metrics using acov-llvm (as documented in go/android-native-coverage-local-workflow

Change-Id: I2fc0f71bf5f6d810b4124e28d7dd69ebfc2579b3
Signed-off-by: Shaju Mathew <shaju@google.com>
2022-12-06 19:31:22 +00:00