Commit Graph

3435 Commits

Author SHA1 Message Date
Paul Duffin
cb15e50b24 Merge "Move boot jars package check from make" am: 1eacd95001 am: d4f99cdebf am: 6a20dd5c29 am: d0c7e75f64
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1478639

Change-Id: Iac8ecf4c8910934d0f6ac11113bc8106f35a31b7
2020-10-30 12:04:31 +00:00
Jingwen Chen
ddc74e50d6 java compilation: refactor and extract javac flag computation into a am: 9cb8d1b37b am: 76d6f9be1c am: 63e2704c6a am: c54138f858
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1480607

Change-Id: I29d3af3cf2372ea3e55f2b627f0a00d04e00eb67
2020-10-30 11:04:46 +00:00
Paul Duffin
1eacd95001 Merge "Move boot jars package check from make" 2020-10-30 10:06:46 +00:00
Jingwen Chen
9cb8d1b37b java compilation: refactor and extract javac flag computation into a
separate function.

This cleans up the internal wiring for a follow-up --patch-module
functionality change.

Bug: 150878007
Test: m
Change-Id: Ie7d9c2b1ad40e055da8a53d632510bef408fc7d2
2020-10-30 00:55:58 -04:00
Ulyana Trafimovich
76d69c3bf2 Merge "Drop "android.hidl.manager" -> "android.hidl.base" dependency from class loader context." am: 42cac12541 am: c8b9f0a679 am: eafca437da am: a42dbeaf29
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1478218

Change-Id: Id8cdd0b682235126cbda3865606c511e2e456eec
2020-10-29 19:17:04 +00:00
Ulyana Trafimovich
42cac12541 Merge "Drop "android.hidl.manager" -> "android.hidl.base" dependency from class loader context." 2020-10-29 17:51:48 +00:00
Ulya Trafimovich
180fecedf0 Drop "android.hidl.manager" -> "android.hidl.base" dependency from class loader context.
This dependency is incorrect and shouldn't exist.
It has been removed in https://r.android.com/1467918

Test: m nothing
Bug: 170710203
Bug: 132357300
Change-Id: If3036437e138b552436f135425e6bd15be043678
2020-10-29 17:47:34 +00:00
Paul Duffin
9a89a2a0ea Move boot jars package check from make
Adds a singleton that traverses the module variants finding the ones
that are in the list (updatable and non-updatable) of boot jars and
add a ninja rule to ensure that they only contain packages from an
allowed list.

Replaces a hack that ignored any prebuilt boot jars supplied as dex
file with an equivalent one to ensure that they are still ignored.
A follow up change that switches to checking dex jars will allow the
hack to be removed.

The boot jars check can be strict or lax. If strict then all the boot
jars listed in the configuration must be found, otherwise it will only
check the ones it finds. It is strict by default unless
TARGET_BUILD_UNBUNDLED=true or ALLOW_MISSING_DEPENDENCIES=true.

Moves the script and data file from build/make.

Test: m check-boot-jars - for failing and passing cases
      SKIP_BOOT_JARS_CHECK=true - no check-boot-jars target created
	  ALLOW_MISSING_DEPENDENCIES=true - not strict
	  TARGET_BUILD_UNBUNDLED=true - not strict
      verified manually that apart from path differences the same
      files (same check sum) were checked in both old make checks and
      the new Soong ones
      EMMA_INSTRUMENT=true EMMA_INSTRUMENT_FRAMEWORK=true m check-boot-jars
Bug: 171479578
Change-Id: I9d81d6650ba64fc0d48d2dab4ba5a3ba8dd03dec
2020-10-29 17:20:06 +00:00
Ulyana Trafimovich
54874ad136 Merge "Move part of logic from construct_context.py to Soong." am: e430ac338a am: bc4e9d5f8a am: a9fa672c56 am: ea8b14a87b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1453038

Change-Id: I95bbb8a843ba46a0a32949a0157f65061a65bde9
2020-10-29 16:01:08 +00:00
Ulyana Trafimovich
e430ac338a Merge "Move part of logic from construct_context.py to Soong." 2020-10-29 13:53:17 +00:00
Ulyana Trafimovich
3a81ccd8f9 Merge "Add separate dependency tags for compat libs based on SDK version." am: 05b9a65f25 am: 9d5814ff7c am: 7b898a1960 am: ad16c12eba
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1453037

Change-Id: I92ac79581ad5cd29b9e05398d4e9b8ea7345fa2d
2020-10-29 12:04:16 +00:00
Ulyana Trafimovich
9ba949ae48 Merge "Fix handling of "android.test.mock" in class loader context." am: 17da06cfd9 am: 94b74f9559 am: deea2844fd am: a9381bec3f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1467832

Change-Id: I6f245711fd003a5f2c3f036241053c781c26c1fd
2020-10-29 12:04:06 +00:00
Ulyana Trafimovich
05b9a65f25 Merge "Add separate dependency tags for compat libs based on SDK version." 2020-10-29 10:27:59 +00:00
Ulyana Trafimovich
17da06cfd9 Merge "Fix handling of "android.test.mock" in class loader context." 2020-10-29 10:27:33 +00:00
Ulyana Trafimovich
175d8d6cd2 Merge "Unify handling of compat and normal libs in class loader contexts." am: c5b6f32751 am: 228f63b4c1 am: 4dc62516cb am: 182b45c981
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1450817

Change-Id: Idd32fb1f1cfdff57a152492794fddbb642629190
2020-10-28 18:18:25 +00:00
Ulyana Trafimovich
c5b6f32751 Merge "Unify handling of compat and normal libs in class loader contexts." 2020-10-28 17:05:05 +00:00
Paul Duffin
3527eadd0c Merge "Retry: Make ConfiguredJarList immutable" am: c097474f21 am: 101339a133 am: 104a934353 am: 1e6f10bf33
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1476916

Change-Id: I52505ceea5d1284ac3fdfc9f7d3e47a8d85cf972
2020-10-28 11:29:34 +00:00
Paul Duffin
3b8b84973b Cleanup usages of CreateConfiguredJarList am: e10dfa4e3d am: d34168219d am: f80f9004ea am: 6eb013d805
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1471781

Change-Id: I4dcf51fa2fc7b661240943233dbf6312e8163bf3
2020-10-27 18:19:40 +00:00
Paul Duffin
7d584e9360 Retry: Make ConfiguredJarList immutable
By making the Append and RemoveList methods return a new list instead
of modifying the existing list it makes the ConfiguredJarList usages
easier to reason about and safer to use, especially considering that
they are primarily used in global configuration.

Added some tests for Append/RemoveList to ensure that they work and
do not modify the original or result in newly created lists sharing
storage with the original which would lead to corruption.

Bug: 171756871
Bug: 171479578
Test: m nothing
      EMMA_INSTRUMENT=true EMMA_INSTRUMENT_FRAMEWORK=true m nothing
Change-Id: I541c4686ecdd45c6a0c8b1c93fedf0fcd5952e2b
2020-10-27 17:37:20 +00:00
Paul Duffin
7df37bee7f Switch BootJars/UpdatableBootJars to ConfiguredJarList am: 69d1fb1e39 am: 769b1eab84 am: 3e29458b28 am: 0b34b8cdfb
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1471779

Change-Id: I90e1bafedf0492e8299cad31e7b4a648c3cc3bfa
2020-10-27 17:29:01 +00:00
Ulya Trafimovich
8130c482ab Move part of logic from construct_context.py to Soong.
construct_context.py is a script that runs at Ninja stage and constructs
class loader context arguments for dex2oat. Previously it accepted lists
of library paths and concatenated them into one class loader context
string. The script also handled the dependency of "android.hidl.manager"
on "android.hidl.base" that is not tracked by the build system and must
be handled in a special way.

Now that class loader context representation is going to change from
flat lists to trees, passing paths to individual libraries as script
arguments is no longer possible, because a list of paths cannot
represent a class loader context tree. Passing the trees in a serialized
form is also inconvenient, because the script would have to parse them,
which would complicate it a lot.

Therefore this patch ports all the concatenation and "android.hidl.base"
handling to Soong. It is not possible to port the remaining script to
Soong because Soong has no information about the targetSdkVersiion of
the dexpreopted apps (it is in the manifest and sometimes in an APK, and
has to be extracted at Ninja time).

Test: construct_context_test.py
Test: new subtests in TestUsesLibs
Test: lunch aosp_cf_x86_phone-userdebug && m
Bug: 132357300
Change-Id: Icdb03cf00d1e27e4cff3844b89bfaec4de502dd7
2020-10-27 17:05:30 +00:00
Ulya Trafimovich
b521811d7b Add separate dependency tags for compat libs based on SDK version.
The version in the tag is the SDK version that in which compatibility
library was added as a separate libary. Using distinct tags makes it
possible to differentiate between dependencies for different SDK
versions (this will be needed in subsequent CLs).

Test: lunch aosp_cf_x86_phone-userdebug && m
Bug: 132357300
Change-Id: I72296c05d6649e811ddc701aaeb84f91d1ba66cb
2020-10-27 17:05:30 +00:00
Ulya Trafimovich
46b3d5bd05 Fix handling of "android.test.mock" in class loader context.
Mimick the way PackageManager handles it at runtime: do add it to class
loader context for apps with targetSdkVersion < 30, but only if
"android.test.runner" is used. Previously it was not added at all.

Test: lunch aosp_cf_x86_phone-userdebug && m
Bug: 132357300
Change-Id: I4c06635277ab13e21069b9fa0b46eb6a2547dfdd
2020-10-27 17:05:30 +00:00
Ulya Trafimovich
24813e1d80 Unify handling of compat and normal libs in class loader contexts.
Also, add tests for compatibility libraries in class loader context.

This CL separates special-case handling of compatibility libraries into
a "fixup" step that is done after class loader context is constructed by
Soong. This allows to handle compatibility libraries and normal
libraries uniformly, which should enable further simplification of class
loader context representation (in subsequent CLs).

Currently the only "fixup" step is removal of libraries from conditional
class loader context if they already are in unconditional context. This
check cannot be done at the time when the libraries are added to
conditional context, because the full uncoditional context is not yet
known at that time. Previously construction of unconditional context was
delayed, now it is no longer delayed and handled in the same way as
unconditional context, and the "fixup" does the filtering.

Test: lunch aosp_cf_x86_phone-userdebug && m
Bug: 132357300
Change-Id: Ie71e9fb2d3d529b5317cd84e09ab3c853017c349
2020-10-27 17:05:30 +00:00
Paul Duffin
e10dfa4e3d Cleanup usages of CreateConfiguredJarList
After previous refactorings the CreateConfiguredJarList function is now
only used in tests and are supplied with a PathContext that will cause
ReportPathErrorf() to panic. So, this change removes the ctx parameter,
calls panic directly on any error and renames the method to make it
clear that it is for testing only.

Bug: 171479578
Test: m nothing
Change-Id: Icfb4bdfe720afa855b64ecf0e74a0b030882d029
2020-10-27 10:36:29 +00:00
Paul Duffin
69d1fb1e39 Switch BootJars/UpdatableBootJars to ConfiguredJarList
This change:
* Switches BootJars/UpdatableBootJars fields of config.productVariables
  from []string to ConfiguredJarList.
* Updates BootJars() method to simply concatenate the jars list from
  the BootJars/UpdatableBootJars fields.
* Adds an UnmarshalJSON(..) method to ConfiguredJarList to support
  unmarshalling from a single string array to avoid having to change the
  format of the JSON file from which the configuration is loaded.
* Adds some additional calls to ConfiguredJarList(..) in tests to
  convert from []string to ConfiguredJarList. They pass nil as the
  ctx argument as there is no suitable PathContext which will cause any
  errors to be thrown using panic. That is reasonable for hard coded
  values in tests. A follow up change will clean up the calls to
  ConfiguredJarList(..).

Bug: 171479578
Test: m nothing
Change-Id: I59b94dafb479ccd8f0471ed802be175af57be271
2020-10-27 10:36:29 +00:00
Anton Hansson
71beaf12dc Merge "Make highmem classification of metalava optional" am: 72b1df4b79 am: ba63a2c9ce am: d951c976bb am: e04d8e7b3f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1474017

Change-Id: I8473530af498e04b0880f921920448b36597a1a8
2020-10-27 09:39:42 +00:00
Joanne Chung
342c8bba27 Merge "Revert "Make ConfiguredJarList immutable"" am: 578b5f06c6 am: 1f67171167 am: 7b907ab4eb am: 495a40d67d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1475896

Change-Id: Ib65f69eadfc708fc2775768c29abb79bcf6b4553
2020-10-27 06:15:12 +00:00
Joanne Chung
1f25794e03 Revert "Make ConfiguredJarList immutable"
This reverts commit 052f4727fe.

Reason for revert: Looks to have broken master b/171756871

Change-Id: I6b3b7039c3e3b8ac453734281cb8e7c71b65aed3
2020-10-27 03:22:29 +00:00
Paul Duffin
f63c3b4925 Merge "Make ConfiguredJarList immutable" am: e1878c101d am: 7ad2fa969b am: 89e8d18655 am: 8df961a826
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1471776

Change-Id: Ia35aa8e42f0a88f6182ac6aa0e91ce1b204c23cf
2020-10-26 21:28:28 +00:00
Paul Duffin
052f4727fe Make ConfiguredJarList immutable
By making the Append and RemoveList methods return a new list instead
of modifying the existing list it makes the ConfiguredJarList usages
easier to reason about and safer to use, especially considering that
they are primarily used in global configuration.

Bug: 171479578
Test: m nothing
Change-Id: I102c4fb42f0c54e4ed299d2921fbf5efeb6e99b9
2020-10-26 15:57:11 +00:00
Anton Hansson
52ac73d21e Make highmem classification of metalava optional
We have added a lot of metalava invocations since the highmem
differentation was added, most of which do not use a lot of memory.

By collecting data of max rss per process we have narrowed down
the set of highmem modules to a smaller set, and will annotate the
relevant modules as such.

Bug: 170701554
Test: NINJA_HIGHMEM_NUM_JOBS=3 m checkapi (no long tail of metalava)
Change-Id: Ic9c8c91388b02889111ef596fc6fd8bde9b42b9d
2020-10-26 11:38:40 +00:00
Mathew Inwood
9b8c1a54b0 Merge "Tag removed APIs as such in hiddenapi_flags.csv." am: 1e8118da95 am: 6123adab59 am: 1f4b17f49e am: f36f496c15
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1469622

Change-Id: I9af52d5b97eefe04dc7cf81127c219d1ecf0799a
2020-10-26 11:02:21 +00:00
Mathew Inwood
1e8118da95 Merge "Tag removed APIs as such in hiddenapi_flags.csv." 2020-10-26 08:52:11 +00:00
Cole Faust
64c2fd39c7 Merge "Export proguard_flags_files from android_librarys" am: 26c468c155 am: b32d809f3c am: c03c600591 am: e08ca80890
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1470254

Change-Id: I0ccf20f6acd6469185ac4dfb66c074790125eb81
2020-10-23 21:18:27 +00:00
Cole Faust
26c468c155 Merge "Export proguard_flags_files from android_librarys" 2020-10-23 19:35:57 +00:00
Cole Faust
9a631319ab Export proguard_flags_files from android_librarys
If an android_library has a proguard flag file, that
file should also be used when compiling apps with the
library.

Fixes: 171425221
Test: New unit test in app_test.go, and manually
2020-10-22 21:07:35 +00:00
Mathew Inwood
a44e8c515d Tag removed APIs as such in hiddenapi_flags.csv.
Refactor flags in generate_hiddenapi_lists.py" the invocation to use the
new more flexible schema. Add "--tag removed" to removed.txt APIs so
that we can identify those APIs in the final output.

Test: m -j out/soong/hiddenapi/hiddenapi-flags.csv
Bug: 171300342
Change-Id: I38f2ec7c6e2ff7e5bdd9fe2aeb771d5153a2dc99
2020-10-21 15:52:15 +01:00
Martin Stjernholm
7f51107ee6 Rename ART release APEX to com.android.art.
Test: See https://r.android.com/1457217
Bug: 169639321
Change-Id: I6800c7a382486b4e50945cc8b789f4be16482fe6
Merged-In: I6800c7a382486b4e50945cc8b789f4be16482fe6
2020-10-21 15:41:02 +01:00
TreeHugger Robot
03c718efa1 Merge "Added new target to core_platform list of allowed modules" 2020-10-21 14:01:01 +00:00
Martin Stjernholm
09e2aa9e84 Rename ART release APEX to com.android.art.
Test: See https://r.android.com/1457217
Bug: 169639321
Change-Id: I6800c7a382486b4e50945cc8b789f4be16482fe6
Merged-In: I6800c7a382486b4e50945cc8b789f4be16482fe6
2020-10-20 23:28:49 +01:00
Martin Stjernholm
666981d91c Merge "Move the intermediate directory for ART boot images." am: f657ff1d00 am: 1cbe84940c am: 607ac2fc5a am: e8490a11b4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1461622

Change-Id: I1920bddee598229fe0bbfdcf0b4e3dde01f33537
2020-10-20 21:15:04 +00:00
Martin Stjernholm
ea581fc95d Move the intermediate directory for ART boot images.
Free up the directory $(PRODUCT_OUT)/apex/com.android.art for the
release ART APEX. Without this we'll get conflicting install paths in
make.

Test: build/soong/soong_ui.bash --make-mode \
    TARGET_PRODUCT=sdk_x86_64 TARGET_BUILD_VARIANT=userdebug nothing
  with http://r.android.com/q/topic:release-apex-rename+author:mast
  present to rename the ART release APEX to com.android.art.
Test: Build & boot on CF
Test: apct/device_boot_test and asit/perf/boottime_test on
  blueline_jitzygote-userdebug
Test: avd/avd_boot_health_check on cf_x86_phone-userdebug_coverage_art
Bug: 169639321
Change-Id: I0b263d5922d438834e5c804e55f69a2a1421ab73
Merged-In: I0b263d5922d438834e5c804e55f69a2a1421ab73
2020-10-19 20:42:46 +01:00
Ioana Stefan
8fe8f42c0a Added new target to core_platform list of allowed modules
Re-added plugin of intdefs annotation processor. The plugin was
added to a different target (`framework-minus-apex-intdefs`)
because of the refactoring of the `framework-all` target.

Because the new target depends on `core_platform`, it needs to
also be added to this list.

Test: run 'mp :framework-minus-apex-intdefs' and check that it builds
Change-Id: I96d4941219560049c9a014a40de39978c9e5bbb8
2020-10-16 15:21:07 +02:00
Aaron Huang
01fd0385e1 Merge "Add service-connectivity to legacy core platform list" 2020-10-16 07:03:33 +00:00
Treehugger Robot
94b36c9930 Merge "Add empty tag support for java_import" am: faf30e19d6 am: 479ed0c3cf am: 812f49412a am: f249499d30
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1462684

Change-Id: I48f3bfdd19b723dc4b7c61c5a95f054031ebf23c
2020-10-15 23:13:40 +00:00
Saeid Farivar Asanjan
128fe5c1f5 Add empty tag support for java_import
Test: manual
Change-Id: I53d7c6bb620fa8fe7f5c3ec0a12f723eb62fca16
2020-10-15 17:55:24 +00:00
Anton Hansson
faa866c5f0 Merge "Make test api extend system in sdk_library.go" 2020-10-14 14:43:03 +00:00
Treehugger Robot
e95a865166 Merge "Support building WITHOUT_CHECK_API=true" am: 527b2578ea am: deea9b7659 am: ece1006280 am: f208db8a18
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1458439

Change-Id: I881e2525bfb3e650060042368e95b56f84c7b585
2020-10-14 13:50:38 +00:00
Paul Duffin
bc0fe96be3 Support building WITHOUT_CHECK_API=true
When WITHOUT_CHECK_API=true the check api process is not run which
means that the current.txt and removed.txt files are not generated by
the build. In that case this change causes the droidstubs module to
fallback to exporting the source files instead.

An additional removedApiFilePath property (to match apiFilePath) was
added to hold the exported path as removedApiFile has to be a
WritablePath and source paths are not writable.

Bug: 169034951
Test: m WITHOUT_CHECK_API=true nothing
      fails without this fix, passes with it.
Change-Id: If6b09dd67c8533368b71405143f524d66350703f
2020-10-13 15:37:10 +01:00