platform_build_soong/android
Jiyong Park 6a9ddc37a9 mark platform un-availability
A module is marked unavailable for platform when 1) it does not have
"//apex_available:platform" in its apex_available property, or 2)
it depends on another module that is unavailable for platform.

In that case, LOCAL_NOT_AVAILABLE_FOR_PLATFORM is set to true for the
module in the Make world. Later, that flag is used to ensure that there
is no module with the flag is installed to the device.

The reason why this isn't entirely done in Soong is because Soong
doesn't know if a module will be installed to the device or not. To
explain this, let's have an example.

cc_test { name: "mytest", static_libs: ["libfoo"]}
cc_library_static { name: "libfoo", static_libs: ["libbar"]}
cc_library { name: "libbar", apex_available: ["com.android.xxx"]}

Here, libbar is not available for platform, but is used by libfoo which
is available for platform (apex_available defaults to
"//apex_available:platform"). libfoo is again depended on by mytest
which again is available for platform. The use of libbar should be
allowed in the context of test; we don't want to make libbar available
to platform just for the dependency from test because it will allow
non-test uses of the library as well.

Soong by itself can't tell whether libfoo and libbar are used only in the
context of a test. There could be another module depending them, e.g.,

cc_library_shared { name: "mylib", static_libs: ["libfoo"] }

can exist and it might be installed to the device, in which case
we really should trigger an error.

Since Make has the knowledge of what's installed and what's not,
the check should be done there.

Exempt-From-Owner-Approval: cherry-pick from AOSP

Bug: 153073816
Test: m
Test: remove "//apex_available:platform" from libmdnssd (it is currently
installed to /system/lib), and check that `m system_image` fails

Merged-In: Ia304cc5f41f173229e8a154e90cea4dce46dcebe
(cherry picked from commit 89e850ab84)
Change-Id: Ia304cc5f41f173229e8a154e90cea4dce46dcebe
2020-04-28 09:27:24 +09:00
..
soongconfig soong config: add value_variable substitution 2020-04-09 13:30:38 -07:00
android_test.go Share buildDir for android/soong/android tests 2019-06-10 15:51:06 -07:00
androidmk.go mark platform un-availability 2020-04-28 09:27:24 +09:00
androidmk_test.go Move filesystem into Config 2019-12-18 08:19:10 -08:00
apex.go mark platform un-availability 2020-04-28 09:27:24 +09:00
api_levels.go Remove PLATFORM_VERSION_FUTURE_CODENAMES 2020-04-08 09:25:20 +09:00
arch.go Add support for multiple os types 2020-04-22 12:51:34 +01:00
arch_test.go Do a better job removing tags from arch structs 2020-01-22 18:30:56 -08:00
config.go Merge changes Ie883eb45,If46a2f74,I8f4c5395,Ic4eb169d,I2b2408ef, ... into rvc-dev 2020-04-23 15:19:26 +00:00
config_test.go
csuite_config.go Create C-Suite config module 2019-10-18 18:28:00 +00:00
csuite_config_test.go Move filesystem into Config 2019-12-18 08:19:10 -08:00
defaults.go Fix product variables in defaults modules 2020-02-06 17:43:29 -08:00
defaults_test.go Fix product variables in defaults modules 2020-02-06 17:43:29 -08:00
defs.go Create a highmem pool and put metalava into it 2020-01-24 11:44:23 -08:00
env.go Sandbox soong_build by changing to root directory 2020-01-11 01:11:46 +00:00
expand.go Fix android.Expand and ninja escaping 2019-07-11 14:52:17 -07:00
expand_test.go Fix android.Expand and ninja escaping 2019-07-11 14:52:17 -07:00
filegroup.go
hooks.go Follow input changes to proptools.CloneEmptyProperties 2020-01-28 12:17:06 -08:00
image.go Add ramdisk image. 2020-01-22 16:54:18 -08:00
makevars.go Sandbox soong_build by changing to root directory 2020-01-11 01:11:46 +00:00
module.go Add dependency tags to apex available errors 2020-04-22 12:51:51 +01:00
module_test.go Move filesystem into Config 2019-12-18 08:19:10 -08:00
mutator.go Allow defining neverallow in packages other than android. 2020-04-16 13:34:31 +00:00
mutator_test.go Add FinalDeps mutator phase, where CreateVariations is disallowed. 2020-01-21 11:40:02 +00:00
namespace.go Simplify vendor conditionals 2020-01-24 16:43:40 -08:00
namespace_test.go Move filesystem into Config 2019-12-18 08:19:10 -08:00
neverallow.go Allow defining neverallow in packages other than android. 2020-04-16 13:34:31 +00:00
neverallow_test.go Allow defining neverallow in packages other than android. 2020-04-16 13:34:31 +00:00
notices.go Separate InstallPath from OutputPath 2019-10-03 10:07:53 -07:00
onceper.go Convert droidstubs to android.RuleBuilder 2019-07-18 14:28:14 -07:00
onceper_test.go Prevent hangs in OncePer when the callback panics 2019-05-14 18:40:13 +00:00
override_module.go Rename OverridableModuleBase.properties. 2020-01-10 13:26:00 -08:00
package.go Dedup package build components registration 2020-01-15 11:17:57 +00:00
package_ctx.go Add support for experimentally enabling RBE support on specific rules. 2020-01-28 12:42:47 -05:00
package_test.go Dedup package build components registration 2020-01-15 11:17:57 +00:00
path_properties.go Dedup path properties across property structs 2019-07-16 09:52:23 -07:00
path_properties_test.go Move filesystem into Config 2019-12-18 08:19:10 -08:00
paths.go Add a nice install paths for module SDKs and exports. 2020-04-22 12:51:31 +01:00
paths_test.go Add ramdisk image. 2020-01-22 16:54:18 -08:00
prebuilt.go Ignore PrebuiltDepTag when processing APEX contents 2020-04-22 12:51:52 +01:00
prebuilt_etc.go Add ramdisk image. 2020-01-22 16:54:18 -08:00
prebuilt_etc_test.go Move filesystem into Config 2019-12-18 08:19:10 -08:00
prebuilt_test.go Exclude source->prebuilt deps from visibility enforcement 2020-01-15 11:17:57 +00:00
proto.go Add method to determine variations from a Target 2019-10-16 14:52:30 -07:00
register.go Add FinalDeps mutator phase, where CreateVariations is disallowed. 2020-01-21 11:40:02 +00:00
rule_builder.go Add an order-only dependency on the build number file 2020-04-09 08:16:44 -07:00
rule_builder_test.go Add an order-only dependency on the build number file 2020-04-09 08:16:44 -07:00
sandbox.go Sandbox soong_build by changing to root directory 2020-01-11 01:11:46 +00:00
sdk.go Extract DepIsInSameApex and RequiredSdks interfaces 2020-04-22 12:51:50 +01:00
sh_binary.go Make sh_binary a HostToolProvider 2019-12-19 09:22:36 -08:00
sh_binary_test.go Move filesystem into Config 2019-12-18 08:19:10 -08:00
singleton.go Create a highmem pool and put metalava into it 2020-01-24 11:44:23 -08:00
soong_config_modules.go Merge "soong config: add value_variable substitution" into rvc-dev 2020-04-11 17:24:57 +00:00
soong_config_modules_test.go soong config: add value_variable substitution 2020-04-09 13:30:38 -07:00
testing.go Enable androidmk processing in sdk testing 2020-04-22 12:51:32 +01:00
util.go Simple refactoring of prefix related functions. 2020-02-14 14:33:49 -08:00
util_test.go Simple refactoring of prefix related functions. 2020-02-14 14:33:49 -08:00
variable.go Apply EnforceRROExemptedTargets in Soong 2020-04-20 14:02:23 +00:00
variable_test.go Fix product variables in defaults modules 2020-02-06 17:43:29 -08:00
visibility.go Simplify visibility rules that include //visibility:public 2020-02-20 11:41:17 +00:00
visibility_test.go Simplify visibility rules that include //visibility:public 2020-02-20 11:41:17 +00:00
vts_config.go Merge "Rename VTS to VTS10" am: 7182c45fe7 am: 4058983c0c am: 8989420fee am: 2d2a3643f5 2020-03-31 23:20:53 +00:00
vts_config_test.go Move filesystem into Config 2019-12-18 08:19:10 -08:00
writedocs.go