Commit Graph

34818 Commits

Author SHA1 Message Date
Treehugger Robot
d92c9bbf46 Merge "Add smoke test for Bazel." am: 9d181ec5d5 am: 096747407a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1475777

Change-Id: I050ef08d13b1c7660c6957818523dd40154f213d
2020-10-28 07:05:41 +00:00
Treehugger Robot
096747407a Merge "Add smoke test for Bazel." am: 9d181ec5d5
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1475777

Change-Id: Icb2e85ff495e1f34356661c8caed47b95db13d73
2020-10-28 06:33:29 +00:00
Treehugger Robot
9d181ec5d5 Merge "Add smoke test for Bazel." 2020-10-28 06:21:58 +00:00
Yifan Hong
02e7dec682 Make vendor_ramdisk_available.
Test: pass
Bug: 156098440
Change-Id: Id980fae69db9c3e506dc89e3776c918e675e252b
2020-10-27 20:51:49 -07:00
Yifan Hong
6da33c2af6 Add target.vendor_ramdisk.
Add exclude_srcs, exclude_static_libs, exclude_shared_libs, and
cflags.

Test: pass
Bug: 156098440

Change-Id: I2e10e1f7145932e9bc64f72fa95d0aac776f7f63
2020-10-27 20:51:49 -07:00
Yifan Hong
d2057fbb8e cc/linker.go: fix typo.
The ramdisk variant is using properties from the recovery variant.

Test: TH
Change-Id: Ib2a349e307ab0389413c2d550cf7deb4c7c8ecf4
2020-10-27 20:51:49 -07:00
Treehugger Robot
3d4457b212 Merge "Set stem and suffix for vndk prebuilt libraries" am: 6776629f63 am: 35b7a9506b am: c8f6b8ea0c am: a1c1f6e67f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1471663

Change-Id: Ib82fbb19843cf5acbd5f23f74e7434e6df580633
2020-10-28 03:03:25 +00:00
Treehugger Robot
a1c1f6e67f Merge "Set stem and suffix for vndk prebuilt libraries" am: 6776629f63 am: 35b7a9506b am: c8f6b8ea0c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1471663

Change-Id: I4ccc71ddc06f8e6d13791bf1a238cd64685c6007
2020-10-28 02:51:33 +00:00
Treehugger Robot
c8f6b8ea0c Merge "Set stem and suffix for vndk prebuilt libraries" am: 6776629f63 am: 35b7a9506b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1471663

Change-Id: I09e60a144101be2e12612c5ed9fdf7f381212f6c
2020-10-28 02:17:42 +00:00
Treehugger Robot
35b7a9506b Merge "Set stem and suffix for vndk prebuilt libraries" am: 6776629f63
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1471663

Change-Id: I631f8849283d009f3046ebf5415a594145434775
2020-10-28 01:41:40 +00:00
Treehugger Robot
6776629f63 Merge "Set stem and suffix for vndk prebuilt libraries" 2020-10-28 01:25:36 +00:00
Nikita Ioffe
769f4a5c03 Update apex/allowed_deps.txt
Bug: 171330443
Test: build/soong/scripts/update-apex-allowed-deps.sh
Change-Id: Ic7ddd86cefc0c6a26de294b6e73b3e23d4791f5c
Merged-In: Ic7ddd86cefc0c6a26de294b6e73b3e23d4791f5c
2020-10-28 01:17:55 +00:00
Chris Parsons
8b77a009e2 Change mixed soong/bazel builds to use USE_BAZEL_ANALYSIS
As a result, one can enable bazel-as-ninja-executor separately from
mixed builds.

Test: Manually verified building image with and without bazelenv.sh.
Change-Id: Ia97806fb41e1de850a80b9483ed8a5ff50d9dab2
2020-10-27 18:59:25 -04:00
Nikita Ioffe
ec62601d24 Update apex/allowed_deps.txt
Bug: 171330443
Test: build/soong/scripts/update-apex-allowed-deps.sh
Change-Id: Ic7ddd86cefc0c6a26de294b6e73b3e23d4791f5c
2020-10-27 22:22:39 +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
6eb013d805 Cleanup usages of CreateConfiguredJarList am: e10dfa4e3d am: d34168219d am: f80f9004ea
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1471781

Change-Id: If243dff6867a5e8aa58362ddc4d088c37ec5f8ea
2020-10-27 17:58:27 +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
f80f9004ea Cleanup usages of CreateConfiguredJarList am: e10dfa4e3d am: d34168219d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1471781

Change-Id: Iaf669a40406915c5798ade0a7d67996cc53ed3e7
2020-10-27 17:35:03 +00:00
Paul Duffin
e2de42f7e5 Remove unnecessary properties in GlobalJSONConfig am: 7ccacaedbe am: 1a9f05649b am: 55cf474711 am: e0f049aed5
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1471780

Change-Id: Iafe8f0abef1b940b7a8dfc715b9edadf83756324
2020-10-27 17:29:03 +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
Paul Duffin
85fbdb652f Refactor creation of ConfiguredJarList from list of pairs am: 0141660c63 am: 8ddf83e691 am: 1d74000378 am: ae3f50750f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1471778

Change-Id: Idc2bc70c6261a5cb6cae2b641745ed04d487e68d
2020-10-27 17:28:58 +00:00
Paul Duffin
e0f049aed5 Remove unnecessary properties in GlobalJSONConfig am: 7ccacaedbe am: 1a9f05649b am: 55cf474711
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1471780

Change-Id: I3f186b963896e426c03dd4947a240b0980f91d24
2020-10-27 17:20:26 +00:00
Paul Duffin
0b34b8cdfb Switch BootJars/UpdatableBootJars to ConfiguredJarList am: 69d1fb1e39 am: 769b1eab84 am: 3e29458b28
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1471779

Change-Id: I105cce84a3f8bd3eb3500d5bc1e4ffcd3524c030
2020-10-27 17:20:24 +00:00
Paul Duffin
d34168219d Cleanup usages of CreateConfiguredJarList am: e10dfa4e3d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1471781

Change-Id: I699d621e21831b2e1d2ae8ccd5beffd92fe1a7aa
2020-10-27 17:20:23 +00:00
Paul Duffin
ae3f50750f Refactor creation of ConfiguredJarList from list of pairs am: 0141660c63 am: 8ddf83e691 am: 1d74000378
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1471778

Change-Id: Iee4205a704154b97e7a1d11640d2511a550a31b2
2020-10-27 17:20:20 +00:00
Paul Duffin
55cf474711 Remove unnecessary properties in GlobalJSONConfig am: 7ccacaedbe am: 1a9f05649b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1471780

Change-Id: I62656cdf625f104d925b912ad47a84722a5409e3
2020-10-27 17:09:52 +00:00
Paul Duffin
3e29458b28 Switch BootJars/UpdatableBootJars to ConfiguredJarList am: 69d1fb1e39 am: 769b1eab84
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1471779

Change-Id: Ia770a0b227d8a5ab0c88d56c7e6110c8b697381a
2020-10-27 17:09:50 +00:00
Paul Duffin
1d74000378 Refactor creation of ConfiguredJarList from list of pairs am: 0141660c63 am: 8ddf83e691
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1471778

Change-Id: I997bd77deb135b389d0fc4d7f1c081f3993f0a0e
2020-10-27 17:09:48 +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
1a9f05649b Remove unnecessary properties in GlobalJSONConfig am: 7ccacaedbe
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1471780

Change-Id: Id30f187d4101fad4c4fab53f973f7a6c33928c22
2020-10-27 16:58:58 +00:00
Paul Duffin
769b1eab84 Switch BootJars/UpdatableBootJars to ConfiguredJarList am: 69d1fb1e39
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1471779

Change-Id: I32de733aea29ddfdb13427acdf203b99e43176d2
2020-10-27 16:58:55 +00:00
Paul Duffin
8ddf83e691 Refactor creation of ConfiguredJarList from list of pairs am: 0141660c63
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1471778

Change-Id: Id144fb2c4928d7d0135255dc9606b6a1c528a739
2020-10-27 16:58:13 +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
7ccacaedbe Remove unnecessary properties in GlobalJSONConfig
This change removes the properties in GlobalJSONConfig that are used to
hold the unmarshalled []string along with the code to convert them into
ConfiguredJarList as they are no longer necessary because the
ConfiguredJarList.UnmarshalJSON(..) method can handle that automatically.

Bug: 171479578
Test: m nothing
Change-Id: Ie297cd00cb23d12e544d922454868db6fe9eb77c
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
Paul Duffin
0141660c63 Refactor creation of ConfiguredJarList from list of pairs
This change:
* Changes splitConfiguredJarPair to return an error rather than
  reporting it through the context.
* Extracts the splitting of a list of pairs into a pair of lists into a
  new splitListOfPairsIntoPairOfLists() method for reuse in a follow up
  change.

Bug: 171479578
Test: m nothing
Change-Id: I824ed1bc673b47757424563fc37e1190adff2ed1
2020-10-27 10:36:26 +00:00
Slava Shklyaev
e7c1a55d7b Merge "Add new neuralnetworks targets to apex/allowed_deps.txt" 2020-10-27 09:51:56 +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
Anton Hansson
e04d8e7b3f Merge "Make highmem classification of metalava optional" am: 72b1df4b79 am: ba63a2c9ce am: d951c976bb
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1474017

Change-Id: Ic8fb378b832a47e36a26fcb425fdbeb322a5c0c2
2020-10-27 09:28:41 +00:00
Anton Hansson
d951c976bb Merge "Make highmem classification of metalava optional" am: 72b1df4b79 am: ba63a2c9ce
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1474017

Change-Id: I2358dd9efc47c7663fe181b3bbb40de03808451a
2020-10-27 09:09:45 +00:00
Anton Hansson
ba63a2c9ce Merge "Make highmem classification of metalava optional" am: 72b1df4b79
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1474017

Change-Id: I029a5dc67b1b069b1600827568b90f46641a7c79
2020-10-27 08:46:38 +00:00
Anton Hansson
72b1df4b79 Merge "Make highmem classification of metalava optional" 2020-10-27 08:07:08 +00:00
Treehugger Robot
f1cf9d7337 Merge "Fix path conflict for vendor_ramdisk_available" am: 07bc11722b am: 194339bceb am: a569d6dd0c am: 9485e47663
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1473538

Change-Id: Ic526b0dd9b3186e954823a9a73f7840619639314
2020-10-27 07:46:15 +00:00
Treehugger Robot
9485e47663 Merge "Fix path conflict for vendor_ramdisk_available" am: 07bc11722b am: 194339bceb am: a569d6dd0c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1473538

Change-Id: I3b85175d8d02fec96f361891cae6c520619bae06
2020-10-27 07:30:44 +00:00
Treehugger Robot
a569d6dd0c Merge "Fix path conflict for vendor_ramdisk_available" am: 07bc11722b am: 194339bceb
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1473538

Change-Id: I2145ccfd28d1178b1086019609a4c1cba3fd97b1
2020-10-27 07:05:30 +00:00
Treehugger Robot
194339bceb Merge "Fix path conflict for vendor_ramdisk_available" am: 07bc11722b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1473538

Change-Id: Ic47e67d72e995387b03b6a7b69a39072e0b9c39c
2020-10-27 06:38:54 +00:00
Treehugger Robot
07bc11722b Merge "Fix path conflict for vendor_ramdisk_available" 2020-10-27 06:27:12 +00:00