Commit Graph

56570 Commits

Author SHA1 Message Date
Elliott Hughes
8e8ef9fe66 Revert "Disable BTI for now."
This reverts commit c75994d623.

Reason for revert: BTI shipped in S, and we're going to work on app compat outreach rather than regress this security feature.

Bug: https://issuetracker.google.com/216395195
Bug: https://issuetracker.google.com/233339366
Change-Id: Ic7143d756907ceb574a686258751840ce62c920f
Merged-In: Ic7143d756907ceb574a686258751840ce62c920f
2022-06-06 20:40:47 +00:00
Pete Bentley
c54158d3c7 Remove -sha256 flag when calling bssl_inject_hash.
Cherry-pick note: Needed for the BoringSSL change in the same topic due to build flag changes.

Flag removed upstream, all platforms now use SHA-256
for libcrypto integrity hash.

Test: m && flashall
Change-Id: I453edebb80ec2a853d54ce5c3f055b6456010524
(cherry picked from commit c0d89b3db1)
Merged-In: I453edebb80ec2a853d54ce5c3f055b6456010524
2022-05-31 19:02:49 +00:00
Hsin-Yi Chen
39a9db3bae Merge "Add diff_flags as a header_abi_checker property" into tm-dev 2022-05-26 04:21:54 +00:00
Paul Duffin
7b885d7ab1 [automerge] java_sdk_library_import: Delegate OutputFiles to impl library if needed 2p: e89f3e22e5
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/18579281

Bug: 230846030
Change-Id: I1360401084333107d1834eed7d230782c0e50708
2022-05-24 13:29:21 +00:00
Paul Duffin
e89f3e22e5 java_sdk_library_import: Delegate OutputFiles to impl library if needed
(cherry picked from commit 1e940d5b44)

Bug: 230846030
Test: m nothing
      # Cherry pick into build with prebuilts enabled to verify.
Change-Id: I5ac9b1cdd2fc61efbc988e84556202ff6cd57146
2022-05-24 13:28:43 +00:00
Oriol Prieto Gascó
c17b70053d Merge "Revert "Append APEX version instead of build ID for APK-in-APEX ..."" into tm-dev 2022-05-23 19:49:32 +00:00
Yi-yo Chiang
6fc324a9e0 Merge "Add android.hardware.gnss-V2-ndk to VndkMustUseVendorVariantList" into tm-dev 2022-05-23 16:18:10 +00:00
Oriol Prieto Gascó
a70425fb2f Revert "Append APEX version instead of build ID for APK-in-APEX ..."
Revert "Make apexer replace instances of version placeholder str..."

Revert submission 17944887-apk-in-apex

Reason for revert: Caused a regression (b/230873680)
Reverted Changes:
Ic37eeba8b:Make apexer replace instances of version placehold...
I9cef1418c:Append APEX version instead of build ID for APK-in...

Change-Id: I3da8bcb782baf71cddce9e4e92fe3894fc187b5c
2022-05-20 13:05:34 +00:00
Liz Kammer
dbd8eb11f4 Remove unused uses_sdks property for apexes
(cherry picked from commit 7eed538208)

Bug: 232546567
Test: m nothing & compare build.ninja before/after
Merged-In: I3f1199af338e1d2e48ec29cf9f59b6b36236c4cc
Change-Id: I3f1199af338e1d2e48ec29cf9f59b6b36236c4cc
2022-05-20 07:45:48 +00:00
Yi-Yo Chiang
8500198442 Add android.hardware.gnss-V2-ndk to VndkMustUseVendorVariantList
Bug: 229319958
Test: Build android.hardware.gnss-V2-ndk.vendor without triggering
  "Checking VNDK vendor variant" error.
Change-Id: Ic03a04b97db601ff46510e00b2986a30f60066e6
2022-05-19 18:19:10 +08:00
Hsin-Yi Chen
4f992b663f Add diff_flags as a header_abi_checker property
The property allows developers to add extra flags to header-abi-diff for
specific libraries.

Bug: 232891473
Test: m libbinder.vendor
Change-Id: I203af73c784dfc7738bb64f57b224c08d5c595ce
2022-05-19 15:19:57 +08:00
Colin Cross
d7d2a2a6bf Merge "Fix prebuilts of overridden apps" into tm-dev 2022-05-18 17:40:23 +00:00
Colin Cross
5088544ddc Fix prebuilts of overridden apps
AndroidApp had its own HideFromMake method and flag that shadowed
the one in ModuleBase.  This caused performOverrideMutator to set the
AndroidApp flag, but ModuleBase.skipInstall to read the ModuleBase
flag, resulting in a conflicting install rule being created.  Remove
AndroidApp's HideFromMake in favor of the ModuleBase one.

Bug: 232788722
Test: TestOverrideAndroidAppWithPrebuilt
Change-Id: I8c0dfcb50ff4dc1e4d0574f150b10d79908f46aa
Merged-In: I8c0dfcb50ff4dc1e4d0574f150b10d79908f46aa
(cherry picked from commit aaa0c1ffcd)
2022-05-17 14:39:36 -07:00
Spandan Das
91250b1ae4 Enforce updatable=true on apps of updatable apexes
- Update apex_info (a topdown mutator) so that it sets updatable=true on
  apps of updatable apexes
- Write a unit test that tests different combinations of
  updatable/non-updatable apks-in-apexes
- Update an existing unit test that asserts a different error

Test: go test ./java
Test: m nothing (in internal)
Bug: 209409604

Change-Id: Ie8881b857afcec44addf27fc360c5b8abf726bd2
Merged-In: Ie8881b857afcec44addf27fc360c5b8abf726bd2
(cherry picked from commit 42e89508ee)
2022-05-13 19:16:23 +00:00
Spandan Das
456a77e9a0 Update sdk_version check for jni_libs of updatable apps
With aosp/1640364, all variants of a cc_* module use min_sdk_version as
the version part of the clang triple. Therefore, checking
min_sdk_version of jni_libs should be sufficient to ensure that there is
no unintended access to symbols in newer Android versions

Test: go test ./java
Test: TH
Bug: 155209650
Bug: 209409604

Change-Id: I6c064f8a6ea12c8aa40165a9063380306a180c9b
Merged-In: I6c064f8a6ea12c8aa40165a9063380306a180c9b
(cherry picked from commit 2e8c044b2c)
2022-05-13 19:15:58 +00:00
Dan Willemsen
ee3290d33a Background distGzipFile to speed up CI builds
These can take a minute or more of build time, and currently hold up
other processing. We could move to a parallel compression scheme to
speed them up, but it's simpler just to background them and continue the
build, waiting to make sure they've finished before exiting.

Testing this on git_master/flame-userdebug:

This brings a local no-op `m nothing dist` build from 2m1s to 1m39s,
even though most of that time is still spent waiting on these (since
there is very little else happening in a `nothing` build when Soong and
Kati don't need to run).

Running `touch art/Android.mk; m nothing dist` (so the above, but with
Kati) goes from 3m39s to 2m2s. We spent 9 seconds at the end waiting for
these to finish.

CI cases that almost always run Kati plus some number of other actions
are likely to completely hide the time taken to dist these files.

Bug: 229932999
Test: Check $DIST_DIR, files still exist
Change-Id: I1fb78d7c4d5103d72b5d71d9277dea0d452f8968
(cherry picked from commit 80d7261821)
Merged-In: I1fb78d7c4d5103d72b5d71d9277dea0d452f8968
2022-05-09 17:51:46 +00:00
Yurii Zubrytskyi
2c268407dc Merge "build/soong - support the REL platform version in classpath" into tm-dev 2022-05-07 15:11:19 +00:00
Yurii Zubrytskyi
3cdd35199d Revert "Hacky workaround for half-finalized builds."
This reverts commit 50493f0797.

Reason for revert: build is now fully finalized

Change-Id: Iaa5b9d84b84303a8b8baf30641d861a035169f48
2022-05-06 16:10:04 +00:00
Yurii Zubrytskyi
1611334fa2 build/soong - support the REL platform version in classpath
Make sure we select the proper API level number for the REL
platform version when generating the classpath protos

Bug: 231272086
Test: build + boot emulator
Change-Id: Ib3b711dc05dd6136a68e6de414d806687a849bc9
2022-05-06 16:09:52 +00:00
Artur Satayev
9f2bcac707 Add support to max-target-s to generate_hiddenapi_lists
Test: make
Bug: 169748350
Change-Id: I2662a643a190ed531d85755d01e1be9c49c02e25
Merged-In: I2662a643a190ed531d85755d01e1be9c49c02e25
2022-05-06 08:58:24 +00:00
Colin Cross
dddb402c02 Add missing dependency on compose plugin in kapt rules
The kapt rule uses kotlincFlags but was not using kotlincDeps,
causing the rule to get the -Xplugin argument on the compose
compiler plugin jar, but not have a dependency on it.

Bug: 231222079
Test: TestKotlinCompose
Change-Id: I4c2cf30fb7d8cad4eededa29f67f4ffd459caa41
(cherry picked from commit 08b0a1cd79)
Merged-In: I4c2cf30fb7d8cad4eededa29f67f4ffd459caa41
2022-05-03 17:07:27 +00:00
Paul Duffin
fe45ae8feb Merge "Prevent non-app/non-test modules from statically including jacocoagent" into tm-dev 2022-05-03 10:07:55 +00:00
TreeHugger Robot
a83d03c206 Merge "Add buildinfo_prop module" into tm-dev 2022-05-03 05:14:30 +00:00
Paul Duffin
3953153c9e Prevent non-app/non-test modules from statically including jacocoagent
Previously, the .impl library of java_sdk_library modules would end up
with the jacocoagent statically included. That is because their
Instrument flag was set to true when created by their parent. As that
was before the deps were added that meant that they ended up with a
static dependency on jacoagent (at least when UnbundledBuild() was
true).

That was not previously a problem because the .impl files were only
used at build time. However, a recent change to make updatable-media
statically include framework-media.impl (which statically included the
jacocoagent classes) broke the coverage build because the jacocoagent
classes are not in the permitted packages for the updatable-media.

When instrumenting the bootclasspath the jacocoagent library is added
to the art-bootclasspath-fragment.

The jacocoagent should only be statically included in apps, or test
apps. This change adds an extra flag to specify whether the module type
supports statically including the jacocoagent. This is set to true by
apps and test apps but not when the java_sdk_library creates the .impl
java_library preventing it from statically including jacocoagent.

Bug: 230967146
Bug: 229932396
Test: COVERAGE_MODULES=media \
      PRODUCT=mainline_modules_x86 \
      TARGET_BUILD_APPS=com.google.android.media \
      vendor/google/build/build_unbundled_coverage_mainline_module.sh
      # Fails without this change, passes with it.
Change-Id: Ic95cf11a05f59b67e623474ed3dd9be6b4442c42
2022-05-03 00:46:55 +00:00
Yi Kong
b3089e8a20 Update clang version to clang-r450784d
Test: presubmit
Bug: 219872355
Change-Id: If6c2c331044a363cb8f20a2516da894e72c4b7e7
(cherry picked from commit 4f6c92765d)
Merged-In: If6c2c331044a363cb8f20a2516da894e72c4b7e7
2022-05-02 19:02:05 +00:00
Inseob Kim
c7c4746151 Add buildinfo_prop module
buildinfo_prop module is a replacement for build/make/tools/buildinfo.sh
so other images like microdroid can refer to build.prop.

For now, buildinfo_prop only supports a few build.prop properties, and
it's only used in microdroid.

Bug: 189164487
Test: build
Change-Id: I120654ca23a68de414df8da2051c6677afbab441
Merged-In: I120654ca23a68de414df8da2051c6677afbab441
(cherry picked from commit 4f1f3d97ca)
2022-05-02 09:51:45 +09:00
Spandan Das
2a42e55457 Disable newapi check in defaults
- Making newapi disabled by default will ensure that this lint check
  does not run on the platform. This prevents noisy lint warnings like b/228956345#1
- This lint check will continue to be enforced on the transitive deps of
  apexes, since lint.strict_updatability_linting will be true for those
  Soong modules

Test: TH
Test: m
out/soong/.intermediates/frameworks/base/services/core/services.core.unboosted/android_common/lint/lint-report.xml
// file no longer contains "Call requires API level ..." warning
Bug: 228956345

Merged-In: I8ef3137394011fb679a1129f80f6351fb05a4eff
Change-Id: I8ef3137394011fb679a1129f80f6351fb05a4eff
(cherry picked from commit 397e910835)
2022-04-29 17:36:07 +00:00
Spandan Das
a3264efb42 Enforce newapi check only if min_sdk_version < compile_sdk_version
- NewApi check should be enforced only if min_sdk_version is less than
  the compile_sdk_version (the opposite direction should be a different
  build-time error)
- Change the datatype of *sdkVersion to android.ApiLevel (from string)
  to support version comparisons

Test: go build ./java
Test: no changes in ninja file
Bug: 228956345

Merged-In: Ic408857db7760d912ef4694d2ed72c0b7106eb04
Change-Id: Ic408857db7760d912ef4694d2ed72c0b7106eb04
(cherry picked from commit ba7e532a11)
2022-04-29 17:35:51 +00:00
Paul Duffin
2b5384bc93 Merge "java_sdk_library_import: Delegate OutputFiles to impl library if needed" into tm-dev 2022-04-29 16:26:07 +00:00
Paul Duffin
a80cc174a2 hiddenapi: Prevent libraries for Q/R from include S+ flags.
The Q and R runtimes can handle Q/R flags but not S flags. So, this
change verifies that any library that can run on Q/R
(min_sdk_version <= R) by adding --max-hiddenapi-level=max-target-r
to the "hiddenapi encode" command. That will cause a failure if any
S+ flags are found in the flags to encode.

Bug: 172453495
Test: m droid && launch_cvd
      Cherry pick changes in https://r.android.com/q/topic:max-target-s
      Add @UnsupportedAppUsage maxTargetSdk=S in classes in framework-permission (for r/q)
      and framework-permission-s (nominally for S+). I had to incresed the min_sdk_version
      in the latter to 31 (S) as it was still set at 30 (R).
Merged-In: Ie0f68482603adc7b4e3d7a5c81bf203d81a84a9e
Change-Id: Ie0f68482603adc7b4e3d7a5c81bf203d81a84a9e
(cherry picked from commit 09817d66de)
2022-04-29 14:08:30 +00:00
Paul Duffin
3cf140fe98 java_sdk_library_import: Delegate OutputFiles to impl library if needed
Bug: 230846030
Test: m nothing
      # Cherry pick into build with prebuilts enabled to verify.
Merged-In: I5ac9b1cdd2fc61efbc988e84556202ff6cd57146
Change-Id: I5ac9b1cdd2fc61efbc988e84556202ff6cd57146
(cherry picked from commit 1e940d5b44)
2022-04-29 14:05:22 +00:00
Paul Duffin
a083ec4acf Allow framework-media to build the framework-media.impl
(cherry picked from commit 77590a8263)

The framework-media java_sdk_library is currently api_only for legacy
reasons. This change allows it to also build the framework-media.impl
library by making the following changes:
* Adds impl_only_static_libs to allow the implementation to statically
  include other libraries, something no other java_sdk_library has
  needed to do.
* Passes the apex_availability property through to the impl library so
  it can be statically included in the updatable-media which is what is
  included in the apex, again for legacy reasons.

Bug: 190807367
Bug: 229932396
Test: m com.android.media media-module-sdk
      # Compare before and after this change (and corresponding change
      # to updatable-media/framework-media.
Merged-In: I9e1837edcca6f5fa84fc611274cf8fbba8a896b8
Change-Id: I9e1837edcca6f5fa84fc611274cf8fbba8a896b8
2022-04-28 21:49:52 +00:00
Oriol Prieto Gasco
557e3fa4a6 Merge "Set the dist dir for musl targets of build_version_test" into tm-dev 2022-04-28 12:17:41 +00:00
TreeHugger Robot
8fc3fa09fa Merge "Bump minimum minSdkVersion to 19." into tm-dev 2022-04-27 22:05:18 +00:00
Yi Kong
b5abdaef42 Merge "Update to clang-r450784d" into tm-dev 2022-04-27 16:54:06 +00:00
Oriol Prieto Gasco
92e3e4fbf6 Set the dist dir for musl targets of build_version_test
Bug: 230604501
Test: build/soong/soong_ui.bash --make-mode apexer_tools static_apexer_tools dist BUILD_HOST_static=1 USE_HOST_MUSL=true
Change-Id: I29b7f4c16346e39b89f099eecf816d9811a7b587
2022-04-27 15:32:48 +00:00
Yi Kong
db7e0ceb2f Update to clang-r450784d
This respin contains performance improvements to clang-tidy and lld, and
fp16 cost fixes.

Test: presubmit
Bug: 219872481
Change-Id: I322a680cdc6ebc0f1fe3735ed087477e7f2508fe
(cherry picked from commit a126c63042)
Merged-In: I322a680cdc6ebc0f1fe3735ed087477e7f2508fe
2022-04-26 16:45:34 +00:00
Jingwen Chen
3b1dcf4f46 Append APEX version instead of build ID for APK-in-APEX paths.
This CL removes the build_id.mk suffix and replaces it with a hardcoded
placeholder string that will be replaced with the actual version in
apex_manifest.json by apexer at apex construction time.

This means that as long as the apex version is incremented, the
APK-in-APEX will be installed to a new directory path from the package
manager's perspective.

Fixes: 229574810
Bug: 229625490
Bug: 226559955
Bug: 224589412
Bug: 227417611
Bug: 228157333
Bug: 228803590
Bug: 229136249

Test: atest StrictJavaPackagesTest
Test: soong tests
Test: deapexer list out/dist/com.google.android.permission.apex
Ignore-AOSP-First: this is an cherrypick
Change-Id: I9cef1418c3fc7e0970d96995b8398f5e82f479e0
Merged-In: I9cef1418c3fc7e0970d96995b8398f5e82f479e0
2022-04-26 12:54:50 +00:00
Dan Albert
fa652e32a6 Bump minimum minSdkVersion to 19.
We need to land an update to the NDK prebuilts and the NDK no longer
supports APIs 16-18.

Bug: http://b/222341313
Test: treehugger
Change-Id: I996b0eb65a7d1ae4cc0687b7ed8f533fbbba295d
2022-04-25 23:17:23 +00:00
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux
562477b1c7 Merge changes from topic "b/215723302" am: 66e6466e0f am: 4ed4ace5d9 am: 3f8e0c4846
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2002753

Change-Id: I77a2f325a37001ef47e83687242e1642bc6a3fd6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-21 15:33:23 +00:00
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux
90bdb0b46a Abstract prebuilt_etc into prebuilt_file am: b81f77ed24 am: c0fa5fb34e am: 30136e83d5
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2002752

Change-Id: Ic7909cc9aa5d32c1eb4f9fb4e28b86885ce442df
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-21 15:33:19 +00:00
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux
7f55284a9e DoNotConvert tzdata nor tz_version am: bff2e88a85 am: 9ea047d5e3 am: bf99c62ff5
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2069572

Change-Id: I4e40f401a5f35e346ec45ed0093ec2f7aa1f349e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-21 15:33:16 +00:00
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux
3f8e0c4846 Merge changes from topic "b/215723302" am: 66e6466e0f am: 4ed4ace5d9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2002753

Change-Id: I065c9ddbc5b27d2b5ed1fae998a776153de096f0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-21 15:12:13 +00:00
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux
30136e83d5 Abstract prebuilt_etc into prebuilt_file am: b81f77ed24 am: c0fa5fb34e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2002752

Change-Id: Ie579a368a2b51f802250bce13cf3447e73b9eaf6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-21 15:12:09 +00:00
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux
bf99c62ff5 DoNotConvert tzdata nor tz_version am: bff2e88a85 am: 9ea047d5e3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2069572

Change-Id: I7ec3dcae1f326750945b87e74df6718e0defa23f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-21 15:12:06 +00:00
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux
4ed4ace5d9 Merge changes from topic "b/215723302" am: 66e6466e0f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2002753

Change-Id: I3a2b3d7c2830f82bc578624b3a434058c956eaf2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-21 14:55:30 +00:00
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux
c0fa5fb34e Abstract prebuilt_etc into prebuilt_file am: b81f77ed24
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2002752

Change-Id: Ica34b683a4696e86feabe0a6fd7f0fd0561d906f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-21 14:55:26 +00:00
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux
9ea047d5e3 DoNotConvert tzdata nor tz_version am: bff2e88a85
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2069572

Change-Id: Ib46e17f36142a262e20463509926a00b32cc89b7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-04-21 14:55:23 +00:00
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux
66e6466e0f Merge changes from topic "b/215723302"
* changes:
  Use prebuilt_file for prebuilt_{etc,usr_share}
  Abstract prebuilt_etc into prebuilt_file
2022-04-21 14:37:46 +00:00
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux
bff2e88a85 DoNotConvert tzdata nor tz_version
In using prebuilt_file for prebuilt_{etc,usr_share}, Bazel now sees such
targets translated and doesn't permit a target name to alias e.g. its
`src`. Thus we temporarily disable the conversion of the `tz_version` and
`tzdata` whilst their in-tree sources are updated. Their conversions
will be reenabled afterward.

Bug: 215723302
Test: bp2build.sh
Test: mixed_{libc,droid}.sh
Change-Id: Ie19813ccb0fb93c90b54bfd19c909ed15b826385
2022-04-21 14:37:12 +00:00