Commit Graph

27521 Commits

Author SHA1 Message Date
Paul Duffin 81febc4500 Avoid panic when a boot jar is provided as a java_import
Bug: 142938164
Test: m nothing
Change-Id: I607009825f5946d7e1daa31dc1e4bb8f2609206d
2020-10-06 16:54:02 +01:00
Ulya Trafimovich a54d33be77 Fail the build if dexpreopt cannot find path to a <uses-library>.
This doesn't apply to compatibility libraries (those added to
conditional class loader context base on the targetSdkVersion in the
manifest), because Soong doesn't know if they are needed or not (the
build rule that parses the manifest runs at Ninja stage).

In the future we may need to relax this and instead of failing the build
to disable dexpreopt in such cases. But currently there are no use cases
that fail.

Also, this patch replaces hardcoded install path with a constant.

Test: lunch aosp_cf_x86_phone-userdebug && m
Bug: 132357300
Change-Id: Ic894bc17e8ffd8ff173111ea09366252001ef3e9
2020-10-06 14:04:49 +01:00
Ulya Trafimovich 39b437b25f Add dependency on implementation <uses-library> for modules that depend on component libraries.
If a dexpreopted Java module depends on a component library (such as
stubs), it must be dexpreopted against the implementation library,
because that is what it will use at run time. Therefore dexpreopt needs
to know about the implementation library.

One of the subtests of TestUsesLibraries is removed. This is because the
subtest was previosuly split in two variants with the only difference
that the first variant had dependency on a stubs library, and the second
one had dependency on the implementation. The latter caused dexpreopt to
be disabled because Soong couldn't find the implementation (it had only
the name, but no access to the module). Now that there is a dependency
on the implementation, the problem goes away and the two subtest
variants can be merged into one.

Add a method for getting the name of the implementation library for the
optional SDK library. Currently it is the same as the SDK library name,
but it may change in future.

Test: lunch aosp_cf_x86_phone-userdebug && m
Bug: 132357300
Change-Id: I584df4b6db874c7ae3c478231fc51572a46929b1
2020-10-06 14:04:49 +01:00
Anton Hansson ecf5435590 Add outputfiles tags for droidstubs api txts
These can then easily be used in genrules to merge txt files.

Bug: 169034951
Test: m combined-dex-api
Change-Id: Id49739c90a2ab52a72094b76696a4e5211c8d742
2020-10-06 10:01:29 +01:00
Jooyung Han 605b7a6bde Merge "apex: emit file_contexts for flattened apex" am: 51ce6b0acc
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1435292

Change-Id: I23fe348b58f5e60fd854c79c594b09a8fa66c6da
2020-10-06 03:43:55 +00:00
Martin Stjernholm 02460abb30 Avoid conflicting shared libraries from SDK snapshots.
Test: m nothing
Test: env SANITIZE_HOST=address \
  SANITIZE_TARGET='hwaddress fuzzer' \
  build/soong/soong_ui.bash --make-mode \
  TARGET_PRODUCT=blueline_hwasan haiku dist
Bug: 170041398
Change-Id: Ifa4f72d6778cbb10663a780c7eb54b5e21d5b571
2020-10-06 04:27:42 +01:00
Jooyung Han 51ce6b0acc Merge "apex: emit file_contexts for flattened apex" 2020-10-06 03:26:14 +00:00
Colin Cross 565cafdcb1 Don't create version variations of sdk modules
They are never used, skip creating them.

Test: m checkbuild
Change-Id: I4c8cd544327ae79b781f704be5a9064efdbdf2af
2020-10-05 18:57:26 -07:00
Colin Cross 3146c5cd67 Create fewer empty version variants
Don't create empty version variants for binaries, objects, rust
rlibs or rust dylibs.

Test: no change to build.ninja
Change-Id: I62d4d43da476eafdb258a08b5ada758bb2971a1a
2020-10-05 18:57:21 -07:00
Steven Moreland 3453948ad0 build/soong/scripts/update-apex-allowed-deps.sh
For bionic_libc_platform_headers(minSdkVersion:29).

Bug: 166675194
Test: build
Change-Id: I5c516265003ee2e0cec619ef7872e8a549354385
2020-10-06 00:52:00 +00:00
Tom Cherry 042238162e Merge "Revert "Include system/core/liblog/include instead of using symlinks"" am: 66fee25c5b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1449380

Change-Id: I6703303e549f04432f1c32720ec2411cc722dd8e
2020-10-05 19:54:26 +00:00
Tom Cherry 66fee25c5b Merge "Revert "Include system/core/liblog/include instead of using symlinks"" 2020-10-05 19:26:17 +00:00
Tom Cherry 271f4acd72 Revert "Include system/core/liblog/include instead of using symlinks"
Revert submission 1428983-no-log-header-symlinks

Reason for revert: Build breaks
Reverted Changes:
I248a2f045:Include system/core/liblog/include instead of usin...
Ic189e0f59:Remove logging symlinks from system/core/include

Change-Id: I9ee896f5fde36c879c182365295c1f5a5a39a76b
2020-10-05 19:24:12 +00:00
Tom Cherry f6a4e63413 Merge "Include system/core/liblog/include instead of using symlinks" am: 24ee3605fa
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1429369

Change-Id: I2d3a7994578d9766ac85231189046eec2759f59b
2020-10-05 17:35:57 +00:00
Tom Cherry 24ee3605fa Merge "Include system/core/liblog/include instead of using symlinks" 2020-10-05 15:26:51 +00:00
Paul Duffin f78b75224f Merge "Add prebuilt_visibility property" am: cbda59333c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1441935

Change-Id: I6228adbeabd2cf7e1ce957964c269e40b553be2a
2020-10-05 12:13:00 +00:00
Paul Duffin cbda59333c Merge "Add prebuilt_visibility property" 2020-10-05 11:41:55 +00:00
Treehugger Robot e74f6092de Merge "Remove stale apex_available dependency." am: 0400ede359
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1435497

Change-Id: I9ab452e3dd054fa68dd64f829c829cf58af8f996
2020-10-04 23:26:28 +00:00
Treehugger Robot 0400ede359 Merge "Remove stale apex_available dependency." 2020-10-04 22:52:57 +00:00
Ivan Lozano 46df6b07e3 Merge "rust: Allow rust_bindgen to use cc_defaults." am: 4e7b26a434
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1439751

Change-Id: I161ce227d518125f5cd13607b4b5dcb669101b18
2020-10-03 00:35:24 +00:00
Ivan Lozano 4e7b26a434 Merge "rust: Allow rust_bindgen to use cc_defaults." 2020-10-03 00:22:49 +00:00
Ivan Lozano 9197667b21 Merge "rust: Add static binary support" am: e934c5ba7e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1446955

Change-Id: I5d9a7613f7231107828a8a6be28e9f6b3d0b1e5b
2020-10-02 22:31:26 +00:00
Ivan Lozano e934c5ba7e Merge "rust: Add static binary support" 2020-10-02 21:48:00 +00:00
Colin Cross 1348ce3f13 Don't make SplitPerApiLevel imply UseSdk
UseSdk was returning true when SplitPerApiLevel returned true,
which was causing the platform variant of SplitPerApiLevel
module to compile against the SDK.  Check SplitPerApiLevel
separately in the sdkMutator instead.

Test: m checkbuild
Change-Id: I0ae667d48a3b7b96709a6cad8e8ea9701659fc2a
2020-10-02 13:00:19 -07:00
Colin Cross b6135218a4 Remove vendor crt special case
It doesn't seem to be necessary, crt objects can get headers via
local_include_dirs.

Test: m checkbuild
Change-Id: Id357adc054c85576aa9935d0acbee5f1ae3dcbff
2020-10-02 13:00:19 -07:00
Colin Cross 9f720ce52a Fix apex_test.go and add it to Android.bp
apex_test.go wasn't listed in the Android.bp file, which allowed
it to bitrot.  Make the API level methods take a PathContext
so that they can be called from a test using configErrorWrapper.
Also fix an int that was converted to a string.

Test: apex_test.go
Change-Id: I1ff87134c837bd5d344d22550baabde10d1b0b2e
2020-10-02 13:00:14 -07:00
Pirama Arumuga Nainar 18fc11a093 Merge "Update to use clang-r399163b." am: 0b88bf33fc
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1443739

Change-Id: Iadcdee65467e9e5ee4ccbb33beeac8ef52c605f4
2020-10-02 16:57:04 +00:00
Pirama Arumuga Nainar 0b88bf33fc Merge "Update to use clang-r399163b." 2020-10-02 16:37:52 +00:00
Ivan Lozano bf63d00c54 rust: Add static binary support
Adds the "static_executable" property to rust_binary modules which
allows for building fully static executables. This only impacts bionic
targets.

Bug: 169434439
Test: rust_binary module with static_executable true builds, runs on
      device.

Change-Id: I83c19fddd070859b7e56d248237cfd73e1768519
2020-10-02 12:31:23 -04:00
Paul Duffin 55a2ad6c6b Merge "Explicitly specify visibility in sdk/module_exports snapshot" am: 958dd4f6ad
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1441934

Change-Id: I125abb0ba408a538d3b311ac2dc5b2ee5f49ca2a
2020-10-02 10:05:49 +00:00
Paul Duffin 157f40f056 Add prebuilt_visibility property
Some mainline modules provide an `sdk` and one or more set of
module_exports. When the snapshots are unpacked into separate prebuilts
directories (one per snapshot) then any dependencies from a member of
one snapshot to a member of another may require the latter to have
additional visibility rules.

Previously, these rules had to be added to each source module. This
change allows additional visibility rules to be specified on the
sdk/module_exports that are added to all the prebuilts in its snapshot.

Bug: 155921753
Bug: 168301990
Test: m nothing
Change-Id: Ia3eacb5749981f04770ae9872a8013e43c5c6ef1
2020-10-02 10:59:41 +01:00
Paul Duffin 958dd4f6ad Merge "Explicitly specify visibility in sdk/module_exports snapshot" 2020-10-02 09:45:22 +00:00
Colin Cross 0730dce1c0 Merge changes from topic "sanitizer-runtime-stubs" am: 973f46703b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1437232

Change-Id: I5807ce1617f2d78828c914fea8858d26a5883409
2020-10-02 01:22:03 +00:00
Artur Satayev a0a4061836 Track allowed transitive deps in any updatable module. am: 4e1f2bd0d8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1437234

Change-Id: Ie8fb3d8d69d3cbf68b7652f3465a6f268498c8d8
2020-10-02 01:21:27 +00:00
Colin Cross 973f46703b Merge changes from topic "sanitizer-runtime-stubs"
* changes:
  Add version dependencies to sanitizer runtime dependencies
  Fix prebuilt library stubs
  Track allowed transitive deps in any updatable module.
2020-10-02 01:06:10 +00:00
Kris Alder 394e9930b9 Merge "add acknowledgements field to fuzz_config" am: 0f1a0f7a81
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1442242

Change-Id: Idb94b2a56d21b00db4a717247ccdace1c52667a1
2020-10-02 00:45:30 +00:00
Kris Alder 0f1a0f7a81 Merge "add acknowledgements field to fuzz_config" 2020-10-01 23:58:01 +00:00
Paul Duffin d99d997238 Explicitly specify visibility in sdk/module_exports snapshot
This change ensures that each prebuilt in a snapshot explicitly
specifies its visibility even when that visibility is the current
default. This is done for two reasons:
1. It simplifies a follow up change that adds visibility rules to an
   existing set of rules.
2. It ensures that the snapshots are independent of the current Soong
   default visibility.

The latter is important because we intend to switch from modules being
visible to everyone by default (i.e. //visibility:public) to only being
visible to modules in the same package (i.e. //visibility:private). By
making the snapshots of modules that do not specify any visibility
explicitly specify that they are "//visibility:public" it ensures that
the snapshots will not need to be changed when the default changes.

Bug: 168301990
Test: m nothing
Change-Id: Ia034f4a1e5124c17f46d73b0e9a6c5f2a251038e
2020-10-01 18:20:13 +01:00
Ivan Lozano cee1e90ed3 Merge "rust: Refactor staticStd to stdLinkage" am: 45dda43df0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1441253

Change-Id: I90ce086becadb199f85bd513b6a5f37d6ed4a846
2020-10-01 12:38:29 +00:00
Ivan Lozano 45dda43df0 Merge "rust: Refactor staticStd to stdLinkage" 2020-10-01 12:25:38 +00:00
Paul Duffin c218ace51c Merge "Add support for using sdk_version: "module_<ver>"" am: 3a7e672abe
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1442937

Change-Id: If112463c2a44fa6d7e39c0763107783a2aa2f555
2020-10-01 10:57:39 +00:00
Paul Duffin 3a7e672abe Merge "Add support for using sdk_version: "module_<ver>"" 2020-10-01 10:36:23 +00:00
Stephen Hines 5060c9e558 Update to use clang-r399163b.
Bug: http://b/155835175
Test: aosp_blueline
Change-Id: I34d26da72a36b16491cf328075d817b073acfc0d
2020-09-30 19:07:42 -07:00
Janis Danisevskis 1edd039bff Add allow rust rule for android.system.keystore2 vts tests.
Bug: 160623310
Test: N/A
Change-Id: Ie501a56c3ed6c1352fc57b5b956df6ac3f4af39f
2020-09-30 14:43:40 -07:00
Colin Cross e7257d2019 Add version dependencies to sanitizer runtime dependencies
The hwasan runtime has stubs, make the function to add all version
variants of a shared library available to the sanitizer mutator.

Test: m checkbuild
Change-Id: Ie4124022140f8520834d7bf7b59f0499cd381083
2020-09-30 21:17:59 +00:00
Colin Cross d48fe734cd Fix prebuilt library stubs
There were multiple stacked issues with prebuilt library stubs that
cancelled eachother out.  Prebuilts were never considered to be
DirectlyInAnyApex by the AndroidMk logic to handle stubs libraries
because it looked it up in the global list of modules in apexes
using the name with the "prebuilt_" prefix.  Fixing that to use
ctx.BaseModuleName() exposed a second issue, that stubs variants
for prebuilt libraries were never created, so there was no latest
version to expose to Make.

Making the *prebuiltLibraryLinker type work with all of the
methods that handle stubs should really be done with an interface
and methods implemented on *libraryDecorator, but that would
also cause other types like that embed libraryDecorator to
participate in stubs that may trigger more issues.  I'd like
to replace those methods anyways, so just manually handle
*prebuiltLibraryLinker for now.

Test: m checkbuild
Change-Id: I1267ee01659ad9ab11d75318c6c6bdbf8f72a061
2020-09-30 21:17:51 +00:00
Artur Satayev 4e1f2bd0d8 Track allowed transitive deps in any updatable module.
Instead of tracking per module and per module variant, track allowed
list of dependecies for all modules combined. This avoids issues with
different products and different downstream branches having different
build graphs.

To compare allowed_deps.txt vs head, run:
:; m -j out/soong/apex/depsinfo/new-allowed-deps.txt.check

To update source allowed_deps.txt, run:
:; build/soong/scripts/update-apex-allowed-deps.sh

Bug: 149622332
Test: m
Change-Id: Ic518fbd9ebfe1b46aaf9a58df731780a7e5a676b
Merged-In: Ic518fbd9ebfe1b46aaf9a58df731780a7e5a676b
(cherry picked from commit 453555083b)
(cherry picked from commit e5207cd9a6)
2020-09-30 21:17:42 +00:00
Martin Stjernholm 3b8ca4c317 Remove stale apex_available dependency.
Test: m
Bug: 142944931
Change-Id: I9c69ef64eb9eecd45f6272a1d79bf77ee910815c
2020-09-30 17:40:17 +01:00
Paul Duffin fb6ae5bc73 Add support for using sdk_version: "module_<ver>"
Fixes a panic when trying to build something with
sdk_version: "module_30".

Test: m nothing
Change-Id: I9b2ce50957f59e2bead335ffa58888e15cda1f78
2020-09-30 16:20:17 +01:00
Thiébaud Weksteen c944017c9f Merge "rust: document manual configuration for rustfmt" am: 996de36d0f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1393184

Change-Id: Ib85fe502686392c4e40e2cfa28b428212e3485cb
2020-09-30 15:12:39 +00:00