Commit graph

42564 commits

Author SHA1 Message Date
Colin Cross
1072a71089 Ignore owner property when computing java_sdk_library dist subdirectory
The owner property is no longer used, the dist subdirectory is determined
by the dist_group property.

Bug: 186723288
Test: TestJavaSdkLibraryDist
Change-Id: Id6d997eef05f6511070677974219674f248cb754
Merged-In: Id6d997eef05f6511070677974219674f248cb754
(cherry picked from commit 59b92bfdb3)
2021-06-08 10:17:58 -07:00
Colin Cross
0f9eeb753d Make the default java_sdk_library dist_group "unknown"
Change the default dist_group from "android" to "unknown" to prevent
accidentally including java_sdk_library stubs that do not set
dist_group or owner in the public SDK.

Bug: 186723288
Test: TestJavaSdkLibraryDist
Change-Id: I9aae2a16254ac1a8d444acfa63bc571d1ef4b045
Merged-In: I9aae2a16254ac1a8d444acfa63bc571d1ef4b045
(cherry picked from commit 3dd662509d)
2021-06-08 10:17:58 -07:00
Martin Stjernholm
7e148881d0 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.

Cherry-picked from https://r.android.com/1729335.

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
Merged-In: I86327b082b61c292f18c0a6b315d9add08002832
2021-06-08 16:33:06 +01:00
satayev
b75cd4ed7a Add exemption for framework-sdkextensions-classpaths boot jar.
As long as we have boot jars defined in make, we should try to keep
global.UpdatableBootJars as a source of truth when it comes to classpath
configuration. However, for testing purposes there is a need to add
java libraries to bootclasspath that aren't present in
PRODUCT_UPDATABLE_BOOT_JARS variable.

Ideally, we would unconditionally add all contents to the config for
test apexes, however, I don't fully understand apex merging to support
it.

Bug: 180105615
Test: atest sdkextensions_classpaths_e2e_tests
Change-Id: I552f93289c27b3713e75dcda1faed909b0bfcef2
Merged-In: I552f93289c27b3713e75dcda1faed909b0bfcef2
(cherry picked from commit 1b75a3ce62)
2021-06-08 15:29:19 +01:00
Yi-Yo Chiang
0de94db394 cc/sabi.go: Propagate ShouldCreateSourceAbiDump to reuseObjTag deps
`reuseObjTag` is a dependency from the shared variant of a `cc_library`
to the static variant. When such dependency exist, the shared variant
would reuse the object files of the static variant.
Thus if the shared variant requires ABI dump, then the static variant
would need to generate ABI dump as well.

Bug: 190339664
Test: m findlsdump
Change-Id: I015328d74acbeb89ff7622397e59b68864af34a4
Merged-In: I015328d74acbeb89ff7622397e59b68864af34a4
(cherry picked from commit 21d1c6d637)
2021-06-08 15:53:46 +08:00
Ivan Lozano
ab5f042d9f Disable Rust vendor-specific modules
We need to avoid building Rust vendor-specific modules as there is no
vendor snapshot support for Rust yet.

Bug: 184042776
Test: m <vendor_rust_module> # build error generated
Change-Id: I5afce74bc939b3ceda5cbb9dbe75833d4c3b413e
Merged-In: I51a7fa49096ee5809fd37ce76113ff14841d1b52
2021-06-07 20:02:25 +00:00
Chris Gross
0f437f21b9 Use broader permissions when archiving files.
Using broader premissions for archived files allows them to be more
easily used when extracted. For example, defaulting regular files to
0644 will allow other tooling to use a file without the need to change
permissions manually.

Bug: 189919409
Test: m dist and inspected file permissions of archived files
Change-Id: I4a0f8075206391254c639ecf865639bb9e8df0bf
2021-06-07 09:09:28 -07:00
Anton Hansson
b6d94b6999 Merge "Make soong create sourcepath dirs" into sc-dev 2021-06-04 17:48:44 +00:00
Yuntao Xu
21d41073f5 Merge "add the LOCAL_DISABLE_TEST_CONFIG variable" into sc-dev 2021-06-04 16:51:28 +00:00
Anton Hansson
546de4a1f3 Add a soong-only mode to soong-ui
The previous --skip-kati flag could be interpreted as "do not run kati
to re-generate ninja file". Add a more specific flag for the "soong
only" build use-case, where we do not load the kati-generated ninja
files at all.

Bug: 189187214
Test: build/soong/soong_ui.bash \
  --make-mode \
  --soong-only
  --skip-soong-tests \
  TARGET_PRODUCT=mainline_sdk \
  SOONG_ALLOW_MISSING_DEPENDENCIES=true \
  SOONG_SDK_SNAPSHOT_VERSION=unversioned \
  SOONG_SDK_SNAPSHOT_USE_SRCJAR=true \
  out/soong/mainline-sdks/art-module-sdk.zip
Change-Id: I91abbd28af517d4b550ebc6d88fd64947caf9545
2021-06-04 12:14:05 +01:00
Anton Hansson
d274ea9196 Various cleanup in soong_ui to aid new feature
- Rename the "BuildX" variables to "RunX"
- Remove redundant comments
- Inline all the "what to do" based on config in build.go
- Inline some constants only used in one place

Bug: 189187214
Test: m nothing
Test: build/soong/build_test.bash
Change-Id: I111a69e642212d7938d4971283545e0d9acbb01a
2021-06-04 12:10:36 +01:00
Anton Hansson
7eff3a8fc3 Make soong create sourcepath dirs
Sourcepath is set to dir of the Android.bp, but that dir does not
necessarily have any inputs for the metalava invocation defined in that
Android.bp. This leads to problems when metalava tries to read a
non-existent dir, so create it first.

Bug: 153703940
Test: m sdk dist
Change-Id: I8c2ca45c8f066cabf3247b9652a7094cefc047a9
2021-06-04 10:27:18 +01:00
Yuntao Xu
ad1668fc13 add the LOCAL_DISABLE_TEST_CONFIG variable
Introduce and set the variable LOCAL_DISABLE_TEST_CONFIG varaible to be
true for the `android_test_helper_app` type modules.

Bug: 188927912
Test: rum 'm module-name' (`android_test_helper_app` type module)
Test: TreeHugger
Change-Id: I5db1029f31d8afe1ca5e9fab95e39d751971058d
Merged-In: I5db1029f31d8afe1ca5e9fab95e39d751971058d
2021-06-03 10:16:39 -07:00
TreeHugger Robot
a9f7e07d5d Merge "Do not build compressed APEX" into sc-dev 2021-06-03 13:58:29 +00:00
Jeff Sharkey
799822d7af Merge changes from topic "may27-sdk" into sc-dev
* changes:
  Hacky workaround for half-finalized builds.
  platform/build/soong - S is now 31
2021-06-02 20:11:14 +00:00
Colin Cross
0d3dd0600f Support dist_group property instead of owner for setting sdk dist subdirectory
Reusing the owner property is confusing, especially when the property is
required on every java_sdk_library module.  Create a new dist_group property
to use instead.

Bug: 186723288
Test: TestJavaSdkLibraryDist
Change-Id: I9e62c703a95d6b63cafa60bffb1b37ba85388593
Merged-In: I9e62c703a95d6b63cafa60bffb1b37ba85388593
(cherry picked from commit 986b69aa51)
2021-06-02 08:06:41 -07:00
Colin Cross
3b538082fe Add test for java_sdk_library dist properties
Add tests that cover the owner, core_lib and dist_stem properties.

Bug: 186723288
Test: TestJavaSdkLibraryDist
Change-Id: I4c2ae2a23dcd9a668c46ed5cc23b1d7dcfae798a
Merged-In: I4c2ae2a23dcd9a668c46ed5cc23b1d7dcfae798a
(cherry picked from commit 30c491b885)
2021-06-02 08:06:40 -07:00
Colin Cross
76069a30a4 Move java_sdk_library tests to sdk_library_test.go
Seperate the java_sdk_library tests into their own file.

Bug: 186723288
Test: go test ./java/...
Change-Id: I899c2946cb2234dc595a4281e64bbb239b89bda8
Merged-In: I899c2946cb2234dc595a4281e64bbb239b89bda8
(cherry picked from commit 1d2b6b3b2e)
2021-06-02 08:06:40 -07:00
Samiul Islam
129afaea73 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
Merged-In: If0f62c2baa3db3c079b2913fcdc3dafd66394011
(cherry picked from commit d365449fae)
2021-06-02 15:42:41 +01:00
TreeHugger Robot
0bdd20d5e0 Merge "Fix ExcludeFromVendorSnapshot check" into sc-dev 2021-06-02 00:13:38 +00:00
Colin Cross
7dcd16c6eb Fix propagating EMPTY_NINJA_FILE from multiproduct_kati to minibp
I6dca478f356f56a8aee1e457d71439272351390b replaced calling
build/blueprint/bootstrap.bash with running minibp directly,
but didn't propagate the EMPTY_NINJA_FILE environment variable
to minibp.  Since everything that uses EMPTY_NINJA_FILE is
executed directly from soong_ui now, replace the EMPTY_NINJA_FILE
environment variable with a config bool and pass it to minibp.

Bug: 189148777
Test: build/soong/build_test.bash --dist --incremental --shard-count=300 --shard=1 && du out/multiproduct
Change-Id: I4d64275ce02c5d68948012f71ac4dc3795af9e85
Merged-In: I4d64275ce02c5d68948012f71ac4dc3795af9e85
(cherry picked from commit f3bdbcbea3)
2021-06-01 14:57:06 -07:00
Jeff Sharkey
05597c0cc4 Hacky workaround for half-finalized builds.
Metalava increments the SDK level by one when it's not "REL", so we
temporarily force the build to be "REL" while we're still in the
process of finalizing it.

This CL must be reverted as part of actually declaring "REL".

Bug: 171506470
Test: Build
Change-Id: I95ee4879268eab3e28a653ca8c169bf6a83e2a19
2021-06-01 12:31:13 -06:00
Colin Cross
f58e5e8f24 Merge "Don't propagate ASAN through shared library dependencies" into sc-dev 2021-06-01 17:24:09 +00:00
Colin Cross
f63cf839ca Merge changes I0116f5f4,I950c9b54,I967f5c42 into sc-dev
* changes:
  Treat java libraries in classpath fragments as directly in apex
  Make CopyDirectlyInAnyApex match the documentation
  Remove unused cc.copyDirectlyInAnyApexDependencyTag
2021-06-01 17:23:45 +00:00
Jeff Sharkey
7412091dcc platform/build/soong - S is now 31
Bug: 171506470
Test: Build
Change-Id: I7b02ab24d12ea07463efd319a7ff059751416990
2021-06-01 06:49:05 -06:00
Anton Hansson
ea2d99c1a0 Merge "Remove support for removed_dex_api_filename" into sc-dev 2021-05-28 06:34:10 +00:00
Justin Yun
027bfc68db Fix ExcludeFromVendorSnapshot check
ExcludeFromVendorSnapshot() must return true if the module must not
be snapshotted and built from the vendor source tree.
The default value must be false because rust modules are provided by
the system source tree.

Bug: 184042776
Bug: 189372652
Test: m nothing
Change-Id: I267c3a5674bea966d1dd831cda73538ae94cf25f
Merged-In: I267c3a5674bea966d1dd831cda73538ae94cf25f
(cherry picked from commit 9e13187f6b)
2021-05-28 09:04:12 +09:00
Colin Cross
cbb2b8172d Treat java libraries in classpath fragments as directly in apex
Coverage is applied to java libraries that are directly in an apex.
Mark java libraries that are in an apex through a bootclasspath_fragment
or a systemserverclasspath_fragment as directly in the apex by
implementing CopyDirectlyInAnyApexTag on the dependency tags used for
their contents.

Bug: 183759446
Test: TestApexJavaCoverage
Change-Id: I0116f5f415083b5194000988cb257454ef115200
Merged-In: I0116f5f415083b5194000988cb257454ef115200
(cherry picked from commit c33e5216f1)
2021-05-27 13:14:33 -07:00
Colin Cross
3225be468a Make CopyDirectlyInAnyApex match the documentation
CopyDirectlyInAnyApex was documented to copy from child to parent, but
was copying from parent to child.  It is unused, so reverse it to
match the documentation.

Bug: 183759446
Test: next CL
Change-Id: I950c9b5416d66e83d76ca489aeb5e0572e005d5d
Merged-In: I950c9b5416d66e83d76ca489aeb5e0572e005d5d
(cherry picked from commit 4d4f7d6114)
2021-05-27 13:13:17 -07:00
Colin Cross
58b783b460 Remove unused cc.copyDirectlyInAnyApexDependencyTag
Bug: 183759446
Test: go test ./build/soong/cc
Change-Id: I967f5c42cbf7722843a6455cbc2867a8912033cb
Merged-In: I967f5c42cbf7722843a6455cbc2867a8912033cb
(cherry picked from commit 243f3c250e)
2021-05-27 13:13:17 -07:00
Martin Stjernholm
c4f4cedc47 Merge "Drop "prebuilt_" prefixes from names registered in ApexInfo.InApexXxx."
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1719298

Bug: 180325915
Change-Id: I1fd96bad2326612d153fed31308914902f58d3ec
Merged-In: Icbe4e025ce1a4c8dd258ff95d326ca2f27905188
(cherry picked from commit f4c44417a3)
2021-05-27 17:23:16 +00:00
Anton Hansson
a7bb86b48e Remove support for removed_dex_api_filename
Nothing uses this argument anymore, so simplify the droidstubs code by
removing the argument.

Bug: 189426360
Test: m
Change-Id: I0e4b84d73a954b3819db1149be3da287cf604eec
2021-05-27 12:31:03 +01:00
Anton Hansson
ae5072fac3 Add sdkextensions tests to soong TEST_MAPPING
Changes in soong have left sdkextensions tests broken for over 2 days,
so let's prevent that happening again.

Bug: 180105615
Test: presubmit
Change-Id: I6961228bdd5a4606eb5078ed332b508ef6d2d6af
Merged-In: I6961228bdd5a4606eb5078ed332b508ef6d2d6af
2021-05-26 20:16:11 +01:00
Artur Satayev
b9d7ff160c Merge changes from topic "populate-bootclasspath-fragments-with-stem" into sc-dev
* changes:
  Use stem when filtering boot jars.
  Revert "Partial Revert "Populate individual classpath_fragments'..."
2021-05-26 16:10:57 +00:00
Artur Satayev
119770fd98 Merge "Populate individual systemserverclasspath_fragments' proto configs." into sc-dev 2021-05-26 10:19:24 +00:00
Jiyong Park
59fa1e4b7f Merge "Update VndkMustUseVendorVariantList after aidl-freeze-api" into sc-dev 2021-05-25 22:43:41 +00:00
satayev
07753d8467 Use stem when filtering boot jars.
For testing purposes, a boot jar may be provided by a test java_library
that has a different content name, but sets "stem" property to match
the original java_library.

Given that Stem() returns either the property value or module name,
it is safe to replace all content names by their stems.

Bug: 180105615
Test: atest CtsClasspathsTestCases sdkextensions_e2e_tests
Change-Id: Ic519ffa0c5b616abddf15b41c934421dfac2e78a
2021-05-25 21:16:34 +01:00
Artur Satayev
5cb569794e Revert "Partial Revert "Populate individual classpath_fragments'..."
Revert submission 14717811-revert-populate-platform-bootclasspath

Reason for revert: retry with a fix
Reverted Changes:
Ib58cd0211:Revert "Add bootclasspath_fragments to platform-bo...
I13b622d6c:Partial Revert "Populate individual classpath_frag...

Bug: 180105615
Test: atest sdkextensions_e2e_tests

Change-Id: I7b6b6b980a4c6430a70394e85222f3b35c4efd5f
2021-05-25 21:00:31 +01:00
satayev
931a4488da Populate individual systemserverclasspath_fragments' proto configs.
Bug: 180105615
Test: m && launch_cvd; atest CtsClasspathsTestCases
Change-Id: Ic0ae897e9baca75dcc022d84656496563645e74e
Merged-In: Ic0ae897e9baca75dcc022d84656496563645e74e
2021-05-25 21:00:07 +01:00
Artur Satayev
f1adfb38fb Merge "Rename generate proto config file to match classpath type." into sc-dev 2021-05-25 19:40:05 +00:00
Anton Hansson
bbe2d3db4a Merge "Partial Revert "Populate individual classpath_fragments' classpaths.prot..."" into sc-dev 2021-05-25 14:18:42 +00:00
satayev
a3fc817771 Partial Revert "Populate individual classpath_fragments' classpaths.prot..."
Reason for revert: test breakage b/189114287
Bug: 180105615
Bug: 189114287
Test: atest sdkextensions_e2e_tests

Change-Id: I13b622d6c61ea392bfcc8a40535045c87fa3a7b5
2021-05-25 15:12:23 +01:00
Paul Duffin
9dbfa1c10a Merge "Tighten bootclasspath_fragment property validation" into sc-dev 2021-05-25 11:12:35 +00:00
Paul Duffin
0a79631092 Merge "Only export boot image files to APEX if they are actually created" into sc-dev 2021-05-25 11:12:25 +00:00
Paul Duffin
3adc8ea682 Merge "Add SOONG_SDK_SNAPSHOT_VERSION support" into sc-dev 2021-05-25 10:25:54 +00:00
Paul Duffin
a1c6be19fb Merge "Support removed API members in modular hidden API processing" into sc-dev 2021-05-25 10:25:47 +00:00
Paul Duffin
a1522da36b Merge "Support hidden API processing for fragments with dependencies" into sc-dev 2021-05-25 10:25:41 +00:00
Paul Duffin
49eff1d147 Merge changes I5459c56d,I9b5c7c74 into sc-dev
* changes:
  Remove bootclasspathApiInfo
  Fix hidden API flags in com.android.i18n
2021-05-25 10:25:28 +00:00
TreeHugger Robot
fa08e19460 Merge changes I9f780b20,I53805737,I7373ba10,Ia5c5f65a into sc-dev
* changes:
  Rename hiddenAPIFlagFileInfo to HiddenAPIInfo
  Separate input to flag generation from hiddenAPIFlagFileInfo
  Separate output of flag generation from hiddenAPIFlagFileInfo
  Separate monolithic hidden API processing from hiddenAPIFlagFileInfo
2021-05-25 10:07:28 +00:00
Paul Duffin
588e22a6bc Tighten bootclasspath_fragment property validation
Previously, due to legacy reasons, the property validation did not
require a contents property and allowed the image_name to be either
"art" or "boot". Those reasons no longer apply and so this change
requires a contents property and only allows the image_name to be set
to "art" if specified.

Bug: 177892522
Test: m nothing
Merged-In: I8855d6e5365ef0b55490e90e7b6c0081cf070ee5
Change-Id: I8855d6e5365ef0b55490e90e7b6c0081cf070ee5
(cherry picked from commit 8018e50ddb)
2021-05-25 09:30:20 +01:00