Commit graph

121 commits

Author SHA1 Message Date
Mark White
a15790ac1e java_library support for building headers-only
Flag for java_library modules to build just the Turbine headers and
skip building an impl jar.

Test: go test java
Bug: 289776578
Change-Id: Iad0babf951710476bc32df93c25d17065a14ab84
2023-08-22 21:29:05 +00:00
Jihoon Kang
019ffe121c Merge "Allow java_library.exclude_static_libs property for libcore and f/b/api" 2023-06-23 17:10:54 +00:00
Nikita Ioffe
11a9c2c763 Update neverallow rules for init_first_stage
We are introducing Microdroid-specific variant of the init_first_stage,
and need to add init_first_stage_defaults and
init_first_stage.microdroid to the neverallow rule.

Bug: 287206497
Test: build com.android.virt APEX
Change-Id: I88543256ab0479d4676865ebb1d16d9d39f1f455
2023-06-21 16:51:09 +01:00
Jihoon Kang
3d4d88d68e Allow java_library.exclude_static_libs property for libcore and f/b/api
exclude_static_lib property was introduced to enable static lib
switching based on build configuration. The usage of property was
limited to build/soong directory to prevent other modules from using the
proerty.

In order to allow "core-lambda-stubs" and
"android-non-updatable.stubs.*" to utilize similar static lib switching
based on build configuration, allow exclude_static_libs property to be
used in libcore and frameworks/base/api directory.

Test: m nothing
Bug: 287344503
Change-Id: I342b09c7ada03607b12dc8896ae39825d8545e92
2023-06-15 18:51:57 +00:00
Jihoon Kang
381c2fa27c Introduce "Exclude_static_libs" property for Java modules
Exclude_static_libs property can be used to specify static libs that
should not be used to build the module. The list acts as filter for
static_libs.

Bug: 285410821
Test: go test ./java
Change-Id: Iee7f160ba88b5f64bdd265c30d47c9f51feb0f5e
2023-06-05 21:42:48 +00:00
Jooyung Han
a2b57abb4a Remove makefile_goal
This was added to use 'make' target in soong. It was a hacky way and
caused many problems:
- can't track dependency
- doesn't work with sanitizer
- VSDK snapshot doesn't support
- ..

Now references are all gone. Let's remove it.

Bug: n/a
Test: m
Change-Id: I0336a490780f37a4e77d343c61315686e23db643
2023-04-26 16:46:03 +09:00
Treehugger Robot
631ad00a41 Merge "Replace SortedStringKeys with SortedKeys" am: 0f0d3ce49c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2462193

Change-Id: Ia4153e6fd8bcee6636907fb87c4a8cd61aa2786e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-01 04:56:32 +00:00
Cole Faust
18994c73f1 Replace SortedStringKeys with SortedKeys
Now that we have generics.

Bug: 193460475
Test: presubmits
Change-Id: I1594fd8feb505175d5c09c03ef397e5ffd5b09cb
2023-02-28 16:51:32 -08:00
Treehugger Robot
08c6c4c354 Merge "Allow stubs implementation to be omitted" am: 378124baf1 am: 6ba2a5b746
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2301917

Change-Id: I586a02cd61b25390152dfa804ffe1d649f0e527c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-24 12:11:52 +00:00
Alan Stokes
73feba3330 Allow stubs implementation to be omitted
When defining a stubs library, allow specifying that the
implementation library does not need to be installed. This allows for
cases where the implementation is deployed in some non-standard way -
e.g. inside a Microdroid virtual machine.

Without this, we get build errors like: "TARGET module
com.android.compos requires non-existent TARGET module: libvm_payload".

Default behavior is unchanged. The change is protected by an allowlist
to limit usage to the immediate use case.

Bug: 243512108
Test: builds; soong tests pass
Test: Remove allowlist, see build failure
Change-Id: Iaae75f2e93b842f5944a7518cc95069d62c5a638
2022-11-22 16:00:02 +00:00
Sam Delmerico
222d112fbc Merge "export neverallow include dir list to Bazel" am: 775f2cb3cd am: c4366480fd
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2302771

Change-Id: I11d6f39cf1021eca92802ed4135bc80c62d20617
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-16 21:42:34 +00:00
Sam Delmerico
46d08b4e39 export neverallow include dir list to Bazel
Bazel needs to recreate the neverallow behavior for absolute includes,
so export the list of include dirs to soong_injection.

Bug: 250931909
Test: aosp/2302925
Change-Id: I3bd345ea4cfb3181f07e4570466f2fc8c5fe32da
2022-11-15 17:33:21 -05:00
Steve Elliott
8a35f07280 Add kotlinx.coroutines to "neverallow" allowlist am: 8053f82697
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/20224345

Change-Id: I95d2ea15334461c52491f2df8d092fc7576b2c12
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2022-11-01 21:23:59 +00:00
Steve Elliott
8053f82697 Add kotlinx.coroutines to "neverallow" allowlist
Bug: 239834928
Test: manual -- all existing tests and builds should pass
Change-Id: Ie5fb0d6cbd8d624f71b80bb1afe003917410aa3d
2022-10-28 10:08:22 -04:00
Lukacs T. Berki
c541cd27fa Create Bazel symlink forest in a separate process.
This helps with incrementality a lot: the symlink forest must depend on
almost every directory in the source tree so that if a new file is added
or removed from *anywhere*, it is regenerated.

Previously, we couldn't do this without invoking bp2build, which is
quite wasteful because bp2build takes way more time than the symlink
forest creation, even though we do the latter in a very suboptimal way
at the moment.

This means that if a source file is added or removed (which does not
affect globs), we don't pay the cost of bp2build anymore.

Also refactored symlink_forest.go on the side. Too much state was being
passed around in arguments.

This change reimplements aosp/2263423 ; the semantics of not touching an
output file is the exact same as order-only inputs and the latter is a
bit fewer lines of code.

Test: Presubmits.
Change-Id: I565c580df8a01bacf175d56747c3f50743d4a4d4
2022-10-27 08:08:45 +00:00
Rex Hoffman
54641d2aec Enable new_robolectric
Allow new robolectric to break soong's exepected machine type restrictions

Test: mma in /external/robolectric
Bug: 244627502

Change-Id: If58a36b2d84804d586d9c8a773e2e739867fa987
2022-10-21 17:53:40 +00:00
Jingwen Chen
1735b2e096 Blanket disallow bp2build_available: true.
This can be updated to use an allowlist again if the need arises.

Bug: 251197532
Test: presubmits
Change-Id: If56c45d8587a41b57358f249d20eb9a6ed9191ac
2022-10-10 14:31:53 +00:00
Jingwen Chen
a4b7eed0bd bp2build: disallow bp2build_available definition with neverallow.
..other than the specified directories.

Test: CI

Bug: 251197532
Fixes: 251197532
Change-Id: Iec6407c915d2554bbfb62aea4591783208c4f633
2022-10-07 09:54:16 +00:00
Jooyung Han
39cadf9f06 Allow libwifi-hal to use makefile_goal
To migrate libwifi-hal from make to soong, its dependencis
(libwifi-hal-<vendor>) are wrapped in makefile_goal until they are
migrated to soong as well.

Bug: 239984067
Test: m
Merged-In: Icb09ef1bf40311498db04b7358634eadd0fed5fa
Change-Id: Icb09ef1bf40311498db04b7358634eadd0fed5fa
(cherry picked from commit f9392095d7e6f065310ab7662bb34897295f7d9f)
2022-08-03 17:47:25 +09:00
Bob Badour
0cc5facf79 Remove obsolete notice property.
Bug: 192434786

Test: m droid dist

Change-Id: I0f384ae895cebab9732448b82db600c67eb8f711
2022-07-29 17:54:40 +00:00
Bob Badour
124f3fe855 Deprecate notice property.
Bug: 192434786

Test: m droid dist

Change-Id: Id47ff3c945b556ea0452a91305f7637bbcc35008
2022-07-20 14:37:13 -07:00
Jiyong Park
3c306f3d1d Don't allow using framework and SDK at the same time.
Using SDK (current, system_current, module_current, or <api_version>)
while at the same time depending on "framework" doesn't make sense
because framework anyway provides all APIs including hidden ones. This
is not only uncessary but also error prone because the availability of a
private method in a class depends on whether the class is part of the
SDK or not.

Add a neverallow rule for prohibiting that. Note that "core_*" SDKs are
allowed because there's no overlap between "framework" and the core-Java
SDKs.

Bug: 227528906
Test: m nothing on git_master
Change-Id: I0605075aef20c75db084beeedcbf49a642573e69
2022-04-05 15:39:05 +09:00
Spandan Das
f14e254a28 Change permitted_packages check to be per-jar rather than per-apex
(cherry-pick of ag/17524387 into aosp)

Summary:
- updates the Q and R maps, the new keys are the bcp jars and not the
apexes. neverallow build rules ensure that these bcp jars have a
restricted set of permitted_packages
- remove BootclasspathJar from the neverallow rule. This is no longer
necessary since the keys in the maps are the bootjars themselves, and
not apexes

Bug: 205289292
Test: In build/soong, go test ./apex
Change-Id: Icb91de934181a8b6f085e03a0ce8c5e08504ff94
Merged-In: Icb91de934181a8b6f085e03a0ce8c5e08504ff94
(cherry picked from commit 440ff96728)
2022-04-04 17:42:00 +00:00
Anton Hansson
e1b1836939 Revert "Relax apex package restriction for T+ jars"
This reverts commit 1fdd6ca88a.

Reason for revert: b/205289292 tracks the real fix for this

Test: presubmit
Change-Id: I5a2edaf4f930dafa26659f85d9425e9041c72275
Merged-In: I5a2edaf4f930dafa26659f85d9425e9041c72275
2022-04-04 17:27:43 +00:00
Inseob Kim
865d5e6c9d Merge "Revert^3 "Add seapp_contexts to allowlist of makefile goal"" 2022-01-10 11:15:28 +00:00
Inseob Kim
a9078747bb Revert^3 "Add seapp_contexts to allowlist of makefile goal"
This reverts commit feb0756d41.

Reason for revert: redundant now

Change-Id: I6cd43f03a28d03a87d19510a554e3bbe0e69b1de
2021-12-29 08:59:19 +00:00
Yi Kong
2b8f5f588f Remove mention of libhidlbase_pgo
This library is getting removed.

Test: presubmit
Change-Id: I10bfb36c07e094881c7254219d3071da6ac687dd
2021-12-27 23:30:39 +08:00
Liz Kammer
a3d7915c9e Add comments and clarify errors in neverallow
Sample of new error for violation:

error: system/bt/gd/rust/topshim/macros/Android.bp:10:1: module
"libtopshim_macros" variant "linux_glibc_x86_64": violates neverallow
requirements. Not allowed:
        module types: ["rust_benchmark" "rust_benchmark_host"
"rust_binary" "rust_binary_host" "rust_library" "rust_library_dylib"
"rust_library_rlib" "rust_ffi" "rust_ffi_shared" "rust_ffi_static"
"rust_fuzz" "rust_library_host" "rust_library_host_dylib"
"rust_library_host_rlib" "rust_ffi_host" "rust_ffi_host_shared"
"rust_ffi_host_static" "rust_proc_macro" "rust_test" "rust_test_host"]
      EXCEPT in dirs: ["device/google/cuttlefish/"
"external/adhd/" "external/crosvm/" "external/libchromeos-rs/"
"external/minijail/" "external/rust/" "external/selinux/libselinux/"
"external/uwb/" "external/vm_tools/p9/"
"frameworks/native/libs/binder/rust/" "frameworks/proto_logging/stats/"
"packages/modules/DnsResolver/" "packages/modules/Virtualization/"
"prebuilts/rust/" "system/core/libstats/pull_rust/"
"system/extras/profcollectd/" "system/extras/simpleperf/"
"system/hardware/interfaces/keystore2/" "system/librustutils/"
"system/logging/liblog/" "system/logging/rust/" "system/nfc/"
"system/security/" "system/tools/aidl/"
"tools/security/fuzzing/example_rust_fuzzer/"
"tools/security/fuzzing/orphans/" "vendor/"]

Old error:

error: system/bt/gd/rust/topshim/macros/Android.bp:10:1: module
"libtopshim_macros" variant "linux_glibc_x86_64": neverallow
-dir:device/google/cuttlefish/* -dir:external/adhd/*
-dir:external/crosvm/* -dir:external/libchromeos-rs/*
-dir:external/minijail/* -dir:external/rust/*
-dir:external/selinux/libselinux/* -dir:external/uwb/*
-dir:external/vm_tools/p9/* -dir:frameworks/native/libs/binder/rust/*
-dir:frameworks/proto_logging/stats/*
-dir:packages/modules/DnsResolver/*
-dir:packages/modules/Virtualization/* -dir:prebuilts/rust/*
-dir:system/core/libstats/pull_rust/* -dir:system/extras/profcollectd/*
-dir:system/extras/simpleperf/*
-dir:system/hardware/interfaces/keystore2/* -dir:system/librustutils/*
-dir:system/logging/liblog/* -dir:system/logging/rust/*
-dir:system/nfc/* -dir:system/security/* -dir:system/tools/aidl/*
-dir:tools/security/fuzzing/example_rust_fuzzer/*
-dir:tools/security/fuzzing/orphans/* -dir:vendor/*
type:"rust_benchmark" type:"rust_benchmark_host type:rust_binary
type:rust_binary_host type:rust_library type:rust_library_dylib
type:rust_library_rlib type:rust_ffi type:rust_ffi_shared
type:rust_ffi_static type:rust_fuzz type:rust_library_host
type:rust_library_host_dylib type:rust_library_host_rlib
type:rust_ffi_host type:rust_ffi_host_shared type:rust_ffi_host_static
type:rust_proc_macro type:rust_test type:rust_test_host

Test: go test soong tests
Change-Id: I1a7ee6bbc8258dfffa5a76f02c12fb1e54fdba1a
2021-12-21 12:00:43 -05:00
Remi NGUYEN VAN
1fdd6ca88a Relax apex package restriction for T+ jars
The ART AOT exemption only applies to Q/R/S, so module jars that have
min_sdk T+ do not need to follow the module package restriction, even if
they are part of a Q/R/S module (but not loaded on Q/R/S).

Relax the restriction to only apply to jars that have min_sdk before T.

Bug: 208773835
Test: m (runs apex tests)
Change-Id: I2c3ad8984ca05ad763bf6162bd478f93ab4ee650
2021-12-09 18:28:47 +09:00
Yuntao Xu
feb0756d41 Revert^2 "Add seapp_contexts to allowlist of makefile goal"
e87a81673e

Change-Id: I461f3ecdd0b0ea0a4b7b12531cf8b561e170df55
2021-11-18 22:33:02 +00:00
Vova Sharaienko
e87a81673e Revert "Add seapp_contexts to allowlist of makefile goal"
Revert submission 1795972-Convert security/Android.mk to Android.bp

Reason for revert: http://b/206976319 Broken build 7928060 on aosp-master on sdk_arm64-sdk
Reverted Changes:
I0e0e7f677:Split property and file contexts modules
I5596d6f00:Add seapp_contexts to allowlist of makefile goal
If685e5ccc:Convert security/Android.mk to Android.bp

Change-Id: I8cf8c0bc2f88172bb3bfa850bbd7ce6daa170c3d
2021-11-18 17:29:01 +00:00
Inseob Kim
a92d10bdf2 Add seapp_contexts to allowlist of makefile goal
This is an interim solution before seapp_contexts and seapp_neverallows
are migrated into Soong. CtsSecurityHostTests needs these two modules.

Bug: 194096505
Test: build
Change-Id: I5596d6f00b957afd86c752501c1e83b3d4089d9e
2021-11-05 05:10:26 +00:00
Treehugger Robot
c9e85ca825 Merge "Make a pass over our codebase cleaning up non-precise / non-inclusive language." 2021-10-28 20:51:17 +00:00
Joe Onorato
b4638c1ac3 Make a pass over our codebase cleaning up non-precise / non-inclusive language.
Test: treehugger
Bug: 204369779
Change-Id: I6e63cae824d323535cdb14b493edd868df47738d
2021-10-28 10:32:07 -07:00
Dan Willemsen
9fe1410213 Add android_sdk_repo_host to build platform-tools&build-tools
The Android SDK has been built with Make up until now, monolithically,
then split up into several sdk-repo zip files for different purposes.
The Mac and Windows SDKs really only need to contain the platform-tools
and build-tools pieces, but due to this monolithic sdk zip, we had to
build the whole SDK first.

This adds an `android_sdk_repo_host` module that can build these
platform-tools and build-tools zips.

Bug: 187222815
Change-Id: I55809e1d7447dd65e22461f921b2b8abb6d5f822
2021-10-13 01:25:02 -07:00
Jerome Gaillard
8467166b0c Merge "Fix path to layoutlib project" am: f346429e0e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1834613

Change-Id: I931d20bb43cf0c3294c5c2746da828ac06914e17
2021-09-23 13:03:27 +00:00
Jerome Gaillard
655ee02d29 Fix path to layoutlib project
It is in the 'frameworks/layoutlib' folder and not in 'framework/layoutlib'.

Change-Id: I437558a0afa8bfaac0226b1e4c5a7c0a983b180a
2021-09-23 11:38:11 +00:00
Chang Li
ee34414579 Allowlist external/libtextclassifier for sdk_variant_only. am: 66d3cb727f
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15358458

Change-Id: I53d08ab7f326c8fa78e2406c774b5b2280ce76ae
2021-07-23 09:44:06 +00:00
Chang Li
66d3cb727f Allowlist external/libtextclassifier for sdk_variant_only.
Bug: 166040889
Change-Id: If8a9d916dada116f52fd84194fa42e9179526b2c
2021-07-22 09:42:33 +00:00
Inseob Kim
c5fe044474 Revert "Add install_in_root to cc_binary"
Revert "Add ramdisk_available to init_first_stage's deps"

Revert submission 15071196-init_first_stage_soong

Reason for revert: fixes b/192248690
Reverted Changes:
I23cf4f975:Add ramdisk_available to init_first_stage's deps
Icd98c7e24:Add ramdisk_available to init_first_stage's deps
If9da9ba16:Add ramdisk_available to init_first_stage's deps
Ibc8668029:Add ramdisk_available to init_first_stage's deps
I3b4b8c475:Add ramdisk_available to init_first_stage's deps
I59cd149e0:Completely migrate init first stage to Soong
I36d789578:Add ramdisk_available to init_first_stage's deps
I2a0daa612:Add BUILD_USES_RECOVERY_AS_BOOT to soong config
Ic76c325ce:Directly create ramdisk dirs in ramdisk image rule...
I4c5374deb:Add BOARD_BUILD_SYSTEM_ROOT_IMAGE to config vars
I8aab5faf3:Add ramdisk_available to init_first_stage's deps
I9d5a10661:Add ramdisk_available to init_first_stage's deps
Iaa2edeb4a:Add ramdisk_available to init_first_stage's deps
I7cb582ca0:Update init_first_stage
I06091d15e:Add ramdisk_available to init_first_stage's deps
I8bdb8dda3:Add ramdisk_available to init_first_stage's deps
I7436b8dd1:Add ramdisk_available to init_first_stage's deps
I39693fd86:Add ramdisk_available to init_first_stage's deps
I0a9ba90f0:Add ramdisk_available to init_first_stage's deps
Ib66b4c4ea:Add ramdisk_available to init_first_stage's deps
I31ce63d23:Add ramdisk_available to init_first_stage's deps
Icb580f97c:Add ramdisk_available to init_first_stage's deps
I044a075b7:Add ramdisk_available to init_first_stage's deps
I33164a7e7:Fix ndk and aml arch order
Ib8d92904a:Add ramdisk_available to sysprop_library
Ibc3516453:Add install_in_root to cc_binary

Change-Id: I3f48a1bee726c7c2b38c9bdc501b2a32337eaab7
2021-07-01 06:50:40 +00:00
Inseob Kim
f75c415810 Add install_in_root to cc_binary
To support init_first_stage, install_in_root property is added to
cc_binary. The output is installed to {partition}, rather than
{partition}/{mount_point}/bin.

Bug: 187196593
Test: build init_first_stage
Change-Id: Ibc351645308676ed188f748972eb6312c9cbd64f
Merged-In: Ibc351645308676ed188f748972eb6312c9cbd64f
2021-06-23 04:31:54 +00:00
Inseob Kim
800d114003 Add install_in_root to cc_binary
To support init_first_stage, install_in_root property is added to
cc_binary. The output is installed to {partition}, rather than
{partition}/{mount_point}/bin.

Bug: 187196593
Test: build init_first_stage
Change-Id: Ibc351645308676ed188f748972eb6312c9cbd64f
2021-06-18 05:25:44 +00:00
Steven Moreland
f36a3ac8b8 more no include_dir
Add a few more paths.

Bug: N/A
Test: N/A
Change-Id: Ib9503c2c792c4e93e30be631406e7e8314e6af31
2021-04-27 18:03:55 +00:00
Steven Moreland
8fc8dbf70c start eating include_dirs from both ends
Further restrictions on a restricting build configuration. Before, we
restricted certain paths from being included. Now, we restrict certain
paths from including.

This adds system/libfmq for now, but I'm planning to add more in the
future, as they are cleaned up.

Bug: 35624006
Test: m nothing
Change-Id: I913f190f93ab63059ee0372d342daa8f5584806b
2021-04-27 02:56:03 +00:00
Paul Duffin
45338f05e3 Convert TestApexPermittedPackagesRules to use test fixtures
Adds PrepareForTestWithNeverallowRules to make it easy to test
neverallow rules. Avoid exporting any unnecessary neverallow related
methods from the android package.

Bug: 181070625
Test: m nothing
Change-Id: Idfc6955cb23f1a4d1790be7879388154b03f3980
2021-03-31 16:16:18 +01:00
Hyundo Moon
8bee1b00ea Allow service-media-s in apex
Bug: 175511943
Test: Builds successfully
Change-Id: I5d76087d3c537205e8b8ca837c13ca1aeb641b4c
2021-01-21 02:21:23 +00:00
Anton Hansson
0af20effc1 Remove sdk_version: "none" restriction
Not entirely sure what the history behind requiring only libcore
projects use this, but it is a bit annoying to have to allow-list every
use.

Bug: 173606718
Test: m nothing
Change-Id: I66f71e67d3f17e7f983c8537dff537fe8419da95
2020-12-17 15:43:29 +00:00
Xin Li
65cb5c69ea Merge Android R (rvc-dev-plus-aosp-without-vendor@6692709)
Bug: 166295507
Merged-In: Ifca7b65f4e27bf14cdc30f72f790b0de90130bae
Change-Id: I3a39be5f0b8736de4822c6a14072c78d4e4ad89d
2020-08-29 01:17:45 -07:00
Anton Hansson
4b8e64b1ce Update neverallows path for sdkextensions
The modules sources have been moved, update the sdk variant whitelist.

Bug: 156286599
Test: m
Exempt-From-Owner-Approval: cherry-pick from internal
Change-Id: Idbd02b17b1c741f1dc20a3742ff57e8469a846c0
Merged-In: Idbd02b17b1c741f1dc20a3742ff57e8469a846c0
2020-08-11 10:32:21 +01:00
Yifan Hong
696ed4d54c Add makefile_goal.
Only for boot images.

Test: add one makefile_goal
Bug: 158537840
Change-Id: I88a006a1c7bfbf79f10f5360aae27a9bc267e42d
2020-07-28 09:51:15 -07:00