Commit graph

449 commits

Author SHA1 Message Date
satayev
035fba700a Remove unused build-mainline-modules.sh
This script is no longer used in any CI or in any other scripts.

Bug: 180394948
Test: presubmit
Change-Id: Ia1b9f699ae3b9263b6e1d6c28ebec449ee31ef84
2021-12-15 16:21:02 +00:00
sophiez
bc82ba55c5 Java used-by API list generation
Update the java used by script to fix the xml format when dexdeps processing resource only APKs

Test: TARGET_BUILD_APPS=com.android.adbd m dist apps_only
Change-Id: I61a58d7c739e74a571e97166a7c9b4091e6f8da0
2021-12-14 14:52:58 -08:00
sophiez
65a981569f Java used-by API list generation
Wrap the dexdeps output content with "<externals></externals>" to
simplify backend xml parsing.

Test: TARGET_BUILD_APPS=com.android.adbd m dist apps_only
Change-Id: I1457eb9558763e50911dc9c689b9bc3fb833a52c
2021-12-10 13:43:10 -08:00
Nikita Iashchenko
84bec80023 Merge "Add jdk.internal.ref to package_allowed_list.txt (OpenJDK 11)" 2021-12-08 13:40:44 +00:00
Cole Faust
864028a71b Support passing input variables to the product configuration
Since rblf_env / rblf_cli are not typed properly, accept
input variables via a file so that they can be converted
with the correct types.

Bug: 201700692
Test: go test
Change-Id: I9b56067cfe396d1bcd8d62c353ff222dd61a6c9f
2021-12-02 16:19:19 -08:00
Cole Faust
c903f00e3f Remove python 2 support from manifest_utils
Bug: 203436762
Test: Presubmits
Change-Id: If93033a428aa1aa0dd2db973666d4790af8f0912
2021-11-30 12:24:02 -08:00
Nikita Iashchenko
a4676f5de6 Add jdk.internal.ref to package_allowed_list.txt (OpenJDK 11)
This is part of merging upstream changes from OpenJDK 11.28. New classes
have been added to core-oj, so there is a new path added to
package_allowed_list.txt:

 * jdk.internal.ref

Bug: 198792576
Test: atest CtsLibcoreOjTestCases
Change-Id: I19a40447bbb060612e0c2f3ef0770568345a7405
2021-11-24 17:15:30 +00:00
Bob Badour
0174ae3ae0 Account for "validations:"
Change-Id: I72b188c8cac54aa59d31e91b2a03b1329384e686
2021-11-23 12:12:06 -08:00
Anton Hansson
c5eac1cf47 Merge "Silence unpack-prebuilt-apex" 2021-11-22 16:36:49 +00:00
Anton Hansson
ff2804e195 Silence unpack-prebuilt-apex
Build tools should not output anything on success, as it clutters
the terminal.

Test: No
Change-Id: Iadfc326be58b32d5cb4f40dd114d3f0a54dbd9b4
2021-11-22 15:07:35 +00:00
Sasha Smundak
82b6e8483c A script to update the file contents with the command output.
Used to avoid rerunning Ninja files regeneration if m2rbc conversion
generated the same makefile.

Test: treehugger
Change-Id: I1b0a619f961e6d2c7bf99a48053ecb58147c6db0
2021-11-18 15:15:45 -08:00
Victor Hsieh
83742ea9e9 Merge "Revert "Include compos-module-sdk in the SDK build."" 2021-11-18 15:47:01 +00:00
Victor Hsieh
e4f0b0a090 Revert "Include compos-module-sdk in the SDK build."
This reverts commit 5b817e642c.

Reason for revert: No longer needed

Bug: 203231943
Change-Id: I220ff6b2033cadf7b29f1bc4a68bec50900f2aef
2021-11-16 19:17:42 +00:00
Sophie Zheng
7b5fa4277f Merge "Java APIs used by Mainline modules." 2021-11-15 06:40:31 +00:00
sophiez
0234737f30 Java APIs used by Mainline modules.
Add scripts to generate java APIs used by Mainline modules. This is
aosp/1879177 with fixed build error that caused by dexdeps analyzing
resource only APKs which doesn't contains any .dex files. Now skip the
error generates in that case in gen_java_usedby_apex.sh

Forrest run:https://android-build.googleplex.com/builds/abtd/run/L38900000951898586

Test: TARGET_BUILD_APPS=com.android.adbd m dist apps_only
Change-Id: Id539cbe1b7306ace69c047f95ffc02265a467511
2021-11-12 23:39:35 +00:00
Cole Faust
4220a61349 Merge "Convert soong scripts to python 3" 2021-11-12 19:04:31 +00:00
Cole Faust
c41dd72d3b Convert soong scripts to python 3
Except manifest_utils, which is used by
apexer.

Tests run:
m construct_context_test manifest_check_test manifest_fixer_test test_config_fixer_test
out/host/linux-x86/testcases/construct_context_test/x86_64/construct_context_test
out/host/linux-x86/testcases/manifest_check_test/x86_64/manifest_check_test
out/host/linux-x86/testcases/manifest_fixer_test/x86_64/manifest_fixer_test
out/host/linux-x86/testcases/test_config_fixer_test/x86_64/test_config_fixer_test

Bug: 203436762
Test: Tests listed above + presubmits
Change-Id: Ife75b3af1efc871a2d8521d26153a262573bb706
2021-11-10 13:49:27 -08:00
Laura Tsai
33b60e4983 Merge "Revert "Add scripts to generate java APIs used by Mainline modules."" 2021-11-10 07:00:38 +00:00
Laura Tsai
be3c7eacfe Revert "Add scripts to generate java APIs used by Mainline modules."
This reverts commit c92380f001.

Reason for revert:
DroidMonitor:

DroidMonitor-triggered revert due to breakage
https://android-build.googleplex.com/builds/quarterdeck?branch=git_master&target=mainline_modules_arm64-userdebug&lkgb=7898389&lkbb=7900541&fkbb=7898474,
bug 205746850

Change-Id: Ibd84dfe68dfe150b7e05b4287364d1946375bf72
2021-11-10 06:59:37 +00:00
Sophie Zheng
4bb0b7a0c3 Merge "Add scripts to generate java APIs used by Mainline modules." 2021-11-09 17:13:33 +00:00
Treehugger Robot
7ab37e8903 Merge "Fix location of host tools" 2021-11-06 00:13:56 +00:00
sophiez
c92380f001 Add scripts to generate java APIs used by Mainline modules.
Test: TARGET_BUILD_APPS=com.android.adbd m dist apps_only

Change-Id: Icd854fd40c3026ae9aae6dc30c9e79027e1303a0
2021-11-05 15:38:09 -07:00
Colin Cross
6a4d3ba138 Fix location of host tools
Host tools are in out/host/linux-x86/bin now instead of
out/soong/host/linux-x86/bin.

Bug: 204136549
Test: forrest
Change-Id: I293accdde5ee4d1d21a471e12ba66e169f9410fc
2021-11-05 14:10:01 -07:00
Cole Faust
943ac416d2 Collect generated rbc files under one folder
Mk2rbc takes a .mk file and produces a .rbc file under the
same path, but with a different stem. For example:
build/test/foo.mk becomes out/build/test/foo.rbc

This makes it difficult to see everything that mk2rbc has
generated in the out folder. Move the generated files to
out/rbc instead, so they have a common stem that is separate
from the rest of the build outputs.

Fixes: 202249430
Test: m RBC_PRODUCT_CONFIG=1 nothing
Change-Id: If3edba3feef9c2d3631244d533b997ef0b8b4e8b
2021-11-04 16:39:59 -07:00
Lukacs T. Berki
04bd17ecb9 Fix paths rbc-run uses to access the rbc tools.
This was broken in aosp/1878498; ccross@ submitted aosp/1875758 between
writing that change and submitting it, which changed the paths to mk2rbc
and rbcrun, thereby breaking Starlark product configuration.

Test: Presubmits.
Change-Id: I185489589997e6bdc815a54a8f6f328c18f813d0
2021-11-04 18:02:22 +01:00
Lukacs T. Berki
90b4334a64 Remove the out/soong/.bootstrap directory.
It's better not to have state hidden in dotfiles (or rather,
dotdirectories) if we can help.

It's questionable whether the "linux-x86" path segment makes sense since
soong_build only ever runs on one operating system, but I didn't want to
rock the boat now.

Drive-by fixed some quoting fixes in rbc-run. Notably, I didn't wrap
`$@` into double quotes because I don't know whether the lack of double
quotes was intended or not.

Also drive-by fixed the fact that "out/soong" was added twice to the
directory name of bpglob. This turned out not to be a problem because
bpglob doesn't need to be explicitly built: if it's needed, it's
declared as an input of the glob files so it'll be built automatically
(at the cost of the first "null build" not actually being a null build)

Test: Presubmits.
Change-Id: I710d8d16cd8212059a0ca1ee95378505303eed83
2021-11-04 09:47:58 +01:00
Treehugger Robot
31ec5a0709 Merge "Adding jdk.internal in the allowed package list" 2021-11-02 08:49:31 +00:00
Treehugger Robot
0888700fe1 Merge "Make manifest_check errors colorful." 2021-11-01 17:11:52 +00:00
Ulya Trafimovich
b4c19f8a31 Make manifest_check errors colorful.
Insert ANSI escape codes in the error text. Colors are red, blue, green
and some text is in bold --- these are all bright enough on either dark
or light background.

Also, add a link to the online documentation.

Bug: 132357300
Test: manually mangle one of Android.bp files to get a manifest_check
  error and observe that it is colorful.
Change-Id: I2af2aa0415d0eb0eabc88dc5504198e11bfb91b6
2021-11-01 14:39:46 +00:00
Sorin Basca
ca4ab1a7a8 Adding jdk.internal in the allowed package list
This is needed for adding jdk.internal.HotSpotIntrinsicCandidate as a no-op

Bug: 202495224
Test: m
Change-Id: Ib97a7fe955d920aca93630d1d5b04fedff1af960
2021-11-01 14:20:33 +00:00
Colin Cross
34d60c9281 Use --skip-config --soong-only instead of --skip-make
--skip-make is deprecated because of its odd behavior around the
out/.soong.kati_enabled file.  Replace it with --skip-config --soong-only
instead, which will unambigiously skip running kati.

Bug: 204136549
Test: build/soong/tests/run_integration_tests.sh
Test: build/soong/scripts/build-mainline-modules.sh
Test: build/soong/scripts/build-ndk-prebuilts.sh
Change-Id: I629ee7542687aaafd68eea50346b0cf53eafe1ef
2021-10-29 16:34:55 -07:00
Sophie Zheng
7fe4ccafc1 Merge "Save all the detected native shared library backing by mainline modules." 2021-10-21 18:42:35 +00:00
sophiez
9a6eabf952 Save all the detected native shared library backing by mainline modules.
Test: TARGET_BUILD_APPS=com.google.android.adbd m dist apps_only

Change-Id: I510292542bf2550c9244e9374cd6f7b40a971486
2021-10-19 14:33:57 -07:00
Victor Hsieh
5b817e642c Include compos-module-sdk in the SDK build.
Test: build/soong/scripts/build-mainline-modules.sh
Bug: 203231943
Change-Id: Icbd4b15b2434c8a0a7983d52732b5462f3a8b978
2021-10-15 13:38:59 -07:00
Pirama Arumuga Nainar
811a1ae270 [get_clang_version] Make the version regex permissive
For instance, this will match `clang-dev` when using a local build of
llvm-toolchain.

Test: run script
Change-Id: I3f2a0a6adc360f0a299def79535ce139353aece2
2021-10-06 09:44:15 -07:00
Paul Duffin
1e18e98b14 Allow implementation details to be excluded from signature patterns file
Previously, the signature-patterns.csv file (which was output in an sdk
snapshot) included implementation details, e.g. the names of classes
that are not part of any API, including the hidden API. This change
allows a bootclasspath_fragment module owner to customize the generated
signature patterns file to remove as many implementation details as
possible from the sdk snapshot. That means that implementation only
changes would not require that sdk snapshots be updated in sync with
the corresponding APEX.

Module owners can remove implementation in the following ways:
1) Limit the number of packages that are treated as split packages by
   explicitly specifying the split packages in the split_packages
   property. A split package is one whose classes are provided by
   separate bootclasspath_fragment modules and so the signature
   patterns has to include every class in that package provided by a
   specific bootclasspath_fragment module, including implementation
   classes, instead of just listing the package.

   The default is to treat all packages as being split, so if no
   split_packages is specified then it defaults to ["*"] which matches
   all packages. Assuming that no package was split unless specifically
   stated would require that all the modules that had split packages
   explicitly list them before this change could be submitted as
   without them this change would break the build.

   Once all existing modules with split packages have been updated to
   include them then the default may be changed.

2) Adding package prefixes for any hierarchy of packages that are
   owned solely by that bootclasspath_fragment. This removes the need
   to list the packages in that hierarchy, including implementation
   specific packages.

Bug: 194063708
Test: atest --host verify_overlaps_test signature_patterns_test
      m out/soong/hiddenapi/hiddenapi-flags.csv
      - manually change files to cause difference in flags to check
        that it detects the differences.
Change-Id: If2f90cfc41b6fff9fa4ac8b9d4973110938b9392
2021-10-05 15:47:05 +01:00
Sorin Basca
6e06f911a5 Merge "OpenJDK 11: Adding jdk.internal.reflect to allowed package list" 2021-10-05 12:34:42 +00:00
Cole Faust
057828d348 Make rbc-run accept a makefile instead of a product
Needed for the board configuration.

rbc-run will also now pass any extra arguments it receives
to rbcrun. (The real program, not the script)

Bug: 201700692
Test: rbc_product_config.py aosp_arm64-userdebug
Change-Id: Ic9869f693f1d28bafee59050b6ae7b1fba14dbdd
2021-10-04 11:16:55 -07:00
Jerome Gaillard
03c64c87a4 Fix script for package check to work on macOS
The behaviour of shell parameter expansion on linux and macOS is
different:
- on linux "\/" in the replaced string is interpreted as simply "/"
- on macOS it is interpreted as the full string "\/"
For example, "android.package.example" would be changed to:
- "android/package/example" on linux
- "android\/package\/example" on macOS

The character / is not a special character for pattern matching in bash,
so it doesn't need to be escaped. Hence using / instead of \/ in the
replaced string works on both linux and macOS.

Change-Id: Id6a5cf32afc53d5ffd989c0ac8aa0b9e0fcbaf82
Fixes: 201947033
2021-10-04 15:29:06 +00:00
Sorin Basca
87f33ea80b OpenJDK 11: Adding jdk.internal.reflect to allowed package list
As part of the migration to OpenJDK 11, sun.reflect has moved to
jdk.internal.reflect. For now we'll have both packages available
as new code uses the jdk.internal version.

Test: m
Bug: 188889082
Bug: 190791083
Change-Id: Ib03c9c8c346daebd7d97387817b506095f5ec693
2021-09-27 15:39:06 +00:00
Sorin Basca
1bb6d6a2c9 Adding jdk.internal.misc in the allowed packages
Updating OpenJDK 11 means that there is a dependency on
jdk.internal.misc, which is renamed from sun.misc. The new
package is added to the allowed list.

Bug: 190470684
Bug: 190791083
Test: m
Change-Id: I174df7bad5c5ec4286c35998e16c26bcd0737612
2021-09-22 15:18:45 +00:00
Treehugger Robot
77cdde7d91 Merge "Fix statusfile used in dexpreopt" 2021-09-20 19:53:38 +00:00
Spandan Das
3d5cd4d109 Fix statusfile used in dexpreopt
https://android-review.googlesource.com/c/platform/build/soong/+/1820496/1/scripts/manifest_check.py#361
caused a regression wrt to statusfile creation. Specifically it inverted
the logic used to create the status file. This file is used in
dexpreopt, thereby affecting all odex files

Test: In internal git, m <an_odex_file>. File size is restored to
pre-regression value
Bug: 199921980
Bug: 200329228

Change-Id: If1e61ac8e2b95455dacc6e7b9431c8f6e1f339b3
2021-09-20 18:24:56 +00:00
Christopher Ferris
8e5feaa1df Make the script python3.
Test: Ran the python version of the script and the python3 version
Test: and verified the output is the same. This is for all three
Test: outputs (html, text, xml).
Test: Builds without an error.
Change-Id: I344504a4351c14e00caeb109c5507a60fb6be05a
2021-09-13 14:54:01 -07:00
Peter Collingbourne
e168f15ab9 Merge "Read LLVM version from $LLVM_PREBUILTS_VERSION if set." 2021-09-09 18:17:11 +00:00
Treehugger Robot
da513b1ec1 Merge "Apply pylint to scripts/manifest_check*.py" 2021-09-08 23:42:25 +00:00
Peter Collingbourne
cbfbd64823 Read LLVM version from $LLVM_PREBUILTS_VERSION if set.
This matches the behavior of the build system.

Change-Id: Idce0a48403acde100e20246896a1ec68df6b73c7
2021-09-08 13:46:01 -07:00
Spandan Das
96d5424440 Merge "Apply pylint to check_boot_jars.py" 2021-09-08 18:32:02 +00:00
Spandan Das
f880742582 Apply pylint to scripts/manifest_check*.py
1. Run pyformat scripts/<script>.py -s 4 --force_quote_type
none -i to fix formatting
2. Annotate #pylint: disable, where straightforward fix is not available

Test: m manifest_check_test
Test: pylint --rcfile tools/repohooks/tools/pylintrc
build/soong/scripts/manifest_check.py
build/soong/scripts/manifest_check_test.py
Bug: 195738175

Change-Id: I9af498c4abd6ac9f8b9df4f93cbdd4424eacff8e
2021-09-08 03:59:40 +00:00
Nikita Iashchenko
15c1387710 Add jdk.internal.math to package_allowed_list.txt (OpenJDK 11)
This is part of merging upstream changes from OpenJDK 11.28. This CL
adds jdk.internal.math to package_allowed_list.txt

Bug: 199067710
Test: atest CtsLibcoreOjTestCases
Change-Id: I343bed53ce6b52a6b373a75828b3234073b9cba8
2021-09-06 17:38:34 +01:00
Spandan Das
2c0af22ea8 Apply pylint to check_boot_jars.py
1. Run pyformat scripts/check_boot_jars/check_boot_jars.py -s 4
--force_quote_type none -i to fix formatting.
3. use pylint: disable=<X> where fixes are not obvious

Test: m check_boot_jars
Test: pylint --rcfile tools/repohooks/tools/pylintrc
scripts/check_boot_jars/check_boot_jars.py
Bug: 195738175

Change-Id: I0f86d95e0d174c9f87a2872dedaa65cd3e814246
2021-09-03 18:01:49 +00:00
Treehugger Robot
0364846a73 Merge "Apply pylint to remaining scripts in hiddenapi" 2021-09-01 14:27:13 +00:00
Treehugger Robot
deee92ca0c Merge "Apply pylint to scripts/hiddenapi/verify_overlaps*" 2021-09-01 14:27:13 +00:00
Treehugger Robot
373fe3b598 Merge "Apply pylint to scripts/hiddenapi/generate_hiddenapi_lists*" 2021-09-01 14:27:13 +00:00
Spandan Das
559132fb98 Apply pylint to scripts/hiddenapi/verify_overlaps*
1. Run pyformat scripts/hiddenapi/verify_overlaps.py -s 4
--force_quote_type none -i to fix formatting. Some double quotes change
to single quotes since pyformat enforces consistent quotes
2. Wrap #pylint: (enable|disable)=line-too-long in tests

Test: m verify_overlaps verify_overlaps_test
Test: pylint --rcfile tools/repohooks/tools/pylintrc <file1>
<file1_test>
Bug: 195738175

Change-Id: Ieb23c04aa53a8b74917f6865296dd8740ecf20ba
2021-08-31 18:24:24 +00:00
Christopher Ferris
cd989defab Merge "Make this script use python3." 2021-08-27 21:42:09 +00:00
Christopher Ferris
cce6d652c5 Make this script use python3.
There is nothing in this script that is not python3, so
make it python3. Without this, a system without python will
fail when trying to run gdbclient.py.

Test: Ran gdbclient.py on a system without a python executable.
Change-Id: I9f8418932628569c445ee01bc6f9ead8aed7989f
2021-08-27 11:54:19 -07:00
Treehugger Robot
5edc77d06c Merge "Apply pylint to conv_linker_config.py" 2021-08-27 04:04:14 +00:00
Spandan Das
2c2219b60e Apply pylint to remaining scripts in hiddenapi
1. Run pyformat scripts/hiddenapi -s 4
--force_quote_type none -i to fix formatting.
2. rename restricted variable names (e.g. variable name "input" has been
changed to "csvfile")
3. use pylint: disable=<X> where fixes are not obvious

Test: m merge_csv signature_patterns signature_patterns_test
Test: pylint --rcfile tools/repohooks/tools/pylintrc <file1>
<file1_test>
Bug: 195738175

Change-Id: I800a208f9c0ee1d32e68e4b20fd5933b3ab92c0e
2021-08-27 00:30:41 +00:00
Spandan Das
c2c31b13dc Apply pylint to scripts/hiddenapi/generate_hiddenapi_lists*
1. Run pyformat scripts/hiddenapi/generate_hiddenapi_lists.py -s 4
--force_quote_type none -i to fix formatting. Some double quotes change
to single quotes since pyformat enforces consistent quotes
2. change map/filter to list comprehension to fix pylint's bad-builtin
warning
3. use pylint: disable=<X> where fixes are not obvious

Test: m generate_hiddenapi_lists_test
Test: pylint --rcfile tools/repohooks/tools/pylintrc <file1>
<file1_test>
Bug: 195738175

Change-Id: I15e71d8d81f0e3fa66d84e6e62eb1848963136e6
2021-08-27 00:09:25 +00:00
Spandan Das
1d4bfd8ca4 Apply pylint to conv_linker_config.py
1. Run pyformat scripts/conv_linker_config.py -s 4 --force_quote_type none -i to fix formatting
2. Annotate #pylint: disable=import-error for linker_config_pb2 since it
will be provided by soong

Test: m conv_linker_config
Test: pylint --rcfile tools/repohooks/tools/pylintrc
build/soong/scripts/conv_linker_config.py
Bug: 195738175

Change-Id: I791576cf65cb053f68c804f8ec5c2fc22976fdb4
2021-08-26 16:48:59 +00:00
Spandan Das
ec555f1a99 Apply pylint to scripts/construct_context*.py
1. Run pyformat scripts/construct_context.py -s 4 --force_quote_type
none -i to fix formatting
2. Wrap #pylint: [disable|enable]=line-too-long in tests

Test: m construct_context construct_context_test
Test: pylint --rcfile tools/repohooks/tools/pylintrc
build/soong/scripts/construct_context.py
build/soong/scripts/construct_context_test.py
Bug: 195738175

Change-Id: I2e756b17aae3e70ddaa03356c78f1f2f85c0f6a5
2021-08-26 01:06:48 +00:00
Matthew Maurer
ca68c49621 rust: doc: Zip up docs when done
Fetching artifacts from the build server doesn't go well with large
numbers of files in nested directories.

Produce an additional rustdoc.zip artifact to make this easier.

This change also prevents ${DIST} from receiving the unpacked rustdoc
site. This can be changed if b/188822051 is fixed.

Bug: 162741284
Test: m rustdoc; check resulting zip contents manually
Change-Id: I80b6a8fa6e274d2d8c3419d8734251afd4d7dba7
2021-08-20 13:08:16 -07:00
Paul Duffin
280bae6d20 Filter blocked entries from modular flag files
Previously, the sdk snapshot would include all the entries from the
stub-flags.csv and all-flags.csv modular files generated by a single
bootclasspath_fragment. That included implementation details, i.e.
class members that are not part of a stable API or the hidden API which
meant that the sdk snapshots were implementation dependent.

This change removes the implementation details from the modular flag
files, i.e. those entries that are only marked as "blocked". When
comparing the files against the corresponding subset of the monolithic
files it assumes that any entries missing from the modular flag files
are blocked.

Bug: 194063708
Test: atest --host verify_overlaps_test signature_patterns_test
      m out/soong/hiddenapi/hiddenapi-flags.csv
      - manually change files to cause difference in flags to check
        that it detects the differences.
Change-Id: I6b67b2253cf029d6830b58a06ebb0c8fcaa0dd71
2021-08-11 17:29:47 +01:00
Paul Duffin
726d44a86d Merge "Remove member signature and inner classes from signature-patterns.csv" 2021-08-11 09:08:01 +00:00
Treehugger Robot
1dde1fade7 Merge "[scripts] Print full clang prebuilt dir from get_clang_version.py" 2021-08-11 06:57:27 +00:00
Paul Duffin
6ffdff853c Remove member signature and inner classes from signature-patterns.csv
Previously, the signature-patterns.csv file included a lot of
implementation details, e.g. the signatures of dex members or inner
classes that are not part of any API, including the hidden API.

This change will remove all member signatures and inner class names
from the file and replace them with just the outermost qualified class
name.

That will still leave some implementation details, e.g. the names of
implementation only classes and packages.

Bug: 194063708
Test: atest --host verify_overlaps_test signature_patterns_test
      m out/soong/hiddenapi/hiddenapi-flags.csv
      - manually change files to cause difference in flags to check
        that it detects the differences.
Change-Id: I9de6a2a6129e875e19f7ded5fae578cbdb584660
2021-08-10 14:01:51 +01:00
Paul Duffin
c11f6679d8 Use trie to store monolithic hidden API flags
Previously, a simple map from dex signature to the flags was used to
store the monolithic hidden API flags. This change replaces that with a
trie that uses packages and class names extracted from the signature
to map from the signature to the flags.

The signature is broken down into pieces consisting of package names,
class names and the remaining member signature. They are used in turn
to navigate through nodes in the trie to a Leaf that contains the flags
associated with the signature.

The flags can be retrieved from the trie in a number of ways:
* Using the complete signature to retrieve the flags for a single
  member.
* Using a class name to retrieve the flags for all the members in a
  class and any nested classes.
* Using a package wildcard to retrieve the flags for all the members in
  the classes in that package.
* Using a recursive package wildcard to retrieve the flags for all the
  members in the classes in that package and nested packages.

This will allow a bootclasspath_fragment to select a subset of the
monolithic flags to compare against itself without specifying the
signatures of every member of that set.

Before creating the trie an attempt was made to compute the subset by
iterating over all the signatures in the monolithic flags and matching
against a regular expression created from the patterns but that was too
slow. It took minutes to run whereas using the simple map or the trie
only takes a few seconds.

Bug: 194063708
Test: atest --host verify_overlaps_test
Change-Id: I36f5e319d3e7d62dd34305de1eec990a93cb3a89
2021-08-09 19:51:33 +01:00
Paul Duffin
67b9d61ac2 Separate creation of signature patterns from overlap checking
Previously, the signatures used to select the subset of the monolithic
flags were simply the signatures read from the modular flags file. This
change moves the creation of the signature list into a separate script
that outputs the signatures to a file and then passes the path through
Soong from the bootclasspath_fragment modules that create it to the
platform_bootclasspath module that uses it to compare the modular
flags against the monolithic flags.

Currently, the signatures are the full signatures but follow up changes
will replace them with patterns (hence the name) that avoids having to
include implementation details in the hidden API flags that are output
as part of a bootclasspath_fragment's snapshot.

This change moves the stub flags related code next to the all flags
related code as they are treated in a similar way.

Bug: 194063708
Test: atest --host verify_overlaps_test signature_patterns_test
      m out/soong/hiddenapi/hiddenapi-flags.csv
      - manually change files to cause difference in flags to check
        that it detects the differences.
Change-Id: I2855bf6d05c91b8a09591664185750361c7e644f
2021-08-06 13:40:34 +01:00
Pirama Arumuga Nainar
238ca381c4 [scripts] Print full clang prebuilt dir from get_clang_version.py
e.g. clang-r416183b1 instead of just r416183b1.

Test: manually run the script
Change-Id: I993202ea97433f841e3127ecef46dec66fb9a8c9
2021-08-05 23:39:00 +00:00
Paul Duffin
53a7607f7d Extract a subset of the monolithic flags for comparison
Previously, the compare_signature_flags compared the full set of
monolithic flags against the modular flags and just ignored any
monolithic flags for a signature that was not present in the modular
flags. It essentially performed two tasks, identifying the subset of
the monolithic flags against which the modular flags should be compared
and then doing the actual comparison.

This change separates those two tasks, by first creating a dict that is
the subset of the monolithic flags against which the modular flags will
be compared and then do the comparison.

At the moment the subset is simply the set of monolithic flags
associated with the signatures that are present in the modular flags.
Follow up changes will provide other ways to select the subset.

Bug: 194063708
Test: atest --host verify_overlaps_test
      m out/soong/hiddenapi/hiddenapi-flags.csv
      - manually change files to cause difference in flags to check
        that it detects the differences.
Change-Id: Icb547f071b814dd955f31255b0d35597f7ba4aa1
2021-08-05 14:19:57 +01:00
Paul Duffin
7be96337f2 Clarify symbols used in verify_overlaps.py
Switches symbols to use monolithic... and modular... to try and clarify
the purpose of those symbols.

Bug: 194063708
Test: atest --host verify_overlaps_test
Change-Id: Ifc646edebe3d43b51dc3528fa883718399cb5254
2021-08-05 14:19:57 +01:00
Paul Duffin
428c65156b Add tests for verify_overlaps script
Refactor verify_overlaps to make it testable and add tests for the
comparison. It does make one significant change in behavior which is to
read each of the files produced by a bootclasspath_fragment into a dict
before comparison, rather than reading and comparing them a row at a
time. That allows it to reuse the code to read a CSV into a dict.

Bug: 194063708
Test: atest --host verify_overlaps_test
      m out/soong/hiddenapi/hiddenapi-flags.csv
      - manually change files to cause difference in flags to check
        that it detects the differences.
Change-Id: Ib70ac87fe089fc25e3bef18f367d4939bfc0cb8d
2021-08-05 14:16:51 +01:00
Dan Willemsen
4591b6496d Upgrade to golang protobuf api v2
Major operations:
 * Fix the go_package entries to be consistent, as the new tool
   complains when it doesn't have a '/'.
 * Regenerate with the new protoc-gen-go tool.
 * github.com/golang/protobuf -> google.golang.org/protobuf
 * proto.[Un]MarshalText -> prototext.[Un]Marshal

Change-Id: Ie1147bd2457fafb66ba555461b3bf14f0561a25d
2021-07-23 11:12:05 -07:00
Ulyana Trafimovich
be67b7a7eb Merge "manifest_check.py: trim namespace part of the module, if needed." 2021-07-22 09:12:25 +00:00
Paul Duffin
2cde5f4389 Add target for generate_hiddenapi_lists_test
atest generate_hiddenapi_lists_test would not work without setting
verbosity=2.

Bug: 194063708
Test: atest --host generate_hiddenapi_lists_test
Change-Id: Ic076ea85d58917921081ae33e72f06011c4ca49e
2021-07-20 19:17:49 +01:00
Ulya Trafimovich
1b513458b1 manifest_check.py: trim namespace part of the module, if needed.
Normally Soong does that automatically when it handles module names
specified in Android.bp properties. However not all <uses-library>
entries in the manifest correspond to real modules: some of the
optional libraries may be missing at build time. Therefor this script
accepts raw module names as spelled in Android.bp/Amdroid.mk and trims
the optional namespace part manually.

Bug: 193891722
Test: manifest_check_test.py
Test: $ lunch aosp_cf_x86_64_phone-userdebug && m && launch_cvd
      $ adb wait-for-device && \
        adb root && \
        adb logcat | \
        grep -E 'ClassLoaderContext [a-z ]+ mismatch' -C1
      # empty output, no errors

Change-Id: I184fb8a2dc26f49e90fb597ebcd6a58c00705206
2021-07-20 14:30:40 +01:00
Pirama Arumuga Nainar
54f92016bc Merge "[scripts] Add script to print clang prebuilts version" 2021-06-29 18:29:09 +00:00
Pirama Arumuga Nainar
2558ce3890 [scripts] Add script to print clang prebuilts version
Bug: http://b/187231324

This script parses soong/cc/config/global.go to return clang prebuilts
version.  (It may get the version from a json config file in the
future.)

Currently it's used in development/scripts/symbol.py and is the
recommended way to get clang prebuilts version number in the future.

Test: get_clang_version_test.py
Change-Id: Id92a74fd523a5270999bb4d6454525bf2f2f0c04
2021-06-25 11:57:16 -07:00
Paul Duffin
2e88097152 Verify the modular stub flags are subsets of the monolithic stub flags
Bug: 179354495
Test: m out/soong/hiddenapi/hiddenapi-stub-flags.txt
      - check that an error is reported if a modular stub-flags.csv file,
        i.e. one created by a fragment is not a subset of the monolithic
        file, e.g. because a signature in the modular file has different
        flags than it does in the monolithic or is not present there.
Change-Id: I46ebb495cb093a5e3abe7571c49933c845318549
2021-06-25 14:49:10 +01:00
Orion Hodson
6a540c4e48 Update dex_preopt related OWNERS
Bug: none
Test: none
Change-Id: I1e6c69b6e3abb54fd37f5b59dad4ced5ce761289
2021-06-17 17:05:39 +01:00
Martin Stjernholm
2ed110c092 Merge "Clean up statsd-module-sdk-for-art." 2021-06-17 08:04:23 +00:00
Sasha Smundak
a3be792b10 Wrapper script to use Starlark-based configuration
Test: manual
Bug: 181797530
Change-Id: I51edea16982386a1022c77ddd282e95b2c5d77a2
2021-06-14 15:52:08 -07:00
Martin Stjernholm
6fe860b47f Clean up statsd-module-sdk-for-art.
No longer needed.

Test: build/soong/scripts/build-mainline-modules.sh
Bug: 188761143
Bug: 180769414
Change-Id: I3524095d0399710e5f474fcc322eba008abfb797
2021-06-14 19:50:58 +01:00
Paul Duffin
84c1cdf31f Maintain header order in merge_csv
Previously, if the --header property was not specified then merge_csv
would use a header constructed by sorting all the fields in the input
files. That required that any use of merge_csv which did not already
have headers in the required order would have to explicitly specify the
headers. That made it harder to use merge_csv as a generic tool as each
invocation needed to be aware of what headers were exported in the
output.

This change causes merge_csv to simply use the headers in the order in
which they are encountered in the input files. That removes the need to
specify the --header option when generating the index files.

Bug: 179354495
Test: m out/soong/hiddenapi/hiddenapi-index.csv out/soong/hiddenapi/hiddenapi-unsupported.csv
      - make sure that they are not changed by this change.
Change-Id: I420b7d07aea85af6372cd7580a8be5e2cc82a513
2021-06-09 14:02:03 +01:00
Martin Stjernholm
040e0443c3 Remove use of fake soong.variables.
Use the --soong-only flag instead to create it the proper way with the
config make step. This fixes build problems arising from the incomplete
soong.variables settings.

This partially relands https://r.android.com/1535202 so that we'll use
TARGET_PRODUCT=mainline_sdk in module SDK builds everywhere.
build-aml-prebuilts.sh isn't removed completely because we still need
the special case to create build_number.txt.

Test: art/build/build-art-module.sh --skip-apex && \
      packages/modules/ArtPrebuilt/update-art-module-prebuilts.py \
        --local-dist out/dist
  then check that the created prebuilt dex2oatd64 runs with the repro
  in b/190194345
Test: build/soong/scripts/build-mainline-modules.sh
  then
      prebuilts/runtime/mainline/update.py --local-dist .../out/dist
  in a master-art tree and check that art/build/build-art-module.sh
  works there
Bug: 190194345
Bug: 174315599
Change-Id: I86327b082b61c292f18c0a6b315d9add08002832
2021-06-08 11:36:53 +01:00
Lukacs T. Berki
1af9316e0a Remove sort_bss_symbols_by_size.
Its only use was removed in aosp/1717013.

Bug: 187928080
Test: Presubmits.
Change-Id: If6acbfe8ba21ec4dc34166768ba1bde3bb78123c
2021-06-07 09:23:15 +02:00
Samiul Islam
d365449fae Do not build compressed APEX
This script expects to build uncompressed APEX and use them as
prebuilts.

Bug: 189926000
Test: build_mainline_modules.sh
Change-Id: If0f62c2baa3db3c079b2913fcdc3dafd66394011
2021-06-02 15:34:42 +01:00
Dan Albert
7f0e9f970c Merge "Add script for building and archiving rustdocs." 2021-05-14 22:52:35 +00:00
Dan Albert
4d247476ac Add script for building and archiving rustdocs.
Test: OUT_DIR=out DIST_DIR=dist build/soong/scripts/build-rustdocs.sh
Bug: http://b/162741284
Change-Id: Ie94318ed9cc99024a27d414bfecc083b2fa96b57
2021-05-14 13:18:07 -07:00
Paul Duffin
dfa1083fee Validate monolithic and modular hidden API flags are consistent
This makes sure that where there is overlap between the hidden API
flags generated for a module and the monolithic flags that they are
identical. That ensures that the modular hidden API flags will be
compatible with previous releases that relied on the monolithic flags.

Bug: 179354495
Test: m out/soong/.intermediates/art/build/boot/art-bootclasspath-fragment/android_common_apex10000/modular-hiddenapi/all-flags.csv
      m out/soong/hiddenapi/hiddenapi-flags.csv
      - Create some inconsistencies between the above two files.
      m out/soong/hiddenapi/hiddenapi-flags.csv.valid
Change-Id: Iaf9e23cef63e221608955d89dc8d496bcc70c86e
2021-05-14 01:49:19 +01:00
satayev
73c7b8547a Move conv_classpaths.proto to packages/modules/common.
The classpaths.proto file is needed at build time to generate appropriate
classpath configs for the modules. Unbundled ART branches do not include
packages/modules/SdkExtenstion in their manifest; so put the proto in a
project that should be visible to all unbundled modules.

Bug: 180105615
Test: m nothing
Change-Id: Ie5be1822fbee92f280332622a9317894cc98d7ac
2021-05-10 13:14:23 +01:00
David Srbecky
69315e4ea7 Use create_minidebuginfo tool instead of bash script.
The behaviour is semantically identical, however,
the tool additionally sorts the symbols by address,
compresses frame unwind information more efficiently,
and improves random-accessibility for lazy decompression.

Overall, the changes balance and the output size is same,
however, libunwindstack can access the data much faster
while using less memory (due to the lazy decompression).
It will also enable further improvements in the future.

Bug: 110133331
Test: ART unwinding tests, run prefetto on the device.
Change-Id: Id48f9fe67fb67fcf2b90cc3b217b71bb8f5147ca
2021-05-01 00:06:07 +01:00
Jaewoong Jung
3c87b1df11 Fix minor issues in updatability lint CLs.
Test: TreeHugger
Bug: 182349282
Change-Id: Ifae282d51b088d0562605b41a09696d75c5138f1
2021-04-22 13:40:41 -07:00
Paul Duffin
2082e695ce Allow generate_hiddenapi_lists.py to work with no custom flag files
Previously, if generate_hiddenapi_lists.py was invoked without any
custom flag files, e.g. hiddenapi-unsupported.txt, then it would fail.
This change allows it to be used for generating the hiddenapi lists
for modules that do not have any custom flag files,
e.g. framework-sdkextensions

Bug: 179354495
Test: verified that the monolithic out/soong/hiddenapi/... files are
      unchanged by this change
Change-Id: I455d453024c9f06ed59cbc1e9838234f8b7c7317
2021-04-21 17:15:25 +01:00
Jaewoong Jung
7b93908d2e Add lint_project_xml_test.py
Test: lint_project_xml_test.py
Bug: 182349282
Change-Id: Ibdeb2e5aaf9dcdb02c5d30214e5ea89665145eb3
2021-04-20 11:04:51 -07:00
Jaewoong Jung
5a4202575e Rename lint-project-xml.py to remove dashes.
So that a future test can import it without a dirty syntax.

Test: m lint-check
Bug: 182349282
Change-Id: I520a5af49543801ab2a8ee888ff235876546dc74
2021-04-20 07:06:03 -07:00
Jaewoong Jung
a110439b3c Lint baseline file check in lint-project-xml
Add a function to lint-project-xml to scan the given lint baseline file
for disallowed baseline lint issues.

Test: Manual
Bug: 182349282
Change-Id: I0db32bec0da24487b2f2b3f6704629f56ae76f56
2021-04-19 17:38:17 -07:00
Treehugger Robot
7548b1ad05 Merge "Remove draft API support." 2021-04-15 22:58:15 +00:00
Jooyung Han
e134d09831 Add 'merge' command to conv_linker_config
'merge' command can merge multiple configurations.
It just delegates protobuf's msg.MergeFrom(other_msg).

  usage: conv_linker_config merge -o out.pb -i a.pb -i b.pb ...

out.pb will have all keys from multiple inputs.

Bug: 181093750
Test: m
Test: MicrodroidTestCase
Change-Id: Ibf715aa0bcc1e5c82c85a9af8fe7dca8d6ab68ad
2021-04-15 10:58:21 +09:00
Dan Albert
d05ba00415 Remove draft API support.
This is unused and doesn't work with our current API review process
anyway (un-drafting an API won't be flagged for API council review).

Test: treehugger
Bug: None
Change-Id: I6d8fcc9885b82dac5ada7772d9e3fb9101524ece
2021-04-13 15:55:47 -07:00
David Srbecky
789fe0fdeb Revert^2 "[strip.sh] Move remaining GNU binutils usage to llvm binutils"
This reverts commit 33dfba1d9c.

Bug: 141010852
Test: art/test.py -t 137-cfi
Test: llvm-objcopy --dump-section=.gnu_debugdata=mdi.xz libhwui.so && \
      unxz -fk mdi.xz && readelf -a mdi | less
Change-Id: I751b51274a961194647ec11fd3fd49886df1e1b3
2021-04-08 18:31:46 +01:00
Artur Satayev
ca6fe3453a Add a converter for classpaths.proto between proto and json/text formats.
The proto is used at build time to define classpath fragments to be read
and parsed at runtime by `derive_classpath` service; in order to define
and set BOOTCLASSPATH, DEX2OATCLASSPATH, and SYSTEMSERVERCLASSPATH
environ variables.

The tool is used for debugging and generation of binary protos.

Bug: 180105615
Test: m && launch_cvd with a follow up changes
Change-Id: I7e8b084e5f63e9aaad11da3221b909818e69e235
2021-04-06 18:37:13 +01:00
Yi Kong
6f43f54264 Fix toc.sh, llvm-nm does not recognise '-f P' option
llvm-nm only accepts full name for format option, or just '-P' alias.

Test: build
Bug: 184360305
Change-Id: Ie25f5410403f4dbca564430149a5753e0d48d60d
2021-04-03 03:21:24 +08:00
Yi Kong
948205699b Merge "Move toc.sh to use LLVM binutils" 2021-04-02 02:38:16 +00:00
Ulyana Trafimovich
400a1b1309 Merge "Emit a better error message in manifest_check.py." 2021-04-01 09:58:15 +00:00
Yi Kong
4ad44e713b Move toc.sh to use LLVM binutils
Test: build
Change-Id: Ib965b6ea3fba6ae007135ac7e167cc50f0f6e3de
2021-04-01 17:45:42 +08:00
Yi Kong
9d9e053964 Merge "Move gen_sorted_bss_symbols.sh to use LLVM binutils" 2021-04-01 03:10:08 +00:00
Treehugger Robot
fdfb9540f6 Merge "Do not build stats-log-api-gen-exports in mainline builds" 2021-03-31 18:48:18 +00:00
Ulya Trafimovich
bb7513d80a Emit a better error message in manifest_check.py.
Bug: 132357300
Test: lunch aosp_cf_x86_64_phone-userdebug && m
Test: temporarily patch Gallery2 to fail the check, observe the error
Change-Id: Id67e359188396f68dcecd8b3f4d1bc26271af56d
2021-03-31 14:31:49 +01:00
Yi Kong
bf1db7b149 Move gen_sorted_bss_symbols.sh to use LLVM binutils
Test: build
Change-Id: I496b92d963d127087daef405dafa24377d6bac97
2021-03-31 17:13:43 +08:00
Sophie Zheng
dd3797b44e Merge "NDK API coverage" 2021-03-30 20:44:44 +00:00
Sophie Zheng
a4c09e1894 Merge "NDK API coverage" 2021-03-30 20:40:41 +00:00
Eric Holk
406765b15a Do not build stats-log-api-gen-exports in mainline builds
This no longer needs to be a prebuilt since stats-log-api-gen can be
built from proto_logging without extra dependencies.

Test: Treehugger
Bug: 170149255
Change-Id: I6925c2526cee1cbff3ba78bedd7f6c2f58dfff0f
2021-03-29 15:53:32 -07:00
sophiez
d3e2742ad2 NDK API coverage
Update OWNERS file under build/soong/scripts to include coverage team as owner of related scripts.

Test: TARGET_BUILD_APPS=com.android.adbd m dist apps_only
Change-Id: I6150d5bda0d59828a985cd2ab5dd0aa38a7987c3
2021-03-29 20:29:35 +00:00
Ulya Trafimovich
9f12df9abb Don't fail the build if manifest_check cannot extract targetSdkVersion.
Instead, return "any" SDK version 10000, which will cause dexpreopt to
not add any compatibility libraries to class loader context. This is as
good guess as any, and the build system already uses "any" version if
there is not manifest or APK from which to extract targetSdkVersion.

This fixes broken build on cf_x86_auto-userdebug.

Bug: 132357300
Bug: 183943146
Test: lunch cf_x86_auto-userdebug \
  && m out/target/product/vsoc_x86/obj/APPS/playback_intermediates/dexpreopt.zip
Change-Id: I5ee75639ece716c3a9800ddea346fe7c73da7c3a
2021-03-29 15:43:38 +00:00
Ulyana Trafimovich
a8f6db972f Merge changes I1f0ab4af,Iea3be0fc
* changes:
  Fix AAPT path in dexpreopt.
  Allow modules that don't run verify_uses_libraries to have nonempty CLC.
2021-03-29 09:24:00 +00:00
sophiez
ae5da5ba78 NDK API coverage
Update the gen_ndk_usedby_apex.sh script to generate NDK API list with
library name.

Test: TARGET_BUILD_APPS=com.android.adbd m dist apps_only

Change-Id: I799e03ad7d81a4184229f658fd6c8824b9ba6e1f
2021-03-25 22:12:04 +00:00
Treehugger Robot
c29088b727 Merge "Remove .rustc ELF section from mini-debug-info." 2021-03-23 09:13:53 +00:00
Ulya Trafimovich
bd6b076f80 Allow modules that don't run verify_uses_libraries to have nonempty CLC.
There are modules that would have passed verify_uses_library check, but
don't run it for some reason (the check gets enabled either with an
explicit setting, or if the module has nonempty <ues-library> lists in
the build properties). Previously all such modules were assumed to have
empty CLC, which is not always true. In particular, compatibility
libraries are ignored, which affected e.g. Calendar and messaging apps.

This CL gives such apps a chance to have correct CLC. The goal for the
future is to enforce verify_library_check by default.

Bug: 132357300
Test: lunch aosp_cf_x86_64_phone-userdebug && m
Change-Id: Iea3be0fc9d7775c52950848b5a3fd3b7fcd36c53
2021-03-22 10:49:31 +00:00
satayev
2b077baa5e Merge changes from topic "move_allowed_deps_txt"
* changes:
  Treat allowed_deps.txt source file as optional.
  Move allowed_deps.txt to packages/modules/common.
2021-03-22 10:48:45 +00:00
David Srbecky
b474fc0ad6 Remove .rustc ELF section from mini-debug-info.
The section is stripped from binaries (but preserved in /symbols).

However, is it also unintentionally copied into the minidebuginfo
compressed section, which is included in the final shipped binary.
(This does not affect symtab symbols, which are handled as usual)

Removing it from mini-debug-info shrinks some rust binaries by
up to 10x, saving >10MB on the system partition overall (AOSP).

Test: extract minidebuginfo and check it manually with readelf
Change-Id: I462d81455626bb2b5244e1bf3d5f8b71646f3401
2021-03-20 20:31:29 +00:00
Treehugger Robot
f2be52c4dc Merge "Revert "[strip.sh] Move remaining GNU binutils usage to llvm binutils"" 2021-03-20 19:25:23 +00:00
David Srbecky
33dfba1d9c Revert "[strip.sh] Move remaining GNU binutils usage to llvm binutils"
This reverts commit ad50ce8349.

Bug: 183237575
Reason for revert: Breaks stack unwinding

Change-Id: I256dc77525687fb3e670355587b1eac72158b274
2021-03-20 14:46:15 +00:00
Treehugger Robot
8cc04e59e1 Merge "manifest_check.py: translate library names using dexpreopt configs." 2021-03-20 12:12:52 +00:00
Julien Desprez
2dc86b2956 Migrate manifest_*_test out of test mapping
Unit tests do not require an explicit TEST_MAPPING config

Change-Id: Ieccebc78a26b9555803a2278e2962d0b388a6957
Test: presubmit
Bug: 183209529
2021-03-19 17:16:16 +00:00
Yi Kong
ad50ce8349 [strip.sh] Move remaining GNU binutils usage to llvm binutils
With clang r377782, llvm binutils implements all the necessary
funtionaility for strip.sh. We can finally get rid of all the fallback
GNU binutils usage.

Test: m
Bug: 141010852
Bug: 135627985
Change-Id: I110f6028dab7f599decf59a5cb1b927b35e11857
2021-03-19 12:28:44 +08:00
Artur Satayev
fdb61edf43 Move allowed_deps.txt to packages/modules/common.
Bug: 179234385
Test: run update-apex-allowed-deps.sh locally
Change-Id: I8e8864468b87342c688d001bc5f6e6f8416863ed
Merged-In: I8e8864468b87342c688d001bc5f6e6f8416863ed
2021-03-17 13:44:16 +00:00
Ulya Trafimovich
3c902e7acc manifest_check.py: translate library names using dexpreopt configs.
Java modules that are defined in makefiles are not processed in
topological order, so it is necessary to communicate information from
dependencies via dexpreopt.config files. This has already been done in
make/core/dex_preopt_config_merger.py, and now manifest_check.py also
needs to get library names from their dexpreopt.config files.

This is to accommodate Java libraries which name differs from their
modules name. Soong properties `uses_libs`/`optional_uses_libs` and
makefile vars `LOCAL_USES_LIBRARIES`/`LOCAL_OPTIONAL_USES_LIBRARIES`
contain module names, not library names, so it is necessary to translate
them when comparing against library names in the manifest.

Bug: 132357300

Test: lunch cf_x86_64_phone-userdebug && m && launch_cvd \
      adb wait-for-device && adb root && adb logcat \
      | grep -E 'ClassLoaderContext [a-z ]+ mismatch'
      # empty grep output, no errors

Change-Id: I7cfb17d6d74e37fc9f37d977f15f0d711bab5c8e
2021-03-16 15:43:05 +00:00
Ulya Trafimovich
0aba252e15 Reimplement verify_uses_libraries.sh in manifest_check.py.
Previously there were two different scripts that did similar things:
1) build/soong/scripts/manifest_check.py
2) build/make/core/verify_uses_libraries.sh

Both scripts extracted <uses-library> tags and `targetSdkVersion` from
the manifests of Java modules, but 1) worked for XML manifests, and 2)
worked for APKs. This CL reimplements the functionality from 2) in 1),
so that one script can handle both XML manifests and APKs.

Bug: 132357300

Test: lunch cf_x86_64_phone-userdebug && m && launch_cvd \
      adb wait-for-device && adb root && adb logcat \
      | grep -E 'ClassLoaderContext [a-z ]+ mismatch'
      # empty grep output, no errors

Change-Id: Id1b66e4f3f30f307dba70cb111c7571762cb546a
2021-03-15 13:50:49 +00:00
Martin Stjernholm
4f0f3f01d9 Build heapprofd_client_api for use in the ART chroot.
Test: build/soong/scripts/build-mainline-modules.sh
Bug: 179915934
Change-Id: I4653bf705563ad2ddb077ecae7938c2dd1b818e9
2021-03-09 17:13:51 +00:00
Treehugger Robot
7ebe464748 Merge "Build statsd-module-sdk-for-art" 2021-02-24 01:08:28 +00:00
David Srbecky
bb96b56b0d Merge "Set block-size for XZ mini-debug-info compression." 2021-02-24 00:43:12 +00:00
Eric Holk
ff0529d209 Build statsd-module-sdk-for-art
Bug: 178236337
Test: build-mainline-modules.sh
Change-Id: I51dab13416be8ea1cd65234d560d84ca89b53e13
2021-02-23 22:49:57 +00:00
Treehugger Robot
7eacdbf8a6 Merge "Add non-fatal mode for verify_uses_libraries check." 2021-02-23 20:45:42 +00:00
Paul Duffin
ece454400d Merge changes from topic "hiddenapi_additional_annotations"
* changes:
  Sort hiddenapi monolithic files by signature
  Remove duplicates in monolithic hidden API files
  Remove implicit dependency from <x> -> <x>-hiddenapi
2021-02-23 12:48:24 +00:00
Ulya Trafimovich
8c35fcf4d5 Add non-fatal mode for verify_uses_libraries check.
The new mode is enabled with environment variable
RELAX_USES_LIBRARY_CHECK. If the variable is set to true, then a
verify_uses_libraries check failure does not fail the build, instead it
sets a special compiler filter "extract" for dexpreopt, which means that
the DEX file will be extracted, but it won't be compiled to native code.
Class loader context will be set to empty in this case (not &, as it is
going to be deprecated soon).

If the variable RELAX_USES_LIBRARY_CHECK is unset or set to something
other than "true", then the old behaviour of the verify_uses_libraries
check is preserved.

The intended use case for this flag is to have a smoother migration path
for the Java modules that need to add <uses-library> information in
the build files. The flag allows to quickly silence build errors. This
flag should be used with caution and only as a temporary measure, as it
masks real errors and affects performance.

verify_uses_libraries check is reworked so that it writes the error
message to a status file (which is used instead of the former timestamp
file). Currently the stored error message is not used, but it may be
used later to produce a warning. Dexpreopt command checks if the status
file exists and is nonempty; if that is the case, then compiler filter
is set to "extract".
Bug: 132357300

Test: Manually add some mismatch between the libraries in the Android.bp
      and Android.mk files for dexpreopted apps, build with
      RELAX_USES_LIBRARY_CHECK=true and obsserve that the build doesn't
      fail and they are compiled with compiler-filter "extract".
      Unset RELAX_USES_LIBRARY_CHECK and observe that the build fails.

Change-Id: Ibb5d993a25b1df1d2e70b7d5aafc6997f9d64e67
2021-02-22 15:41:03 +00:00
Anton Hansson
a6bf4a189c Merge "Disallow using error-prone merge strategies" 2021-02-19 15:27:29 +00:00
Anton Hansson
771fd524f2 Disallow using error-prone merge strategies
DO NOT MERGE / RESTRICT AUTOMERGE and its cousin DO NOT MERGE
ANYWHERE are almost always misused. Make it an error to upload
commits with those merge strategies.

Bug: 156896646
Test: repo upload -n (with DNM and RM commits)
Change-Id: Iae3540fa35dbd7b87a14b53a20be0cd23a206f3a
2021-02-19 13:05:54 +00:00
Treehugger Robot
999314fd98 Merge "Add bloaty_merger" 2021-02-19 09:45:39 +00:00
Eric Holk
277b0e7f41 Make statsd apex available as a prebuilt
Bug: 178236337
Test: build-mainline-modules.sh
Change-Id: I807eca7c5296227f4b593fc9f52d29bd20e78645
2021-02-18 17:39:51 +00:00
Thiébaud Weksteen
713db480cd Add bloaty_merger
This script will be used to merge the csv outputs from bloaty into a
single proto file.

Bug: 172339795
Test: atest --host bloaty_merger_test
Change-Id: I9a3c12d7b0c4b5e347fec04e6758bcc1fbc8ab40
2021-02-18 10:25:25 +01:00
Bob Badour
1bf6765def Add license to hiddenapi
Test: m all
Change-Id: Ic61a74d94bea0e4de2a47be7e15fcf874fb397c3
2021-02-17 09:46:26 -08:00
Paul Duffin
2c36f24082 Sort hiddenapi monolithic files by signature
Adds a new --key_field option to merge_csv.py which specifies the name
of the field that should be used to sort the input. If specified it
causes that field to be the first in each row and performs the merge
operation of a merge sort on the input files. That assumes that each
input file is already sorted into the same order.

Modifies the rules that use merge_csv.py to pass in:
    --key_field signature
to sort the rows by signature.

Bug: 180387396
Test: Verified that hiddenapi files (both aggregated ones and for the
      individual modules) are not affected by this change other than
      changing the order.
Change-Id: Idcd5f0fea373b520b604889e1c280f21ed495660
2021-02-16 17:38:08 +00:00
Paul Duffin
031d8693b3 Allow explicitly specified additional annotations for hiddenapi
Adds the hiddenapi_additional_annotations to allow a library to list
the libraries that provided additional hiddenapi related annotations
for a library.

Modifies merge_csv.py so it can process multiple zip files at the same
time and uses that to merge the embedded .uau files from a module and
those it depends upon.

Bug: 180102243
Test: m droid
      Verified that hiddenapi files (both aggregated ones and for the
      individual modules) are not affected by this change.
Change-Id: I796520021c7357398a9e2a09f1029e4a578b05b3
2021-02-16 13:28:26 +00:00
Eric Holk
7529f06707 Add statsd exports to be consumed by unbundled modules
This is needed first for ART to enable statsd metrics reporting, but
this will be needed by more modules as they become unbundled.

Test: build-mainline-modules.sh
Bug: 178500083
Change-Id: I5af0b8db7a24c86ffd3f34732ac747a4fc6a7a55
2021-02-11 19:02:40 +00:00
Treehugger Robot
b68036f44b Merge "Add LOCAL_LICENSE_KINDS to build/soong" 2021-02-10 07:18:29 +00:00
Paul Duffin
fdada68320 Move hiddenapi tools used by build/soong from frameworks/base
Also, creates a python_binary_host module for generate_hiddenapi_lists
and uses that when constructing the build rule rather than using the
file directly.

Bug: 177317659
Test: m droid
      Verified that hiddenapi files (both aggregated ones and for the
      individual modules) are not affected by this change.
Change-Id: Ia11bb203ce5a74740d35f1b7e86716e15aad336e
2021-02-09 10:46:36 +00:00
Colin Cross
69f0a24762 Pass list of module libraries to gen_ndk_backed_by_apex.sh
Running find on the entire module directory can lead to flaky failures
when a directory is modified by another rule while find is traversing
it.  Pass a list of libraries in the module into the script instead
of finding them on disk.

Fixes: 178509901
Test: TARGET_BUILD_APPS=com.android.runtime dist
Change-Id: Ie4bf288f0e3d99cbbed5ca8770687a9bbe5377e4
2021-02-08 16:52:07 -08:00
Bob Badour
02040de891 Add LOCAL_LICENSE_KINDS to build/soong
Added SPDX-license-identifier-Apache-2.0 to:
  Android.bp
  android/Android.bp
  android/soongconfig/Android.bp
  androidmk/Android.bp
  apex/Android.bp
  bazel/Android.bp
  bp2build/Android.bp
  bpf/Android.bp
  bpfix/Android.bp
  cc/Android.bp
  cc/config/Android.bp
  cc/libbuildversion/Android.bp
  cc/libbuildversion/tests/Android.bp
  cc/ndk_api_coverage_parser/Android.bp
  cc/ndkstubgen/Android.bp
  cc/symbolfile/Android.bp
  cmd/dep_fixer/Android.bp
  cmd/diff_target_files/Android.bp
  cmd/extract_apks/Android.bp
  cmd/extract_jar_packages/Android.bp
  cmd/extract_linker/Android.bp
  cmd/fileslist/Android.bp
  cmd/host_bionic_inject/Android.bp
  cmd/javac_wrapper/Android.bp
  cmd/merge_zips/Android.bp
  cmd/multiproduct_kati/Android.bp
  cmd/path_interposer/Android.bp
  cmd/pom2bp/Android.bp
  cmd/pom2mk/Android.bp
  cmd/sbox/Android.bp
  cmd/soong_build/Android.bp
  cmd/soong_env/Android.bp
  cmd/soong_ui/Android.bp
  cmd/zip2zip/Android.bp
  cmd/zipsync/Android.bp
  cuj/Android.bp
  dexpreopt/Android.bp
  dexpreopt/dexpreopt_gen/Android.bp
  env/Android.bp
  etc/Android.bp
  filesystem/Android.bp
  finder/Android.bp
  finder/cmd/Android.bp
  genrule/Android.bp
  jar/Android.bp
  java/Android.bp
  java/config/Android.bp
  kernel/Android.bp
  linkerconfig/Android.bp
  linkerconfig/proto/Android.bp
  makedeps/Android.bp
  partner/Android.bp
  phony/Android.bp
  python/Android.bp
  python/tests/Android.bp
  remoteexec/Android.bp
  rust/Android.bp
  rust/config/Android.bp
  scripts/Android.bp
  sdk/Android.bp
  sh/Android.bp
  shared/Android.bp
  symbol_inject/Android.bp
  symbol_inject/cmd/Android.bp
  sysprop/Android.bp
  tradefed/Android.bp
  ui/build/Android.bp
  ui/logger/Android.bp
  ui/metrics/Android.bp
  ui/metrics/proc/Android.bp
  ui/status/Android.bp
  ui/terminal/Android.bp
  ui/tracer/Android.bp
  xml/Android.bp
  zip/Android.bp
  zip/cmd/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-BSD to:
  finder/fs/Android.bp
  third_party/zip/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work

Change-Id: Ia47ca14f16b8c9f84f9d533a07e5b00e2c04e8d4
2021-02-06 04:23:21 +00:00