rust_benchmark
name
,
srcs
,
defaults
,
host_supported
,
device_supported
,
afdo
,
aliases
,
apex_available
,
arch
,
auto_gen_config
,
bootstrap
,
cargo_env_compat
,
cargo_pkg_version
,
cfgs
,
clippy_lints
,
compile_multilib
,
crate_name
,
crate_root
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
double_loadable
,
edition
,
enabled
,
exclude_from_recovery_snapshot
,
exclude_from_vendor_snapshot
,
features
,
flags
,
host_cross_supported
,
host_required
,
init_rc
,
installable
,
ld_flags
,
licenses
,
lints
,
lto
,
min_sdk_version
,
multilib
,
native_bridge_supported
,
native_coverage
,
no_full_install
,
no_named_install_directory
,
no_stdlibs
,
odm_available
,
odm_dlkm_specific
,
overrides
,
owner
,
prefer_rlib
,
proc_macros
,
product_available
,
product_specific
,
product_variables.arc
,
product_variables.build_from_text_stub
,
product_variables.debuggable
,
product_variables.eng
,
product_variables.malloc_low_memory
,
product_variables.native_coverage
,
product_variables.release_aidl_use_unfrozen
,
product_variables.selinuxignoreneverallows
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
ramdisk_available
,
recovery
,
recovery_available
,
relative_install_path
,
required
,
rlibs
,
rustlibs
,
sanitize
,
sdk_version
,
shared_libs
,
soc_specific
,
static_executable
,
static_libs
,
stdlibs
,
stem
,
strip
,
suffix
,
system_dlkm_specific
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
test_config
,
test_config_template
,
test_suites
,
use_expansive_default_srcs
,
use_generic_config
,
vendor
,
vendor_available
,
vendor_dlkm_specific
,
vendor_ramdisk
,
vendor_ramdisk_available
,
vintf_fragment_modules
,
vintf_fragments
,
visibility
,
whole_static_libs
name
string, The name of the module. Must be unique across all modules.
srcs
list of string, path to the source file that is the main entry point of the program (e.g. main.rs or lib.rs).
Only a single source file can be defined. Modules which generate source can be included by prefixing
the module name with ":", for example ":libfoo_bindgen"
If no source file is defined, a single generated source module can be defined to be used as the main source.
defaults
list of string
host_supported
bool, If set to true, build a variant of the module for the host. Defaults to false.
device_supported
bool, If set to true, build a variant of the module for the device. Defaults to true.
afdo
bool, Afdo allows developers self-service enroll for
automatic feedback-directed optimization using profile data.
aliases
list of string, Rust crate dependencies to rename. Each entry should be a string of the form "dependencyname:alias".
"dependencyname" here should be the name of the crate, not the Android module. This is
equivalent to writing `alias = { package = "dependencyname" }` in a `Cargo.toml`.
apex_available
list of string, Availability of this module in APEXes. Only the listed APEXes can contain this module. If
the module has stubs then other APEXes and the platform may access it through them
(subject to visibility).
"//apex_available:anyapex" is a pseudo APEX name that matches to any APEX.
"//apex_available:platform" refers to non-APEX partitions like "system.img".
Prefix pattern (com.foo.*) can be used to match with any APEX name with the prefix(com.foo.).
Default is ["//apex_available:platform"].
arch
interface
auto_gen_config
bool, Flag to indicate whether or not to create test config automatically. If AndroidTest.xml
doesn't exist next to the Android.bp, this attribute doesn't need to be set to true
explicitly.
bootstrap
bool, Allows this module to use non-APEX version of libraries. Useful
for building binaries that are started before APEXes are activated.
cargo_env_compat
bool, Enables emitting certain Cargo environment variables. Only intended to be used for compatibility purposes.
Will set CARGO_CRATE_NAME to the crate_name property's value.
Will set CARGO_BIN_NAME to the output filename value without the extension.
cargo_pkg_version
string, If cargo_env_compat is true, sets the CARGO_PKG_VERSION env var to this value.
cfgs
configurable list of string, list of configuration options to enable for this crate. To enable features, use the "features" property.
clippy_lints
string, name of the lint set that should be used to validate this module.
Possible values are "default" (for using a sensible set of lints
depending on the module's location), "android" (for the strictest
lint set that applies to all Android platform code), "vendor" (for a
relaxed set) and "none" (to disable the execution of clippy). The
default value is "default". See also the `lints` property.
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
crate_name
string, crate name, required for modules which produce Rust libraries: rust_library, rust_ffi and SourceProvider
modules which create library variants (rust_bindgen). This must be the expected extern crate name used in
source, and is required to conform to an enforced format matching library output files (if the output file is
lib<someName><suffix>, the crate_name property must be <someName>).
crate_root
string, Entry point that is passed to rustc to begin the compilation. E.g. main.rs or lib.rs.
When this property is set,
* sandboxing is enabled for this module, and
* the srcs attribute is interpreted as a list of all source files potentially
used in compilation, including the entrypoint, and
* compile_data can be used to add additional files used in compilation that
not directly used as source files.
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
prepend_artifact_with_product
bool, If true, then the artifact file will be prepended with <product name>-. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be coral-foo.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
double_loadable
bool, whether this module is capable of being loaded with other instance
(possibly an older version) of the same module in the same process.
Currently, a shared library that is a member of VNDK (vndk: {enabled: true})
can be double loaded in a vendor process if the library is also a
(direct and indirect) dependency of an LLNDK library. Such libraries must be
explicitly marked as `double_loadable: true` by the owner, or the dependency
from the LLNDK lib should be cut if the lib is not designed to be double loaded.
edition
string, specific rust edition that should be used if the default version is not desired
enabled
configurable bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
exclude_from_recovery_snapshot
bool, Normally Soong uses the directory structure to decide which modules
should be included (framework) or excluded (non-framework) from the
different snapshots (vendor, recovery, etc.), but this property
allows a partner to exclude a module normally thought of as a
framework module from the recovery snapshot.
exclude_from_vendor_snapshot
bool, Normally Soong uses the directory structure to decide which modules
should be included (framework) or excluded (non-framework) from the
different snapshots (vendor, recovery, etc.), but this property
allows a partner to exclude a module normally thought of as a
framework module from the vendor snapshot.
features
configurable list of string, list of features to enable for this crate
flags
list of string, flags to pass to rustc. To enable configuration options or features, use the "cfgs" or "features" properties.
host_cross_supported
bool, If set to true, build a variant of the module for the host cross. Defaults to true.
host_required
list of string, names of other modules to install on host if this module is installed
init_rc
configurable list of string, init.rc files to be installed if this module is installed
installable
bool
ld_flags
list of string, flags to pass to the linker
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
lints
string, name of the lint set that should be used to validate this module.
Possible values are "default" (for using a sensible set of lints
depending on the module's location), "android" (for the strictest
lint set that applies to all Android platform code), "vendor" (for
a relaxed set) and "none" (for ignoring all lint warnings and
errors). The default value is "default".
⊕lto
Control whether LTO is used for the final (Rust) linkage. This does not impact
cross-language LTO.
thin
bool, Whether thin LTO should be enabled. By default this is true.
LTO provides such a large code size benefit for Rust, this should always
be enabled for production builds unless there's a clear need to disable it.
min_sdk_version
string, Minimum OS API level supported by this C or C++ module. This property becomes the value
of the __ANDROID_API__ macro. When the C or C++ module is included in an APEX or an APK,
this property is also used to ensure that the min_sdk_version of the containing module is
not older (i.e. less) than this module's min_sdk_version. When not set, this property
defaults to the value of sdk_version. When this is set to "apex_inherit", this tracks
min_sdk_version of the containing APEX. When the module
is not built for an APEX, "apex_inherit" defaults to sdk_version.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
native_coverage
bool
no_full_install
bool, When set to true, this module is not installed to the full install path (ex: under
out/target/product/<name>/<partition>). It can be installed only to the packaging
modules like android_filesystem.
no_named_install_directory
bool, Disables the creation of a test-specific directory when used with
relative_install_path. Useful if several tests need to be in the same
directory.
no_stdlibs
bool, whether to suppress inclusion of standard crates - defaults to false
odm_available
bool, This is the same as the "vendor_available" except that the install path
of the vendor variant is /odm or /vendor/odm.
By replacing "vendor_available: true" with "odm_available: true", the
module will install its vendor variant to the /odm partition or /vendor/odm.
As the modules with "odm_available: true" still create the vendor variants,
they can link to the other vendor modules as the vendor_available modules do.
Also, the vendor modules can link to odm_available modules.
It may not be used for VNDK modules.
odm_dlkm_specific
bool, Install to partition odm_dlkm when set to true.
overrides
list of string, List of module names that are prevented from being installed when this module gets
installed.
owner
string, vendor who owns this module
prefer_rlib
bool, Change the rustlibs linkage to select rlib linkage by default for device targets.
Also link libstd as an rlib as well on device targets.
Note: This is the default behavior for host targets.
This is primarily meant for rust_binary and rust_ffi modules where the default
linkage of libstd might need to be overridden in some use cases. This should
generally be avoided with other module types since it may cause collisions at
linkage if all dependencies of the root binary module do not link against libstd
the same way.
proc_macros
configurable list of string, list of rust proc_macro crate dependencies
product_available
bool, whether this module should be allowed to be directly depended by other
modules with `product_specific: true` or `product_available: true`.
If set to true, an additional product variant will be built separately
that is limited to the set of libraries and headers that are exposed to
/product modules.
The product variant may be used with a different (newer) /system,
so it shouldn't have any unversioned runtime dependencies, or
make assumptions about the system that may not be true in the
future.
If set to false, this module becomes inaccessible from /product modules.
Different from the 'vendor_available' property, the modules with
vndk: {enabled: true} don't have to define 'product_available'. The VNDK
library without 'product_available' may not be depended on by any other
modules that has product variants including the product available VNDKs.
Nothing happens if BOARD_VNDK_VERSION isn't set in the BoardConfig.mk
and PRODUCT_PRODUCT_VNDK_VERSION isn't set.
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.arc
⊕shared_libs
⊕static_libs
⊕srcs
⊕whole_static_libs
⊕product_variables.build_from_text_stub
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕strip.all
⊕strip.keep_symbols
⊕strip.keep_symbols_and_debug_frame
⊕static_libs
⊕whole_static_libs
⊕shared_libs
⊕srcs
⊕product_variables.eng
⊕product_variables.malloc_low_memory
⊕shared_libs
⊕whole_static_libs
⊕static_libs
⊕srcs
⊕product_variables.native_coverage
⊕product_variables.release_aidl_use_unfrozen
⊕required
⊕vintf_fragment_modules
⊕product_variables.selinuxignoreneverallows
⊕product_variables.unbundled_build
⊕enabled
Configurable[bool]
Configurable[bool]
proptools.Configurable[bool]
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
ramdisk_available
bool, Make this module available when building for ramdisk.
On device without a dedicated recovery partition, the module is only
available after switching root into
/first_stage_ramdisk. To expose the module before switching root, install
the recovery variant instead.
recovery
bool, Whether this module is installed to recovery partition
recovery_available
bool, Make this module available when building for recovery
relative_install_path
string, install to a subdirectory of the default install path for the module
required
configurable list of string, names of other modules to install if this module is installed
rlibs
configurable list of string, list of rust rlib crate dependencies
rustlibs
configurable list of string, list of rust automatic crate dependencies.
Rustlibs linkage is rlib for host targets and dylib for device targets.
⊕sanitize
enable AddressSanitizer, HWAddressSanitizer, and others.
address
bool
hwaddress
bool
memtag_heap
bool, Memory-tagging, only available on arm64
if diag.memtag unset or false, enables async memory tagging
fuzzer
bool
never
bool
⊕diag
Sanitizers to run in the diagnostic mode (as opposed to the release mode).
Replaces abort() on error with a human-readable error message.
Address and Thread sanitizers always run in diagnostic mode.
memtag_heap
bool, Memory-tagging, only available on arm64
requires sanitizer.memtag: true
if set, enables sync memory tagging
sdk_version
string, The API level that this module is built against. The APIs of this API level will be
visible at build time, but use of any APIs newer than min_sdk_version will render the
module unloadable on older devices. In the future it will be possible to weakly-link new
APIs, making the behavior match Java: such modules will load on older devices, but
calling new APIs on devices that do not support them will result in a crash.
This property has the same behavior as sdk_version does for Java modules. For those
familiar with Android Gradle, the property behaves similarly to how compileSdkVersion
does for Java code.
In addition, setting this property causes two variants to be built, one for the platform
and one for apps.
shared_libs
configurable list of string, list of C shared library dependencies
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
static_executable
bool, Builds this binary as a static binary. Implies prefer_rlib true.
Static executables currently only support for bionic targets. Non-bionic targets will not produce a fully static
binary, but will still implicitly imply prefer_rlib true.
static_libs
configurable list of string, list of C static library dependencies. These dependencies do not normally propagate to dependents
and may need to be redeclared. See whole_static_libs for bundling static dependencies into a library.
stdlibs
configurable list of string, list of Rust system library dependencies.
This is usually only needed when `no_stdlibs` is true, in which case it can be used to depend on system crates
like `core` and `alloc`.
stem
string, sets name of the output
⊕strip
none
bool, Device modules default to stripping enabled leaving mini debuginfo.
Host modules default to stripping disabled, but can be enabled by setting any other
strip boolean property.
all
bool, all forces stripping everything, including the mini debug info.
keep_symbols
bool, keep_symbols enables stripping but keeps all symbols.
keep_symbols_list
list of string, keep_symbols_list specifies a list of symbols to keep if keep_symbols is enabled.
If it is unset then all symbols are kept.
keep_symbols_and_debug_frame
bool, keep_symbols_and_debug_frame enables stripping but keeps all symbols and debug frames.
suffix
string, append to name of output
system_dlkm_specific
bool, Install to partition system_dlkm when set to true.
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
compile_multilib
string
enabled
bool
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
test_config
string, the name of the test configuration (for example "AndroidBenchmark.xml") that should be
installed with the module.
test_config_template
string, the name of the test configuration template (for example "AndroidBenchmarkTemplate.xml") that
should be installed with the module.
test_suites
list of string, list of compatibility suites (for example "cts", "vts") that the module should be
installed into.
use_expansive_default_srcs
bool, Set this to true to use an expansive default set of source file requirements
(all .rs, .h, .xml, and .md files in the module tree).
This is primarily for tracking sources for RBE purposes. Currently defaults
to true, though this may change in the future.
use_generic_config
bool, Set to true if this module must be generic and does not require product-specific information.
To be included in the system image, this property must be set to true.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_available
bool, whether this module should be allowed to be directly depended by other
modules with `vendor: true`, `proprietary: true`, or `vendor_available:true`.
If set to true, two variants will be built separately, one like
normal, and the other limited to the set of libraries and headers
that are exposed to /vendor modules.
The vendor variant may be used with a different (newer) /system,
so it shouldn't have any unversioned runtime dependencies, or
make assumptions about the system that may not be true in the
future.
If set to false, this module becomes inaccessible from /vendor modules.
The modules with vndk: {enabled: true} must define 'vendor_available'
to 'true'.
Nothing happens if BOARD_VNDK_VERSION isn't set in the BoardConfig.mk
vendor_dlkm_specific
bool, Install to partition vendor_dlkm when set to true.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vendor_ramdisk_available
bool, Make this module available when building for vendor ramdisk.
On device without a dedicated recovery partition, the module is only
available after switching root into
/first_stage_ramdisk. To expose the module before switching root, install
the recovery variant instead
vintf_fragment_modules
configurable list of string, vintf_fragment Modules required from this module.
vintf_fragments
configurable list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
whole_static_libs
configurable list of string, Similar to static_libs, but will bundle the static library dependency into a library. This is helpful
to avoid having to redeclare the dependency for dependents of this library, but in some cases may also
result in bloat if multiple dependencies all include the same static library whole.
The common use case for this is when the static library is unlikely to be a dependency of other modules to avoid
having to redeclare the static library dependency for every dependent module.
If you are not sure what to, for rust_library modules most static dependencies should go in static_libraries,
and for rust_ffi modules most static dependencies should go into whole_static_libraries.
For rust_ffi static variants, these libraries will be included in the resulting static library archive.
For rust_library rlib variants, these libraries will be bundled into the resulting rlib library. This will
include all of the static libraries symbols in any dylibs or binaries which use this rlib as well.
rust_benchmark_host
name
,
srcs
,
defaults
,
afdo
,
aliases
,
apex_available
,
arch
,
auto_gen_config
,
bootstrap
,
cargo_env_compat
,
cargo_pkg_version
,
cfgs
,
clippy_lints
,
compile_multilib
,
crate_name
,
crate_root
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
double_loadable
,
edition
,
enabled
,
exclude_from_recovery_snapshot
,
exclude_from_vendor_snapshot
,
features
,
flags
,
host_cross_supported
,
host_required
,
init_rc
,
installable
,
ld_flags
,
licenses
,
lints
,
lto
,
min_sdk_version
,
multilib
,
native_bridge_supported
,
native_coverage
,
no_full_install
,
no_named_install_directory
,
no_stdlibs
,
odm_available
,
odm_dlkm_specific
,
overrides
,
owner
,
prefer_rlib
,
proc_macros
,
product_available
,
product_specific
,
product_variables.arc
,
product_variables.build_from_text_stub
,
product_variables.debuggable
,
product_variables.eng
,
product_variables.malloc_low_memory
,
product_variables.native_coverage
,
product_variables.release_aidl_use_unfrozen
,
product_variables.selinuxignoreneverallows
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
ramdisk_available
,
recovery
,
recovery_available
,
relative_install_path
,
required
,
rlibs
,
rustlibs
,
sanitize
,
sdk_version
,
shared_libs
,
soc_specific
,
static_executable
,
static_libs
,
stdlibs
,
stem
,
strip
,
suffix
,
system_dlkm_specific
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
test_config
,
test_config_template
,
test_suites
,
use_expansive_default_srcs
,
use_generic_config
,
vendor
,
vendor_available
,
vendor_dlkm_specific
,
vendor_ramdisk
,
vendor_ramdisk_available
,
vintf_fragment_modules
,
vintf_fragments
,
visibility
,
whole_static_libs
name
string, The name of the module. Must be unique across all modules.
srcs
list of string, path to the source file that is the main entry point of the program (e.g. main.rs or lib.rs).
Only a single source file can be defined. Modules which generate source can be included by prefixing
the module name with ":", for example ":libfoo_bindgen"
If no source file is defined, a single generated source module can be defined to be used as the main source.
defaults
list of string
afdo
bool, Afdo allows developers self-service enroll for
automatic feedback-directed optimization using profile data.
aliases
list of string, Rust crate dependencies to rename. Each entry should be a string of the form "dependencyname:alias".
"dependencyname" here should be the name of the crate, not the Android module. This is
equivalent to writing `alias = { package = "dependencyname" }` in a `Cargo.toml`.
apex_available
list of string, Availability of this module in APEXes. Only the listed APEXes can contain this module. If
the module has stubs then other APEXes and the platform may access it through them
(subject to visibility).
"//apex_available:anyapex" is a pseudo APEX name that matches to any APEX.
"//apex_available:platform" refers to non-APEX partitions like "system.img".
Prefix pattern (com.foo.*) can be used to match with any APEX name with the prefix(com.foo.).
Default is ["//apex_available:platform"].
arch
interface
auto_gen_config
bool, Flag to indicate whether or not to create test config automatically. If AndroidTest.xml
doesn't exist next to the Android.bp, this attribute doesn't need to be set to true
explicitly.
bootstrap
bool, Allows this module to use non-APEX version of libraries. Useful
for building binaries that are started before APEXes are activated.
cargo_env_compat
bool, Enables emitting certain Cargo environment variables. Only intended to be used for compatibility purposes.
Will set CARGO_CRATE_NAME to the crate_name property's value.
Will set CARGO_BIN_NAME to the output filename value without the extension.
cargo_pkg_version
string, If cargo_env_compat is true, sets the CARGO_PKG_VERSION env var to this value.
cfgs
configurable list of string, list of configuration options to enable for this crate. To enable features, use the "features" property.
clippy_lints
string, name of the lint set that should be used to validate this module.
Possible values are "default" (for using a sensible set of lints
depending on the module's location), "android" (for the strictest
lint set that applies to all Android platform code), "vendor" (for a
relaxed set) and "none" (to disable the execution of clippy). The
default value is "default". See also the `lints` property.
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
crate_name
string, crate name, required for modules which produce Rust libraries: rust_library, rust_ffi and SourceProvider
modules which create library variants (rust_bindgen). This must be the expected extern crate name used in
source, and is required to conform to an enforced format matching library output files (if the output file is
lib<someName><suffix>, the crate_name property must be <someName>).
crate_root
string, Entry point that is passed to rustc to begin the compilation. E.g. main.rs or lib.rs.
When this property is set,
* sandboxing is enabled for this module, and
* the srcs attribute is interpreted as a list of all source files potentially
used in compilation, including the entrypoint, and
* compile_data can be used to add additional files used in compilation that
not directly used as source files.
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
prepend_artifact_with_product
bool, If true, then the artifact file will be prepended with <product name>-. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be coral-foo.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
double_loadable
bool, whether this module is capable of being loaded with other instance
(possibly an older version) of the same module in the same process.
Currently, a shared library that is a member of VNDK (vndk: {enabled: true})
can be double loaded in a vendor process if the library is also a
(direct and indirect) dependency of an LLNDK library. Such libraries must be
explicitly marked as `double_loadable: true` by the owner, or the dependency
from the LLNDK lib should be cut if the lib is not designed to be double loaded.
edition
string, specific rust edition that should be used if the default version is not desired
enabled
configurable bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
exclude_from_recovery_snapshot
bool, Normally Soong uses the directory structure to decide which modules
should be included (framework) or excluded (non-framework) from the
different snapshots (vendor, recovery, etc.), but this property
allows a partner to exclude a module normally thought of as a
framework module from the recovery snapshot.
exclude_from_vendor_snapshot
bool, Normally Soong uses the directory structure to decide which modules
should be included (framework) or excluded (non-framework) from the
different snapshots (vendor, recovery, etc.), but this property
allows a partner to exclude a module normally thought of as a
framework module from the vendor snapshot.
features
configurable list of string, list of features to enable for this crate
flags
list of string, flags to pass to rustc. To enable configuration options or features, use the "cfgs" or "features" properties.
host_cross_supported
bool, If set to true, build a variant of the module for the host cross. Defaults to true.
host_required
list of string, names of other modules to install on host if this module is installed
init_rc
configurable list of string, init.rc files to be installed if this module is installed
installable
bool
ld_flags
list of string, flags to pass to the linker
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
lints
string, name of the lint set that should be used to validate this module.
Possible values are "default" (for using a sensible set of lints
depending on the module's location), "android" (for the strictest
lint set that applies to all Android platform code), "vendor" (for
a relaxed set) and "none" (for ignoring all lint warnings and
errors). The default value is "default".
⊕lto
Control whether LTO is used for the final (Rust) linkage. This does not impact
cross-language LTO.
thin
bool, Whether thin LTO should be enabled. By default this is true.
LTO provides such a large code size benefit for Rust, this should always
be enabled for production builds unless there's a clear need to disable it.
min_sdk_version
string, Minimum OS API level supported by this C or C++ module. This property becomes the value
of the __ANDROID_API__ macro. When the C or C++ module is included in an APEX or an APK,
this property is also used to ensure that the min_sdk_version of the containing module is
not older (i.e. less) than this module's min_sdk_version. When not set, this property
defaults to the value of sdk_version. When this is set to "apex_inherit", this tracks
min_sdk_version of the containing APEX. When the module
is not built for an APEX, "apex_inherit" defaults to sdk_version.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
native_coverage
bool
no_full_install
bool, When set to true, this module is not installed to the full install path (ex: under
out/target/product/<name>/<partition>). It can be installed only to the packaging
modules like android_filesystem.
no_named_install_directory
bool, Disables the creation of a test-specific directory when used with
relative_install_path. Useful if several tests need to be in the same
directory.
no_stdlibs
bool, whether to suppress inclusion of standard crates - defaults to false
odm_available
bool, This is the same as the "vendor_available" except that the install path
of the vendor variant is /odm or /vendor/odm.
By replacing "vendor_available: true" with "odm_available: true", the
module will install its vendor variant to the /odm partition or /vendor/odm.
As the modules with "odm_available: true" still create the vendor variants,
they can link to the other vendor modules as the vendor_available modules do.
Also, the vendor modules can link to odm_available modules.
It may not be used for VNDK modules.
odm_dlkm_specific
bool, Install to partition odm_dlkm when set to true.
overrides
list of string, List of module names that are prevented from being installed when this module gets
installed.
owner
string, vendor who owns this module
prefer_rlib
bool, Change the rustlibs linkage to select rlib linkage by default for device targets.
Also link libstd as an rlib as well on device targets.
Note: This is the default behavior for host targets.
This is primarily meant for rust_binary and rust_ffi modules where the default
linkage of libstd might need to be overridden in some use cases. This should
generally be avoided with other module types since it may cause collisions at
linkage if all dependencies of the root binary module do not link against libstd
the same way.
proc_macros
configurable list of string, list of rust proc_macro crate dependencies
product_available
bool, whether this module should be allowed to be directly depended by other
modules with `product_specific: true` or `product_available: true`.
If set to true, an additional product variant will be built separately
that is limited to the set of libraries and headers that are exposed to
/product modules.
The product variant may be used with a different (newer) /system,
so it shouldn't have any unversioned runtime dependencies, or
make assumptions about the system that may not be true in the
future.
If set to false, this module becomes inaccessible from /product modules.
Different from the 'vendor_available' property, the modules with
vndk: {enabled: true} don't have to define 'product_available'. The VNDK
library without 'product_available' may not be depended on by any other
modules that has product variants including the product available VNDKs.
Nothing happens if BOARD_VNDK_VERSION isn't set in the BoardConfig.mk
and PRODUCT_PRODUCT_VNDK_VERSION isn't set.
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.arc
⊕shared_libs
⊕static_libs
⊕srcs
⊕whole_static_libs
⊕product_variables.build_from_text_stub
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕strip.all
⊕strip.keep_symbols
⊕strip.keep_symbols_and_debug_frame
⊕static_libs
⊕whole_static_libs
⊕shared_libs
⊕srcs
⊕product_variables.eng
⊕product_variables.malloc_low_memory
⊕shared_libs
⊕whole_static_libs
⊕static_libs
⊕srcs
⊕product_variables.native_coverage
⊕product_variables.release_aidl_use_unfrozen
⊕required
⊕vintf_fragment_modules
⊕product_variables.selinuxignoreneverallows
⊕product_variables.unbundled_build
⊕enabled
Configurable[bool]
Configurable[bool]
proptools.Configurable[bool]
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
ramdisk_available
bool, Make this module available when building for ramdisk.
On device without a dedicated recovery partition, the module is only
available after switching root into
/first_stage_ramdisk. To expose the module before switching root, install
the recovery variant instead.
recovery
bool, Whether this module is installed to recovery partition
recovery_available
bool, Make this module available when building for recovery
relative_install_path
string, install to a subdirectory of the default install path for the module
required
configurable list of string, names of other modules to install if this module is installed
rlibs
configurable list of string, list of rust rlib crate dependencies
rustlibs
configurable list of string, list of rust automatic crate dependencies.
Rustlibs linkage is rlib for host targets and dylib for device targets.
⊕sanitize
enable AddressSanitizer, HWAddressSanitizer, and others.
address
bool
hwaddress
bool
memtag_heap
bool, Memory-tagging, only available on arm64
if diag.memtag unset or false, enables async memory tagging
fuzzer
bool
never
bool
⊕diag
Sanitizers to run in the diagnostic mode (as opposed to the release mode).
Replaces abort() on error with a human-readable error message.
Address and Thread sanitizers always run in diagnostic mode.
memtag_heap
bool, Memory-tagging, only available on arm64
requires sanitizer.memtag: true
if set, enables sync memory tagging
sdk_version
string, The API level that this module is built against. The APIs of this API level will be
visible at build time, but use of any APIs newer than min_sdk_version will render the
module unloadable on older devices. In the future it will be possible to weakly-link new
APIs, making the behavior match Java: such modules will load on older devices, but
calling new APIs on devices that do not support them will result in a crash.
This property has the same behavior as sdk_version does for Java modules. For those
familiar with Android Gradle, the property behaves similarly to how compileSdkVersion
does for Java code.
In addition, setting this property causes two variants to be built, one for the platform
and one for apps.
shared_libs
configurable list of string, list of C shared library dependencies
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
static_executable
bool, Builds this binary as a static binary. Implies prefer_rlib true.
Static executables currently only support for bionic targets. Non-bionic targets will not produce a fully static
binary, but will still implicitly imply prefer_rlib true.
static_libs
configurable list of string, list of C static library dependencies. These dependencies do not normally propagate to dependents
and may need to be redeclared. See whole_static_libs for bundling static dependencies into a library.
stdlibs
configurable list of string, list of Rust system library dependencies.
This is usually only needed when `no_stdlibs` is true, in which case it can be used to depend on system crates
like `core` and `alloc`.
stem
string, sets name of the output
⊕strip
none
bool, Device modules default to stripping enabled leaving mini debuginfo.
Host modules default to stripping disabled, but can be enabled by setting any other
strip boolean property.
all
bool, all forces stripping everything, including the mini debug info.
keep_symbols
bool, keep_symbols enables stripping but keeps all symbols.
keep_symbols_list
list of string, keep_symbols_list specifies a list of symbols to keep if keep_symbols is enabled.
If it is unset then all symbols are kept.
keep_symbols_and_debug_frame
bool, keep_symbols_and_debug_frame enables stripping but keeps all symbols and debug frames.
suffix
string, append to name of output
system_dlkm_specific
bool, Install to partition system_dlkm when set to true.
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
compile_multilib
string
enabled
bool
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
test_config
string, the name of the test configuration (for example "AndroidBenchmark.xml") that should be
installed with the module.
test_config_template
string, the name of the test configuration template (for example "AndroidBenchmarkTemplate.xml") that
should be installed with the module.
test_suites
list of string, list of compatibility suites (for example "cts", "vts") that the module should be
installed into.
use_expansive_default_srcs
bool, Set this to true to use an expansive default set of source file requirements
(all .rs, .h, .xml, and .md files in the module tree).
This is primarily for tracking sources for RBE purposes. Currently defaults
to true, though this may change in the future.
use_generic_config
bool, Set to true if this module must be generic and does not require product-specific information.
To be included in the system image, this property must be set to true.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_available
bool, whether this module should be allowed to be directly depended by other
modules with `vendor: true`, `proprietary: true`, or `vendor_available:true`.
If set to true, two variants will be built separately, one like
normal, and the other limited to the set of libraries and headers
that are exposed to /vendor modules.
The vendor variant may be used with a different (newer) /system,
so it shouldn't have any unversioned runtime dependencies, or
make assumptions about the system that may not be true in the
future.
If set to false, this module becomes inaccessible from /vendor modules.
The modules with vndk: {enabled: true} must define 'vendor_available'
to 'true'.
Nothing happens if BOARD_VNDK_VERSION isn't set in the BoardConfig.mk
vendor_dlkm_specific
bool, Install to partition vendor_dlkm when set to true.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vendor_ramdisk_available
bool, Make this module available when building for vendor ramdisk.
On device without a dedicated recovery partition, the module is only
available after switching root into
/first_stage_ramdisk. To expose the module before switching root, install
the recovery variant instead
vintf_fragment_modules
configurable list of string, vintf_fragment Modules required from this module.
vintf_fragments
configurable list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
whole_static_libs
configurable list of string, Similar to static_libs, but will bundle the static library dependency into a library. This is helpful
to avoid having to redeclare the dependency for dependents of this library, but in some cases may also
result in bloat if multiple dependencies all include the same static library whole.
The common use case for this is when the static library is unlikely to be a dependency of other modules to avoid
having to redeclare the static library dependency for every dependent module.
If you are not sure what to, for rust_library modules most static dependencies should go in static_libraries,
and for rust_ffi modules most static dependencies should go into whole_static_libraries.
For rust_ffi static variants, these libraries will be included in the resulting static library archive.
For rust_library rlib variants, these libraries will be bundled into the resulting rlib library. This will
include all of the static libraries symbols in any dylibs or binaries which use this rlib as well.
rust_binary
rust_binary produces a binary that is runnable on a device.
name
,
srcs
,
defaults
,
host_supported
,
device_supported
,
afdo
,
aliases
,
apex_available
,
arch
,
bootstrap
,
cargo_env_compat
,
cargo_pkg_version
,
cfgs
,
clippy_lints
,
compile_multilib
,
crate_name
,
crate_root
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
double_loadable
,
edition
,
enabled
,
exclude_from_recovery_snapshot
,
exclude_from_vendor_snapshot
,
features
,
flags
,
host_cross_supported
,
host_required
,
init_rc
,
installable
,
ld_flags
,
licenses
,
lints
,
lto
,
min_sdk_version
,
multilib
,
native_bridge_supported
,
native_coverage
,
no_full_install
,
no_stdlibs
,
odm_available
,
odm_dlkm_specific
,
overrides
,
owner
,
prefer_rlib
,
proc_macros
,
product_available
,
product_specific
,
product_variables.arc
,
product_variables.build_from_text_stub
,
product_variables.debuggable
,
product_variables.eng
,
product_variables.malloc_low_memory
,
product_variables.native_coverage
,
product_variables.release_aidl_use_unfrozen
,
product_variables.selinuxignoreneverallows
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
ramdisk_available
,
recovery
,
recovery_available
,
relative_install_path
,
required
,
rlibs
,
rustlibs
,
sanitize
,
sdk_version
,
shared_libs
,
soc_specific
,
static_executable
,
static_libs
,
stdlibs
,
stem
,
strip
,
suffix
,
system_dlkm_specific
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
use_expansive_default_srcs
,
use_generic_config
,
vendor
,
vendor_available
,
vendor_dlkm_specific
,
vendor_ramdisk
,
vendor_ramdisk_available
,
vintf_fragment_modules
,
vintf_fragments
,
visibility
,
whole_static_libs
name
string, The name of the module. Must be unique across all modules.
srcs
list of string, path to the source file that is the main entry point of the program (e.g. main.rs or lib.rs).
Only a single source file can be defined. Modules which generate source can be included by prefixing
the module name with ":", for example ":libfoo_bindgen"
If no source file is defined, a single generated source module can be defined to be used as the main source.
defaults
list of string
host_supported
bool, If set to true, build a variant of the module for the host. Defaults to false.
device_supported
bool, If set to true, build a variant of the module for the device. Defaults to true.
afdo
bool, Afdo allows developers self-service enroll for
automatic feedback-directed optimization using profile data.
aliases
list of string, Rust crate dependencies to rename. Each entry should be a string of the form "dependencyname:alias".
"dependencyname" here should be the name of the crate, not the Android module. This is
equivalent to writing `alias = { package = "dependencyname" }` in a `Cargo.toml`.
apex_available
list of string, Availability of this module in APEXes. Only the listed APEXes can contain this module. If
the module has stubs then other APEXes and the platform may access it through them
(subject to visibility).
"//apex_available:anyapex" is a pseudo APEX name that matches to any APEX.
"//apex_available:platform" refers to non-APEX partitions like "system.img".
Prefix pattern (com.foo.*) can be used to match with any APEX name with the prefix(com.foo.).
Default is ["//apex_available:platform"].
arch
interface
bootstrap
bool, Allows this module to use non-APEX version of libraries. Useful
for building binaries that are started before APEXes are activated.
cargo_env_compat
bool, Enables emitting certain Cargo environment variables. Only intended to be used for compatibility purposes.
Will set CARGO_CRATE_NAME to the crate_name property's value.
Will set CARGO_BIN_NAME to the output filename value without the extension.
cargo_pkg_version
string, If cargo_env_compat is true, sets the CARGO_PKG_VERSION env var to this value.
cfgs
configurable list of string, list of configuration options to enable for this crate. To enable features, use the "features" property.
clippy_lints
string, name of the lint set that should be used to validate this module.
Possible values are "default" (for using a sensible set of lints
depending on the module's location), "android" (for the strictest
lint set that applies to all Android platform code), "vendor" (for a
relaxed set) and "none" (to disable the execution of clippy). The
default value is "default". See also the `lints` property.
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
crate_name
string, crate name, required for modules which produce Rust libraries: rust_library, rust_ffi and SourceProvider
modules which create library variants (rust_bindgen). This must be the expected extern crate name used in
source, and is required to conform to an enforced format matching library output files (if the output file is
lib<someName><suffix>, the crate_name property must be <someName>).
crate_root
string, Entry point that is passed to rustc to begin the compilation. E.g. main.rs or lib.rs.
When this property is set,
* sandboxing is enabled for this module, and
* the srcs attribute is interpreted as a list of all source files potentially
used in compilation, including the entrypoint, and
* compile_data can be used to add additional files used in compilation that
not directly used as source files.
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
prepend_artifact_with_product
bool, If true, then the artifact file will be prepended with <product name>-. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be coral-foo.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
double_loadable
bool, whether this module is capable of being loaded with other instance
(possibly an older version) of the same module in the same process.
Currently, a shared library that is a member of VNDK (vndk: {enabled: true})
can be double loaded in a vendor process if the library is also a
(direct and indirect) dependency of an LLNDK library. Such libraries must be
explicitly marked as `double_loadable: true` by the owner, or the dependency
from the LLNDK lib should be cut if the lib is not designed to be double loaded.
edition
string, specific rust edition that should be used if the default version is not desired
enabled
configurable bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
exclude_from_recovery_snapshot
bool, Normally Soong uses the directory structure to decide which modules
should be included (framework) or excluded (non-framework) from the
different snapshots (vendor, recovery, etc.), but this property
allows a partner to exclude a module normally thought of as a
framework module from the recovery snapshot.
exclude_from_vendor_snapshot
bool, Normally Soong uses the directory structure to decide which modules
should be included (framework) or excluded (non-framework) from the
different snapshots (vendor, recovery, etc.), but this property
allows a partner to exclude a module normally thought of as a
framework module from the vendor snapshot.
features
configurable list of string, list of features to enable for this crate
flags
list of string, flags to pass to rustc. To enable configuration options or features, use the "cfgs" or "features" properties.
host_cross_supported
bool, If set to true, build a variant of the module for the host cross. Defaults to true.
host_required
list of string, names of other modules to install on host if this module is installed
init_rc
configurable list of string, init.rc files to be installed if this module is installed
installable
bool
ld_flags
list of string, flags to pass to the linker
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
lints
string, name of the lint set that should be used to validate this module.
Possible values are "default" (for using a sensible set of lints
depending on the module's location), "android" (for the strictest
lint set that applies to all Android platform code), "vendor" (for
a relaxed set) and "none" (for ignoring all lint warnings and
errors). The default value is "default".
⊕lto
Control whether LTO is used for the final (Rust) linkage. This does not impact
cross-language LTO.
thin
bool, Whether thin LTO should be enabled. By default this is true.
LTO provides such a large code size benefit for Rust, this should always
be enabled for production builds unless there's a clear need to disable it.
min_sdk_version
string, Minimum OS API level supported by this C or C++ module. This property becomes the value
of the __ANDROID_API__ macro. When the C or C++ module is included in an APEX or an APK,
this property is also used to ensure that the min_sdk_version of the containing module is
not older (i.e. less) than this module's min_sdk_version. When not set, this property
defaults to the value of sdk_version. When this is set to "apex_inherit", this tracks
min_sdk_version of the containing APEX. When the module
is not built for an APEX, "apex_inherit" defaults to sdk_version.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
native_coverage
bool
no_full_install
bool, When set to true, this module is not installed to the full install path (ex: under
out/target/product/<name>/<partition>). It can be installed only to the packaging
modules like android_filesystem.
no_stdlibs
bool, whether to suppress inclusion of standard crates - defaults to false
odm_available
bool, This is the same as the "vendor_available" except that the install path
of the vendor variant is /odm or /vendor/odm.
By replacing "vendor_available: true" with "odm_available: true", the
module will install its vendor variant to the /odm partition or /vendor/odm.
As the modules with "odm_available: true" still create the vendor variants,
they can link to the other vendor modules as the vendor_available modules do.
Also, the vendor modules can link to odm_available modules.
It may not be used for VNDK modules.
odm_dlkm_specific
bool, Install to partition odm_dlkm when set to true.
overrides
list of string, List of module names that are prevented from being installed when this module gets
installed.
owner
string, vendor who owns this module
prefer_rlib
bool, Change the rustlibs linkage to select rlib linkage by default for device targets.
Also link libstd as an rlib as well on device targets.
Note: This is the default behavior for host targets.
This is primarily meant for rust_binary and rust_ffi modules where the default
linkage of libstd might need to be overridden in some use cases. This should
generally be avoided with other module types since it may cause collisions at
linkage if all dependencies of the root binary module do not link against libstd
the same way.
proc_macros
configurable list of string, list of rust proc_macro crate dependencies
product_available
bool, whether this module should be allowed to be directly depended by other
modules with `product_specific: true` or `product_available: true`.
If set to true, an additional product variant will be built separately
that is limited to the set of libraries and headers that are exposed to
/product modules.
The product variant may be used with a different (newer) /system,
so it shouldn't have any unversioned runtime dependencies, or
make assumptions about the system that may not be true in the
future.
If set to false, this module becomes inaccessible from /product modules.
Different from the 'vendor_available' property, the modules with
vndk: {enabled: true} don't have to define 'product_available'. The VNDK
library without 'product_available' may not be depended on by any other
modules that has product variants including the product available VNDKs.
Nothing happens if BOARD_VNDK_VERSION isn't set in the BoardConfig.mk
and PRODUCT_PRODUCT_VNDK_VERSION isn't set.
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.arc
⊕shared_libs
⊕static_libs
⊕srcs
⊕whole_static_libs
⊕product_variables.build_from_text_stub
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕strip.all
⊕strip.keep_symbols
⊕strip.keep_symbols_and_debug_frame
⊕static_libs
⊕whole_static_libs
⊕shared_libs
⊕srcs
⊕product_variables.eng
⊕product_variables.malloc_low_memory
⊕shared_libs
⊕whole_static_libs
⊕static_libs
⊕srcs
⊕product_variables.native_coverage
⊕product_variables.release_aidl_use_unfrozen
⊕required
⊕vintf_fragment_modules
⊕product_variables.selinuxignoreneverallows
⊕product_variables.unbundled_build
⊕enabled
Configurable[bool]
Configurable[bool]
proptools.Configurable[bool]
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
ramdisk_available
bool, Make this module available when building for ramdisk.
On device without a dedicated recovery partition, the module is only
available after switching root into
/first_stage_ramdisk. To expose the module before switching root, install
the recovery variant instead.
recovery
bool, Whether this module is installed to recovery partition
recovery_available
bool, Make this module available when building for recovery
relative_install_path
string, install to a subdirectory of the default install path for the module
required
configurable list of string, names of other modules to install if this module is installed
rlibs
configurable list of string, list of rust rlib crate dependencies
rustlibs
configurable list of string, list of rust automatic crate dependencies.
Rustlibs linkage is rlib for host targets and dylib for device targets.
⊕sanitize
enable AddressSanitizer, HWAddressSanitizer, and others.
address
bool
hwaddress
bool
memtag_heap
bool, Memory-tagging, only available on arm64
if diag.memtag unset or false, enables async memory tagging
fuzzer
bool
never
bool
⊕diag
Sanitizers to run in the diagnostic mode (as opposed to the release mode).
Replaces abort() on error with a human-readable error message.
Address and Thread sanitizers always run in diagnostic mode.
memtag_heap
bool, Memory-tagging, only available on arm64
requires sanitizer.memtag: true
if set, enables sync memory tagging
sdk_version
string, The API level that this module is built against. The APIs of this API level will be
visible at build time, but use of any APIs newer than min_sdk_version will render the
module unloadable on older devices. In the future it will be possible to weakly-link new
APIs, making the behavior match Java: such modules will load on older devices, but
calling new APIs on devices that do not support them will result in a crash.
This property has the same behavior as sdk_version does for Java modules. For those
familiar with Android Gradle, the property behaves similarly to how compileSdkVersion
does for Java code.
In addition, setting this property causes two variants to be built, one for the platform
and one for apps.
shared_libs
configurable list of string, list of C shared library dependencies
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
static_executable
bool, Builds this binary as a static binary. Implies prefer_rlib true.
Static executables currently only support for bionic targets. Non-bionic targets will not produce a fully static
binary, but will still implicitly imply prefer_rlib true.
static_libs
configurable list of string, list of C static library dependencies. These dependencies do not normally propagate to dependents
and may need to be redeclared. See whole_static_libs for bundling static dependencies into a library.
stdlibs
configurable list of string, list of Rust system library dependencies.
This is usually only needed when `no_stdlibs` is true, in which case it can be used to depend on system crates
like `core` and `alloc`.
stem
string, sets name of the output
⊕strip
none
bool, Device modules default to stripping enabled leaving mini debuginfo.
Host modules default to stripping disabled, but can be enabled by setting any other
strip boolean property.
all
bool, all forces stripping everything, including the mini debug info.
keep_symbols
bool, keep_symbols enables stripping but keeps all symbols.
keep_symbols_list
list of string, keep_symbols_list specifies a list of symbols to keep if keep_symbols is enabled.
If it is unset then all symbols are kept.
keep_symbols_and_debug_frame
bool, keep_symbols_and_debug_frame enables stripping but keeps all symbols and debug frames.
suffix
string, append to name of output
system_dlkm_specific
bool, Install to partition system_dlkm when set to true.
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
compile_multilib
string
enabled
bool
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
use_expansive_default_srcs
bool, Set this to true to use an expansive default set of source file requirements
(all .rs, .h, .xml, and .md files in the module tree).
This is primarily for tracking sources for RBE purposes. Currently defaults
to true, though this may change in the future.
use_generic_config
bool, Set to true if this module must be generic and does not require product-specific information.
To be included in the system image, this property must be set to true.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_available
bool, whether this module should be allowed to be directly depended by other
modules with `vendor: true`, `proprietary: true`, or `vendor_available:true`.
If set to true, two variants will be built separately, one like
normal, and the other limited to the set of libraries and headers
that are exposed to /vendor modules.
The vendor variant may be used with a different (newer) /system,
so it shouldn't have any unversioned runtime dependencies, or
make assumptions about the system that may not be true in the
future.
If set to false, this module becomes inaccessible from /vendor modules.
The modules with vndk: {enabled: true} must define 'vendor_available'
to 'true'.
Nothing happens if BOARD_VNDK_VERSION isn't set in the BoardConfig.mk
vendor_dlkm_specific
bool, Install to partition vendor_dlkm when set to true.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vendor_ramdisk_available
bool, Make this module available when building for vendor ramdisk.
On device without a dedicated recovery partition, the module is only
available after switching root into
/first_stage_ramdisk. To expose the module before switching root, install
the recovery variant instead
vintf_fragment_modules
configurable list of string, vintf_fragment Modules required from this module.
vintf_fragments
configurable list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
whole_static_libs
configurable list of string, Similar to static_libs, but will bundle the static library dependency into a library. This is helpful
to avoid having to redeclare the dependency for dependents of this library, but in some cases may also
result in bloat if multiple dependencies all include the same static library whole.
The common use case for this is when the static library is unlikely to be a dependency of other modules to avoid
having to redeclare the static library dependency for every dependent module.
If you are not sure what to, for rust_library modules most static dependencies should go in static_libraries,
and for rust_ffi modules most static dependencies should go into whole_static_libraries.
For rust_ffi static variants, these libraries will be included in the resulting static library archive.
For rust_library rlib variants, these libraries will be bundled into the resulting rlib library. This will
include all of the static libraries symbols in any dylibs or binaries which use this rlib as well.
rust_binary_host
name
,
srcs
,
defaults
,
afdo
,
aliases
,
apex_available
,
arch
,
bootstrap
,
cargo_env_compat
,
cargo_pkg_version
,
cfgs
,
clippy_lints
,
compile_multilib
,
crate_name
,
crate_root
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
double_loadable
,
edition
,
enabled
,
exclude_from_recovery_snapshot
,
exclude_from_vendor_snapshot
,
features
,
flags
,
host_cross_supported
,
host_required
,
init_rc
,
installable
,
ld_flags
,
licenses
,
lints
,
lto
,
min_sdk_version
,
multilib
,
native_bridge_supported
,
native_coverage
,
no_full_install
,
no_stdlibs
,
odm_available
,
odm_dlkm_specific
,
overrides
,
owner
,
prefer_rlib
,
proc_macros
,
product_available
,
product_specific
,
product_variables.arc
,
product_variables.build_from_text_stub
,
product_variables.debuggable
,
product_variables.eng
,
product_variables.malloc_low_memory
,
product_variables.native_coverage
,
product_variables.release_aidl_use_unfrozen
,
product_variables.selinuxignoreneverallows
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
ramdisk_available
,
recovery
,
recovery_available
,
relative_install_path
,
required
,
rlibs
,
rustlibs
,
sanitize
,
sdk_version
,
shared_libs
,
soc_specific
,
static_executable
,
static_libs
,
stdlibs
,
stem
,
strip
,
suffix
,
system_dlkm_specific
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
use_expansive_default_srcs
,
use_generic_config
,
vendor
,
vendor_available
,
vendor_dlkm_specific
,
vendor_ramdisk
,
vendor_ramdisk_available
,
vintf_fragment_modules
,
vintf_fragments
,
visibility
,
whole_static_libs
name
string, The name of the module. Must be unique across all modules.
srcs
list of string, path to the source file that is the main entry point of the program (e.g. main.rs or lib.rs).
Only a single source file can be defined. Modules which generate source can be included by prefixing
the module name with ":", for example ":libfoo_bindgen"
If no source file is defined, a single generated source module can be defined to be used as the main source.
defaults
list of string
afdo
bool, Afdo allows developers self-service enroll for
automatic feedback-directed optimization using profile data.
aliases
list of string, Rust crate dependencies to rename. Each entry should be a string of the form "dependencyname:alias".
"dependencyname" here should be the name of the crate, not the Android module. This is
equivalent to writing `alias = { package = "dependencyname" }` in a `Cargo.toml`.
apex_available
list of string, Availability of this module in APEXes. Only the listed APEXes can contain this module. If
the module has stubs then other APEXes and the platform may access it through them
(subject to visibility).
"//apex_available:anyapex" is a pseudo APEX name that matches to any APEX.
"//apex_available:platform" refers to non-APEX partitions like "system.img".
Prefix pattern (com.foo.*) can be used to match with any APEX name with the prefix(com.foo.).
Default is ["//apex_available:platform"].
arch
interface
bootstrap
bool, Allows this module to use non-APEX version of libraries. Useful
for building binaries that are started before APEXes are activated.
cargo_env_compat
bool, Enables emitting certain Cargo environment variables. Only intended to be used for compatibility purposes.
Will set CARGO_CRATE_NAME to the crate_name property's value.
Will set CARGO_BIN_NAME to the output filename value without the extension.
cargo_pkg_version
string, If cargo_env_compat is true, sets the CARGO_PKG_VERSION env var to this value.
cfgs
configurable list of string, list of configuration options to enable for this crate. To enable features, use the "features" property.
clippy_lints
string, name of the lint set that should be used to validate this module.
Possible values are "default" (for using a sensible set of lints
depending on the module's location), "android" (for the strictest
lint set that applies to all Android platform code), "vendor" (for a
relaxed set) and "none" (to disable the execution of clippy). The
default value is "default". See also the `lints` property.
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
crate_name
string, crate name, required for modules which produce Rust libraries: rust_library, rust_ffi and SourceProvider
modules which create library variants (rust_bindgen). This must be the expected extern crate name used in
source, and is required to conform to an enforced format matching library output files (if the output file is
lib<someName><suffix>, the crate_name property must be <someName>).
crate_root
string, Entry point that is passed to rustc to begin the compilation. E.g. main.rs or lib.rs.
When this property is set,
* sandboxing is enabled for this module, and
* the srcs attribute is interpreted as a list of all source files potentially
used in compilation, including the entrypoint, and
* compile_data can be used to add additional files used in compilation that
not directly used as source files.
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
prepend_artifact_with_product
bool, If true, then the artifact file will be prepended with <product name>-. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be coral-foo.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
double_loadable
bool, whether this module is capable of being loaded with other instance
(possibly an older version) of the same module in the same process.
Currently, a shared library that is a member of VNDK (vndk: {enabled: true})
can be double loaded in a vendor process if the library is also a
(direct and indirect) dependency of an LLNDK library. Such libraries must be
explicitly marked as `double_loadable: true` by the owner, or the dependency
from the LLNDK lib should be cut if the lib is not designed to be double loaded.
edition
string, specific rust edition that should be used if the default version is not desired
enabled
configurable bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
exclude_from_recovery_snapshot
bool, Normally Soong uses the directory structure to decide which modules
should be included (framework) or excluded (non-framework) from the
different snapshots (vendor, recovery, etc.), but this property
allows a partner to exclude a module normally thought of as a
framework module from the recovery snapshot.
exclude_from_vendor_snapshot
bool, Normally Soong uses the directory structure to decide which modules
should be included (framework) or excluded (non-framework) from the
different snapshots (vendor, recovery, etc.), but this property
allows a partner to exclude a module normally thought of as a
framework module from the vendor snapshot.
features
configurable list of string, list of features to enable for this crate
flags
list of string, flags to pass to rustc. To enable configuration options or features, use the "cfgs" or "features" properties.
host_cross_supported
bool, If set to true, build a variant of the module for the host cross. Defaults to true.
host_required
list of string, names of other modules to install on host if this module is installed
init_rc
configurable list of string, init.rc files to be installed if this module is installed
installable
bool
ld_flags
list of string, flags to pass to the linker
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
lints
string, name of the lint set that should be used to validate this module.
Possible values are "default" (for using a sensible set of lints
depending on the module's location), "android" (for the strictest
lint set that applies to all Android platform code), "vendor" (for
a relaxed set) and "none" (for ignoring all lint warnings and
errors). The default value is "default".
⊕lto
Control whether LTO is used for the final (Rust) linkage. This does not impact
cross-language LTO.
thin
bool, Whether thin LTO should be enabled. By default this is true.
LTO provides such a large code size benefit for Rust, this should always
be enabled for production builds unless there's a clear need to disable it.
min_sdk_version
string, Minimum OS API level supported by this C or C++ module. This property becomes the value
of the __ANDROID_API__ macro. When the C or C++ module is included in an APEX or an APK,
this property is also used to ensure that the min_sdk_version of the containing module is
not older (i.e. less) than this module's min_sdk_version. When not set, this property
defaults to the value of sdk_version. When this is set to "apex_inherit", this tracks
min_sdk_version of the containing APEX. When the module
is not built for an APEX, "apex_inherit" defaults to sdk_version.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
native_coverage
bool
no_full_install
bool, When set to true, this module is not installed to the full install path (ex: under
out/target/product/<name>/<partition>). It can be installed only to the packaging
modules like android_filesystem.
no_stdlibs
bool, whether to suppress inclusion of standard crates - defaults to false
odm_available
bool, This is the same as the "vendor_available" except that the install path
of the vendor variant is /odm or /vendor/odm.
By replacing "vendor_available: true" with "odm_available: true", the
module will install its vendor variant to the /odm partition or /vendor/odm.
As the modules with "odm_available: true" still create the vendor variants,
they can link to the other vendor modules as the vendor_available modules do.
Also, the vendor modules can link to odm_available modules.
It may not be used for VNDK modules.
odm_dlkm_specific
bool, Install to partition odm_dlkm when set to true.
overrides
list of string, List of module names that are prevented from being installed when this module gets
installed.
owner
string, vendor who owns this module
prefer_rlib
bool, Change the rustlibs linkage to select rlib linkage by default for device targets.
Also link libstd as an rlib as well on device targets.
Note: This is the default behavior for host targets.
This is primarily meant for rust_binary and rust_ffi modules where the default
linkage of libstd might need to be overridden in some use cases. This should
generally be avoided with other module types since it may cause collisions at
linkage if all dependencies of the root binary module do not link against libstd
the same way.
proc_macros
configurable list of string, list of rust proc_macro crate dependencies
product_available
bool, whether this module should be allowed to be directly depended by other
modules with `product_specific: true` or `product_available: true`.
If set to true, an additional product variant will be built separately
that is limited to the set of libraries and headers that are exposed to
/product modules.
The product variant may be used with a different (newer) /system,
so it shouldn't have any unversioned runtime dependencies, or
make assumptions about the system that may not be true in the
future.
If set to false, this module becomes inaccessible from /product modules.
Different from the 'vendor_available' property, the modules with
vndk: {enabled: true} don't have to define 'product_available'. The VNDK
library without 'product_available' may not be depended on by any other
modules that has product variants including the product available VNDKs.
Nothing happens if BOARD_VNDK_VERSION isn't set in the BoardConfig.mk
and PRODUCT_PRODUCT_VNDK_VERSION isn't set.
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.arc
⊕shared_libs
⊕static_libs
⊕srcs
⊕whole_static_libs
⊕product_variables.build_from_text_stub
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕strip.all
⊕strip.keep_symbols
⊕strip.keep_symbols_and_debug_frame
⊕static_libs
⊕whole_static_libs
⊕shared_libs
⊕srcs
⊕product_variables.eng
⊕product_variables.malloc_low_memory
⊕shared_libs
⊕whole_static_libs
⊕static_libs
⊕srcs
⊕product_variables.native_coverage
⊕product_variables.release_aidl_use_unfrozen
⊕required
⊕vintf_fragment_modules
⊕product_variables.selinuxignoreneverallows
⊕product_variables.unbundled_build
⊕enabled
Configurable[bool]
Configurable[bool]
proptools.Configurable[bool]
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
ramdisk_available
bool, Make this module available when building for ramdisk.
On device without a dedicated recovery partition, the module is only
available after switching root into
/first_stage_ramdisk. To expose the module before switching root, install
the recovery variant instead.
recovery
bool, Whether this module is installed to recovery partition
recovery_available
bool, Make this module available when building for recovery
relative_install_path
string, install to a subdirectory of the default install path for the module
required
configurable list of string, names of other modules to install if this module is installed
rlibs
configurable list of string, list of rust rlib crate dependencies
rustlibs
configurable list of string, list of rust automatic crate dependencies.
Rustlibs linkage is rlib for host targets and dylib for device targets.
⊕sanitize
enable AddressSanitizer, HWAddressSanitizer, and others.
address
bool
hwaddress
bool
memtag_heap
bool, Memory-tagging, only available on arm64
if diag.memtag unset or false, enables async memory tagging
fuzzer
bool
never
bool
⊕diag
Sanitizers to run in the diagnostic mode (as opposed to the release mode).
Replaces abort() on error with a human-readable error message.
Address and Thread sanitizers always run in diagnostic mode.
memtag_heap
bool, Memory-tagging, only available on arm64
requires sanitizer.memtag: true
if set, enables sync memory tagging
sdk_version
string, The API level that this module is built against. The APIs of this API level will be
visible at build time, but use of any APIs newer than min_sdk_version will render the
module unloadable on older devices. In the future it will be possible to weakly-link new
APIs, making the behavior match Java: such modules will load on older devices, but
calling new APIs on devices that do not support them will result in a crash.
This property has the same behavior as sdk_version does for Java modules. For those
familiar with Android Gradle, the property behaves similarly to how compileSdkVersion
does for Java code.
In addition, setting this property causes two variants to be built, one for the platform
and one for apps.
shared_libs
configurable list of string, list of C shared library dependencies
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
static_executable
bool, Builds this binary as a static binary. Implies prefer_rlib true.
Static executables currently only support for bionic targets. Non-bionic targets will not produce a fully static
binary, but will still implicitly imply prefer_rlib true.
static_libs
configurable list of string, list of C static library dependencies. These dependencies do not normally propagate to dependents
and may need to be redeclared. See whole_static_libs for bundling static dependencies into a library.
stdlibs
configurable list of string, list of Rust system library dependencies.
This is usually only needed when `no_stdlibs` is true, in which case it can be used to depend on system crates
like `core` and `alloc`.
stem
string, sets name of the output
⊕strip
none
bool, Device modules default to stripping enabled leaving mini debuginfo.
Host modules default to stripping disabled, but can be enabled by setting any other
strip boolean property.
all
bool, all forces stripping everything, including the mini debug info.
keep_symbols
bool, keep_symbols enables stripping but keeps all symbols.
keep_symbols_list
list of string, keep_symbols_list specifies a list of symbols to keep if keep_symbols is enabled.
If it is unset then all symbols are kept.
keep_symbols_and_debug_frame
bool, keep_symbols_and_debug_frame enables stripping but keeps all symbols and debug frames.
suffix
string, append to name of output
system_dlkm_specific
bool, Install to partition system_dlkm when set to true.
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
compile_multilib
string
enabled
bool
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
use_expansive_default_srcs
bool, Set this to true to use an expansive default set of source file requirements
(all .rs, .h, .xml, and .md files in the module tree).
This is primarily for tracking sources for RBE purposes. Currently defaults
to true, though this may change in the future.
use_generic_config
bool, Set to true if this module must be generic and does not require product-specific information.
To be included in the system image, this property must be set to true.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_available
bool, whether this module should be allowed to be directly depended by other
modules with `vendor: true`, `proprietary: true`, or `vendor_available:true`.
If set to true, two variants will be built separately, one like
normal, and the other limited to the set of libraries and headers
that are exposed to /vendor modules.
The vendor variant may be used with a different (newer) /system,
so it shouldn't have any unversioned runtime dependencies, or
make assumptions about the system that may not be true in the
future.
If set to false, this module becomes inaccessible from /vendor modules.
The modules with vndk: {enabled: true} must define 'vendor_available'
to 'true'.
Nothing happens if BOARD_VNDK_VERSION isn't set in the BoardConfig.mk
vendor_dlkm_specific
bool, Install to partition vendor_dlkm when set to true.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vendor_ramdisk_available
bool, Make this module available when building for vendor ramdisk.
On device without a dedicated recovery partition, the module is only
available after switching root into
/first_stage_ramdisk. To expose the module before switching root, install
the recovery variant instead
vintf_fragment_modules
configurable list of string, vintf_fragment Modules required from this module.
vintf_fragments
configurable list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
whole_static_libs
configurable list of string, Similar to static_libs, but will bundle the static library dependency into a library. This is helpful
to avoid having to redeclare the dependency for dependents of this library, but in some cases may also
result in bloat if multiple dependencies all include the same static library whole.
The common use case for this is when the static library is unlikely to be a dependency of other modules to avoid
having to redeclare the static library dependency for every dependent module.
If you are not sure what to, for rust_library modules most static dependencies should go in static_libraries,
and for rust_ffi modules most static dependencies should go into whole_static_libraries.
For rust_ffi static variants, these libraries will be included in the resulting static library archive.
For rust_library rlib variants, these libraries will be bundled into the resulting rlib library. This will
include all of the static libraries symbols in any dylibs or binaries which use this rlib as well.
rust_bindgen
rust_bindgen generates Rust FFI bindings to C libraries using bindgen given a wrapper header as the primary input.
Bindgen has a number of flags to control the generated source, and additional flags can be passed to clang to ensure
the header and generated source is appropriately handled. It is recommended to add it as a dependency in the
rlibs or rustlibs property. It may also be added in the srcs property for external crates, using the ":"
prefix.
name
,
srcs
,
defaults
,
host_supported
,
device_supported
,
afdo
,
aliases
,
apex_available
,
apex_exclude
,
arch
,
bindgen_flag_files
,
bindgen_flags
,
bootstrap
,
c_std
,
cargo_env_compat
,
cargo_pkg_version
,
cfgs
,
cflags
,
clippy_lints
,
compile_multilib
,
cpp_std
,
cppflags
,
crate_name
,
crate_root
,
custom_bindgen
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
double_loadable
,
dylib
,
edition
,
enabled
,
exclude_from_recovery_snapshot
,
exclude_from_vendor_snapshot
,
export_include_dirs
,
extra_exported_symbols
,
features
,
flags
,
handle_static_inline
,
header_libs
,
host_cross_supported
,
host_required
,
include_dirs
,
init_rc
,
installable
,
ld_flags
,
licenses
,
lints
,
local_include_dirs
,
lto
,
min_sdk_version
,
multilib
,
native_bridge_supported
,
native_coverage
,
no_full_install
,
no_stdlibs
,
odm_available
,
odm_dlkm_specific
,
overrides
,
owner
,
prefer_rlib
,
proc_macros
,
product_available
,
product_specific
,
product_variables.arc
,
product_variables.binder32bit
,
product_variables.build_from_text_stub
,
product_variables.debuggable
,
product_variables.enforce_vintf_manifest
,
product_variables.eng
,
product_variables.malloc_low_memory
,
product_variables.malloc_pattern_fill_contents
,
product_variables.malloc_zero_contents
,
product_variables.native_coverage
,
product_variables.override_rs_driver
,
product_variables.platform_sdk_version
,
product_variables.release_aidl_use_unfrozen
,
product_variables.safestack
,
product_variables.selinuxignoreneverallows
,
product_variables.shipping_api_level
,
product_variables.treble_linker_namespaces
,
product_variables.uml
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
ramdisk_available
,
recovery
,
recovery_available
,
relative_install_path
,
required
,
rlib
,
rlibs
,
rustlibs
,
sanitize
,
sdk_version
,
shared
,
shared_libs
,
soc_specific
,
source_stem
,
static
,
static_inline_library
,
static_libs
,
stdlibs
,
stem
,
strip
,
stubs
,
suffix
,
sysroot
,
system_dlkm_specific
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
use_expansive_default_srcs
,
use_generic_config
,
vendor
,
vendor_available
,
vendor_dlkm_specific
,
vendor_ramdisk
,
vendor_ramdisk_available
,
version_script
,
vintf_fragment_modules
,
vintf_fragments
,
visibility
,
whole_static_libs
,
wrapper_src
name
string, The name of the module. Must be unique across all modules.
srcs
list of string, path to the source file that is the main entry point of the program (e.g. main.rs or lib.rs).
Only a single source file can be defined. Modules which generate source can be included by prefixing
the module name with ":", for example ":libfoo_bindgen"
If no source file is defined, a single generated source module can be defined to be used as the main source.
defaults
list of string
host_supported
bool, If set to true, build a variant of the module for the host. Defaults to false.
device_supported
bool, If set to true, build a variant of the module for the device. Defaults to true.
afdo
bool, Afdo allows developers self-service enroll for
automatic feedback-directed optimization using profile data.
aliases
list of string, Rust crate dependencies to rename. Each entry should be a string of the form "dependencyname:alias".
"dependencyname" here should be the name of the crate, not the Android module. This is
equivalent to writing `alias = { package = "dependencyname" }` in a `Cargo.toml`.
apex_available
list of string, Availability of this module in APEXes. Only the listed APEXes can contain this module. If
the module has stubs then other APEXes and the platform may access it through them
(subject to visibility).
"//apex_available:anyapex" is a pseudo APEX name that matches to any APEX.
"//apex_available:platform" refers to non-APEX partitions like "system.img".
Prefix pattern (com.foo.*) can be used to match with any APEX name with the prefix(com.foo.).
Default is ["//apex_available:platform"].
apex_exclude
bool, Deprecated - exclude this rust_ffi target from being included in APEXes.
TODO(b/362509506): remove this once all apex_exclude uses are switched to stubs.
arch
interface
bindgen_flag_files
list of string, list of files containing extra bindgen flags
bindgen_flags
list of string, list of bindgen-specific flags and options
bootstrap
bool, Allows this module to use non-APEX version of libraries. Useful
for building binaries that are started before APEXes are activated.
c_std
string, C standard version to use. Can be a specific version (such as "gnu11"),
"experimental" (which will use draft versions like C1x when available),
or the empty string (which will use the default).
If this is set, the file extension will be ignored and this will be used as the std version value. Setting this
to "default" will use the build system default version. This cannot be set at the same time as cpp_std.
cargo_env_compat
bool, Enables emitting certain Cargo environment variables. Only intended to be used for compatibility purposes.
Will set CARGO_CRATE_NAME to the crate_name property's value.
Will set CARGO_BIN_NAME to the output filename value without the extension.
cargo_pkg_version
string, If cargo_env_compat is true, sets the CARGO_PKG_VERSION env var to this value.
cfgs
configurable list of string, list of configuration options to enable for this crate. To enable features, use the "features" property.
cflags
configurable list of string, list of clang flags required to correctly interpret the headers.
clippy_lints
string, name of the lint set that should be used to validate this module.
Possible values are "default" (for using a sensible set of lints
depending on the module's location), "android" (for the strictest
lint set that applies to all Android platform code), "vendor" (for a
relaxed set) and "none" (to disable the execution of clippy). The
default value is "default". See also the `lints` property.
Default: none
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
cpp_std
string, C++ standard version to use. Can be a specific version (such as
"gnu++11"), "experimental" (which will use draft versions like C++1z when
available), or the empty string (which will use the default).
If this is set, the file extension will be ignored and this will be used as the std version value. Setting this
to "default" will use the build system default version. This cannot be set at the same time as c_std.
cppflags
configurable list of string, list of c++ specific clang flags required to correctly interpret the headers.
This is provided primarily to make sure cppflags defined in cc_defaults are pulled in.
crate_name
string, crate name, used for the library variant of this source provider. See additional details in rust_library.
crate_root
string, Entry point that is passed to rustc to begin the compilation. E.g. main.rs or lib.rs.
When this property is set,
* sandboxing is enabled for this module, and
* the srcs attribute is interpreted as a list of all source files potentially
used in compilation, including the entrypoint, and
* compile_data can be used to add additional files used in compilation that
not directly used as source files.
custom_bindgen
string, module name of a custom binary/script which should be used instead of the 'bindgen' binary. This custom
binary must expect arguments in a similar fashion to bindgen, e.g.
"my_bindgen [flags] wrapper_header.h -o [output_path] -- [clang flags]"
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
prepend_artifact_with_product
bool, If true, then the artifact file will be prepended with <product name>-. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be coral-foo.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
double_loadable
bool, whether this module is capable of being loaded with other instance
(possibly an older version) of the same module in the same process.
Currently, a shared library that is a member of VNDK (vndk: {enabled: true})
can be double loaded in a vendor process if the library is also a
(direct and indirect) dependency of an LLNDK library. Such libraries must be
explicitly marked as `double_loadable: true` by the owner, or the dependency
from the LLNDK lib should be cut if the lib is not designed to be double loaded.
⊕dylib
VariantLibraryProperties
enabled
bool
srcs
list of string
edition
string, specific rust edition that should be used if the default version is not desired
enabled
configurable bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
exclude_from_recovery_snapshot
bool, Normally Soong uses the directory structure to decide which modules
should be included (framework) or excluded (non-framework) from the
different snapshots (vendor, recovery, etc.), but this property
allows a partner to exclude a module normally thought of as a
framework module from the recovery snapshot.
exclude_from_vendor_snapshot
bool, Normally Soong uses the directory structure to decide which modules
should be included (framework) or excluded (non-framework) from the
different snapshots (vendor, recovery, etc.), but this property
allows a partner to exclude a module normally thought of as a
framework module from the vendor snapshot.
export_include_dirs
list of string, path to include directories to export to cc_* modules, only relevant for static/shared variants.
features
configurable list of string, list of features to enable for this crate
flags
list of string, flags to pass to rustc. To enable configuration options or features, use the "cfgs" or "features" properties.
handle_static_inline
bool, flag to indicate if bindgen should handle `static inline` functions (default is false).
If true, Static_inline_library must be set.
host_cross_supported
bool, If set to true, build a variant of the module for the host cross. Defaults to true.
host_required
list of string, names of other modules to install on host if this module is installed
include_dirs
list of string, TODO: Remove this when all instances of Include_dirs have been removed from rust_ffi modules.
path to include directories to pass to cc_* modules, only relevant for static/shared variants (deprecated, use export_include_dirs instead).
init_rc
configurable list of string, init.rc files to be installed if this module is installed
installable
bool
ld_flags
list of string, flags to pass to the linker
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
lints
string, name of the lint set that should be used to validate this module.
Possible values are "default" (for using a sensible set of lints
depending on the module's location), "android" (for the strictest
lint set that applies to all Android platform code), "vendor" (for
a relaxed set) and "none" (for ignoring all lint warnings and
errors). The default value is "default".
Default: none
local_include_dirs
configurable list of string, list of directories relative to the Blueprints file that will
be added to the include path using -I
⊕lto
Control whether LTO is used for the final (Rust) linkage. This does not impact
cross-language LTO.
thin
bool, Whether thin LTO should be enabled. By default this is true.
LTO provides such a large code size benefit for Rust, this should always
be enabled for production builds unless there's a clear need to disable it.
min_sdk_version
string, Minimum OS API level supported by this C or C++ module. This property becomes the value
of the __ANDROID_API__ macro. When the C or C++ module is included in an APEX or an APK,
this property is also used to ensure that the min_sdk_version of the containing module is
not older (i.e. less) than this module's min_sdk_version. When not set, this property
defaults to the value of sdk_version. When this is set to "apex_inherit", this tracks
min_sdk_version of the containing APEX. When the module
is not built for an APEX, "apex_inherit" defaults to sdk_version.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
native_coverage
bool
no_full_install
bool, When set to true, this module is not installed to the full install path (ex: under
out/target/product/<name>/<partition>). It can be installed only to the packaging
modules like android_filesystem.
no_stdlibs
bool, whether to suppress inclusion of standard crates - defaults to false
odm_available
bool, This is the same as the "vendor_available" except that the install path
of the vendor variant is /odm or /vendor/odm.
By replacing "vendor_available: true" with "odm_available: true", the
module will install its vendor variant to the /odm partition or /vendor/odm.
As the modules with "odm_available: true" still create the vendor variants,
they can link to the other vendor modules as the vendor_available modules do.
Also, the vendor modules can link to odm_available modules.
It may not be used for VNDK modules.
odm_dlkm_specific
bool, Install to partition odm_dlkm when set to true.
overrides
list of string, List of module names that are prevented from being installed when this module gets
installed.
owner
string, vendor who owns this module
prefer_rlib
bool, Change the rustlibs linkage to select rlib linkage by default for device targets.
Also link libstd as an rlib as well on device targets.
Note: This is the default behavior for host targets.
This is primarily meant for rust_binary and rust_ffi modules where the default
linkage of libstd might need to be overridden in some use cases. This should
generally be avoided with other module types since it may cause collisions at
linkage if all dependencies of the root binary module do not link against libstd
the same way.
proc_macros
configurable list of string, list of rust proc_macro crate dependencies
product_available
bool, whether this module should be allowed to be directly depended by other
modules with `product_specific: true` or `product_available: true`.
If set to true, an additional product variant will be built separately
that is limited to the set of libraries and headers that are exposed to
/product modules.
The product variant may be used with a different (newer) /system,
so it shouldn't have any unversioned runtime dependencies, or
make assumptions about the system that may not be true in the
future.
If set to false, this module becomes inaccessible from /product modules.
Different from the 'vendor_available' property, the modules with
vndk: {enabled: true} don't have to define 'product_available'. The VNDK
library without 'product_available' may not be depended on by any other
modules that has product variants including the product available VNDKs.
Nothing happens if BOARD_VNDK_VERSION isn't set in the BoardConfig.mk
and PRODUCT_PRODUCT_VNDK_VERSION isn't set.
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.arc
⊕cflags
⊕include_dirs
⊕shared_libs
⊕static_libs
⊕srcs
⊕whole_static_libs
⊕product_variables.binder32bit
⊕product_variables.build_from_text_stub
⊕product_variables.debuggable
⊕cflags
⊕cppflags
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕strip.all
⊕strip.keep_symbols
⊕strip.keep_symbols_and_debug_frame
⊕static_libs
⊕whole_static_libs
⊕shared_libs
⊕srcs
⊕product_variables.enforce_vintf_manifest
⊕product_variables.eng
⊕cflags
⊕cppflags
⊕sanitize.address
⊕product_variables.malloc_low_memory
⊕cflags
⊕shared_libs
⊕whole_static_libs
⊕static_libs
⊕srcs
⊕product_variables.malloc_pattern_fill_contents
⊕product_variables.malloc_zero_contents
⊕product_variables.native_coverage
⊕product_variables.override_rs_driver
⊕product_variables.platform_sdk_version
⊕product_variables.release_aidl_use_unfrozen
⊕cflags
⊕required
⊕vintf_fragment_modules
⊕product_variables.safestack
⊕product_variables.selinuxignoreneverallows
⊕product_variables.shipping_api_level
⊕product_variables.treble_linker_namespaces
⊕product_variables.uml
⊕product_variables.unbundled_build
⊕enabled
Configurable[bool]
Configurable[bool]
proptools.Configurable[bool]
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
ramdisk_available
bool, Make this module available when building for ramdisk.
On device without a dedicated recovery partition, the module is only
available after switching root into
/first_stage_ramdisk. To expose the module before switching root, install
the recovery variant instead.
recovery
bool, Whether this module is installed to recovery partition
recovery_available
bool, Make this module available when building for recovery
relative_install_path
string, install to a subdirectory of the default install path for the module
required
configurable list of string, names of other modules to install if this module is installed
⊕rlib
VariantLibraryProperties
enabled
bool
srcs
list of string
rlibs
configurable list of string, list of rust rlib crate dependencies
rustlibs
configurable list of string, list of rust automatic crate dependencies.
Rustlibs linkage is rlib for host targets and dylib for device targets.
⊕sanitize
enable AddressSanitizer, HWAddressSanitizer, and others.
address
bool
hwaddress
bool
memtag_heap
bool, Memory-tagging, only available on arm64
if diag.memtag unset or false, enables async memory tagging
fuzzer
bool
never
bool
⊕diag
Sanitizers to run in the diagnostic mode (as opposed to the release mode).
Replaces abort() on error with a human-readable error message.
Address and Thread sanitizers always run in diagnostic mode.
memtag_heap
bool, Memory-tagging, only available on arm64
requires sanitizer.memtag: true
if set, enables sync memory tagging
sdk_version
string, The API level that this module is built against. The APIs of this API level will be
visible at build time, but use of any APIs newer than min_sdk_version will render the
module unloadable on older devices. In the future it will be possible to weakly-link new
APIs, making the behavior match Java: such modules will load on older devices, but
calling new APIs on devices that do not support them will result in a crash.
This property has the same behavior as sdk_version does for Java modules. For those
familiar with Android Gradle, the property behaves similarly to how compileSdkVersion
does for Java code.
In addition, setting this property causes two variants to be built, one for the platform
and one for apps.
⊕shared
VariantLibraryProperties
enabled
bool
srcs
list of string
shared_libs
configurable list of string, list of C shared library dependencies
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
source_stem
string, filename for the generated source file (<source_stem>.rs). This field is required.
The inherited "stem" property sets the output filename for the generated library variants only.
⊕static
VariantLibraryProperties
enabled
bool
srcs
list of string
static_inline_library
string, module name of the corresponding cc_library_static which includes the static_inline wrapper
generated functions from bindgen. Must be used together with handle_static_inline.
If there are no static inline functions provided through the header file,
then bindgen (as of 0.69.2) will silently fail to output a .c file, and
the cc_library_static depending on this module will fail compilation.
static_libs
configurable list of string, list of static libraries that provide headers for this binding.
stdlibs
configurable list of string, list of Rust system library dependencies.
This is usually only needed when `no_stdlibs` is true, in which case it can be used to depend on system crates
like `core` and `alloc`.
stem
string, sets name of the output
⊕strip
none
bool, Device modules default to stripping enabled leaving mini debuginfo.
Host modules default to stripping disabled, but can be enabled by setting any other
strip boolean property.
all
bool, all forces stripping everything, including the mini debug info.
keep_symbols
bool, keep_symbols enables stripping but keeps all symbols.
keep_symbols_list
list of string, keep_symbols_list specifies a list of symbols to keep if keep_symbols is enabled.
If it is unset then all symbols are kept.
keep_symbols_and_debug_frame
bool, keep_symbols_and_debug_frame enables stripping but keeps all symbols and debug frames.
⊕stubs
*ast.SelectorExpr
Generate stubs to make this library accessible to APEXes.
Can only be set for modules producing shared libraries.
symbol_file
string, Relative path to the symbol map. The symbol map provides the list of
symbols that are exported for stubs variant of this library.
versions
list of string, List versions to generate stubs libs for. The version name "current" is always
implicitly added.
implementation_installable
bool, Whether to not require the implementation of the library to be installed if a
client of the stubs is installed. Defaults to true; set to false if the
implementation is made available by some other means, e.g. in a Microdroid
virtual machine.
suffix
string, append to name of output
sysroot
bool, Whether this library is part of the Rust toolchain sysroot.
system_dlkm_specific
bool, Install to partition system_dlkm when set to true.
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
compile_multilib
string
enabled
bool
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
use_expansive_default_srcs
bool, Set this to true to use an expansive default set of source file requirements
(all .rs, .h, .xml, and .md files in the module tree).
This is primarily for tracking sources for RBE purposes. Currently defaults
to true, though this may change in the future.
use_generic_config
bool, Set to true if this module must be generic and does not require product-specific information.
To be included in the system image, this property must be set to true.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_available
bool, whether this module should be allowed to be directly depended by other
modules with `vendor: true`, `proprietary: true`, or `vendor_available:true`.
If set to true, two variants will be built separately, one like
normal, and the other limited to the set of libraries and headers
that are exposed to /vendor modules.
The vendor variant may be used with a different (newer) /system,
so it shouldn't have any unversioned runtime dependencies, or
make assumptions about the system that may not be true in the
future.
If set to false, this module becomes inaccessible from /vendor modules.
The modules with vndk: {enabled: true} must define 'vendor_available'
to 'true'.
Nothing happens if BOARD_VNDK_VERSION isn't set in the BoardConfig.mk
vendor_dlkm_specific
bool, Install to partition vendor_dlkm when set to true.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vendor_ramdisk_available
bool, Make this module available when building for vendor ramdisk.
On device without a dedicated recovery partition, the module is only
available after switching root into
/first_stage_ramdisk. To expose the module before switching root, install
the recovery variant instead
version_script
string, Version script to pass to the linker. By default this will replace the
implicit rustc emitted version script to mirror expected behavior in CC.
This is only relevant for rust_ffi_shared modules which are exposing a
versioned C API.
vintf_fragment_modules
configurable list of string, vintf_fragment Modules required from this module.
vintf_fragments
configurable list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
whole_static_libs
configurable list of string, Similar to static_libs, but will bundle the static library dependency into a library. This is helpful
to avoid having to redeclare the dependency for dependents of this library, but in some cases may also
result in bloat if multiple dependencies all include the same static library whole.
The common use case for this is when the static library is unlikely to be a dependency of other modules to avoid
having to redeclare the static library dependency for every dependent module.
If you are not sure what to, for rust_library modules most static dependencies should go in static_libraries,
and for rust_ffi modules most static dependencies should go into whole_static_libraries.
For rust_ffi static variants, these libraries will be included in the resulting static library archive.
For rust_library rlib variants, these libraries will be bundled into the resulting rlib library. This will
include all of the static libraries symbols in any dylibs or binaries which use this rlib as well.
wrapper_src
string, The wrapper header file. By default this is assumed to be a C header unless the extension is ".hh" or ".hpp".
This is used to specify how to interpret the header and determines which '-std' flag to use by default.
If your C++ header must have some other extension, then the default behavior can be overridden by setting the
cpp_std property.
rust_bindgen_host
name
,
srcs
,
defaults
,
afdo
,
aliases
,
apex_available
,
apex_exclude
,
arch
,
bindgen_flag_files
,
bindgen_flags
,
bootstrap
,
c_std
,
cargo_env_compat
,
cargo_pkg_version
,
cfgs
,
cflags
,
clippy_lints
,
compile_multilib
,
cpp_std
,
cppflags
,
crate_name
,
crate_root
,
custom_bindgen
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
double_loadable
,
dylib
,
edition
,
enabled
,
exclude_from_recovery_snapshot
,
exclude_from_vendor_snapshot
,
export_include_dirs
,
extra_exported_symbols
,
features
,
flags
,
handle_static_inline
,
header_libs
,
host_cross_supported
,
host_required
,
include_dirs
,
init_rc
,
installable
,
ld_flags
,
licenses
,
lints
,
local_include_dirs
,
lto
,
min_sdk_version
,
multilib
,
native_bridge_supported
,
native_coverage
,
no_full_install
,
no_stdlibs
,
odm_available
,
odm_dlkm_specific
,
overrides
,
owner
,
prefer_rlib
,
proc_macros
,
product_available
,
product_specific
,
product_variables.arc
,
product_variables.binder32bit
,
product_variables.build_from_text_stub
,
product_variables.debuggable
,
product_variables.enforce_vintf_manifest
,
product_variables.eng
,
product_variables.malloc_low_memory
,
product_variables.malloc_pattern_fill_contents
,
product_variables.malloc_zero_contents
,
product_variables.native_coverage
,
product_variables.override_rs_driver
,
product_variables.platform_sdk_version
,
product_variables.release_aidl_use_unfrozen
,
product_variables.safestack
,
product_variables.selinuxignoreneverallows
,
product_variables.shipping_api_level
,
product_variables.treble_linker_namespaces
,
product_variables.uml
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
ramdisk_available
,
recovery
,
recovery_available
,
relative_install_path
,
required
,
rlib
,
rlibs
,
rustlibs
,
sanitize
,
sdk_version
,
shared
,
shared_libs
,
soc_specific
,
source_stem
,
static
,
static_inline_library
,
static_libs
,
stdlibs
,
stem
,
strip
,
stubs
,
suffix
,
sysroot
,
system_dlkm_specific
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
use_expansive_default_srcs
,
use_generic_config
,
vendor
,
vendor_available
,
vendor_dlkm_specific
,
vendor_ramdisk
,
vendor_ramdisk_available
,
version_script
,
vintf_fragment_modules
,
vintf_fragments
,
visibility
,
whole_static_libs
,
wrapper_src
name
string, The name of the module. Must be unique across all modules.
srcs
list of string, path to the source file that is the main entry point of the program (e.g. main.rs or lib.rs).
Only a single source file can be defined. Modules which generate source can be included by prefixing
the module name with ":", for example ":libfoo_bindgen"
If no source file is defined, a single generated source module can be defined to be used as the main source.
defaults
list of string
afdo
bool, Afdo allows developers self-service enroll for
automatic feedback-directed optimization using profile data.
aliases
list of string, Rust crate dependencies to rename. Each entry should be a string of the form "dependencyname:alias".
"dependencyname" here should be the name of the crate, not the Android module. This is
equivalent to writing `alias = { package = "dependencyname" }` in a `Cargo.toml`.
apex_available
list of string, Availability of this module in APEXes. Only the listed APEXes can contain this module. If
the module has stubs then other APEXes and the platform may access it through them
(subject to visibility).
"//apex_available:anyapex" is a pseudo APEX name that matches to any APEX.
"//apex_available:platform" refers to non-APEX partitions like "system.img".
Prefix pattern (com.foo.*) can be used to match with any APEX name with the prefix(com.foo.).
Default is ["//apex_available:platform"].
apex_exclude
bool, Deprecated - exclude this rust_ffi target from being included in APEXes.
TODO(b/362509506): remove this once all apex_exclude uses are switched to stubs.
arch
interface
bindgen_flag_files
list of string, list of files containing extra bindgen flags
bindgen_flags
list of string, list of bindgen-specific flags and options
bootstrap
bool, Allows this module to use non-APEX version of libraries. Useful
for building binaries that are started before APEXes are activated.
c_std
string, C standard version to use. Can be a specific version (such as "gnu11"),
"experimental" (which will use draft versions like C1x when available),
or the empty string (which will use the default).
If this is set, the file extension will be ignored and this will be used as the std version value. Setting this
to "default" will use the build system default version. This cannot be set at the same time as cpp_std.
cargo_env_compat
bool, Enables emitting certain Cargo environment variables. Only intended to be used for compatibility purposes.
Will set CARGO_CRATE_NAME to the crate_name property's value.
Will set CARGO_BIN_NAME to the output filename value without the extension.
cargo_pkg_version
string, If cargo_env_compat is true, sets the CARGO_PKG_VERSION env var to this value.
cfgs
configurable list of string, list of configuration options to enable for this crate. To enable features, use the "features" property.
cflags
configurable list of string, list of clang flags required to correctly interpret the headers.
clippy_lints
string, name of the lint set that should be used to validate this module.
Possible values are "default" (for using a sensible set of lints
depending on the module's location), "android" (for the strictest
lint set that applies to all Android platform code), "vendor" (for a
relaxed set) and "none" (to disable the execution of clippy). The
default value is "default". See also the `lints` property.
Default: none
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
cpp_std
string, C++ standard version to use. Can be a specific version (such as
"gnu++11"), "experimental" (which will use draft versions like C++1z when
available), or the empty string (which will use the default).
If this is set, the file extension will be ignored and this will be used as the std version value. Setting this
to "default" will use the build system default version. This cannot be set at the same time as c_std.
cppflags
configurable list of string, list of c++ specific clang flags required to correctly interpret the headers.
This is provided primarily to make sure cppflags defined in cc_defaults are pulled in.
crate_name
string, crate name, used for the library variant of this source provider. See additional details in rust_library.
crate_root
string, Entry point that is passed to rustc to begin the compilation. E.g. main.rs or lib.rs.
When this property is set,
* sandboxing is enabled for this module, and
* the srcs attribute is interpreted as a list of all source files potentially
used in compilation, including the entrypoint, and
* compile_data can be used to add additional files used in compilation that
not directly used as source files.
custom_bindgen
string, module name of a custom binary/script which should be used instead of the 'bindgen' binary. This custom
binary must expect arguments in a similar fashion to bindgen, e.g.
"my_bindgen [flags] wrapper_header.h -o [output_path] -- [clang flags]"
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
prepend_artifact_with_product
bool, If true, then the artifact file will be prepended with <product name>-. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be coral-foo.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
double_loadable
bool, whether this module is capable of being loaded with other instance
(possibly an older version) of the same module in the same process.
Currently, a shared library that is a member of VNDK (vndk: {enabled: true})
can be double loaded in a vendor process if the library is also a
(direct and indirect) dependency of an LLNDK library. Such libraries must be
explicitly marked as `double_loadable: true` by the owner, or the dependency
from the LLNDK lib should be cut if the lib is not designed to be double loaded.
⊕dylib
VariantLibraryProperties
enabled
bool
srcs
list of string
edition
string, specific rust edition that should be used if the default version is not desired
enabled
configurable bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
exclude_from_recovery_snapshot
bool, Normally Soong uses the directory structure to decide which modules
should be included (framework) or excluded (non-framework) from the
different snapshots (vendor, recovery, etc.), but this property
allows a partner to exclude a module normally thought of as a
framework module from the recovery snapshot.
exclude_from_vendor_snapshot
bool, Normally Soong uses the directory structure to decide which modules
should be included (framework) or excluded (non-framework) from the
different snapshots (vendor, recovery, etc.), but this property
allows a partner to exclude a module normally thought of as a
framework module from the vendor snapshot.
export_include_dirs
list of string, path to include directories to export to cc_* modules, only relevant for static/shared variants.
features
configurable list of string, list of features to enable for this crate
flags
list of string, flags to pass to rustc. To enable configuration options or features, use the "cfgs" or "features" properties.
handle_static_inline
bool, flag to indicate if bindgen should handle `static inline` functions (default is false).
If true, Static_inline_library must be set.
host_cross_supported
bool, If set to true, build a variant of the module for the host cross. Defaults to true.
host_required
list of string, names of other modules to install on host if this module is installed
include_dirs
list of string, TODO: Remove this when all instances of Include_dirs have been removed from rust_ffi modules.
path to include directories to pass to cc_* modules, only relevant for static/shared variants (deprecated, use export_include_dirs instead).
init_rc
configurable list of string, init.rc files to be installed if this module is installed
installable
bool
ld_flags
list of string, flags to pass to the linker
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
lints
string, name of the lint set that should be used to validate this module.
Possible values are "default" (for using a sensible set of lints
depending on the module's location), "android" (for the strictest
lint set that applies to all Android platform code), "vendor" (for
a relaxed set) and "none" (for ignoring all lint warnings and
errors). The default value is "default".
Default: none
local_include_dirs
configurable list of string, list of directories relative to the Blueprints file that will
be added to the include path using -I
⊕lto
Control whether LTO is used for the final (Rust) linkage. This does not impact
cross-language LTO.
thin
bool, Whether thin LTO should be enabled. By default this is true.
LTO provides such a large code size benefit for Rust, this should always
be enabled for production builds unless there's a clear need to disable it.
min_sdk_version
string, Minimum OS API level supported by this C or C++ module. This property becomes the value
of the __ANDROID_API__ macro. When the C or C++ module is included in an APEX or an APK,
this property is also used to ensure that the min_sdk_version of the containing module is
not older (i.e. less) than this module's min_sdk_version. When not set, this property
defaults to the value of sdk_version. When this is set to "apex_inherit", this tracks
min_sdk_version of the containing APEX. When the module
is not built for an APEX, "apex_inherit" defaults to sdk_version.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
native_coverage
bool
no_full_install
bool, When set to true, this module is not installed to the full install path (ex: under
out/target/product/<name>/<partition>). It can be installed only to the packaging
modules like android_filesystem.
no_stdlibs
bool, whether to suppress inclusion of standard crates - defaults to false
odm_available
bool, This is the same as the "vendor_available" except that the install path
of the vendor variant is /odm or /vendor/odm.
By replacing "vendor_available: true" with "odm_available: true", the
module will install its vendor variant to the /odm partition or /vendor/odm.
As the modules with "odm_available: true" still create the vendor variants,
they can link to the other vendor modules as the vendor_available modules do.
Also, the vendor modules can link to odm_available modules.
It may not be used for VNDK modules.
odm_dlkm_specific
bool, Install to partition odm_dlkm when set to true.
overrides
list of string, List of module names that are prevented from being installed when this module gets
installed.
owner
string, vendor who owns this module
prefer_rlib
bool, Change the rustlibs linkage to select rlib linkage by default for device targets.
Also link libstd as an rlib as well on device targets.
Note: This is the default behavior for host targets.
This is primarily meant for rust_binary and rust_ffi modules where the default
linkage of libstd might need to be overridden in some use cases. This should
generally be avoided with other module types since it may cause collisions at
linkage if all dependencies of the root binary module do not link against libstd
the same way.
proc_macros
configurable list of string, list of rust proc_macro crate dependencies
product_available
bool, whether this module should be allowed to be directly depended by other
modules with `product_specific: true` or `product_available: true`.
If set to true, an additional product variant will be built separately
that is limited to the set of libraries and headers that are exposed to
/product modules.
The product variant may be used with a different (newer) /system,
so it shouldn't have any unversioned runtime dependencies, or
make assumptions about the system that may not be true in the
future.
If set to false, this module becomes inaccessible from /product modules.
Different from the 'vendor_available' property, the modules with
vndk: {enabled: true} don't have to define 'product_available'. The VNDK
library without 'product_available' may not be depended on by any other
modules that has product variants including the product available VNDKs.
Nothing happens if BOARD_VNDK_VERSION isn't set in the BoardConfig.mk
and PRODUCT_PRODUCT_VNDK_VERSION isn't set.
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.arc
⊕cflags
⊕include_dirs
⊕shared_libs
⊕static_libs
⊕srcs
⊕whole_static_libs
⊕product_variables.binder32bit
⊕product_variables.build_from_text_stub
⊕product_variables.debuggable
⊕cflags
⊕cppflags
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕strip.all
⊕strip.keep_symbols
⊕strip.keep_symbols_and_debug_frame
⊕static_libs
⊕whole_static_libs
⊕shared_libs
⊕srcs
⊕product_variables.enforce_vintf_manifest
⊕product_variables.eng
⊕cflags
⊕cppflags
⊕sanitize.address
⊕product_variables.malloc_low_memory
⊕cflags
⊕shared_libs
⊕whole_static_libs
⊕static_libs
⊕srcs
⊕product_variables.malloc_pattern_fill_contents
⊕product_variables.malloc_zero_contents
⊕product_variables.native_coverage
⊕product_variables.override_rs_driver
⊕product_variables.platform_sdk_version
⊕product_variables.release_aidl_use_unfrozen
⊕cflags
⊕required
⊕vintf_fragment_modules
⊕product_variables.safestack
⊕product_variables.selinuxignoreneverallows
⊕product_variables.shipping_api_level
⊕product_variables.treble_linker_namespaces
⊕product_variables.uml
⊕product_variables.unbundled_build
⊕enabled
Configurable[bool]
Configurable[bool]
proptools.Configurable[bool]
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
ramdisk_available
bool, Make this module available when building for ramdisk.
On device without a dedicated recovery partition, the module is only
available after switching root into
/first_stage_ramdisk. To expose the module before switching root, install
the recovery variant instead.
recovery
bool, Whether this module is installed to recovery partition
recovery_available
bool, Make this module available when building for recovery
relative_install_path
string, install to a subdirectory of the default install path for the module
required
configurable list of string, names of other modules to install if this module is installed
⊕rlib
VariantLibraryProperties
enabled
bool
srcs
list of string
rlibs
configurable list of string, list of rust rlib crate dependencies
rustlibs
configurable list of string, list of rust automatic crate dependencies.
Rustlibs linkage is rlib for host targets and dylib for device targets.
⊕sanitize
enable AddressSanitizer, HWAddressSanitizer, and others.
address
bool
hwaddress
bool
memtag_heap
bool, Memory-tagging, only available on arm64
if diag.memtag unset or false, enables async memory tagging
fuzzer
bool
never
bool
⊕diag
Sanitizers to run in the diagnostic mode (as opposed to the release mode).
Replaces abort() on error with a human-readable error message.
Address and Thread sanitizers always run in diagnostic mode.
memtag_heap
bool, Memory-tagging, only available on arm64
requires sanitizer.memtag: true
if set, enables sync memory tagging
sdk_version
string, The API level that this module is built against. The APIs of this API level will be
visible at build time, but use of any APIs newer than min_sdk_version will render the
module unloadable on older devices. In the future it will be possible to weakly-link new
APIs, making the behavior match Java: such modules will load on older devices, but
calling new APIs on devices that do not support them will result in a crash.
This property has the same behavior as sdk_version does for Java modules. For those
familiar with Android Gradle, the property behaves similarly to how compileSdkVersion
does for Java code.
In addition, setting this property causes two variants to be built, one for the platform
and one for apps.
⊕shared
VariantLibraryProperties
enabled
bool
srcs
list of string
shared_libs
configurable list of string, list of shared libraries that provide headers for this binding.
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
source_stem
string, filename for the generated source file (<source_stem>.rs). This field is required.
The inherited "stem" property sets the output filename for the generated library variants only.
⊕static
VariantLibraryProperties
enabled
bool
srcs
list of string
static_inline_library
string, module name of the corresponding cc_library_static which includes the static_inline wrapper
generated functions from bindgen. Must be used together with handle_static_inline.
If there are no static inline functions provided through the header file,
then bindgen (as of 0.69.2) will silently fail to output a .c file, and
the cc_library_static depending on this module will fail compilation.
static_libs
configurable list of string, list of C static library dependencies. These dependencies do not normally propagate to dependents
and may need to be redeclared. See whole_static_libs for bundling static dependencies into a library.
stdlibs
configurable list of string, list of Rust system library dependencies.
This is usually only needed when `no_stdlibs` is true, in which case it can be used to depend on system crates
like `core` and `alloc`.
stem
string, sets name of the output
⊕strip
none
bool, Device modules default to stripping enabled leaving mini debuginfo.
Host modules default to stripping disabled, but can be enabled by setting any other
strip boolean property.
all
bool, all forces stripping everything, including the mini debug info.
keep_symbols
bool, keep_symbols enables stripping but keeps all symbols.
keep_symbols_list
list of string, keep_symbols_list specifies a list of symbols to keep if keep_symbols is enabled.
If it is unset then all symbols are kept.
keep_symbols_and_debug_frame
bool, keep_symbols_and_debug_frame enables stripping but keeps all symbols and debug frames.
⊕stubs
*ast.SelectorExpr
Generate stubs to make this library accessible to APEXes.
Can only be set for modules producing shared libraries.
symbol_file
string, Relative path to the symbol map. The symbol map provides the list of
symbols that are exported for stubs variant of this library.
versions
list of string, List versions to generate stubs libs for. The version name "current" is always
implicitly added.
implementation_installable
bool, Whether to not require the implementation of the library to be installed if a
client of the stubs is installed. Defaults to true; set to false if the
implementation is made available by some other means, e.g. in a Microdroid
virtual machine.
suffix
string, append to name of output
sysroot
bool, Whether this library is part of the Rust toolchain sysroot.
system_dlkm_specific
bool, Install to partition system_dlkm when set to true.
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
compile_multilib
string
enabled
bool
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
use_expansive_default_srcs
bool, Set this to true to use an expansive default set of source file requirements
(all .rs, .h, .xml, and .md files in the module tree).
This is primarily for tracking sources for RBE purposes. Currently defaults
to true, though this may change in the future.
use_generic_config
bool, Set to true if this module must be generic and does not require product-specific information.
To be included in the system image, this property must be set to true.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_available
bool, whether this module should be allowed to be directly depended by other
modules with `vendor: true`, `proprietary: true`, or `vendor_available:true`.
If set to true, two variants will be built separately, one like
normal, and the other limited to the set of libraries and headers
that are exposed to /vendor modules.
The vendor variant may be used with a different (newer) /system,
so it shouldn't have any unversioned runtime dependencies, or
make assumptions about the system that may not be true in the
future.
If set to false, this module becomes inaccessible from /vendor modules.
The modules with vndk: {enabled: true} must define 'vendor_available'
to 'true'.
Nothing happens if BOARD_VNDK_VERSION isn't set in the BoardConfig.mk
vendor_dlkm_specific
bool, Install to partition vendor_dlkm when set to true.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vendor_ramdisk_available
bool, Make this module available when building for vendor ramdisk.
On device without a dedicated recovery partition, the module is only
available after switching root into
/first_stage_ramdisk. To expose the module before switching root, install
the recovery variant instead
version_script
string, Version script to pass to the linker. By default this will replace the
implicit rustc emitted version script to mirror expected behavior in CC.
This is only relevant for rust_ffi_shared modules which are exposing a
versioned C API.
vintf_fragment_modules
configurable list of string, vintf_fragment Modules required from this module.
vintf_fragments
configurable list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
whole_static_libs
configurable list of string, Similar to static_libs, but will bundle the static library dependency into a library. This is helpful
to avoid having to redeclare the dependency for dependents of this library, but in some cases may also
result in bloat if multiple dependencies all include the same static library whole.
The common use case for this is when the static library is unlikely to be a dependency of other modules to avoid
having to redeclare the static library dependency for every dependent module.
If you are not sure what to, for rust_library modules most static dependencies should go in static_libraries,
and for rust_ffi modules most static dependencies should go into whole_static_libraries.
For rust_ffi static variants, these libraries will be included in the resulting static library archive.
For rust_library rlib variants, these libraries will be bundled into the resulting rlib library. This will
include all of the static libraries symbols in any dylibs or binaries which use this rlib as well.
wrapper_src
string, The wrapper header file. By default this is assumed to be a C header unless the extension is ".hh" or ".hpp".
This is used to specify how to interpret the header and determines which '-std' flag to use by default.
If your C++ header must have some other extension, then the default behavior can be overridden by setting the
cpp_std property.
rust_defaults
name
,
srcs
,
defaults
,
host_supported
,
device_supported
,
afdo
,
aliases
,
apex_available
,
apex_exclude
,
arch
,
auto_gen_config
,
bindgen_flag_files
,
bindgen_flags
,
bootstrap
,
c_std
,
cargo_env_compat
,
cargo_pkg_version
,
cfgs
,
cflags
,
clippy_lints
,
compile_multilib
,
corpus
,
cpp_std
,
cppflags
,
crate_name
,
crate_root
,
crt
,
custom_bindgen
,
data
,
data_bins
,
data_libs
,
debug_ramdisk
,
defaults_visibility
,
device_common_corpus
,
device_common_data
,
device_first_data
,
device_specific
,
dictionary
,
dist
,
dists
,
double_loadable
,
dylib
,
edition
,
enabled
,
exclude_from_recovery_snapshot
,
exclude_from_vendor_snapshot
,
export_include_dirs
,
extra_exported_symbols
,
features
,
flags
,
force_use_prebuilt
,
fuzz_config
,
fuzzing_frameworks
,
handle_static_inline
,
header_libs
,
host_common_data
,
host_required
,
include_dirs
,
init_rc
,
installable
,
ld_flags
,
licenses
,
link_dirs
,
lints
,
local_include_dirs
,
lto
,
min_sdk_version
,
multilib
,
native_bridge_supported
,
native_coverage
,
no_full_install
,
no_named_install_directory
,
no_stdlibs
,
odm_available
,
odm_dlkm_specific
,
overrides
,
owner
,
prefer_rlib
,
proc_macros
,
product_available
,
product_specific
,
product_variables.arc
,
product_variables.binder32bit
,
product_variables.build_from_text_stub
,
product_variables.debuggable
,
product_variables.enforce_vintf_manifest
,
product_variables.eng
,
product_variables.malloc_low_memory
,
product_variables.malloc_pattern_fill_contents
,
product_variables.malloc_zero_contents
,
product_variables.native_coverage
,
product_variables.override_rs_driver
,
product_variables.platform_sdk_version
,
product_variables.release_aidl_use_unfrozen
,
product_variables.safestack
,
product_variables.selinuxignoreneverallows
,
product_variables.shipping_api_level
,
product_variables.treble_linker_namespaces
,
product_variables.uml
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
ramdisk_available
,
recovery
,
recovery_available
,
relative_install_path
,
require_root
,
required
,
rlib
,
rlibs
,
rustlibs
,
sanitize
,
sdk_version
,
shared
,
shared_libs
,
soc_specific
,
source_stem
,
static
,
static_executable
,
static_inline_library
,
static_libs
,
stdlibs
,
stem
,
stubs
,
suffix
,
sysroot
,
system_dlkm_specific
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
test_config
,
test_config_template
,
test_harness
,
test_options
,
test_suites
,
use_expansive_default_srcs
,
use_generic_config
,
vendor
,
vendor_available
,
vendor_dlkm_specific
,
vendor_ramdisk
,
vendor_ramdisk_available
,
version_script
,
vintf_fragment_modules
,
vintf_fragments
,
visibility
,
whole_static_libs
,
wrapper_src
name
string, The name of the module. Must be unique across all modules.
srcs
list of string, path to the prebuilt file
defaults
list of string
host_supported
bool, If set to true, build a variant of the module for the host. Defaults to false.
device_supported
bool, If set to true, build a variant of the module for the device. Defaults to true.
afdo
bool, Afdo allows developers self-service enroll for
automatic feedback-directed optimization using profile data.
aliases
list of string, Rust crate dependencies to rename. Each entry should be a string of the form "dependencyname:alias".
"dependencyname" here should be the name of the crate, not the Android module. This is
equivalent to writing `alias = { package = "dependencyname" }` in a `Cargo.toml`.
apex_available
list of string, Availability of this module in APEXes. Only the listed APEXes can contain this module. If
the module has stubs then other APEXes and the platform may access it through them
(subject to visibility).
"//apex_available:anyapex" is a pseudo APEX name that matches to any APEX.
"//apex_available:platform" refers to non-APEX partitions like "system.img".
Prefix pattern (com.foo.*) can be used to match with any APEX name with the prefix(com.foo.).
Default is ["//apex_available:platform"].
apex_exclude
bool, Deprecated - exclude this rust_ffi target from being included in APEXes.
TODO(b/362509506): remove this once all apex_exclude uses are switched to stubs.
arch
interface
auto_gen_config
bool, Flag to indicate whether or not to create test config automatically. If AndroidTest.xml
doesn't exist next to the Android.bp, this attribute doesn't need to be set to true
explicitly.
bindgen_flag_files
list of string, list of files containing extra bindgen flags
bindgen_flags
list of string, list of bindgen-specific flags and options
bootstrap
bool, Allows this module to use non-APEX version of libraries. Useful
for building binaries that are started before APEXes are activated.
c_std
string, C standard version to use. Can be a specific version (such as "gnu11"),
"experimental" (which will use draft versions like C1x when available),
or the empty string (which will use the default).
If this is set, the file extension will be ignored and this will be used as the std version value. Setting this
to "default" will use the build system default version. This cannot be set at the same time as cpp_std.
cargo_env_compat
bool, Enables emitting certain Cargo environment variables. Only intended to be used for compatibility purposes.
Will set CARGO_CRATE_NAME to the crate_name property's value.
Will set CARGO_BIN_NAME to the output filename value without the extension.
cargo_pkg_version
string, If cargo_env_compat is true, sets the CARGO_PKG_VERSION env var to this value.
cfgs
configurable list of string, list of configuration options to enable for this crate. To enable features, use the "features" property.
cflags
configurable list of string, list of clang flags required to correctly interpret the headers.
clippy_lints
string, name of the lint set that should be used to validate this module.
Possible values are "default" (for using a sensible set of lints
depending on the module's location), "android" (for the strictest
lint set that applies to all Android platform code), "vendor" (for a
relaxed set) and "none" (to disable the execution of clippy). The
default value is "default". See also the `lints` property.
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
corpus
list of string, Optional list of seed files to be installed to the fuzz target's output
directory.
cpp_std
string, C++ standard version to use. Can be a specific version (such as
"gnu++11"), "experimental" (which will use draft versions like C++1z when
available), or the empty string (which will use the default).
If this is set, the file extension will be ignored and this will be used as the std version value. Setting this
to "default" will use the build system default version. This cannot be set at the same time as c_std.
cppflags
configurable list of string, list of c++ specific clang flags required to correctly interpret the headers.
This is provided primarily to make sure cppflags defined in cc_defaults are pulled in.
crate_name
string, crate name, required for modules which produce Rust libraries: rust_library, rust_ffi and SourceProvider
modules which create library variants (rust_bindgen). This must be the expected extern crate name used in
source, and is required to conform to an enforced format matching library output files (if the output file is
lib<someName><suffix>, the crate_name property must be <someName>).
crate_root
string, Entry point that is passed to rustc to begin the compilation. E.g. main.rs or lib.rs.
When this property is set,
* sandboxing is enabled for this module, and
* the srcs attribute is interpreted as a list of all source files potentially
used in compilation, including the entrypoint, and
* compile_data can be used to add additional files used in compilation that
not directly used as source files.
crt
bool, Indicates that this module is a CRT object. CRT objects will be split
into a variant per-API level between min_sdk_version and current.
custom_bindgen
string, module name of a custom binary/script which should be used instead of the 'bindgen' binary. This custom
binary must expect arguments in a similar fashion to bindgen, e.g.
"my_bindgen [flags] wrapper_header.h -o [output_path] -- [clang flags]"
data
list of string, list of files or filegroup modules that provide data that should be installed alongside
the test
data_bins
list of string, list of binary modules that should be installed alongside the test
data_libs
list of string, list of shared library modules that should be installed alongside the test
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
defaults_visibility
list of string, Controls the visibility of the defaults module itself.
device_common_corpus
list of string, Same as corpus, but adds dependencies on module references using the device's os variant
and the common arch variant.
device_common_data
list of string, Same as data, but adds dependencies on modules using the device's os variant, and common
architecture's variant. Can be useful to add device-built apps to the data of a host
test.
device_first_data
list of string, Same as data, but adds dependencies on modules using the device's os variant, and the
device's first architecture's variant. Can be useful to add device-built apps to the data
of a host test.
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
dictionary
string, Optional dictionary to be installed to the fuzz target's output directory.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
prepend_artifact_with_product
bool, If true, then the artifact file will be prepended with <product name>-. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be coral-foo.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
double_loadable
bool, whether this module is capable of being loaded with other instance
(possibly an older version) of the same module in the same process.
Currently, a shared library that is a member of VNDK (vndk: {enabled: true})
can be double loaded in a vendor process if the library is also a
(direct and indirect) dependency of an LLNDK library. Such libraries must be
explicitly marked as `double_loadable: true` by the owner, or the dependency
from the LLNDK lib should be cut if the lib is not designed to be double loaded.
⊕dylib
VariantLibraryProperties
enabled
bool
srcs
list of string
edition
string, specific rust edition that should be used if the default version is not desired
enabled
configurable bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
exclude_from_recovery_snapshot
bool, Normally Soong uses the directory structure to decide which modules
should be included (framework) or excluded (non-framework) from the
different snapshots (vendor, recovery, etc.), but this property
allows a partner to exclude a module normally thought of as a
framework module from the recovery snapshot.
exclude_from_vendor_snapshot
bool, Normally Soong uses the directory structure to decide which modules
should be included (framework) or excluded (non-framework) from the
different snapshots (vendor, recovery, etc.), but this property
allows a partner to exclude a module normally thought of as a
framework module from the vendor snapshot.
export_include_dirs
list of string, path to include directories to export to cc_* modules, only relevant for static/shared variants.
features
configurable list of string, list of features to enable for this crate
flags
list of string, flags to pass to rustc. To enable configuration options or features, use the "cfgs" or "features" properties.
force_use_prebuilt
bool
fuzz_config
FuzzConfig, Config for running the target on fuzzing infrastructure.
fuzzing_frameworks
FuzzFrameworks, Define the fuzzing frameworks this fuzz target can be built for. If
empty then the fuzz target will be available to be built for all fuzz
frameworks available
handle_static_inline
bool, flag to indicate if bindgen should handle `static inline` functions (default is false).
If true, Static_inline_library must be set.
host_common_data
list of string, Same as data, but will add dependencies on modules using the host's os variation and
the common arch variation. Useful for a device test that wants to depend on a host
module, for example to include a custom Tradefed test runner.
host_required
list of string, names of other modules to install on host if this module is installed
include_dirs
list of string, TODO: Remove this when all instances of Include_dirs have been removed from rust_ffi modules.
path to include directories to pass to cc_* modules, only relevant for static/shared variants (deprecated, use export_include_dirs instead).
init_rc
configurable list of string, init.rc files to be installed if this module is installed
installable
bool
ld_flags
list of string, flags to pass to the linker
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
link_dirs
list of string, directories containing associated rlib dependencies
lints
string, name of the lint set that should be used to validate this module.
Possible values are "default" (for using a sensible set of lints
depending on the module's location), "android" (for the strictest
lint set that applies to all Android platform code), "vendor" (for
a relaxed set) and "none" (for ignoring all lint warnings and
errors). The default value is "default".
local_include_dirs
configurable list of string, list of directories relative to the Blueprints file that will
be added to the include path using -I
⊕lto
Control whether LTO is used for the final (Rust) linkage. This does not impact
cross-language LTO.
thin
bool, Whether thin LTO should be enabled. By default this is true.
LTO provides such a large code size benefit for Rust, this should always
be enabled for production builds unless there's a clear need to disable it.
min_sdk_version
string, Minimum OS API level supported by this C or C++ module. This property becomes the value
of the __ANDROID_API__ macro. When the C or C++ module is included in an APEX or an APK,
this property is also used to ensure that the min_sdk_version of the containing module is
not older (i.e. less) than this module's min_sdk_version. When not set, this property
defaults to the value of sdk_version. When this is set to "apex_inherit", this tracks
min_sdk_version of the containing APEX. When the module
is not built for an APEX, "apex_inherit" defaults to sdk_version.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
native_coverage
bool
no_full_install
bool, When set to true, this module is not installed to the full install path (ex: under
out/target/product/<name>/<partition>). It can be installed only to the packaging
modules like android_filesystem.
no_named_install_directory
bool, Disables the creation of a test-specific directory when used with
relative_install_path. Useful if several tests need to be in the same
directory.
no_stdlibs
bool, whether to suppress inclusion of standard crates - defaults to false
odm_available
bool, This is the same as the "vendor_available" except that the install path
of the vendor variant is /odm or /vendor/odm.
By replacing "vendor_available: true" with "odm_available: true", the
module will install its vendor variant to the /odm partition or /vendor/odm.
As the modules with "odm_available: true" still create the vendor variants,
they can link to the other vendor modules as the vendor_available modules do.
Also, the vendor modules can link to odm_available modules.
It may not be used for VNDK modules.
odm_dlkm_specific
bool, Install to partition odm_dlkm when set to true.
overrides
list of string, List of module names that are prevented from being installed when this module gets
installed.
owner
string, vendor who owns this module
prefer_rlib
bool, Change the rustlibs linkage to select rlib linkage by default for device targets.
Also link libstd as an rlib as well on device targets.
Note: This is the default behavior for host targets.
This is primarily meant for rust_binary and rust_ffi modules where the default
linkage of libstd might need to be overridden in some use cases. This should
generally be avoided with other module types since it may cause collisions at
linkage if all dependencies of the root binary module do not link against libstd
the same way.
proc_macros
configurable list of string, list of rust proc_macro crate dependencies
product_available
bool, whether this module should be allowed to be directly depended by other
modules with `product_specific: true` or `product_available: true`.
If set to true, an additional product variant will be built separately
that is limited to the set of libraries and headers that are exposed to
/product modules.
The product variant may be used with a different (newer) /system,
so it shouldn't have any unversioned runtime dependencies, or
make assumptions about the system that may not be true in the
future.
If set to false, this module becomes inaccessible from /product modules.
Different from the 'vendor_available' property, the modules with
vndk: {enabled: true} don't have to define 'product_available'. The VNDK
library without 'product_available' may not be depended on by any other
modules that has product variants including the product available VNDKs.
Nothing happens if BOARD_VNDK_VERSION isn't set in the BoardConfig.mk
and PRODUCT_PRODUCT_VNDK_VERSION isn't set.
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.arc
⊕cflags
⊕include_dirs
⊕shared_libs
⊕static_libs
⊕srcs
⊕whole_static_libs
⊕product_variables.binder32bit
⊕product_variables.build_from_text_stub
⊕product_variables.debuggable
⊕cflags
⊕cppflags
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕static_libs
⊕whole_static_libs
⊕shared_libs
⊕srcs
⊕product_variables.enforce_vintf_manifest
⊕product_variables.eng
⊕cflags
⊕cppflags
⊕sanitize.address
⊕product_variables.malloc_low_memory
⊕cflags
⊕shared_libs
⊕whole_static_libs
⊕static_libs
⊕srcs
⊕product_variables.malloc_pattern_fill_contents
⊕product_variables.malloc_zero_contents
⊕product_variables.native_coverage
⊕product_variables.override_rs_driver
⊕product_variables.platform_sdk_version
⊕product_variables.release_aidl_use_unfrozen
⊕cflags
⊕required
⊕vintf_fragment_modules
⊕product_variables.safestack
⊕product_variables.selinuxignoreneverallows
⊕product_variables.shipping_api_level
⊕product_variables.treble_linker_namespaces
⊕product_variables.uml
⊕product_variables.unbundled_build
⊕enabled
Configurable[bool]
Configurable[bool]
proptools.Configurable[bool]
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
ramdisk_available
bool, Make this module available when building for ramdisk.
On device without a dedicated recovery partition, the module is only
available after switching root into
/first_stage_ramdisk. To expose the module before switching root, install
the recovery variant instead.
recovery
bool, Whether this module is installed to recovery partition
recovery_available
bool, Make this module available when building for recovery
relative_install_path
string, install to a subdirectory of the default install path for the module
require_root
bool, Add RootTargetPreparer to auto generated test config. This guarantees the test to run
with root permission.
required
configurable list of string, names of other modules to install if this module is installed
⊕rlib
VariantLibraryProperties
enabled
bool
srcs
list of string
rlibs
configurable list of string, list of rust rlib crate dependencies
rustlibs
configurable list of string, list of rust automatic crate dependencies.
Rustlibs linkage is rlib for host targets and dylib for device targets.
⊕sanitize
enable AddressSanitizer, HWAddressSanitizer, and others.
address
bool
hwaddress
bool
memtag_heap
bool, Memory-tagging, only available on arm64
if diag.memtag unset or false, enables async memory tagging
fuzzer
bool
never
bool
⊕diag
Sanitizers to run in the diagnostic mode (as opposed to the release mode).
Replaces abort() on error with a human-readable error message.
Address and Thread sanitizers always run in diagnostic mode.
memtag_heap
bool, Memory-tagging, only available on arm64
requires sanitizer.memtag: true
if set, enables sync memory tagging
sdk_version
string, The API level that this module is built against. The APIs of this API level will be
visible at build time, but use of any APIs newer than min_sdk_version will render the
module unloadable on older devices. In the future it will be possible to weakly-link new
APIs, making the behavior match Java: such modules will load on older devices, but
calling new APIs on devices that do not support them will result in a crash.
This property has the same behavior as sdk_version does for Java modules. For those
familiar with Android Gradle, the property behaves similarly to how compileSdkVersion
does for Java code.
In addition, setting this property causes two variants to be built, one for the platform
and one for apps.
⊕shared
VariantLibraryProperties
enabled
bool
srcs
list of string
shared_libs
configurable list of string, list of C shared library dependencies
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
source_stem
string, filename for the generated source file (<source_stem>.rs). This field is required.
The inherited "stem" property sets the output filename for the generated library variants only.
⊕static
VariantLibraryProperties
enabled
bool
srcs
list of string
static_executable
bool, Builds this binary as a static binary. Implies prefer_rlib true.
Static executables currently only support for bionic targets. Non-bionic targets will not produce a fully static
binary, but will still implicitly imply prefer_rlib true.
static_inline_library
string, module name of the corresponding cc_library_static which includes the static_inline wrapper
generated functions from bindgen. Must be used together with handle_static_inline.
If there are no static inline functions provided through the header file,
then bindgen (as of 0.69.2) will silently fail to output a .c file, and
the cc_library_static depending on this module will fail compilation.
static_libs
configurable list of string, list of static libraries that provide headers for this binding.
stdlibs
configurable list of string, list of Rust system library dependencies.
This is usually only needed when `no_stdlibs` is true, in which case it can be used to depend on system crates
like `core` and `alloc`.
stem
string, sets name of the output
⊕stubs
*ast.SelectorExpr
Generate stubs to make this library accessible to APEXes.
Can only be set for modules producing shared libraries.
symbol_file
string, Relative path to the symbol map. The symbol map provides the list of
symbols that are exported for stubs variant of this library.
versions
list of string, List versions to generate stubs libs for. The version name "current" is always
implicitly added.
implementation_installable
bool, Whether to not require the implementation of the library to be installed if a
client of the stubs is installed. Defaults to true; set to false if the
implementation is made available by some other means, e.g. in a Microdroid
virtual machine.
suffix
string, append to name of output
sysroot
bool, Whether this library is part of the Rust toolchain sysroot.
system_dlkm_specific
bool, Install to partition system_dlkm when set to true.
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
compile_multilib
string
enabled
bool
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
test_config
string, the name of the test configuration (for example "AndroidBenchmark.xml") that should be
installed with the module.
test_config_template
string, the name of the test configuration template (for example "AndroidBenchmarkTemplate.xml") that
should be installed with the module.
test_harness
bool, if set, build with the standard Rust test harness. Defaults to true.
⊕test_options
*ast.SelectorExpr
Test options.
unit_test
bool, If the test is a hostside (no device required) unittest that shall be run
during presubmit check.
tags
list of string, Tags provide additional metadata to customize test execution by downstream
test runners. The tags have no special meaning to Soong.
test_suites
list of string, list of compatibility suites (for example "cts", "vts") that the module should be
installed into.
use_expansive_default_srcs
bool, Set this to true to use an expansive default set of source file requirements
(all .rs, .h, .xml, and .md files in the module tree).
This is primarily for tracking sources for RBE purposes. Currently defaults
to true, though this may change in the future.
use_generic_config
bool, Set to true if this module must be generic and does not require product-specific information.
To be included in the system image, this property must be set to true.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_available
bool, whether this module should be allowed to be directly depended by other
modules with `vendor: true`, `proprietary: true`, or `vendor_available:true`.
If set to true, two variants will be built separately, one like
normal, and the other limited to the set of libraries and headers
that are exposed to /vendor modules.
The vendor variant may be used with a different (newer) /system,
so it shouldn't have any unversioned runtime dependencies, or
make assumptions about the system that may not be true in the
future.
If set to false, this module becomes inaccessible from /vendor modules.
The modules with vndk: {enabled: true} must define 'vendor_available'
to 'true'.
Nothing happens if BOARD_VNDK_VERSION isn't set in the BoardConfig.mk
vendor_dlkm_specific
bool, Install to partition vendor_dlkm when set to true.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vendor_ramdisk_available
bool, Make this module available when building for vendor ramdisk.
On device without a dedicated recovery partition, the module is only
available after switching root into
/first_stage_ramdisk. To expose the module before switching root, install
the recovery variant instead
version_script
string, Version script to pass to the linker. By default this will replace the
implicit rustc emitted version script to mirror expected behavior in CC.
This is only relevant for rust_ffi_shared modules which are exposing a
versioned C API.
vintf_fragment_modules
configurable list of string, vintf_fragment Modules required from this module.
vintf_fragments
configurable list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
whole_static_libs
configurable list of string, Similar to static_libs, but will bundle the static library dependency into a library. This is helpful
to avoid having to redeclare the dependency for dependents of this library, but in some cases may also
result in bloat if multiple dependencies all include the same static library whole.
The common use case for this is when the static library is unlikely to be a dependency of other modules to avoid
having to redeclare the static library dependency for every dependent module.
If you are not sure what to, for rust_library modules most static dependencies should go in static_libraries,
and for rust_ffi modules most static dependencies should go into whole_static_libraries.
For rust_ffi static variants, these libraries will be included in the resulting static library archive.
For rust_library rlib variants, these libraries will be bundled into the resulting rlib library. This will
include all of the static libraries symbols in any dylibs or binaries which use this rlib as well.
wrapper_src
string, The wrapper header file. By default this is assumed to be a C header unless the extension is ".hh" or ".hpp".
This is used to specify how to interpret the header and determines which '-std' flag to use by default.
If your C++ header must have some other extension, then the default behavior can be overridden by setting the
cpp_std property.
rust_ffi
rust_ffi produces all FFI variants (rust_ffi_shared, rust_ffi_static).
name
,
srcs
,
defaults
,
host_supported
,
device_supported
,
afdo
,
aliases
,
apex_available
,
apex_exclude
,
arch
,
bootstrap
,
cargo_env_compat
,
cargo_pkg_version
,
cfgs
,
clippy_lints
,
compile_multilib
,
crate_name
,
crate_root
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
double_loadable
,
dylib
,
edition
,
enabled
,
exclude_from_recovery_snapshot
,
exclude_from_vendor_snapshot
,
export_include_dirs
,
extra_exported_symbols
,
features
,
flags
,
host_cross_supported
,
host_required
,
include_dirs
,
init_rc
,
installable
,
ld_flags
,
licenses
,
lints
,
lto
,
min_sdk_version
,
multilib
,
native_bridge_supported
,
native_coverage
,
no_full_install
,
no_stdlibs
,
odm_available
,
odm_dlkm_specific
,
overrides
,
owner
,
prefer_rlib
,
proc_macros
,
product_available
,
product_specific
,
product_variables.arc
,
product_variables.build_from_text_stub
,
product_variables.debuggable
,
product_variables.eng
,
product_variables.malloc_low_memory
,
product_variables.native_coverage
,
product_variables.release_aidl_use_unfrozen
,
product_variables.selinuxignoreneverallows
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
ramdisk_available
,
recovery
,
recovery_available
,
relative_install_path
,
required
,
rlib
,
rlibs
,
rustlibs
,
sanitize
,
sdk_version
,
shared
,
shared_libs
,
soc_specific
,
static
,
static_libs
,
stdlibs
,
stem
,
strip
,
stubs
,
suffix
,
sysroot
,
system_dlkm_specific
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
use_expansive_default_srcs
,
use_generic_config
,
vendor
,
vendor_available
,
vendor_dlkm_specific
,
vendor_ramdisk
,
vendor_ramdisk_available
,
version_script
,
vintf_fragment_modules
,
vintf_fragments
,
visibility
,
whole_static_libs
name
string, The name of the module. Must be unique across all modules.
srcs
list of string, path to the source file that is the main entry point of the program (e.g. main.rs or lib.rs).
Only a single source file can be defined. Modules which generate source can be included by prefixing
the module name with ":", for example ":libfoo_bindgen"
If no source file is defined, a single generated source module can be defined to be used as the main source.
defaults
list of string
host_supported
bool, If set to true, build a variant of the module for the host. Defaults to false.
device_supported
bool, If set to true, build a variant of the module for the device. Defaults to true.
afdo
bool, Afdo allows developers self-service enroll for
automatic feedback-directed optimization using profile data.
aliases
list of string, Rust crate dependencies to rename. Each entry should be a string of the form "dependencyname:alias".
"dependencyname" here should be the name of the crate, not the Android module. This is
equivalent to writing `alias = { package = "dependencyname" }` in a `Cargo.toml`.
apex_available
list of string, Availability of this module in APEXes. Only the listed APEXes can contain this module. If
the module has stubs then other APEXes and the platform may access it through them
(subject to visibility).
"//apex_available:anyapex" is a pseudo APEX name that matches to any APEX.
"//apex_available:platform" refers to non-APEX partitions like "system.img".
Prefix pattern (com.foo.*) can be used to match with any APEX name with the prefix(com.foo.).
Default is ["//apex_available:platform"].
apex_exclude
bool, Deprecated - exclude this rust_ffi target from being included in APEXes.
TODO(b/362509506): remove this once all apex_exclude uses are switched to stubs.
arch
interface
bootstrap
bool, Allows this module to use non-APEX version of libraries. Useful
for building binaries that are started before APEXes are activated.
cargo_env_compat
bool, Enables emitting certain Cargo environment variables. Only intended to be used for compatibility purposes.
Will set CARGO_CRATE_NAME to the crate_name property's value.
Will set CARGO_BIN_NAME to the output filename value without the extension.
cargo_pkg_version
string, If cargo_env_compat is true, sets the CARGO_PKG_VERSION env var to this value.
cfgs
configurable list of string, list of configuration options to enable for this crate. To enable features, use the "features" property.
clippy_lints
string, name of the lint set that should be used to validate this module.
Possible values are "default" (for using a sensible set of lints
depending on the module's location), "android" (for the strictest
lint set that applies to all Android platform code), "vendor" (for a
relaxed set) and "none" (to disable the execution of clippy). The
default value is "default". See also the `lints` property.
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
crate_name
string, crate name, required for modules which produce Rust libraries: rust_library, rust_ffi and SourceProvider
modules which create library variants (rust_bindgen). This must be the expected extern crate name used in
source, and is required to conform to an enforced format matching library output files (if the output file is
lib<someName><suffix>, the crate_name property must be <someName>).
crate_root
string, Entry point that is passed to rustc to begin the compilation. E.g. main.rs or lib.rs.
When this property is set,
* sandboxing is enabled for this module, and
* the srcs attribute is interpreted as a list of all source files potentially
used in compilation, including the entrypoint, and
* compile_data can be used to add additional files used in compilation that
not directly used as source files.
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
prepend_artifact_with_product
bool, If true, then the artifact file will be prepended with <product name>-. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be coral-foo.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
double_loadable
bool, whether this module is capable of being loaded with other instance
(possibly an older version) of the same module in the same process.
Currently, a shared library that is a member of VNDK (vndk: {enabled: true})
can be double loaded in a vendor process if the library is also a
(direct and indirect) dependency of an LLNDK library. Such libraries must be
explicitly marked as `double_loadable: true` by the owner, or the dependency
from the LLNDK lib should be cut if the lib is not designed to be double loaded.
⊕dylib
VariantLibraryProperties
enabled
bool
srcs
list of string
edition
string, specific rust edition that should be used if the default version is not desired
enabled
configurable bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
exclude_from_recovery_snapshot
bool, Normally Soong uses the directory structure to decide which modules
should be included (framework) or excluded (non-framework) from the
different snapshots (vendor, recovery, etc.), but this property
allows a partner to exclude a module normally thought of as a
framework module from the recovery snapshot.
exclude_from_vendor_snapshot
bool, Normally Soong uses the directory structure to decide which modules
should be included (framework) or excluded (non-framework) from the
different snapshots (vendor, recovery, etc.), but this property
allows a partner to exclude a module normally thought of as a
framework module from the vendor snapshot.
export_include_dirs
list of string, path to include directories to export to cc_* modules, only relevant for static/shared variants.
features
configurable list of string, list of features to enable for this crate
flags
list of string, flags to pass to rustc. To enable configuration options or features, use the "cfgs" or "features" properties.
host_cross_supported
bool, If set to true, build a variant of the module for the host cross. Defaults to true.
host_required
list of string, names of other modules to install on host if this module is installed
include_dirs
list of string, TODO: Remove this when all instances of Include_dirs have been removed from rust_ffi modules.
path to include directories to pass to cc_* modules, only relevant for static/shared variants (deprecated, use export_include_dirs instead).
init_rc
configurable list of string, init.rc files to be installed if this module is installed
installable
bool
ld_flags
list of string, flags to pass to the linker
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
lints
string, name of the lint set that should be used to validate this module.
Possible values are "default" (for using a sensible set of lints
depending on the module's location), "android" (for the strictest
lint set that applies to all Android platform code), "vendor" (for
a relaxed set) and "none" (for ignoring all lint warnings and
errors). The default value is "default".
⊕lto
Control whether LTO is used for the final (Rust) linkage. This does not impact
cross-language LTO.
thin
bool, Whether thin LTO should be enabled. By default this is true.
LTO provides such a large code size benefit for Rust, this should always
be enabled for production builds unless there's a clear need to disable it.
min_sdk_version
string, Minimum OS API level supported by this C or C++ module. This property becomes the value
of the __ANDROID_API__ macro. When the C or C++ module is included in an APEX or an APK,
this property is also used to ensure that the min_sdk_version of the containing module is
not older (i.e. less) than this module's min_sdk_version. When not set, this property
defaults to the value of sdk_version. When this is set to "apex_inherit", this tracks
min_sdk_version of the containing APEX. When the module
is not built for an APEX, "apex_inherit" defaults to sdk_version.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
native_coverage
bool
no_full_install
bool, When set to true, this module is not installed to the full install path (ex: under
out/target/product/<name>/<partition>). It can be installed only to the packaging
modules like android_filesystem.
no_stdlibs
bool, whether to suppress inclusion of standard crates - defaults to false
odm_available
bool, This is the same as the "vendor_available" except that the install path
of the vendor variant is /odm or /vendor/odm.
By replacing "vendor_available: true" with "odm_available: true", the
module will install its vendor variant to the /odm partition or /vendor/odm.
As the modules with "odm_available: true" still create the vendor variants,
they can link to the other vendor modules as the vendor_available modules do.
Also, the vendor modules can link to odm_available modules.
It may not be used for VNDK modules.
odm_dlkm_specific
bool, Install to partition odm_dlkm when set to true.
overrides
list of string, List of module names that are prevented from being installed when this module gets
installed.
owner
string, vendor who owns this module
prefer_rlib
bool, Change the rustlibs linkage to select rlib linkage by default for device targets.
Also link libstd as an rlib as well on device targets.
Note: This is the default behavior for host targets.
This is primarily meant for rust_binary and rust_ffi modules where the default
linkage of libstd might need to be overridden in some use cases. This should
generally be avoided with other module types since it may cause collisions at
linkage if all dependencies of the root binary module do not link against libstd
the same way.
proc_macros
configurable list of string, list of rust proc_macro crate dependencies
product_available
bool, whether this module should be allowed to be directly depended by other
modules with `product_specific: true` or `product_available: true`.
If set to true, an additional product variant will be built separately
that is limited to the set of libraries and headers that are exposed to
/product modules.
The product variant may be used with a different (newer) /system,
so it shouldn't have any unversioned runtime dependencies, or
make assumptions about the system that may not be true in the
future.
If set to false, this module becomes inaccessible from /product modules.
Different from the 'vendor_available' property, the modules with
vndk: {enabled: true} don't have to define 'product_available'. The VNDK
library without 'product_available' may not be depended on by any other
modules that has product variants including the product available VNDKs.
Nothing happens if BOARD_VNDK_VERSION isn't set in the BoardConfig.mk
and PRODUCT_PRODUCT_VNDK_VERSION isn't set.
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.arc
⊕include_dirs
⊕shared_libs
⊕static_libs
⊕srcs
⊕whole_static_libs
⊕product_variables.build_from_text_stub
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕strip.all
⊕strip.keep_symbols
⊕strip.keep_symbols_and_debug_frame
⊕static_libs
⊕whole_static_libs
⊕shared_libs
⊕srcs
⊕product_variables.eng
⊕product_variables.malloc_low_memory
⊕shared_libs
⊕whole_static_libs
⊕static_libs
⊕srcs
⊕product_variables.native_coverage
⊕product_variables.release_aidl_use_unfrozen
⊕required
⊕vintf_fragment_modules
⊕product_variables.selinuxignoreneverallows
⊕product_variables.unbundled_build
⊕enabled
Configurable[bool]
Configurable[bool]
proptools.Configurable[bool]
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
ramdisk_available
bool, Make this module available when building for ramdisk.
On device without a dedicated recovery partition, the module is only
available after switching root into
/first_stage_ramdisk. To expose the module before switching root, install
the recovery variant instead.
recovery
bool, Whether this module is installed to recovery partition
recovery_available
bool, Make this module available when building for recovery
relative_install_path
string, install to a subdirectory of the default install path for the module
required
configurable list of string, names of other modules to install if this module is installed
⊕rlib
VariantLibraryProperties
enabled
bool
srcs
list of string
rlibs
configurable list of string, list of rust rlib crate dependencies
rustlibs
configurable list of string, list of rust automatic crate dependencies.
Rustlibs linkage is rlib for host targets and dylib for device targets.
⊕sanitize
enable AddressSanitizer, HWAddressSanitizer, and others.
address
bool
hwaddress
bool
memtag_heap
bool, Memory-tagging, only available on arm64
if diag.memtag unset or false, enables async memory tagging
fuzzer
bool
never
bool
⊕diag
Sanitizers to run in the diagnostic mode (as opposed to the release mode).
Replaces abort() on error with a human-readable error message.
Address and Thread sanitizers always run in diagnostic mode.
memtag_heap
bool, Memory-tagging, only available on arm64
requires sanitizer.memtag: true
if set, enables sync memory tagging
sdk_version
string, The API level that this module is built against. The APIs of this API level will be
visible at build time, but use of any APIs newer than min_sdk_version will render the
module unloadable on older devices. In the future it will be possible to weakly-link new
APIs, making the behavior match Java: such modules will load on older devices, but
calling new APIs on devices that do not support them will result in a crash.
This property has the same behavior as sdk_version does for Java modules. For those
familiar with Android Gradle, the property behaves similarly to how compileSdkVersion
does for Java code.
In addition, setting this property causes two variants to be built, one for the platform
and one for apps.
⊕shared
VariantLibraryProperties
enabled
bool
srcs
list of string
shared_libs
configurable list of string, list of C shared library dependencies
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
⊕static
VariantLibraryProperties
enabled
bool
srcs
list of string
static_libs
configurable list of string, list of C static library dependencies. These dependencies do not normally propagate to dependents
and may need to be redeclared. See whole_static_libs for bundling static dependencies into a library.
stdlibs
configurable list of string, list of Rust system library dependencies.
This is usually only needed when `no_stdlibs` is true, in which case it can be used to depend on system crates
like `core` and `alloc`.
stem
string, sets name of the output
⊕strip
none
bool, Device modules default to stripping enabled leaving mini debuginfo.
Host modules default to stripping disabled, but can be enabled by setting any other
strip boolean property.
all
bool, all forces stripping everything, including the mini debug info.
keep_symbols
bool, keep_symbols enables stripping but keeps all symbols.
keep_symbols_list
list of string, keep_symbols_list specifies a list of symbols to keep if keep_symbols is enabled.
If it is unset then all symbols are kept.
keep_symbols_and_debug_frame
bool, keep_symbols_and_debug_frame enables stripping but keeps all symbols and debug frames.
⊕stubs
*ast.SelectorExpr
Generate stubs to make this library accessible to APEXes.
Can only be set for modules producing shared libraries.
symbol_file
string, Relative path to the symbol map. The symbol map provides the list of
symbols that are exported for stubs variant of this library.
versions
list of string, List versions to generate stubs libs for. The version name "current" is always
implicitly added.
implementation_installable
bool, Whether to not require the implementation of the library to be installed if a
client of the stubs is installed. Defaults to true; set to false if the
implementation is made available by some other means, e.g. in a Microdroid
virtual machine.
suffix
string, append to name of output
sysroot
bool, Whether this library is part of the Rust toolchain sysroot.
system_dlkm_specific
bool, Install to partition system_dlkm when set to true.
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
compile_multilib
string
enabled
bool
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
use_expansive_default_srcs
bool, Set this to true to use an expansive default set of source file requirements
(all .rs, .h, .xml, and .md files in the module tree).
This is primarily for tracking sources for RBE purposes. Currently defaults
to true, though this may change in the future.
use_generic_config
bool, Set to true if this module must be generic and does not require product-specific information.
To be included in the system image, this property must be set to true.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_available
bool, whether this module should be allowed to be directly depended by other
modules with `vendor: true`, `proprietary: true`, or `vendor_available:true`.
If set to true, two variants will be built separately, one like
normal, and the other limited to the set of libraries and headers
that are exposed to /vendor modules.
The vendor variant may be used with a different (newer) /system,
so it shouldn't have any unversioned runtime dependencies, or
make assumptions about the system that may not be true in the
future.
If set to false, this module becomes inaccessible from /vendor modules.
The modules with vndk: {enabled: true} must define 'vendor_available'
to 'true'.
Nothing happens if BOARD_VNDK_VERSION isn't set in the BoardConfig.mk
vendor_dlkm_specific
bool, Install to partition vendor_dlkm when set to true.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vendor_ramdisk_available
bool, Make this module available when building for vendor ramdisk.
On device without a dedicated recovery partition, the module is only
available after switching root into
/first_stage_ramdisk. To expose the module before switching root, install
the recovery variant instead
version_script
string, Version script to pass to the linker. By default this will replace the
implicit rustc emitted version script to mirror expected behavior in CC.
This is only relevant for rust_ffi_shared modules which are exposing a
versioned C API.
vintf_fragment_modules
configurable list of string, vintf_fragment Modules required from this module.
vintf_fragments
configurable list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
whole_static_libs
configurable list of string, Similar to static_libs, but will bundle the static library dependency into a library. This is helpful
to avoid having to redeclare the dependency for dependents of this library, but in some cases may also
result in bloat if multiple dependencies all include the same static library whole.
The common use case for this is when the static library is unlikely to be a dependency of other modules to avoid
having to redeclare the static library dependency for every dependent module.
If you are not sure what to, for rust_library modules most static dependencies should go in static_libraries,
and for rust_ffi modules most static dependencies should go into whole_static_libraries.
For rust_ffi static variants, these libraries will be included in the resulting static library archive.
For rust_library rlib variants, these libraries will be bundled into the resulting rlib library. This will
include all of the static libraries symbols in any dylibs or binaries which use this rlib as well.
rust_ffi_host
rust_ffi_host produces all FFI variants for the host
(rust_ffi_static_host and rust_ffi_shared_host).
name
,
srcs
,
defaults
,
afdo
,
aliases
,
apex_available
,
apex_exclude
,
arch
,
bootstrap
,
cargo_env_compat
,
cargo_pkg_version
,
cfgs
,
clippy_lints
,
compile_multilib
,
crate_name
,
crate_root
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
double_loadable
,
dylib
,
edition
,
enabled
,
exclude_from_recovery_snapshot
,
exclude_from_vendor_snapshot
,
export_include_dirs
,
extra_exported_symbols
,
features
,
flags
,
host_cross_supported
,
host_required
,
include_dirs
,
init_rc
,
installable
,
ld_flags
,
licenses
,
lints
,
lto
,
min_sdk_version
,
multilib
,
native_bridge_supported
,
native_coverage
,
no_full_install
,
no_stdlibs
,
odm_available
,
odm_dlkm_specific
,
overrides
,
owner
,
prefer_rlib
,
proc_macros
,
product_available
,
product_specific
,
product_variables.arc
,
product_variables.build_from_text_stub
,
product_variables.debuggable
,
product_variables.eng
,
product_variables.malloc_low_memory
,
product_variables.native_coverage
,
product_variables.release_aidl_use_unfrozen
,
product_variables.selinuxignoreneverallows
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
ramdisk_available
,
recovery
,
recovery_available
,
relative_install_path
,
required
,
rlib
,
rlibs
,
rustlibs
,
sanitize
,
sdk_version
,
shared
,
shared_libs
,
soc_specific
,
static
,
static_libs
,
stdlibs
,
stem
,
strip
,
stubs
,
suffix
,
sysroot
,
system_dlkm_specific
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
use_expansive_default_srcs
,
use_generic_config
,
vendor
,
vendor_available
,
vendor_dlkm_specific
,
vendor_ramdisk
,
vendor_ramdisk_available
,
version_script
,
vintf_fragment_modules
,
vintf_fragments
,
visibility
,
whole_static_libs
name
string, The name of the module. Must be unique across all modules.
srcs
list of string, path to the source file that is the main entry point of the program (e.g. main.rs or lib.rs).
Only a single source file can be defined. Modules which generate source can be included by prefixing
the module name with ":", for example ":libfoo_bindgen"
If no source file is defined, a single generated source module can be defined to be used as the main source.
defaults
list of string
afdo
bool, Afdo allows developers self-service enroll for
automatic feedback-directed optimization using profile data.
aliases
list of string, Rust crate dependencies to rename. Each entry should be a string of the form "dependencyname:alias".
"dependencyname" here should be the name of the crate, not the Android module. This is
equivalent to writing `alias = { package = "dependencyname" }` in a `Cargo.toml`.
apex_available
list of string, Availability of this module in APEXes. Only the listed APEXes can contain this module. If
the module has stubs then other APEXes and the platform may access it through them
(subject to visibility).
"//apex_available:anyapex" is a pseudo APEX name that matches to any APEX.
"//apex_available:platform" refers to non-APEX partitions like "system.img".
Prefix pattern (com.foo.*) can be used to match with any APEX name with the prefix(com.foo.).
Default is ["//apex_available:platform"].
apex_exclude
bool, Deprecated - exclude this rust_ffi target from being included in APEXes.
TODO(b/362509506): remove this once all apex_exclude uses are switched to stubs.
arch
interface
bootstrap
bool, Allows this module to use non-APEX version of libraries. Useful
for building binaries that are started before APEXes are activated.
cargo_env_compat
bool, Enables emitting certain Cargo environment variables. Only intended to be used for compatibility purposes.
Will set CARGO_CRATE_NAME to the crate_name property's value.
Will set CARGO_BIN_NAME to the output filename value without the extension.
cargo_pkg_version
string, If cargo_env_compat is true, sets the CARGO_PKG_VERSION env var to this value.
cfgs
configurable list of string, list of configuration options to enable for this crate. To enable features, use the "features" property.
clippy_lints
string, name of the lint set that should be used to validate this module.
Possible values are "default" (for using a sensible set of lints
depending on the module's location), "android" (for the strictest
lint set that applies to all Android platform code), "vendor" (for a
relaxed set) and "none" (to disable the execution of clippy). The
default value is "default". See also the `lints` property.
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
crate_name
string, crate name, required for modules which produce Rust libraries: rust_library, rust_ffi and SourceProvider
modules which create library variants (rust_bindgen). This must be the expected extern crate name used in
source, and is required to conform to an enforced format matching library output files (if the output file is
lib<someName><suffix>, the crate_name property must be <someName>).
crate_root
string, Entry point that is passed to rustc to begin the compilation. E.g. main.rs or lib.rs.
When this property is set,
* sandboxing is enabled for this module, and
* the srcs attribute is interpreted as a list of all source files potentially
used in compilation, including the entrypoint, and
* compile_data can be used to add additional files used in compilation that
not directly used as source files.
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
prepend_artifact_with_product
bool, If true, then the artifact file will be prepended with <product name>-. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be coral-foo.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
double_loadable
bool, whether this module is capable of being loaded with other instance
(possibly an older version) of the same module in the same process.
Currently, a shared library that is a member of VNDK (vndk: {enabled: true})
can be double loaded in a vendor process if the library is also a
(direct and indirect) dependency of an LLNDK library. Such libraries must be
explicitly marked as `double_loadable: true` by the owner, or the dependency
from the LLNDK lib should be cut if the lib is not designed to be double loaded.
⊕dylib
VariantLibraryProperties
enabled
bool
srcs
list of string
edition
string, specific rust edition that should be used if the default version is not desired
enabled
configurable bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
exclude_from_recovery_snapshot
bool, Normally Soong uses the directory structure to decide which modules
should be included (framework) or excluded (non-framework) from the
different snapshots (vendor, recovery, etc.), but this property
allows a partner to exclude a module normally thought of as a
framework module from the recovery snapshot.
exclude_from_vendor_snapshot
bool, Normally Soong uses the directory structure to decide which modules
should be included (framework) or excluded (non-framework) from the
different snapshots (vendor, recovery, etc.), but this property
allows a partner to exclude a module normally thought of as a
framework module from the vendor snapshot.
export_include_dirs
list of string, path to include directories to export to cc_* modules, only relevant for static/shared variants.
features
configurable list of string, list of features to enable for this crate
flags
list of string, flags to pass to rustc. To enable configuration options or features, use the "cfgs" or "features" properties.
host_cross_supported
bool, If set to true, build a variant of the module for the host cross. Defaults to true.
host_required
list of string, names of other modules to install on host if this module is installed
include_dirs
list of string, TODO: Remove this when all instances of Include_dirs have been removed from rust_ffi modules.
path to include directories to pass to cc_* modules, only relevant for static/shared variants (deprecated, use export_include_dirs instead).
init_rc
configurable list of string, init.rc files to be installed if this module is installed
installable
bool
ld_flags
list of string, flags to pass to the linker
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
lints
string, name of the lint set that should be used to validate this module.
Possible values are "default" (for using a sensible set of lints
depending on the module's location), "android" (for the strictest
lint set that applies to all Android platform code), "vendor" (for
a relaxed set) and "none" (for ignoring all lint warnings and
errors). The default value is "default".
⊕lto
Control whether LTO is used for the final (Rust) linkage. This does not impact
cross-language LTO.
thin
bool, Whether thin LTO should be enabled. By default this is true.
LTO provides such a large code size benefit for Rust, this should always
be enabled for production builds unless there's a clear need to disable it.
min_sdk_version
string, Minimum OS API level supported by this C or C++ module. This property becomes the value
of the __ANDROID_API__ macro. When the C or C++ module is included in an APEX or an APK,
this property is also used to ensure that the min_sdk_version of the containing module is
not older (i.e. less) than this module's min_sdk_version. When not set, this property
defaults to the value of sdk_version. When this is set to "apex_inherit", this tracks
min_sdk_version of the containing APEX. When the module
is not built for an APEX, "apex_inherit" defaults to sdk_version.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
native_coverage
bool
no_full_install
bool, When set to true, this module is not installed to the full install path (ex: under
out/target/product/<name>/<partition>). It can be installed only to the packaging
modules like android_filesystem.
no_stdlibs
bool, whether to suppress inclusion of standard crates - defaults to false
odm_available
bool, This is the same as the "vendor_available" except that the install path
of the vendor variant is /odm or /vendor/odm.
By replacing "vendor_available: true" with "odm_available: true", the
module will install its vendor variant to the /odm partition or /vendor/odm.
As the modules with "odm_available: true" still create the vendor variants,
they can link to the other vendor modules as the vendor_available modules do.
Also, the vendor modules can link to odm_available modules.
It may not be used for VNDK modules.
odm_dlkm_specific
bool, Install to partition odm_dlkm when set to true.
overrides
list of string, List of module names that are prevented from being installed when this module gets
installed.
owner
string, vendor who owns this module
prefer_rlib
bool, Change the rustlibs linkage to select rlib linkage by default for device targets.
Also link libstd as an rlib as well on device targets.
Note: This is the default behavior for host targets.
This is primarily meant for rust_binary and rust_ffi modules where the default
linkage of libstd might need to be overridden in some use cases. This should
generally be avoided with other module types since it may cause collisions at
linkage if all dependencies of the root binary module do not link against libstd
the same way.
proc_macros
configurable list of string, list of rust proc_macro crate dependencies
product_available
bool, whether this module should be allowed to be directly depended by other
modules with `product_specific: true` or `product_available: true`.
If set to true, an additional product variant will be built separately
that is limited to the set of libraries and headers that are exposed to
/product modules.
The product variant may be used with a different (newer) /system,
so it shouldn't have any unversioned runtime dependencies, or
make assumptions about the system that may not be true in the
future.
If set to false, this module becomes inaccessible from /product modules.
Different from the 'vendor_available' property, the modules with
vndk: {enabled: true} don't have to define 'product_available'. The VNDK
library without 'product_available' may not be depended on by any other
modules that has product variants including the product available VNDKs.
Nothing happens if BOARD_VNDK_VERSION isn't set in the BoardConfig.mk
and PRODUCT_PRODUCT_VNDK_VERSION isn't set.
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.arc
⊕include_dirs
⊕shared_libs
⊕static_libs
⊕srcs
⊕whole_static_libs
⊕product_variables.build_from_text_stub
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕strip.all
⊕strip.keep_symbols
⊕strip.keep_symbols_and_debug_frame
⊕static_libs
⊕whole_static_libs
⊕shared_libs
⊕srcs
⊕product_variables.eng
⊕product_variables.malloc_low_memory
⊕shared_libs
⊕whole_static_libs
⊕static_libs
⊕srcs
⊕product_variables.native_coverage
⊕product_variables.release_aidl_use_unfrozen
⊕required
⊕vintf_fragment_modules
⊕product_variables.selinuxignoreneverallows
⊕product_variables.unbundled_build
⊕enabled
Configurable[bool]
Configurable[bool]
proptools.Configurable[bool]
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
ramdisk_available
bool, Make this module available when building for ramdisk.
On device without a dedicated recovery partition, the module is only
available after switching root into
/first_stage_ramdisk. To expose the module before switching root, install
the recovery variant instead.
recovery
bool, Whether this module is installed to recovery partition
recovery_available
bool, Make this module available when building for recovery
relative_install_path
string, install to a subdirectory of the default install path for the module
required
configurable list of string, names of other modules to install if this module is installed
⊕rlib
VariantLibraryProperties
enabled
bool
srcs
list of string
rlibs
configurable list of string, list of rust rlib crate dependencies
rustlibs
configurable list of string, list of rust automatic crate dependencies.
Rustlibs linkage is rlib for host targets and dylib for device targets.
⊕sanitize
enable AddressSanitizer, HWAddressSanitizer, and others.
address
bool
hwaddress
bool
memtag_heap
bool, Memory-tagging, only available on arm64
if diag.memtag unset or false, enables async memory tagging
fuzzer
bool
never
bool
⊕diag
Sanitizers to run in the diagnostic mode (as opposed to the release mode).
Replaces abort() on error with a human-readable error message.
Address and Thread sanitizers always run in diagnostic mode.
memtag_heap
bool, Memory-tagging, only available on arm64
requires sanitizer.memtag: true
if set, enables sync memory tagging
sdk_version
string, The API level that this module is built against. The APIs of this API level will be
visible at build time, but use of any APIs newer than min_sdk_version will render the
module unloadable on older devices. In the future it will be possible to weakly-link new
APIs, making the behavior match Java: such modules will load on older devices, but
calling new APIs on devices that do not support them will result in a crash.
This property has the same behavior as sdk_version does for Java modules. For those
familiar with Android Gradle, the property behaves similarly to how compileSdkVersion
does for Java code.
In addition, setting this property causes two variants to be built, one for the platform
and one for apps.
⊕shared
VariantLibraryProperties
enabled
bool
srcs
list of string
shared_libs
configurable list of string, list of C shared library dependencies
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
⊕static
VariantLibraryProperties
enabled
bool
srcs
list of string
static_libs
configurable list of string, list of C static library dependencies. These dependencies do not normally propagate to dependents
and may need to be redeclared. See whole_static_libs for bundling static dependencies into a library.
stdlibs
configurable list of string, list of Rust system library dependencies.
This is usually only needed when `no_stdlibs` is true, in which case it can be used to depend on system crates
like `core` and `alloc`.
stem
string, sets name of the output
⊕strip
none
bool, Device modules default to stripping enabled leaving mini debuginfo.
Host modules default to stripping disabled, but can be enabled by setting any other
strip boolean property.
all
bool, all forces stripping everything, including the mini debug info.
keep_symbols
bool, keep_symbols enables stripping but keeps all symbols.
keep_symbols_list
list of string, keep_symbols_list specifies a list of symbols to keep if keep_symbols is enabled.
If it is unset then all symbols are kept.
keep_symbols_and_debug_frame
bool, keep_symbols_and_debug_frame enables stripping but keeps all symbols and debug frames.
⊕stubs
*ast.SelectorExpr
Generate stubs to make this library accessible to APEXes.
Can only be set for modules producing shared libraries.
symbol_file
string, Relative path to the symbol map. The symbol map provides the list of
symbols that are exported for stubs variant of this library.
versions
list of string, List versions to generate stubs libs for. The version name "current" is always
implicitly added.
implementation_installable
bool, Whether to not require the implementation of the library to be installed if a
client of the stubs is installed. Defaults to true; set to false if the
implementation is made available by some other means, e.g. in a Microdroid
virtual machine.
suffix
string, append to name of output
sysroot
bool, Whether this library is part of the Rust toolchain sysroot.
system_dlkm_specific
bool, Install to partition system_dlkm when set to true.
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
compile_multilib
string
enabled
bool
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
use_expansive_default_srcs
bool, Set this to true to use an expansive default set of source file requirements
(all .rs, .h, .xml, and .md files in the module tree).
This is primarily for tracking sources for RBE purposes. Currently defaults
to true, though this may change in the future.
use_generic_config
bool, Set to true if this module must be generic and does not require product-specific information.
To be included in the system image, this property must be set to true.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_available
bool, whether this module should be allowed to be directly depended by other
modules with `vendor: true`, `proprietary: true`, or `vendor_available:true`.
If set to true, two variants will be built separately, one like
normal, and the other limited to the set of libraries and headers
that are exposed to /vendor modules.
The vendor variant may be used with a different (newer) /system,
so it shouldn't have any unversioned runtime dependencies, or
make assumptions about the system that may not be true in the
future.
If set to false, this module becomes inaccessible from /vendor modules.
The modules with vndk: {enabled: true} must define 'vendor_available'
to 'true'.
Nothing happens if BOARD_VNDK_VERSION isn't set in the BoardConfig.mk
vendor_dlkm_specific
bool, Install to partition vendor_dlkm when set to true.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vendor_ramdisk_available
bool, Make this module available when building for vendor ramdisk.
On device without a dedicated recovery partition, the module is only
available after switching root into
/first_stage_ramdisk. To expose the module before switching root, install
the recovery variant instead
version_script
string, Version script to pass to the linker. By default this will replace the
implicit rustc emitted version script to mirror expected behavior in CC.
This is only relevant for rust_ffi_shared modules which are exposing a
versioned C API.
vintf_fragment_modules
configurable list of string, vintf_fragment Modules required from this module.
vintf_fragments
configurable list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
whole_static_libs
configurable list of string, Similar to static_libs, but will bundle the static library dependency into a library. This is helpful
to avoid having to redeclare the dependency for dependents of this library, but in some cases may also
result in bloat if multiple dependencies all include the same static library whole.
The common use case for this is when the static library is unlikely to be a dependency of other modules to avoid
having to redeclare the static library dependency for every dependent module.
If you are not sure what to, for rust_library modules most static dependencies should go in static_libraries,
and for rust_ffi modules most static dependencies should go into whole_static_libraries.
For rust_ffi static variants, these libraries will be included in the resulting static library archive.
For rust_library rlib variants, these libraries will be bundled into the resulting rlib library. This will
include all of the static libraries symbols in any dylibs or binaries which use this rlib as well.
rust_ffi_host_shared
rust_ffi_shared_host produces an shared library for the host (Rust
crate type "cdylib").
name
,
srcs
,
defaults
,
afdo
,
aliases
,
apex_available
,
apex_exclude
,
arch
,
bootstrap
,
cargo_env_compat
,
cargo_pkg_version
,
cfgs
,
clippy_lints
,
compile_multilib
,
crate_name
,
crate_root
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
double_loadable
,
dylib
,
edition
,
enabled
,
exclude_from_recovery_snapshot
,
exclude_from_vendor_snapshot
,
export_include_dirs
,
extra_exported_symbols
,
features
,
flags
,
host_cross_supported
,
host_required
,
include_dirs
,
init_rc
,
installable
,
ld_flags
,
licenses
,
lints
,
lto
,
min_sdk_version
,
multilib
,
native_bridge_supported
,
native_coverage
,
no_full_install
,
no_stdlibs
,
odm_available
,
odm_dlkm_specific
,
overrides
,
owner
,
prefer_rlib
,
proc_macros
,
product_available
,
product_specific
,
product_variables.arc
,
product_variables.build_from_text_stub
,
product_variables.debuggable
,
product_variables.eng
,
product_variables.malloc_low_memory
,
product_variables.native_coverage
,
product_variables.release_aidl_use_unfrozen
,
product_variables.selinuxignoreneverallows
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
ramdisk_available
,
recovery
,
recovery_available
,
relative_install_path
,
required
,
rlib
,
rlibs
,
rustlibs
,
sanitize
,
sdk_version
,
shared
,
shared_libs
,
soc_specific
,
static
,
static_libs
,
stdlibs
,
stem
,
strip
,
stubs
,
suffix
,
sysroot
,
system_dlkm_specific
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
use_expansive_default_srcs
,
use_generic_config
,
vendor
,
vendor_available
,
vendor_dlkm_specific
,
vendor_ramdisk
,
vendor_ramdisk_available
,
version_script
,
vintf_fragment_modules
,
vintf_fragments
,
visibility
,
whole_static_libs
name
string, The name of the module. Must be unique across all modules.
srcs
list of string, path to the source file that is the main entry point of the program (e.g. main.rs or lib.rs).
Only a single source file can be defined. Modules which generate source can be included by prefixing
the module name with ":", for example ":libfoo_bindgen"
If no source file is defined, a single generated source module can be defined to be used as the main source.
defaults
list of string
afdo
bool, Afdo allows developers self-service enroll for
automatic feedback-directed optimization using profile data.
aliases
list of string, Rust crate dependencies to rename. Each entry should be a string of the form "dependencyname:alias".
"dependencyname" here should be the name of the crate, not the Android module. This is
equivalent to writing `alias = { package = "dependencyname" }` in a `Cargo.toml`.
apex_available
list of string, Availability of this module in APEXes. Only the listed APEXes can contain this module. If
the module has stubs then other APEXes and the platform may access it through them
(subject to visibility).
"//apex_available:anyapex" is a pseudo APEX name that matches to any APEX.
"//apex_available:platform" refers to non-APEX partitions like "system.img".
Prefix pattern (com.foo.*) can be used to match with any APEX name with the prefix(com.foo.).
Default is ["//apex_available:platform"].
apex_exclude
bool, Deprecated - exclude this rust_ffi target from being included in APEXes.
TODO(b/362509506): remove this once all apex_exclude uses are switched to stubs.
arch
interface
bootstrap
bool, Allows this module to use non-APEX version of libraries. Useful
for building binaries that are started before APEXes are activated.
cargo_env_compat
bool, Enables emitting certain Cargo environment variables. Only intended to be used for compatibility purposes.
Will set CARGO_CRATE_NAME to the crate_name property's value.
Will set CARGO_BIN_NAME to the output filename value without the extension.
cargo_pkg_version
string, If cargo_env_compat is true, sets the CARGO_PKG_VERSION env var to this value.
cfgs
configurable list of string, list of configuration options to enable for this crate. To enable features, use the "features" property.
clippy_lints
string, name of the lint set that should be used to validate this module.
Possible values are "default" (for using a sensible set of lints
depending on the module's location), "android" (for the strictest
lint set that applies to all Android platform code), "vendor" (for a
relaxed set) and "none" (to disable the execution of clippy). The
default value is "default". See also the `lints` property.
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
crate_name
string, crate name, required for modules which produce Rust libraries: rust_library, rust_ffi and SourceProvider
modules which create library variants (rust_bindgen). This must be the expected extern crate name used in
source, and is required to conform to an enforced format matching library output files (if the output file is
lib<someName><suffix>, the crate_name property must be <someName>).
crate_root
string, Entry point that is passed to rustc to begin the compilation. E.g. main.rs or lib.rs.
When this property is set,
* sandboxing is enabled for this module, and
* the srcs attribute is interpreted as a list of all source files potentially
used in compilation, including the entrypoint, and
* compile_data can be used to add additional files used in compilation that
not directly used as source files.
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
prepend_artifact_with_product
bool, If true, then the artifact file will be prepended with <product name>-. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be coral-foo.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
double_loadable
bool, whether this module is capable of being loaded with other instance
(possibly an older version) of the same module in the same process.
Currently, a shared library that is a member of VNDK (vndk: {enabled: true})
can be double loaded in a vendor process if the library is also a
(direct and indirect) dependency of an LLNDK library. Such libraries must be
explicitly marked as `double_loadable: true` by the owner, or the dependency
from the LLNDK lib should be cut if the lib is not designed to be double loaded.
⊕dylib
VariantLibraryProperties
enabled
bool
srcs
list of string
edition
string, specific rust edition that should be used if the default version is not desired
enabled
configurable bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
exclude_from_recovery_snapshot
bool, Normally Soong uses the directory structure to decide which modules
should be included (framework) or excluded (non-framework) from the
different snapshots (vendor, recovery, etc.), but this property
allows a partner to exclude a module normally thought of as a
framework module from the recovery snapshot.
exclude_from_vendor_snapshot
bool, Normally Soong uses the directory structure to decide which modules
should be included (framework) or excluded (non-framework) from the
different snapshots (vendor, recovery, etc.), but this property
allows a partner to exclude a module normally thought of as a
framework module from the vendor snapshot.
export_include_dirs
list of string, path to include directories to export to cc_* modules, only relevant for static/shared variants.
features
configurable list of string, list of features to enable for this crate
flags
list of string, flags to pass to rustc. To enable configuration options or features, use the "cfgs" or "features" properties.
host_cross_supported
bool, If set to true, build a variant of the module for the host cross. Defaults to true.
host_required
list of string, names of other modules to install on host if this module is installed
include_dirs
list of string, TODO: Remove this when all instances of Include_dirs have been removed from rust_ffi modules.
path to include directories to pass to cc_* modules, only relevant for static/shared variants (deprecated, use export_include_dirs instead).
init_rc
configurable list of string, init.rc files to be installed if this module is installed
installable
bool
ld_flags
list of string, flags to pass to the linker
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
lints
string, name of the lint set that should be used to validate this module.
Possible values are "default" (for using a sensible set of lints
depending on the module's location), "android" (for the strictest
lint set that applies to all Android platform code), "vendor" (for
a relaxed set) and "none" (for ignoring all lint warnings and
errors). The default value is "default".
⊕lto
Control whether LTO is used for the final (Rust) linkage. This does not impact
cross-language LTO.
thin
bool, Whether thin LTO should be enabled. By default this is true.
LTO provides such a large code size benefit for Rust, this should always
be enabled for production builds unless there's a clear need to disable it.
min_sdk_version
string, Minimum OS API level supported by this C or C++ module. This property becomes the value
of the __ANDROID_API__ macro. When the C or C++ module is included in an APEX or an APK,
this property is also used to ensure that the min_sdk_version of the containing module is
not older (i.e. less) than this module's min_sdk_version. When not set, this property
defaults to the value of sdk_version. When this is set to "apex_inherit", this tracks
min_sdk_version of the containing APEX. When the module
is not built for an APEX, "apex_inherit" defaults to sdk_version.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
native_coverage
bool
no_full_install
bool, When set to true, this module is not installed to the full install path (ex: under
out/target/product/<name>/<partition>). It can be installed only to the packaging
modules like android_filesystem.
no_stdlibs
bool, whether to suppress inclusion of standard crates - defaults to false
odm_available
bool, This is the same as the "vendor_available" except that the install path
of the vendor variant is /odm or /vendor/odm.
By replacing "vendor_available: true" with "odm_available: true", the
module will install its vendor variant to the /odm partition or /vendor/odm.
As the modules with "odm_available: true" still create the vendor variants,
they can link to the other vendor modules as the vendor_available modules do.
Also, the vendor modules can link to odm_available modules.
It may not be used for VNDK modules.
odm_dlkm_specific
bool, Install to partition odm_dlkm when set to true.
overrides
list of string, List of module names that are prevented from being installed when this module gets
installed.
owner
string, vendor who owns this module
prefer_rlib
bool, Change the rustlibs linkage to select rlib linkage by default for device targets.
Also link libstd as an rlib as well on device targets.
Note: This is the default behavior for host targets.
This is primarily meant for rust_binary and rust_ffi modules where the default
linkage of libstd might need to be overridden in some use cases. This should
generally be avoided with other module types since it may cause collisions at
linkage if all dependencies of the root binary module do not link against libstd
the same way.
proc_macros
configurable list of string, list of rust proc_macro crate dependencies
product_available
bool, whether this module should be allowed to be directly depended by other
modules with `product_specific: true` or `product_available: true`.
If set to true, an additional product variant will be built separately
that is limited to the set of libraries and headers that are exposed to
/product modules.
The product variant may be used with a different (newer) /system,
so it shouldn't have any unversioned runtime dependencies, or
make assumptions about the system that may not be true in the
future.
If set to false, this module becomes inaccessible from /product modules.
Different from the 'vendor_available' property, the modules with
vndk: {enabled: true} don't have to define 'product_available'. The VNDK
library without 'product_available' may not be depended on by any other
modules that has product variants including the product available VNDKs.
Nothing happens if BOARD_VNDK_VERSION isn't set in the BoardConfig.mk
and PRODUCT_PRODUCT_VNDK_VERSION isn't set.
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.arc
⊕include_dirs
⊕shared_libs
⊕static_libs
⊕srcs
⊕whole_static_libs
⊕product_variables.build_from_text_stub
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕strip.all
⊕strip.keep_symbols
⊕strip.keep_symbols_and_debug_frame
⊕static_libs
⊕whole_static_libs
⊕shared_libs
⊕srcs
⊕product_variables.eng
⊕product_variables.malloc_low_memory
⊕shared_libs
⊕whole_static_libs
⊕static_libs
⊕srcs
⊕product_variables.native_coverage
⊕product_variables.release_aidl_use_unfrozen
⊕required
⊕vintf_fragment_modules
⊕product_variables.selinuxignoreneverallows
⊕product_variables.unbundled_build
⊕enabled
Configurable[bool]
Configurable[bool]
proptools.Configurable[bool]
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
ramdisk_available
bool, Make this module available when building for ramdisk.
On device without a dedicated recovery partition, the module is only
available after switching root into
/first_stage_ramdisk. To expose the module before switching root, install
the recovery variant instead.
recovery
bool, Whether this module is installed to recovery partition
recovery_available
bool, Make this module available when building for recovery
relative_install_path
string, install to a subdirectory of the default install path for the module
required
configurable list of string, names of other modules to install if this module is installed
⊕rlib
VariantLibraryProperties
enabled
bool
srcs
list of string
rlibs
configurable list of string, list of rust rlib crate dependencies
rustlibs
configurable list of string, list of rust automatic crate dependencies.
Rustlibs linkage is rlib for host targets and dylib for device targets.
⊕sanitize
enable AddressSanitizer, HWAddressSanitizer, and others.
address
bool
hwaddress
bool
memtag_heap
bool, Memory-tagging, only available on arm64
if diag.memtag unset or false, enables async memory tagging
fuzzer
bool
never
bool
⊕diag
Sanitizers to run in the diagnostic mode (as opposed to the release mode).
Replaces abort() on error with a human-readable error message.
Address and Thread sanitizers always run in diagnostic mode.
memtag_heap
bool, Memory-tagging, only available on arm64
requires sanitizer.memtag: true
if set, enables sync memory tagging
sdk_version
string, The API level that this module is built against. The APIs of this API level will be
visible at build time, but use of any APIs newer than min_sdk_version will render the
module unloadable on older devices. In the future it will be possible to weakly-link new
APIs, making the behavior match Java: such modules will load on older devices, but
calling new APIs on devices that do not support them will result in a crash.
This property has the same behavior as sdk_version does for Java modules. For those
familiar with Android Gradle, the property behaves similarly to how compileSdkVersion
does for Java code.
In addition, setting this property causes two variants to be built, one for the platform
and one for apps.
⊕shared
VariantLibraryProperties
enabled
bool
srcs
list of string
shared_libs
configurable list of string, list of C shared library dependencies
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
⊕static
VariantLibraryProperties
enabled
bool
srcs
list of string
static_libs
configurable list of string, list of C static library dependencies. These dependencies do not normally propagate to dependents
and may need to be redeclared. See whole_static_libs for bundling static dependencies into a library.
stdlibs
configurable list of string, list of Rust system library dependencies.
This is usually only needed when `no_stdlibs` is true, in which case it can be used to depend on system crates
like `core` and `alloc`.
stem
string, sets name of the output
⊕strip
none
bool, Device modules default to stripping enabled leaving mini debuginfo.
Host modules default to stripping disabled, but can be enabled by setting any other
strip boolean property.
all
bool, all forces stripping everything, including the mini debug info.
keep_symbols
bool, keep_symbols enables stripping but keeps all symbols.
keep_symbols_list
list of string, keep_symbols_list specifies a list of symbols to keep if keep_symbols is enabled.
If it is unset then all symbols are kept.
keep_symbols_and_debug_frame
bool, keep_symbols_and_debug_frame enables stripping but keeps all symbols and debug frames.
⊕stubs
*ast.SelectorExpr
Generate stubs to make this library accessible to APEXes.
Can only be set for modules producing shared libraries.
symbol_file
string, Relative path to the symbol map. The symbol map provides the list of
symbols that are exported for stubs variant of this library.
versions
list of string, List versions to generate stubs libs for. The version name "current" is always
implicitly added.
implementation_installable
bool, Whether to not require the implementation of the library to be installed if a
client of the stubs is installed. Defaults to true; set to false if the
implementation is made available by some other means, e.g. in a Microdroid
virtual machine.
suffix
string, append to name of output
sysroot
bool, Whether this library is part of the Rust toolchain sysroot.
system_dlkm_specific
bool, Install to partition system_dlkm when set to true.
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
compile_multilib
string
enabled
bool
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
use_expansive_default_srcs
bool, Set this to true to use an expansive default set of source file requirements
(all .rs, .h, .xml, and .md files in the module tree).
This is primarily for tracking sources for RBE purposes. Currently defaults
to true, though this may change in the future.
use_generic_config
bool, Set to true if this module must be generic and does not require product-specific information.
To be included in the system image, this property must be set to true.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_available
bool, whether this module should be allowed to be directly depended by other
modules with `vendor: true`, `proprietary: true`, or `vendor_available:true`.
If set to true, two variants will be built separately, one like
normal, and the other limited to the set of libraries and headers
that are exposed to /vendor modules.
The vendor variant may be used with a different (newer) /system,
so it shouldn't have any unversioned runtime dependencies, or
make assumptions about the system that may not be true in the
future.
If set to false, this module becomes inaccessible from /vendor modules.
The modules with vndk: {enabled: true} must define 'vendor_available'
to 'true'.
Nothing happens if BOARD_VNDK_VERSION isn't set in the BoardConfig.mk
vendor_dlkm_specific
bool, Install to partition vendor_dlkm when set to true.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vendor_ramdisk_available
bool, Make this module available when building for vendor ramdisk.
On device without a dedicated recovery partition, the module is only
available after switching root into
/first_stage_ramdisk. To expose the module before switching root, install
the recovery variant instead
version_script
string, Version script to pass to the linker. By default this will replace the
implicit rustc emitted version script to mirror expected behavior in CC.
This is only relevant for rust_ffi_shared modules which are exposing a
versioned C API.
vintf_fragment_modules
configurable list of string, vintf_fragment Modules required from this module.
vintf_fragments
configurable list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
whole_static_libs
configurable list of string, Similar to static_libs, but will bundle the static library dependency into a library. This is helpful
to avoid having to redeclare the dependency for dependents of this library, but in some cases may also
result in bloat if multiple dependencies all include the same static library whole.
The common use case for this is when the static library is unlikely to be a dependency of other modules to avoid
having to redeclare the static library dependency for every dependent module.
If you are not sure what to, for rust_library modules most static dependencies should go in static_libraries,
and for rust_ffi modules most static dependencies should go into whole_static_libraries.
For rust_ffi static variants, these libraries will be included in the resulting static library archive.
For rust_library rlib variants, these libraries will be bundled into the resulting rlib library. This will
include all of the static libraries symbols in any dylibs or binaries which use this rlib as well.
rust_ffi_host_static
rust_library_rlib_host and rust_ffi_static_host produces an rlib for the host
(Rust crate type "rlib").
name
,
srcs
,
defaults
,
afdo
,
aliases
,
apex_available
,
apex_exclude
,
arch
,
bootstrap
,
cargo_env_compat
,
cargo_pkg_version
,
cfgs
,
clippy_lints
,
compile_multilib
,
crate_name
,
crate_root
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
double_loadable
,
dylib
,
edition
,
enabled
,
exclude_from_recovery_snapshot
,
exclude_from_vendor_snapshot
,
export_include_dirs
,
extra_exported_symbols
,
features
,
flags
,
host_cross_supported
,
host_required
,
include_dirs
,
init_rc
,
installable
,
ld_flags
,
licenses
,
lints
,
lto
,
min_sdk_version
,
multilib
,
native_bridge_supported
,
native_coverage
,
no_full_install
,
no_stdlibs
,
odm_available
,
odm_dlkm_specific
,
overrides
,
owner
,
prefer_rlib
,
proc_macros
,
product_available
,
product_specific
,
product_variables.arc
,
product_variables.build_from_text_stub
,
product_variables.debuggable
,
product_variables.eng
,
product_variables.malloc_low_memory
,
product_variables.native_coverage
,
product_variables.release_aidl_use_unfrozen
,
product_variables.selinuxignoreneverallows
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
ramdisk_available
,
recovery
,
recovery_available
,
relative_install_path
,
required
,
rlib
,
rlibs
,
rustlibs
,
sanitize
,
sdk_version
,
shared
,
shared_libs
,
soc_specific
,
static
,
static_libs
,
stdlibs
,
stem
,
strip
,
stubs
,
suffix
,
sysroot
,
system_dlkm_specific
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
use_expansive_default_srcs
,
use_generic_config
,
vendor
,
vendor_available
,
vendor_dlkm_specific
,
vendor_ramdisk
,
vendor_ramdisk_available
,
version_script
,
vintf_fragment_modules
,
vintf_fragments
,
visibility
,
whole_static_libs
name
string, The name of the module. Must be unique across all modules.
srcs
list of string, path to the source file that is the main entry point of the program (e.g. main.rs or lib.rs).
Only a single source file can be defined. Modules which generate source can be included by prefixing
the module name with ":", for example ":libfoo_bindgen"
If no source file is defined, a single generated source module can be defined to be used as the main source.
defaults
list of string
afdo
bool, Afdo allows developers self-service enroll for
automatic feedback-directed optimization using profile data.
aliases
list of string, Rust crate dependencies to rename. Each entry should be a string of the form "dependencyname:alias".
"dependencyname" here should be the name of the crate, not the Android module. This is
equivalent to writing `alias = { package = "dependencyname" }` in a `Cargo.toml`.
apex_available
list of string, Availability of this module in APEXes. Only the listed APEXes can contain this module. If
the module has stubs then other APEXes and the platform may access it through them
(subject to visibility).
"//apex_available:anyapex" is a pseudo APEX name that matches to any APEX.
"//apex_available:platform" refers to non-APEX partitions like "system.img".
Prefix pattern (com.foo.*) can be used to match with any APEX name with the prefix(com.foo.).
Default is ["//apex_available:platform"].
apex_exclude
bool, Deprecated - exclude this rust_ffi target from being included in APEXes.
TODO(b/362509506): remove this once all apex_exclude uses are switched to stubs.
arch
interface
bootstrap
bool, Allows this module to use non-APEX version of libraries. Useful
for building binaries that are started before APEXes are activated.
cargo_env_compat
bool, Enables emitting certain Cargo environment variables. Only intended to be used for compatibility purposes.
Will set CARGO_CRATE_NAME to the crate_name property's value.
Will set CARGO_BIN_NAME to the output filename value without the extension.
cargo_pkg_version
string, If cargo_env_compat is true, sets the CARGO_PKG_VERSION env var to this value.
cfgs
configurable list of string, list of configuration options to enable for this crate. To enable features, use the "features" property.
clippy_lints
string, name of the lint set that should be used to validate this module.
Possible values are "default" (for using a sensible set of lints
depending on the module's location), "android" (for the strictest
lint set that applies to all Android platform code), "vendor" (for a
relaxed set) and "none" (to disable the execution of clippy). The
default value is "default". See also the `lints` property.
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
crate_name
string, crate name, required for modules which produce Rust libraries: rust_library, rust_ffi and SourceProvider
modules which create library variants (rust_bindgen). This must be the expected extern crate name used in
source, and is required to conform to an enforced format matching library output files (if the output file is
lib<someName><suffix>, the crate_name property must be <someName>).
crate_root
string, Entry point that is passed to rustc to begin the compilation. E.g. main.rs or lib.rs.
When this property is set,
* sandboxing is enabled for this module, and
* the srcs attribute is interpreted as a list of all source files potentially
used in compilation, including the entrypoint, and
* compile_data can be used to add additional files used in compilation that
not directly used as source files.
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
prepend_artifact_with_product
bool, If true, then the artifact file will be prepended with <product name>-. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be coral-foo.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
double_loadable
bool, whether this module is capable of being loaded with other instance
(possibly an older version) of the same module in the same process.
Currently, a shared library that is a member of VNDK (vndk: {enabled: true})
can be double loaded in a vendor process if the library is also a
(direct and indirect) dependency of an LLNDK library. Such libraries must be
explicitly marked as `double_loadable: true` by the owner, or the dependency
from the LLNDK lib should be cut if the lib is not designed to be double loaded.
⊕dylib
VariantLibraryProperties
enabled
bool
srcs
list of string
edition
string, specific rust edition that should be used if the default version is not desired
enabled
configurable bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
exclude_from_recovery_snapshot
bool, Normally Soong uses the directory structure to decide which modules
should be included (framework) or excluded (non-framework) from the
different snapshots (vendor, recovery, etc.), but this property
allows a partner to exclude a module normally thought of as a
framework module from the recovery snapshot.
exclude_from_vendor_snapshot
bool, Normally Soong uses the directory structure to decide which modules
should be included (framework) or excluded (non-framework) from the
different snapshots (vendor, recovery, etc.), but this property
allows a partner to exclude a module normally thought of as a
framework module from the vendor snapshot.
export_include_dirs
list of string, path to include directories to export to cc_* modules, only relevant for static/shared variants.
features
configurable list of string, list of features to enable for this crate
flags
list of string, flags to pass to rustc. To enable configuration options or features, use the "cfgs" or "features" properties.
host_cross_supported
bool, If set to true, build a variant of the module for the host cross. Defaults to true.
host_required
list of string, names of other modules to install on host if this module is installed
include_dirs
list of string, TODO: Remove this when all instances of Include_dirs have been removed from rust_ffi modules.
path to include directories to pass to cc_* modules, only relevant for static/shared variants (deprecated, use export_include_dirs instead).
init_rc
configurable list of string, init.rc files to be installed if this module is installed
installable
bool
ld_flags
list of string, flags to pass to the linker
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
lints
string, name of the lint set that should be used to validate this module.
Possible values are "default" (for using a sensible set of lints
depending on the module's location), "android" (for the strictest
lint set that applies to all Android platform code), "vendor" (for
a relaxed set) and "none" (for ignoring all lint warnings and
errors). The default value is "default".
⊕lto
Control whether LTO is used for the final (Rust) linkage. This does not impact
cross-language LTO.
thin
bool, Whether thin LTO should be enabled. By default this is true.
LTO provides such a large code size benefit for Rust, this should always
be enabled for production builds unless there's a clear need to disable it.
min_sdk_version
string, Minimum OS API level supported by this C or C++ module. This property becomes the value
of the __ANDROID_API__ macro. When the C or C++ module is included in an APEX or an APK,
this property is also used to ensure that the min_sdk_version of the containing module is
not older (i.e. less) than this module's min_sdk_version. When not set, this property
defaults to the value of sdk_version. When this is set to "apex_inherit", this tracks
min_sdk_version of the containing APEX. When the module
is not built for an APEX, "apex_inherit" defaults to sdk_version.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
native_coverage
bool
no_full_install
bool, When set to true, this module is not installed to the full install path (ex: under
out/target/product/<name>/<partition>). It can be installed only to the packaging
modules like android_filesystem.
no_stdlibs
bool, whether to suppress inclusion of standard crates - defaults to false
odm_available
bool, This is the same as the "vendor_available" except that the install path
of the vendor variant is /odm or /vendor/odm.
By replacing "vendor_available: true" with "odm_available: true", the
module will install its vendor variant to the /odm partition or /vendor/odm.
As the modules with "odm_available: true" still create the vendor variants,
they can link to the other vendor modules as the vendor_available modules do.
Also, the vendor modules can link to odm_available modules.
It may not be used for VNDK modules.
odm_dlkm_specific
bool, Install to partition odm_dlkm when set to true.
overrides
list of string, List of module names that are prevented from being installed when this module gets
installed.
owner
string, vendor who owns this module
prefer_rlib
bool, Change the rustlibs linkage to select rlib linkage by default for device targets.
Also link libstd as an rlib as well on device targets.
Note: This is the default behavior for host targets.
This is primarily meant for rust_binary and rust_ffi modules where the default
linkage of libstd might need to be overridden in some use cases. This should
generally be avoided with other module types since it may cause collisions at
linkage if all dependencies of the root binary module do not link against libstd
the same way.
proc_macros
configurable list of string, list of rust proc_macro crate dependencies
product_available
bool, whether this module should be allowed to be directly depended by other
modules with `product_specific: true` or `product_available: true`.
If set to true, an additional product variant will be built separately
that is limited to the set of libraries and headers that are exposed to
/product modules.
The product variant may be used with a different (newer) /system,
so it shouldn't have any unversioned runtime dependencies, or
make assumptions about the system that may not be true in the
future.
If set to false, this module becomes inaccessible from /product modules.
Different from the 'vendor_available' property, the modules with
vndk: {enabled: true} don't have to define 'product_available'. The VNDK
library without 'product_available' may not be depended on by any other
modules that has product variants including the product available VNDKs.
Nothing happens if BOARD_VNDK_VERSION isn't set in the BoardConfig.mk
and PRODUCT_PRODUCT_VNDK_VERSION isn't set.
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.arc
⊕include_dirs
⊕shared_libs
⊕static_libs
⊕srcs
⊕whole_static_libs
⊕product_variables.build_from_text_stub
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕strip.all
⊕strip.keep_symbols
⊕strip.keep_symbols_and_debug_frame
⊕static_libs
⊕whole_static_libs
⊕shared_libs
⊕srcs
⊕product_variables.eng
⊕product_variables.malloc_low_memory
⊕shared_libs
⊕whole_static_libs
⊕static_libs
⊕srcs
⊕product_variables.native_coverage
⊕product_variables.release_aidl_use_unfrozen
⊕required
⊕vintf_fragment_modules
⊕product_variables.selinuxignoreneverallows
⊕product_variables.unbundled_build
⊕enabled
Configurable[bool]
Configurable[bool]
proptools.Configurable[bool]
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
ramdisk_available
bool, Make this module available when building for ramdisk.
On device without a dedicated recovery partition, the module is only
available after switching root into
/first_stage_ramdisk. To expose the module before switching root, install
the recovery variant instead.
recovery
bool, Whether this module is installed to recovery partition
recovery_available
bool, Make this module available when building for recovery
relative_install_path
string, install to a subdirectory of the default install path for the module
required
configurable list of string, names of other modules to install if this module is installed
⊕rlib
VariantLibraryProperties
enabled
bool
srcs
list of string
rlibs
configurable list of string, list of rust rlib crate dependencies
rustlibs
configurable list of string, list of rust automatic crate dependencies.
Rustlibs linkage is rlib for host targets and dylib for device targets.
⊕sanitize
enable AddressSanitizer, HWAddressSanitizer, and others.
address
bool
hwaddress
bool
memtag_heap
bool, Memory-tagging, only available on arm64
if diag.memtag unset or false, enables async memory tagging
fuzzer
bool
never
bool
⊕diag
Sanitizers to run in the diagnostic mode (as opposed to the release mode).
Replaces abort() on error with a human-readable error message.
Address and Thread sanitizers always run in diagnostic mode.
memtag_heap
bool, Memory-tagging, only available on arm64
requires sanitizer.memtag: true
if set, enables sync memory tagging
sdk_version
string, The API level that this module is built against. The APIs of this API level will be
visible at build time, but use of any APIs newer than min_sdk_version will render the
module unloadable on older devices. In the future it will be possible to weakly-link new
APIs, making the behavior match Java: such modules will load on older devices, but
calling new APIs on devices that do not support them will result in a crash.
This property has the same behavior as sdk_version does for Java modules. For those
familiar with Android Gradle, the property behaves similarly to how compileSdkVersion
does for Java code.
In addition, setting this property causes two variants to be built, one for the platform
and one for apps.
⊕shared
VariantLibraryProperties
enabled
bool
srcs
list of string
shared_libs
configurable list of string, list of C shared library dependencies
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
⊕static
VariantLibraryProperties
enabled
bool
srcs
list of string
static_libs
configurable list of string, list of C static library dependencies. These dependencies do not normally propagate to dependents
and may need to be redeclared. See whole_static_libs for bundling static dependencies into a library.
stdlibs
configurable list of string, list of Rust system library dependencies.
This is usually only needed when `no_stdlibs` is true, in which case it can be used to depend on system crates
like `core` and `alloc`.
stem
string, sets name of the output
⊕strip
none
bool, Device modules default to stripping enabled leaving mini debuginfo.
Host modules default to stripping disabled, but can be enabled by setting any other
strip boolean property.
all
bool, all forces stripping everything, including the mini debug info.
keep_symbols
bool, keep_symbols enables stripping but keeps all symbols.
keep_symbols_list
list of string, keep_symbols_list specifies a list of symbols to keep if keep_symbols is enabled.
If it is unset then all symbols are kept.
keep_symbols_and_debug_frame
bool, keep_symbols_and_debug_frame enables stripping but keeps all symbols and debug frames.
⊕stubs
*ast.SelectorExpr
Generate stubs to make this library accessible to APEXes.
Can only be set for modules producing shared libraries.
symbol_file
string, Relative path to the symbol map. The symbol map provides the list of
symbols that are exported for stubs variant of this library.
versions
list of string, List versions to generate stubs libs for. The version name "current" is always
implicitly added.
implementation_installable
bool, Whether to not require the implementation of the library to be installed if a
client of the stubs is installed. Defaults to true; set to false if the
implementation is made available by some other means, e.g. in a Microdroid
virtual machine.
suffix
string, append to name of output
sysroot
bool, Whether this library is part of the Rust toolchain sysroot.
system_dlkm_specific
bool, Install to partition system_dlkm when set to true.
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
compile_multilib
string
enabled
bool
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
use_expansive_default_srcs
bool, Set this to true to use an expansive default set of source file requirements
(all .rs, .h, .xml, and .md files in the module tree).
This is primarily for tracking sources for RBE purposes. Currently defaults
to true, though this may change in the future.
use_generic_config
bool, Set to true if this module must be generic and does not require product-specific information.
To be included in the system image, this property must be set to true.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_available
bool, whether this module should be allowed to be directly depended by other
modules with `vendor: true`, `proprietary: true`, or `vendor_available:true`.
If set to true, two variants will be built separately, one like
normal, and the other limited to the set of libraries and headers
that are exposed to /vendor modules.
The vendor variant may be used with a different (newer) /system,
so it shouldn't have any unversioned runtime dependencies, or
make assumptions about the system that may not be true in the
future.
If set to false, this module becomes inaccessible from /vendor modules.
The modules with vndk: {enabled: true} must define 'vendor_available'
to 'true'.
Nothing happens if BOARD_VNDK_VERSION isn't set in the BoardConfig.mk
vendor_dlkm_specific
bool, Install to partition vendor_dlkm when set to true.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vendor_ramdisk_available
bool, Make this module available when building for vendor ramdisk.
On device without a dedicated recovery partition, the module is only
available after switching root into
/first_stage_ramdisk. To expose the module before switching root, install
the recovery variant instead
version_script
string, Version script to pass to the linker. By default this will replace the
implicit rustc emitted version script to mirror expected behavior in CC.
This is only relevant for rust_ffi_shared modules which are exposing a
versioned C API.
vintf_fragment_modules
configurable list of string, vintf_fragment Modules required from this module.
vintf_fragments
configurable list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
whole_static_libs
configurable list of string, Similar to static_libs, but will bundle the static library dependency into a library. This is helpful
to avoid having to redeclare the dependency for dependents of this library, but in some cases may also
result in bloat if multiple dependencies all include the same static library whole.
The common use case for this is when the static library is unlikely to be a dependency of other modules to avoid
having to redeclare the static library dependency for every dependent module.
If you are not sure what to, for rust_library modules most static dependencies should go in static_libraries,
and for rust_ffi modules most static dependencies should go into whole_static_libraries.
For rust_ffi static variants, these libraries will be included in the resulting static library archive.
For rust_library rlib variants, these libraries will be bundled into the resulting rlib library. This will
include all of the static libraries symbols in any dylibs or binaries which use this rlib as well.
rust_ffi_shared
rust_ffi_shared produces a shared library (Rust crate type
"cdylib").
name
,
srcs
,
defaults
,
host_supported
,
device_supported
,
afdo
,
aliases
,
apex_available
,
apex_exclude
,
arch
,
bootstrap
,
cargo_env_compat
,
cargo_pkg_version
,
cfgs
,
clippy_lints
,
compile_multilib
,
crate_name
,
crate_root
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
double_loadable
,
dylib
,
edition
,
enabled
,
exclude_from_recovery_snapshot
,
exclude_from_vendor_snapshot
,
export_include_dirs
,
extra_exported_symbols
,
features
,
flags
,
host_cross_supported
,
host_required
,
include_dirs
,
init_rc
,
installable
,
ld_flags
,
licenses
,
lints
,
lto
,
min_sdk_version
,
multilib
,
native_bridge_supported
,
native_coverage
,
no_full_install
,
no_stdlibs
,
odm_available
,
odm_dlkm_specific
,
overrides
,
owner
,
prefer_rlib
,
proc_macros
,
product_available
,
product_specific
,
product_variables.arc
,
product_variables.build_from_text_stub
,
product_variables.debuggable
,
product_variables.eng
,
product_variables.malloc_low_memory
,
product_variables.native_coverage
,
product_variables.release_aidl_use_unfrozen
,
product_variables.selinuxignoreneverallows
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
ramdisk_available
,
recovery
,
recovery_available
,
relative_install_path
,
required
,
rlib
,
rlibs
,
rustlibs
,
sanitize
,
sdk_version
,
shared
,
shared_libs
,
soc_specific
,
static
,
static_libs
,
stdlibs
,
stem
,
strip
,
stubs
,
suffix
,
sysroot
,
system_dlkm_specific
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
use_expansive_default_srcs
,
use_generic_config
,
vendor
,
vendor_available
,
vendor_dlkm_specific
,
vendor_ramdisk
,
vendor_ramdisk_available
,
version_script
,
vintf_fragment_modules
,
vintf_fragments
,
visibility
,
whole_static_libs
name
string, The name of the module. Must be unique across all modules.
srcs
list of string, path to the source file that is the main entry point of the program (e.g. main.rs or lib.rs).
Only a single source file can be defined. Modules which generate source can be included by prefixing
the module name with ":", for example ":libfoo_bindgen"
If no source file is defined, a single generated source module can be defined to be used as the main source.
defaults
list of string
host_supported
bool, If set to true, build a variant of the module for the host. Defaults to false.
device_supported
bool, If set to true, build a variant of the module for the device. Defaults to true.
afdo
bool, Afdo allows developers self-service enroll for
automatic feedback-directed optimization using profile data.
aliases
list of string, Rust crate dependencies to rename. Each entry should be a string of the form "dependencyname:alias".
"dependencyname" here should be the name of the crate, not the Android module. This is
equivalent to writing `alias = { package = "dependencyname" }` in a `Cargo.toml`.
apex_available
list of string, Availability of this module in APEXes. Only the listed APEXes can contain this module. If
the module has stubs then other APEXes and the platform may access it through them
(subject to visibility).
"//apex_available:anyapex" is a pseudo APEX name that matches to any APEX.
"//apex_available:platform" refers to non-APEX partitions like "system.img".
Prefix pattern (com.foo.*) can be used to match with any APEX name with the prefix(com.foo.).
Default is ["//apex_available:platform"].
apex_exclude
bool, Deprecated - exclude this rust_ffi target from being included in APEXes.
TODO(b/362509506): remove this once all apex_exclude uses are switched to stubs.
arch
interface
bootstrap
bool, Allows this module to use non-APEX version of libraries. Useful
for building binaries that are started before APEXes are activated.
cargo_env_compat
bool, Enables emitting certain Cargo environment variables. Only intended to be used for compatibility purposes.
Will set CARGO_CRATE_NAME to the crate_name property's value.
Will set CARGO_BIN_NAME to the output filename value without the extension.
cargo_pkg_version
string, If cargo_env_compat is true, sets the CARGO_PKG_VERSION env var to this value.
cfgs
configurable list of string, list of configuration options to enable for this crate. To enable features, use the "features" property.
clippy_lints
string, name of the lint set that should be used to validate this module.
Possible values are "default" (for using a sensible set of lints
depending on the module's location), "android" (for the strictest
lint set that applies to all Android platform code), "vendor" (for a
relaxed set) and "none" (to disable the execution of clippy). The
default value is "default". See also the `lints` property.
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
crate_name
string, crate name, required for modules which produce Rust libraries: rust_library, rust_ffi and SourceProvider
modules which create library variants (rust_bindgen). This must be the expected extern crate name used in
source, and is required to conform to an enforced format matching library output files (if the output file is
lib<someName><suffix>, the crate_name property must be <someName>).
crate_root
string, Entry point that is passed to rustc to begin the compilation. E.g. main.rs or lib.rs.
When this property is set,
* sandboxing is enabled for this module, and
* the srcs attribute is interpreted as a list of all source files potentially
used in compilation, including the entrypoint, and
* compile_data can be used to add additional files used in compilation that
not directly used as source files.
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
prepend_artifact_with_product
bool, If true, then the artifact file will be prepended with <product name>-. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be coral-foo.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
double_loadable
bool, whether this module is capable of being loaded with other instance
(possibly an older version) of the same module in the same process.
Currently, a shared library that is a member of VNDK (vndk: {enabled: true})
can be double loaded in a vendor process if the library is also a
(direct and indirect) dependency of an LLNDK library. Such libraries must be
explicitly marked as `double_loadable: true` by the owner, or the dependency
from the LLNDK lib should be cut if the lib is not designed to be double loaded.
⊕dylib
VariantLibraryProperties
enabled
bool
srcs
list of string
edition
string, specific rust edition that should be used if the default version is not desired
enabled
configurable bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
exclude_from_recovery_snapshot
bool, Normally Soong uses the directory structure to decide which modules
should be included (framework) or excluded (non-framework) from the
different snapshots (vendor, recovery, etc.), but this property
allows a partner to exclude a module normally thought of as a
framework module from the recovery snapshot.
exclude_from_vendor_snapshot
bool, Normally Soong uses the directory structure to decide which modules
should be included (framework) or excluded (non-framework) from the
different snapshots (vendor, recovery, etc.), but this property
allows a partner to exclude a module normally thought of as a
framework module from the vendor snapshot.
export_include_dirs
list of string, path to include directories to export to cc_* modules, only relevant for static/shared variants.
features
configurable list of string, list of features to enable for this crate
flags
list of string, flags to pass to rustc. To enable configuration options or features, use the "cfgs" or "features" properties.
host_cross_supported
bool, If set to true, build a variant of the module for the host cross. Defaults to true.
host_required
list of string, names of other modules to install on host if this module is installed
include_dirs
list of string, TODO: Remove this when all instances of Include_dirs have been removed from rust_ffi modules.
path to include directories to pass to cc_* modules, only relevant for static/shared variants (deprecated, use export_include_dirs instead).
init_rc
configurable list of string, init.rc files to be installed if this module is installed
installable
bool
ld_flags
list of string, flags to pass to the linker
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
lints
string, name of the lint set that should be used to validate this module.
Possible values are "default" (for using a sensible set of lints
depending on the module's location), "android" (for the strictest
lint set that applies to all Android platform code), "vendor" (for
a relaxed set) and "none" (for ignoring all lint warnings and
errors). The default value is "default".
⊕lto
Control whether LTO is used for the final (Rust) linkage. This does not impact
cross-language LTO.
thin
bool, Whether thin LTO should be enabled. By default this is true.
LTO provides such a large code size benefit for Rust, this should always
be enabled for production builds unless there's a clear need to disable it.
min_sdk_version
string, Minimum OS API level supported by this C or C++ module. This property becomes the value
of the __ANDROID_API__ macro. When the C or C++ module is included in an APEX or an APK,
this property is also used to ensure that the min_sdk_version of the containing module is
not older (i.e. less) than this module's min_sdk_version. When not set, this property
defaults to the value of sdk_version. When this is set to "apex_inherit", this tracks
min_sdk_version of the containing APEX. When the module
is not built for an APEX, "apex_inherit" defaults to sdk_version.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
native_coverage
bool
no_full_install
bool, When set to true, this module is not installed to the full install path (ex: under
out/target/product/<name>/<partition>). It can be installed only to the packaging
modules like android_filesystem.
no_stdlibs
bool, whether to suppress inclusion of standard crates - defaults to false
odm_available
bool, This is the same as the "vendor_available" except that the install path
of the vendor variant is /odm or /vendor/odm.
By replacing "vendor_available: true" with "odm_available: true", the
module will install its vendor variant to the /odm partition or /vendor/odm.
As the modules with "odm_available: true" still create the vendor variants,
they can link to the other vendor modules as the vendor_available modules do.
Also, the vendor modules can link to odm_available modules.
It may not be used for VNDK modules.
odm_dlkm_specific
bool, Install to partition odm_dlkm when set to true.
overrides
list of string, List of module names that are prevented from being installed when this module gets
installed.
owner
string, vendor who owns this module
prefer_rlib
bool, Change the rustlibs linkage to select rlib linkage by default for device targets.
Also link libstd as an rlib as well on device targets.
Note: This is the default behavior for host targets.
This is primarily meant for rust_binary and rust_ffi modules where the default
linkage of libstd might need to be overridden in some use cases. This should
generally be avoided with other module types since it may cause collisions at
linkage if all dependencies of the root binary module do not link against libstd
the same way.
proc_macros
configurable list of string, list of rust proc_macro crate dependencies
product_available
bool, whether this module should be allowed to be directly depended by other
modules with `product_specific: true` or `product_available: true`.
If set to true, an additional product variant will be built separately
that is limited to the set of libraries and headers that are exposed to
/product modules.
The product variant may be used with a different (newer) /system,
so it shouldn't have any unversioned runtime dependencies, or
make assumptions about the system that may not be true in the
future.
If set to false, this module becomes inaccessible from /product modules.
Different from the 'vendor_available' property, the modules with
vndk: {enabled: true} don't have to define 'product_available'. The VNDK
library without 'product_available' may not be depended on by any other
modules that has product variants including the product available VNDKs.
Nothing happens if BOARD_VNDK_VERSION isn't set in the BoardConfig.mk
and PRODUCT_PRODUCT_VNDK_VERSION isn't set.
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.arc
⊕include_dirs
⊕shared_libs
⊕static_libs
⊕srcs
⊕whole_static_libs
⊕product_variables.build_from_text_stub
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕strip.all
⊕strip.keep_symbols
⊕strip.keep_symbols_and_debug_frame
⊕static_libs
⊕whole_static_libs
⊕shared_libs
⊕srcs
⊕product_variables.eng
⊕product_variables.malloc_low_memory
⊕shared_libs
⊕whole_static_libs
⊕static_libs
⊕srcs
⊕product_variables.native_coverage
⊕product_variables.release_aidl_use_unfrozen
⊕required
⊕vintf_fragment_modules
⊕product_variables.selinuxignoreneverallows
⊕product_variables.unbundled_build
⊕enabled
Configurable[bool]
Configurable[bool]
proptools.Configurable[bool]
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
ramdisk_available
bool, Make this module available when building for ramdisk.
On device without a dedicated recovery partition, the module is only
available after switching root into
/first_stage_ramdisk. To expose the module before switching root, install
the recovery variant instead.
recovery
bool, Whether this module is installed to recovery partition
recovery_available
bool, Make this module available when building for recovery
relative_install_path
string, install to a subdirectory of the default install path for the module
required
configurable list of string, names of other modules to install if this module is installed
⊕rlib
VariantLibraryProperties
enabled
bool
srcs
list of string
rlibs
configurable list of string, list of rust rlib crate dependencies
rustlibs
configurable list of string, list of rust automatic crate dependencies.
Rustlibs linkage is rlib for host targets and dylib for device targets.
⊕sanitize
enable AddressSanitizer, HWAddressSanitizer, and others.
address
bool
hwaddress
bool
memtag_heap
bool, Memory-tagging, only available on arm64
if diag.memtag unset or false, enables async memory tagging
fuzzer
bool
never
bool
⊕diag
Sanitizers to run in the diagnostic mode (as opposed to the release mode).
Replaces abort() on error with a human-readable error message.
Address and Thread sanitizers always run in diagnostic mode.
memtag_heap
bool, Memory-tagging, only available on arm64
requires sanitizer.memtag: true
if set, enables sync memory tagging
sdk_version
string, The API level that this module is built against. The APIs of this API level will be
visible at build time, but use of any APIs newer than min_sdk_version will render the
module unloadable on older devices. In the future it will be possible to weakly-link new
APIs, making the behavior match Java: such modules will load on older devices, but
calling new APIs on devices that do not support them will result in a crash.
This property has the same behavior as sdk_version does for Java modules. For those
familiar with Android Gradle, the property behaves similarly to how compileSdkVersion
does for Java code.
In addition, setting this property causes two variants to be built, one for the platform
and one for apps.
⊕shared
VariantLibraryProperties
enabled
bool
srcs
list of string
shared_libs
configurable list of string, list of C shared library dependencies
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
⊕static
VariantLibraryProperties
enabled
bool
srcs
list of string
static_libs
configurable list of string, list of C static library dependencies. These dependencies do not normally propagate to dependents
and may need to be redeclared. See whole_static_libs for bundling static dependencies into a library.
stdlibs
configurable list of string, list of Rust system library dependencies.
This is usually only needed when `no_stdlibs` is true, in which case it can be used to depend on system crates
like `core` and `alloc`.
stem
string, sets name of the output
⊕strip
none
bool, Device modules default to stripping enabled leaving mini debuginfo.
Host modules default to stripping disabled, but can be enabled by setting any other
strip boolean property.
all
bool, all forces stripping everything, including the mini debug info.
keep_symbols
bool, keep_symbols enables stripping but keeps all symbols.
keep_symbols_list
list of string, keep_symbols_list specifies a list of symbols to keep if keep_symbols is enabled.
If it is unset then all symbols are kept.
keep_symbols_and_debug_frame
bool, keep_symbols_and_debug_frame enables stripping but keeps all symbols and debug frames.
⊕stubs
*ast.SelectorExpr
Generate stubs to make this library accessible to APEXes.
Can only be set for modules producing shared libraries.
symbol_file
string, Relative path to the symbol map. The symbol map provides the list of
symbols that are exported for stubs variant of this library.
versions
list of string, List versions to generate stubs libs for. The version name "current" is always
implicitly added.
implementation_installable
bool, Whether to not require the implementation of the library to be installed if a
client of the stubs is installed. Defaults to true; set to false if the
implementation is made available by some other means, e.g. in a Microdroid
virtual machine.
suffix
string, append to name of output
sysroot
bool, Whether this library is part of the Rust toolchain sysroot.
system_dlkm_specific
bool, Install to partition system_dlkm when set to true.
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
compile_multilib
string
enabled
bool
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
use_expansive_default_srcs
bool, Set this to true to use an expansive default set of source file requirements
(all .rs, .h, .xml, and .md files in the module tree).
This is primarily for tracking sources for RBE purposes. Currently defaults
to true, though this may change in the future.
use_generic_config
bool, Set to true if this module must be generic and does not require product-specific information.
To be included in the system image, this property must be set to true.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_available
bool, whether this module should be allowed to be directly depended by other
modules with `vendor: true`, `proprietary: true`, or `vendor_available:true`.
If set to true, two variants will be built separately, one like
normal, and the other limited to the set of libraries and headers
that are exposed to /vendor modules.
The vendor variant may be used with a different (newer) /system,
so it shouldn't have any unversioned runtime dependencies, or
make assumptions about the system that may not be true in the
future.
If set to false, this module becomes inaccessible from /vendor modules.
The modules with vndk: {enabled: true} must define 'vendor_available'
to 'true'.
Nothing happens if BOARD_VNDK_VERSION isn't set in the BoardConfig.mk
vendor_dlkm_specific
bool, Install to partition vendor_dlkm when set to true.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vendor_ramdisk_available
bool, Make this module available when building for vendor ramdisk.
On device without a dedicated recovery partition, the module is only
available after switching root into
/first_stage_ramdisk. To expose the module before switching root, install
the recovery variant instead
version_script
string, Version script to pass to the linker. By default this will replace the
implicit rustc emitted version script to mirror expected behavior in CC.
This is only relevant for rust_ffi_shared modules which are exposing a
versioned C API.
vintf_fragment_modules
configurable list of string, vintf_fragment Modules required from this module.
vintf_fragments
configurable list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
whole_static_libs
configurable list of string, Similar to static_libs, but will bundle the static library dependency into a library. This is helpful
to avoid having to redeclare the dependency for dependents of this library, but in some cases may also
result in bloat if multiple dependencies all include the same static library whole.
The common use case for this is when the static library is unlikely to be a dependency of other modules to avoid
having to redeclare the static library dependency for every dependent module.
If you are not sure what to, for rust_library modules most static dependencies should go in static_libraries,
and for rust_ffi modules most static dependencies should go into whole_static_libraries.
For rust_ffi static variants, these libraries will be included in the resulting static library archive.
For rust_library rlib variants, these libraries will be bundled into the resulting rlib library. This will
include all of the static libraries symbols in any dylibs or binaries which use this rlib as well.
rust_ffi_static
rust_library_rlib and rust_ffi_static produces an rlib (Rust crate type "rlib").
name
,
srcs
,
defaults
,
host_supported
,
device_supported
,
afdo
,
aliases
,
apex_available
,
apex_exclude
,
arch
,
bootstrap
,
cargo_env_compat
,
cargo_pkg_version
,
cfgs
,
clippy_lints
,
compile_multilib
,
crate_name
,
crate_root
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
double_loadable
,
dylib
,
edition
,
enabled
,
exclude_from_recovery_snapshot
,
exclude_from_vendor_snapshot
,
export_include_dirs
,
extra_exported_symbols
,
features
,
flags
,
host_cross_supported
,
host_required
,
include_dirs
,
init_rc
,
installable
,
ld_flags
,
licenses
,
lints
,
lto
,
min_sdk_version
,
multilib
,
native_bridge_supported
,
native_coverage
,
no_full_install
,
no_stdlibs
,
odm_available
,
odm_dlkm_specific
,
overrides
,
owner
,
prefer_rlib
,
proc_macros
,
product_available
,
product_specific
,
product_variables.arc
,
product_variables.build_from_text_stub
,
product_variables.debuggable
,
product_variables.eng
,
product_variables.malloc_low_memory
,
product_variables.native_coverage
,
product_variables.release_aidl_use_unfrozen
,
product_variables.selinuxignoreneverallows
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
ramdisk_available
,
recovery
,
recovery_available
,
relative_install_path
,
required
,
rlib
,
rlibs
,
rustlibs
,
sanitize
,
sdk_version
,
shared
,
shared_libs
,
soc_specific
,
static
,
static_libs
,
stdlibs
,
stem
,
strip
,
stubs
,
suffix
,
sysroot
,
system_dlkm_specific
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
use_expansive_default_srcs
,
use_generic_config
,
vendor
,
vendor_available
,
vendor_dlkm_specific
,
vendor_ramdisk
,
vendor_ramdisk_available
,
version_script
,
vintf_fragment_modules
,
vintf_fragments
,
visibility
,
whole_static_libs
name
string, The name of the module. Must be unique across all modules.
srcs
list of string, path to the source file that is the main entry point of the program (e.g. main.rs or lib.rs).
Only a single source file can be defined. Modules which generate source can be included by prefixing
the module name with ":", for example ":libfoo_bindgen"
If no source file is defined, a single generated source module can be defined to be used as the main source.
defaults
list of string
host_supported
bool, If set to true, build a variant of the module for the host. Defaults to false.
device_supported
bool, If set to true, build a variant of the module for the device. Defaults to true.
afdo
bool, Afdo allows developers self-service enroll for
automatic feedback-directed optimization using profile data.
aliases
list of string, Rust crate dependencies to rename. Each entry should be a string of the form "dependencyname:alias".
"dependencyname" here should be the name of the crate, not the Android module. This is
equivalent to writing `alias = { package = "dependencyname" }` in a `Cargo.toml`.
apex_available
list of string, Availability of this module in APEXes. Only the listed APEXes can contain this module. If
the module has stubs then other APEXes and the platform may access it through them
(subject to visibility).
"//apex_available:anyapex" is a pseudo APEX name that matches to any APEX.
"//apex_available:platform" refers to non-APEX partitions like "system.img".
Prefix pattern (com.foo.*) can be used to match with any APEX name with the prefix(com.foo.).
Default is ["//apex_available:platform"].
apex_exclude
bool, Deprecated - exclude this rust_ffi target from being included in APEXes.
TODO(b/362509506): remove this once all apex_exclude uses are switched to stubs.
arch
interface
bootstrap
bool, Allows this module to use non-APEX version of libraries. Useful
for building binaries that are started before APEXes are activated.
cargo_env_compat
bool, Enables emitting certain Cargo environment variables. Only intended to be used for compatibility purposes.
Will set CARGO_CRATE_NAME to the crate_name property's value.
Will set CARGO_BIN_NAME to the output filename value without the extension.
cargo_pkg_version
string, If cargo_env_compat is true, sets the CARGO_PKG_VERSION env var to this value.
cfgs
configurable list of string, list of configuration options to enable for this crate. To enable features, use the "features" property.
clippy_lints
string, name of the lint set that should be used to validate this module.
Possible values are "default" (for using a sensible set of lints
depending on the module's location), "android" (for the strictest
lint set that applies to all Android platform code), "vendor" (for a
relaxed set) and "none" (to disable the execution of clippy). The
default value is "default". See also the `lints` property.
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
crate_name
string, crate name, required for modules which produce Rust libraries: rust_library, rust_ffi and SourceProvider
modules which create library variants (rust_bindgen). This must be the expected extern crate name used in
source, and is required to conform to an enforced format matching library output files (if the output file is
lib<someName><suffix>, the crate_name property must be <someName>).
crate_root
string, Entry point that is passed to rustc to begin the compilation. E.g. main.rs or lib.rs.
When this property is set,
* sandboxing is enabled for this module, and
* the srcs attribute is interpreted as a list of all source files potentially
used in compilation, including the entrypoint, and
* compile_data can be used to add additional files used in compilation that
not directly used as source files.
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
prepend_artifact_with_product
bool, If true, then the artifact file will be prepended with <product name>-. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be coral-foo.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
double_loadable
bool, whether this module is capable of being loaded with other instance
(possibly an older version) of the same module in the same process.
Currently, a shared library that is a member of VNDK (vndk: {enabled: true})
can be double loaded in a vendor process if the library is also a
(direct and indirect) dependency of an LLNDK library. Such libraries must be
explicitly marked as `double_loadable: true` by the owner, or the dependency
from the LLNDK lib should be cut if the lib is not designed to be double loaded.
⊕dylib
VariantLibraryProperties
enabled
bool
srcs
list of string
edition
string, specific rust edition that should be used if the default version is not desired
enabled
configurable bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
exclude_from_recovery_snapshot
bool, Normally Soong uses the directory structure to decide which modules
should be included (framework) or excluded (non-framework) from the
different snapshots (vendor, recovery, etc.), but this property
allows a partner to exclude a module normally thought of as a
framework module from the recovery snapshot.
exclude_from_vendor_snapshot
bool, Normally Soong uses the directory structure to decide which modules
should be included (framework) or excluded (non-framework) from the
different snapshots (vendor, recovery, etc.), but this property
allows a partner to exclude a module normally thought of as a
framework module from the vendor snapshot.
export_include_dirs
list of string, path to include directories to export to cc_* modules, only relevant for static/shared variants.
features
configurable list of string, list of features to enable for this crate
flags
list of string, flags to pass to rustc. To enable configuration options or features, use the "cfgs" or "features" properties.
host_cross_supported
bool, If set to true, build a variant of the module for the host cross. Defaults to true.
host_required
list of string, names of other modules to install on host if this module is installed
include_dirs
list of string, TODO: Remove this when all instances of Include_dirs have been removed from rust_ffi modules.
path to include directories to pass to cc_* modules, only relevant for static/shared variants (deprecated, use export_include_dirs instead).
init_rc
configurable list of string, init.rc files to be installed if this module is installed
installable
bool
ld_flags
list of string, flags to pass to the linker
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
lints
string, name of the lint set that should be used to validate this module.
Possible values are "default" (for using a sensible set of lints
depending on the module's location), "android" (for the strictest
lint set that applies to all Android platform code), "vendor" (for
a relaxed set) and "none" (for ignoring all lint warnings and
errors). The default value is "default".
⊕lto
Control whether LTO is used for the final (Rust) linkage. This does not impact
cross-language LTO.
thin
bool, Whether thin LTO should be enabled. By default this is true.
LTO provides such a large code size benefit for Rust, this should always
be enabled for production builds unless there's a clear need to disable it.
min_sdk_version
string, Minimum OS API level supported by this C or C++ module. This property becomes the value
of the __ANDROID_API__ macro. When the C or C++ module is included in an APEX or an APK,
this property is also used to ensure that the min_sdk_version of the containing module is
not older (i.e. less) than this module's min_sdk_version. When not set, this property
defaults to the value of sdk_version. When this is set to "apex_inherit", this tracks
min_sdk_version of the containing APEX. When the module
is not built for an APEX, "apex_inherit" defaults to sdk_version.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
native_coverage
bool
no_full_install
bool, When set to true, this module is not installed to the full install path (ex: under
out/target/product/<name>/<partition>). It can be installed only to the packaging
modules like android_filesystem.
no_stdlibs
bool, whether to suppress inclusion of standard crates - defaults to false
odm_available
bool, This is the same as the "vendor_available" except that the install path
of the vendor variant is /odm or /vendor/odm.
By replacing "vendor_available: true" with "odm_available: true", the
module will install its vendor variant to the /odm partition or /vendor/odm.
As the modules with "odm_available: true" still create the vendor variants,
they can link to the other vendor modules as the vendor_available modules do.
Also, the vendor modules can link to odm_available modules.
It may not be used for VNDK modules.
odm_dlkm_specific
bool, Install to partition odm_dlkm when set to true.
overrides
list of string, List of module names that are prevented from being installed when this module gets
installed.
owner
string, vendor who owns this module
prefer_rlib
bool, Change the rustlibs linkage to select rlib linkage by default for device targets.
Also link libstd as an rlib as well on device targets.
Note: This is the default behavior for host targets.
This is primarily meant for rust_binary and rust_ffi modules where the default
linkage of libstd might need to be overridden in some use cases. This should
generally be avoided with other module types since it may cause collisions at
linkage if all dependencies of the root binary module do not link against libstd
the same way.
proc_macros
configurable list of string, list of rust proc_macro crate dependencies
product_available
bool, whether this module should be allowed to be directly depended by other
modules with `product_specific: true` or `product_available: true`.
If set to true, an additional product variant will be built separately
that is limited to the set of libraries and headers that are exposed to
/product modules.
The product variant may be used with a different (newer) /system,
so it shouldn't have any unversioned runtime dependencies, or
make assumptions about the system that may not be true in the
future.
If set to false, this module becomes inaccessible from /product modules.
Different from the 'vendor_available' property, the modules with
vndk: {enabled: true} don't have to define 'product_available'. The VNDK
library without 'product_available' may not be depended on by any other
modules that has product variants including the product available VNDKs.
Nothing happens if BOARD_VNDK_VERSION isn't set in the BoardConfig.mk
and PRODUCT_PRODUCT_VNDK_VERSION isn't set.
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.arc
⊕include_dirs
⊕shared_libs
⊕static_libs
⊕srcs
⊕whole_static_libs
⊕product_variables.build_from_text_stub
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕strip.all
⊕strip.keep_symbols
⊕strip.keep_symbols_and_debug_frame
⊕static_libs
⊕whole_static_libs
⊕shared_libs
⊕srcs
⊕product_variables.eng
⊕product_variables.malloc_low_memory
⊕shared_libs
⊕whole_static_libs
⊕static_libs
⊕srcs
⊕product_variables.native_coverage
⊕product_variables.release_aidl_use_unfrozen
⊕required
⊕vintf_fragment_modules
⊕product_variables.selinuxignoreneverallows
⊕product_variables.unbundled_build
⊕enabled
Configurable[bool]
Configurable[bool]
proptools.Configurable[bool]
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
ramdisk_available
bool, Make this module available when building for ramdisk.
On device without a dedicated recovery partition, the module is only
available after switching root into
/first_stage_ramdisk. To expose the module before switching root, install
the recovery variant instead.
recovery
bool, Whether this module is installed to recovery partition
recovery_available
bool, Make this module available when building for recovery
relative_install_path
string, install to a subdirectory of the default install path for the module
required
configurable list of string, names of other modules to install if this module is installed
⊕rlib
VariantLibraryProperties
enabled
bool
srcs
list of string
rlibs
configurable list of string, list of rust rlib crate dependencies
rustlibs
configurable list of string, list of rust automatic crate dependencies.
Rustlibs linkage is rlib for host targets and dylib for device targets.
⊕sanitize
enable AddressSanitizer, HWAddressSanitizer, and others.
address
bool
hwaddress
bool
memtag_heap
bool, Memory-tagging, only available on arm64
if diag.memtag unset or false, enables async memory tagging
fuzzer
bool
never
bool
⊕diag
Sanitizers to run in the diagnostic mode (as opposed to the release mode).
Replaces abort() on error with a human-readable error message.
Address and Thread sanitizers always run in diagnostic mode.
memtag_heap
bool, Memory-tagging, only available on arm64
requires sanitizer.memtag: true
if set, enables sync memory tagging
sdk_version
string, The API level that this module is built against. The APIs of this API level will be
visible at build time, but use of any APIs newer than min_sdk_version will render the
module unloadable on older devices. In the future it will be possible to weakly-link new
APIs, making the behavior match Java: such modules will load on older devices, but
calling new APIs on devices that do not support them will result in a crash.
This property has the same behavior as sdk_version does for Java modules. For those
familiar with Android Gradle, the property behaves similarly to how compileSdkVersion
does for Java code.
In addition, setting this property causes two variants to be built, one for the platform
and one for apps.
⊕shared
VariantLibraryProperties
enabled
bool
srcs
list of string
shared_libs
configurable list of string, list of C shared library dependencies
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
⊕static
VariantLibraryProperties
enabled
bool
srcs
list of string
static_libs
configurable list of string, list of C static library dependencies. These dependencies do not normally propagate to dependents
and may need to be redeclared. See whole_static_libs for bundling static dependencies into a library.
stdlibs
configurable list of string, list of Rust system library dependencies.
This is usually only needed when `no_stdlibs` is true, in which case it can be used to depend on system crates
like `core` and `alloc`.
stem
string, sets name of the output
⊕strip
none
bool, Device modules default to stripping enabled leaving mini debuginfo.
Host modules default to stripping disabled, but can be enabled by setting any other
strip boolean property.
all
bool, all forces stripping everything, including the mini debug info.
keep_symbols
bool, keep_symbols enables stripping but keeps all symbols.
keep_symbols_list
list of string, keep_symbols_list specifies a list of symbols to keep if keep_symbols is enabled.
If it is unset then all symbols are kept.
keep_symbols_and_debug_frame
bool, keep_symbols_and_debug_frame enables stripping but keeps all symbols and debug frames.
⊕stubs
*ast.SelectorExpr
Generate stubs to make this library accessible to APEXes.
Can only be set for modules producing shared libraries.
symbol_file
string, Relative path to the symbol map. The symbol map provides the list of
symbols that are exported for stubs variant of this library.
versions
list of string, List versions to generate stubs libs for. The version name "current" is always
implicitly added.
implementation_installable
bool, Whether to not require the implementation of the library to be installed if a
client of the stubs is installed. Defaults to true; set to false if the
implementation is made available by some other means, e.g. in a Microdroid
virtual machine.
suffix
string, append to name of output
sysroot
bool, Whether this library is part of the Rust toolchain sysroot.
system_dlkm_specific
bool, Install to partition system_dlkm when set to true.
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
compile_multilib
string
enabled
bool
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
use_expansive_default_srcs
bool, Set this to true to use an expansive default set of source file requirements
(all .rs, .h, .xml, and .md files in the module tree).
This is primarily for tracking sources for RBE purposes. Currently defaults
to true, though this may change in the future.
use_generic_config
bool, Set to true if this module must be generic and does not require product-specific information.
To be included in the system image, this property must be set to true.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_available
bool, whether this module should be allowed to be directly depended by other
modules with `vendor: true`, `proprietary: true`, or `vendor_available:true`.
If set to true, two variants will be built separately, one like
normal, and the other limited to the set of libraries and headers
that are exposed to /vendor modules.
The vendor variant may be used with a different (newer) /system,
so it shouldn't have any unversioned runtime dependencies, or
make assumptions about the system that may not be true in the
future.
If set to false, this module becomes inaccessible from /vendor modules.
The modules with vndk: {enabled: true} must define 'vendor_available'
to 'true'.
Nothing happens if BOARD_VNDK_VERSION isn't set in the BoardConfig.mk
vendor_dlkm_specific
bool, Install to partition vendor_dlkm when set to true.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vendor_ramdisk_available
bool, Make this module available when building for vendor ramdisk.
On device without a dedicated recovery partition, the module is only
available after switching root into
/first_stage_ramdisk. To expose the module before switching root, install
the recovery variant instead
version_script
string, Version script to pass to the linker. By default this will replace the
implicit rustc emitted version script to mirror expected behavior in CC.
This is only relevant for rust_ffi_shared modules which are exposing a
versioned C API.
vintf_fragment_modules
configurable list of string, vintf_fragment Modules required from this module.
vintf_fragments
configurable list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
whole_static_libs
configurable list of string, Similar to static_libs, but will bundle the static library dependency into a library. This is helpful
to avoid having to redeclare the dependency for dependents of this library, but in some cases may also
result in bloat if multiple dependencies all include the same static library whole.
The common use case for this is when the static library is unlikely to be a dependency of other modules to avoid
having to redeclare the static library dependency for every dependent module.
If you are not sure what to, for rust_library modules most static dependencies should go in static_libraries,
and for rust_ffi modules most static dependencies should go into whole_static_libraries.
For rust_ffi static variants, these libraries will be included in the resulting static library archive.
For rust_library rlib variants, these libraries will be bundled into the resulting rlib library. This will
include all of the static libraries symbols in any dylibs or binaries which use this rlib as well.
rust_fuzz
rust_binary produces a binary that is runnable on a device.
name
,
srcs
,
defaults
,
host_supported
,
device_supported
,
afdo
,
aliases
,
apex_available
,
arch
,
bootstrap
,
cargo_env_compat
,
cargo_pkg_version
,
cfgs
,
clippy_lints
,
compile_multilib
,
corpus
,
crate_name
,
crate_root
,
data
,
debug_ramdisk
,
device_common_corpus
,
device_common_data
,
device_first_data
,
device_specific
,
dictionary
,
dist
,
dists
,
double_loadable
,
edition
,
enabled
,
exclude_from_recovery_snapshot
,
exclude_from_vendor_snapshot
,
features
,
flags
,
fuzz_config
,
fuzzing_frameworks
,
host_common_data
,
host_cross_supported
,
host_required
,
init_rc
,
installable
,
ld_flags
,
licenses
,
lints
,
lto
,
min_sdk_version
,
multilib
,
native_bridge_supported
,
native_coverage
,
no_full_install
,
no_stdlibs
,
odm_available
,
odm_dlkm_specific
,
overrides
,
owner
,
prefer_rlib
,
proc_macros
,
product_available
,
product_specific
,
product_variables.arc
,
product_variables.build_from_text_stub
,
product_variables.debuggable
,
product_variables.eng
,
product_variables.malloc_low_memory
,
product_variables.native_coverage
,
product_variables.release_aidl_use_unfrozen
,
product_variables.selinuxignoreneverallows
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
ramdisk_available
,
recovery
,
recovery_available
,
relative_install_path
,
required
,
rlibs
,
rustlibs
,
sanitize
,
sdk_version
,
shared_libs
,
soc_specific
,
static_executable
,
static_libs
,
stdlibs
,
stem
,
strip
,
suffix
,
system_dlkm_specific
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
use_expansive_default_srcs
,
use_generic_config
,
vendor
,
vendor_available
,
vendor_dlkm_specific
,
vendor_ramdisk
,
vendor_ramdisk_available
,
vintf_fragment_modules
,
vintf_fragments
,
visibility
,
whole_static_libs
name
string, The name of the module. Must be unique across all modules.
srcs
list of string, path to the source file that is the main entry point of the program (e.g. main.rs or lib.rs).
Only a single source file can be defined. Modules which generate source can be included by prefixing
the module name with ":", for example ":libfoo_bindgen"
If no source file is defined, a single generated source module can be defined to be used as the main source.
defaults
list of string
host_supported
bool, If set to true, build a variant of the module for the host. Defaults to false.
device_supported
bool, If set to true, build a variant of the module for the device. Defaults to true.
afdo
bool, Afdo allows developers self-service enroll for
automatic feedback-directed optimization using profile data.
aliases
list of string, Rust crate dependencies to rename. Each entry should be a string of the form "dependencyname:alias".
"dependencyname" here should be the name of the crate, not the Android module. This is
equivalent to writing `alias = { package = "dependencyname" }` in a `Cargo.toml`.
apex_available
list of string, Availability of this module in APEXes. Only the listed APEXes can contain this module. If
the module has stubs then other APEXes and the platform may access it through them
(subject to visibility).
"//apex_available:anyapex" is a pseudo APEX name that matches to any APEX.
"//apex_available:platform" refers to non-APEX partitions like "system.img".
Prefix pattern (com.foo.*) can be used to match with any APEX name with the prefix(com.foo.).
Default is ["//apex_available:platform"].
arch
interface
bootstrap
bool, Allows this module to use non-APEX version of libraries. Useful
for building binaries that are started before APEXes are activated.
cargo_env_compat
bool, Enables emitting certain Cargo environment variables. Only intended to be used for compatibility purposes.
Will set CARGO_CRATE_NAME to the crate_name property's value.
Will set CARGO_BIN_NAME to the output filename value without the extension.
cargo_pkg_version
string, If cargo_env_compat is true, sets the CARGO_PKG_VERSION env var to this value.
cfgs
configurable list of string, list of configuration options to enable for this crate. To enable features, use the "features" property.
clippy_lints
string, name of the lint set that should be used to validate this module.
Possible values are "default" (for using a sensible set of lints
depending on the module's location), "android" (for the strictest
lint set that applies to all Android platform code), "vendor" (for a
relaxed set) and "none" (to disable the execution of clippy). The
default value is "default". See also the `lints` property.
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
corpus
list of string, Optional list of seed files to be installed to the fuzz target's output
directory.
crate_name
string, crate name, required for modules which produce Rust libraries: rust_library, rust_ffi and SourceProvider
modules which create library variants (rust_bindgen). This must be the expected extern crate name used in
source, and is required to conform to an enforced format matching library output files (if the output file is
lib<someName><suffix>, the crate_name property must be <someName>).
crate_root
string, Entry point that is passed to rustc to begin the compilation. E.g. main.rs or lib.rs.
When this property is set,
* sandboxing is enabled for this module, and
* the srcs attribute is interpreted as a list of all source files potentially
used in compilation, including the entrypoint, and
* compile_data can be used to add additional files used in compilation that
not directly used as source files.
data
list of string, Optional list of data files to be installed to the fuzz target's output
directory. Directory structure relative to the module is preserved.
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_common_corpus
list of string, Same as corpus, but adds dependencies on module references using the device's os variant
and the common arch variant.
device_common_data
list of string, Same as data, but adds dependencies on modules using the device's os variant, and common
architecture's variant. Can be useful to add device-built apps to the data of a host
test.
device_first_data
list of string, Same as data, but adds dependencies on modules using the device's os variant, and the
device's first architecture's variant. Can be useful to add device-built apps to the data
of a host test.
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
dictionary
string, Optional dictionary to be installed to the fuzz target's output directory.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
prepend_artifact_with_product
bool, If true, then the artifact file will be prepended with <product name>-. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be coral-foo.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
double_loadable
bool, whether this module is capable of being loaded with other instance
(possibly an older version) of the same module in the same process.
Currently, a shared library that is a member of VNDK (vndk: {enabled: true})
can be double loaded in a vendor process if the library is also a
(direct and indirect) dependency of an LLNDK library. Such libraries must be
explicitly marked as `double_loadable: true` by the owner, or the dependency
from the LLNDK lib should be cut if the lib is not designed to be double loaded.
edition
string, specific rust edition that should be used if the default version is not desired
enabled
configurable bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
exclude_from_recovery_snapshot
bool, Normally Soong uses the directory structure to decide which modules
should be included (framework) or excluded (non-framework) from the
different snapshots (vendor, recovery, etc.), but this property
allows a partner to exclude a module normally thought of as a
framework module from the recovery snapshot.
exclude_from_vendor_snapshot
bool, Normally Soong uses the directory structure to decide which modules
should be included (framework) or excluded (non-framework) from the
different snapshots (vendor, recovery, etc.), but this property
allows a partner to exclude a module normally thought of as a
framework module from the vendor snapshot.
features
configurable list of string, list of features to enable for this crate
flags
list of string, flags to pass to rustc. To enable configuration options or features, use the "cfgs" or "features" properties.
fuzz_config
FuzzConfig, Config for running the target on fuzzing infrastructure.
fuzzing_frameworks
FuzzFrameworks, Define the fuzzing frameworks this fuzz target can be built for. If
empty then the fuzz target will be available to be built for all fuzz
frameworks available
host_common_data
list of string, Same as data, but will add dependencies on modules using the host's os variation and
the common arch variation. Useful for a device test that wants to depend on a host
module, for example to include a custom Tradefed test runner.
host_cross_supported
bool, If set to true, build a variant of the module for the host cross. Defaults to true.
host_required
list of string, names of other modules to install on host if this module is installed
init_rc
configurable list of string, init.rc files to be installed if this module is installed
installable
bool
ld_flags
list of string, flags to pass to the linker
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
lints
string, name of the lint set that should be used to validate this module.
Possible values are "default" (for using a sensible set of lints
depending on the module's location), "android" (for the strictest
lint set that applies to all Android platform code), "vendor" (for
a relaxed set) and "none" (for ignoring all lint warnings and
errors). The default value is "default".
⊕lto
Control whether LTO is used for the final (Rust) linkage. This does not impact
cross-language LTO.
thin
bool, Whether thin LTO should be enabled. By default this is true.
LTO provides such a large code size benefit for Rust, this should always
be enabled for production builds unless there's a clear need to disable it.
min_sdk_version
string, Minimum OS API level supported by this C or C++ module. This property becomes the value
of the __ANDROID_API__ macro. When the C or C++ module is included in an APEX or an APK,
this property is also used to ensure that the min_sdk_version of the containing module is
not older (i.e. less) than this module's min_sdk_version. When not set, this property
defaults to the value of sdk_version. When this is set to "apex_inherit", this tracks
min_sdk_version of the containing APEX. When the module
is not built for an APEX, "apex_inherit" defaults to sdk_version.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
native_coverage
bool
no_full_install
bool, When set to true, this module is not installed to the full install path (ex: under
out/target/product/<name>/<partition>). It can be installed only to the packaging
modules like android_filesystem.
no_stdlibs
bool, whether to suppress inclusion of standard crates - defaults to false
odm_available
bool, This is the same as the "vendor_available" except that the install path
of the vendor variant is /odm or /vendor/odm.
By replacing "vendor_available: true" with "odm_available: true", the
module will install its vendor variant to the /odm partition or /vendor/odm.
As the modules with "odm_available: true" still create the vendor variants,
they can link to the other vendor modules as the vendor_available modules do.
Also, the vendor modules can link to odm_available modules.
It may not be used for VNDK modules.
odm_dlkm_specific
bool, Install to partition odm_dlkm when set to true.
overrides
list of string, List of module names that are prevented from being installed when this module gets
installed.
owner
string, vendor who owns this module
prefer_rlib
bool, Change the rustlibs linkage to select rlib linkage by default for device targets.
Also link libstd as an rlib as well on device targets.
Note: This is the default behavior for host targets.
This is primarily meant for rust_binary and rust_ffi modules where the default
linkage of libstd might need to be overridden in some use cases. This should
generally be avoided with other module types since it may cause collisions at
linkage if all dependencies of the root binary module do not link against libstd
the same way.
proc_macros
configurable list of string, list of rust proc_macro crate dependencies
product_available
bool, whether this module should be allowed to be directly depended by other
modules with `product_specific: true` or `product_available: true`.
If set to true, an additional product variant will be built separately
that is limited to the set of libraries and headers that are exposed to
/product modules.
The product variant may be used with a different (newer) /system,
so it shouldn't have any unversioned runtime dependencies, or
make assumptions about the system that may not be true in the
future.
If set to false, this module becomes inaccessible from /product modules.
Different from the 'vendor_available' property, the modules with
vndk: {enabled: true} don't have to define 'product_available'. The VNDK
library without 'product_available' may not be depended on by any other
modules that has product variants including the product available VNDKs.
Nothing happens if BOARD_VNDK_VERSION isn't set in the BoardConfig.mk
and PRODUCT_PRODUCT_VNDK_VERSION isn't set.
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.arc
⊕shared_libs
⊕static_libs
⊕srcs
⊕whole_static_libs
⊕product_variables.build_from_text_stub
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕strip.all
⊕strip.keep_symbols
⊕strip.keep_symbols_and_debug_frame
⊕static_libs
⊕whole_static_libs
⊕shared_libs
⊕srcs
⊕product_variables.eng
⊕product_variables.malloc_low_memory
⊕shared_libs
⊕whole_static_libs
⊕static_libs
⊕srcs
⊕product_variables.native_coverage
⊕product_variables.release_aidl_use_unfrozen
⊕required
⊕vintf_fragment_modules
⊕product_variables.selinuxignoreneverallows
⊕product_variables.unbundled_build
⊕enabled
Configurable[bool]
Configurable[bool]
proptools.Configurable[bool]
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
ramdisk_available
bool, Make this module available when building for ramdisk.
On device without a dedicated recovery partition, the module is only
available after switching root into
/first_stage_ramdisk. To expose the module before switching root, install
the recovery variant instead.
recovery
bool, Whether this module is installed to recovery partition
recovery_available
bool, Make this module available when building for recovery
relative_install_path
string, install to a subdirectory of the default install path for the module
required
configurable list of string, names of other modules to install if this module is installed
rlibs
configurable list of string, list of rust rlib crate dependencies
rustlibs
configurable list of string, list of rust automatic crate dependencies.
Rustlibs linkage is rlib for host targets and dylib for device targets.
⊕sanitize
enable AddressSanitizer, HWAddressSanitizer, and others.
address
bool
hwaddress
bool
memtag_heap
bool, Memory-tagging, only available on arm64
if diag.memtag unset or false, enables async memory tagging
fuzzer
bool
Default: true
never
bool
⊕diag
Sanitizers to run in the diagnostic mode (as opposed to the release mode).
Replaces abort() on error with a human-readable error message.
Address and Thread sanitizers always run in diagnostic mode.
memtag_heap
bool, Memory-tagging, only available on arm64
requires sanitizer.memtag: true
if set, enables sync memory tagging
sdk_version
string, The API level that this module is built against. The APIs of this API level will be
visible at build time, but use of any APIs newer than min_sdk_version will render the
module unloadable on older devices. In the future it will be possible to weakly-link new
APIs, making the behavior match Java: such modules will load on older devices, but
calling new APIs on devices that do not support them will result in a crash.
This property has the same behavior as sdk_version does for Java modules. For those
familiar with Android Gradle, the property behaves similarly to how compileSdkVersion
does for Java code.
In addition, setting this property causes two variants to be built, one for the platform
and one for apps.
shared_libs
configurable list of string, list of C shared library dependencies
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
static_executable
bool, Builds this binary as a static binary. Implies prefer_rlib true.
Static executables currently only support for bionic targets. Non-bionic targets will not produce a fully static
binary, but will still implicitly imply prefer_rlib true.
static_libs
configurable list of string, list of C static library dependencies. These dependencies do not normally propagate to dependents
and may need to be redeclared. See whole_static_libs for bundling static dependencies into a library.
stdlibs
configurable list of string, list of Rust system library dependencies.
This is usually only needed when `no_stdlibs` is true, in which case it can be used to depend on system crates
like `core` and `alloc`.
stem
string, sets name of the output
⊕strip
none
bool, Device modules default to stripping enabled leaving mini debuginfo.
Host modules default to stripping disabled, but can be enabled by setting any other
strip boolean property.
all
bool, all forces stripping everything, including the mini debug info.
keep_symbols
bool, keep_symbols enables stripping but keeps all symbols.
keep_symbols_list
list of string, keep_symbols_list specifies a list of symbols to keep if keep_symbols is enabled.
If it is unset then all symbols are kept.
keep_symbols_and_debug_frame
bool, keep_symbols_and_debug_frame enables stripping but keeps all symbols and debug frames.
suffix
string, append to name of output
system_dlkm_specific
bool, Install to partition system_dlkm when set to true.
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
compile_multilib
string
enabled
bool
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
use_expansive_default_srcs
bool, Set this to true to use an expansive default set of source file requirements
(all .rs, .h, .xml, and .md files in the module tree).
This is primarily for tracking sources for RBE purposes. Currently defaults
to true, though this may change in the future.
use_generic_config
bool, Set to true if this module must be generic and does not require product-specific information.
To be included in the system image, this property must be set to true.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_available
bool, whether this module should be allowed to be directly depended by other
modules with `vendor: true`, `proprietary: true`, or `vendor_available:true`.
If set to true, two variants will be built separately, one like
normal, and the other limited to the set of libraries and headers
that are exposed to /vendor modules.
The vendor variant may be used with a different (newer) /system,
so it shouldn't have any unversioned runtime dependencies, or
make assumptions about the system that may not be true in the
future.
If set to false, this module becomes inaccessible from /vendor modules.
The modules with vndk: {enabled: true} must define 'vendor_available'
to 'true'.
Nothing happens if BOARD_VNDK_VERSION isn't set in the BoardConfig.mk
vendor_dlkm_specific
bool, Install to partition vendor_dlkm when set to true.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vendor_ramdisk_available
bool, Make this module available when building for vendor ramdisk.
On device without a dedicated recovery partition, the module is only
available after switching root into
/first_stage_ramdisk. To expose the module before switching root, install
the recovery variant instead
vintf_fragment_modules
configurable list of string, vintf_fragment Modules required from this module.
vintf_fragments
configurable list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
whole_static_libs
configurable list of string, Similar to static_libs, but will bundle the static library dependency into a library. This is helpful
to avoid having to redeclare the dependency for dependents of this library, but in some cases may also
result in bloat if multiple dependencies all include the same static library whole.
The common use case for this is when the static library is unlikely to be a dependency of other modules to avoid
having to redeclare the static library dependency for every dependent module.
If you are not sure what to, for rust_library modules most static dependencies should go in static_libraries,
and for rust_ffi modules most static dependencies should go into whole_static_libraries.
For rust_ffi static variants, these libraries will be included in the resulting static library archive.
For rust_library rlib variants, these libraries will be bundled into the resulting rlib library. This will
include all of the static libraries symbols in any dylibs or binaries which use this rlib as well.
rust_fuzz_host
name
,
srcs
,
defaults
,
afdo
,
aliases
,
apex_available
,
arch
,
bootstrap
,
cargo_env_compat
,
cargo_pkg_version
,
cfgs
,
clippy_lints
,
compile_multilib
,
corpus
,
crate_name
,
crate_root
,
data
,
debug_ramdisk
,
device_common_corpus
,
device_common_data
,
device_first_data
,
device_specific
,
dictionary
,
dist
,
dists
,
double_loadable
,
edition
,
enabled
,
exclude_from_recovery_snapshot
,
exclude_from_vendor_snapshot
,
features
,
flags
,
fuzz_config
,
fuzzing_frameworks
,
host_common_data
,
host_cross_supported
,
host_required
,
init_rc
,
installable
,
ld_flags
,
licenses
,
lints
,
lto
,
min_sdk_version
,
multilib
,
native_bridge_supported
,
native_coverage
,
no_full_install
,
no_stdlibs
,
odm_available
,
odm_dlkm_specific
,
overrides
,
owner
,
prefer_rlib
,
proc_macros
,
product_available
,
product_specific
,
product_variables.arc
,
product_variables.build_from_text_stub
,
product_variables.debuggable
,
product_variables.eng
,
product_variables.malloc_low_memory
,
product_variables.native_coverage
,
product_variables.release_aidl_use_unfrozen
,
product_variables.selinuxignoreneverallows
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
ramdisk_available
,
recovery
,
recovery_available
,
relative_install_path
,
required
,
rlibs
,
rustlibs
,
sanitize
,
sdk_version
,
shared_libs
,
soc_specific
,
static_executable
,
static_libs
,
stdlibs
,
stem
,
strip
,
suffix
,
system_dlkm_specific
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
use_expansive_default_srcs
,
use_generic_config
,
vendor
,
vendor_available
,
vendor_dlkm_specific
,
vendor_ramdisk
,
vendor_ramdisk_available
,
vintf_fragment_modules
,
vintf_fragments
,
visibility
,
whole_static_libs
name
string, The name of the module. Must be unique across all modules.
srcs
list of string, path to the source file that is the main entry point of the program (e.g. main.rs or lib.rs).
Only a single source file can be defined. Modules which generate source can be included by prefixing
the module name with ":", for example ":libfoo_bindgen"
If no source file is defined, a single generated source module can be defined to be used as the main source.
defaults
list of string
afdo
bool, Afdo allows developers self-service enroll for
automatic feedback-directed optimization using profile data.
aliases
list of string, Rust crate dependencies to rename. Each entry should be a string of the form "dependencyname:alias".
"dependencyname" here should be the name of the crate, not the Android module. This is
equivalent to writing `alias = { package = "dependencyname" }` in a `Cargo.toml`.
apex_available
list of string, Availability of this module in APEXes. Only the listed APEXes can contain this module. If
the module has stubs then other APEXes and the platform may access it through them
(subject to visibility).
"//apex_available:anyapex" is a pseudo APEX name that matches to any APEX.
"//apex_available:platform" refers to non-APEX partitions like "system.img".
Prefix pattern (com.foo.*) can be used to match with any APEX name with the prefix(com.foo.).
Default is ["//apex_available:platform"].
arch
interface
bootstrap
bool, Allows this module to use non-APEX version of libraries. Useful
for building binaries that are started before APEXes are activated.
cargo_env_compat
bool, Enables emitting certain Cargo environment variables. Only intended to be used for compatibility purposes.
Will set CARGO_CRATE_NAME to the crate_name property's value.
Will set CARGO_BIN_NAME to the output filename value without the extension.
cargo_pkg_version
string, If cargo_env_compat is true, sets the CARGO_PKG_VERSION env var to this value.
cfgs
configurable list of string, list of configuration options to enable for this crate. To enable features, use the "features" property.
clippy_lints
string, name of the lint set that should be used to validate this module.
Possible values are "default" (for using a sensible set of lints
depending on the module's location), "android" (for the strictest
lint set that applies to all Android platform code), "vendor" (for a
relaxed set) and "none" (to disable the execution of clippy). The
default value is "default". See also the `lints` property.
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
corpus
list of string, Optional list of seed files to be installed to the fuzz target's output
directory.
crate_name
string, crate name, required for modules which produce Rust libraries: rust_library, rust_ffi and SourceProvider
modules which create library variants (rust_bindgen). This must be the expected extern crate name used in
source, and is required to conform to an enforced format matching library output files (if the output file is
lib<someName><suffix>, the crate_name property must be <someName>).
crate_root
string, Entry point that is passed to rustc to begin the compilation. E.g. main.rs or lib.rs.
When this property is set,
* sandboxing is enabled for this module, and
* the srcs attribute is interpreted as a list of all source files potentially
used in compilation, including the entrypoint, and
* compile_data can be used to add additional files used in compilation that
not directly used as source files.
data
list of string, Optional list of data files to be installed to the fuzz target's output
directory. Directory structure relative to the module is preserved.
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_common_corpus
list of string, Same as corpus, but adds dependencies on module references using the device's os variant
and the common arch variant.
device_common_data
list of string, Same as data, but adds dependencies on modules using the device's os variant, and common
architecture's variant. Can be useful to add device-built apps to the data of a host
test.
device_first_data
list of string, Same as data, but adds dependencies on modules using the device's os variant, and the
device's first architecture's variant. Can be useful to add device-built apps to the data
of a host test.
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
dictionary
string, Optional dictionary to be installed to the fuzz target's output directory.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
prepend_artifact_with_product
bool, If true, then the artifact file will be prepended with <product name>-. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be coral-foo.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
double_loadable
bool, whether this module is capable of being loaded with other instance
(possibly an older version) of the same module in the same process.
Currently, a shared library that is a member of VNDK (vndk: {enabled: true})
can be double loaded in a vendor process if the library is also a
(direct and indirect) dependency of an LLNDK library. Such libraries must be
explicitly marked as `double_loadable: true` by the owner, or the dependency
from the LLNDK lib should be cut if the lib is not designed to be double loaded.
edition
string, specific rust edition that should be used if the default version is not desired
enabled
configurable bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
exclude_from_recovery_snapshot
bool, Normally Soong uses the directory structure to decide which modules
should be included (framework) or excluded (non-framework) from the
different snapshots (vendor, recovery, etc.), but this property
allows a partner to exclude a module normally thought of as a
framework module from the recovery snapshot.
exclude_from_vendor_snapshot
bool, Normally Soong uses the directory structure to decide which modules
should be included (framework) or excluded (non-framework) from the
different snapshots (vendor, recovery, etc.), but this property
allows a partner to exclude a module normally thought of as a
framework module from the vendor snapshot.
features
configurable list of string, list of features to enable for this crate
flags
list of string, flags to pass to rustc. To enable configuration options or features, use the "cfgs" or "features" properties.
fuzz_config
FuzzConfig, Config for running the target on fuzzing infrastructure.
fuzzing_frameworks
FuzzFrameworks, Define the fuzzing frameworks this fuzz target can be built for. If
empty then the fuzz target will be available to be built for all fuzz
frameworks available
host_common_data
list of string, Same as data, but will add dependencies on modules using the host's os variation and
the common arch variation. Useful for a device test that wants to depend on a host
module, for example to include a custom Tradefed test runner.
host_cross_supported
bool, If set to true, build a variant of the module for the host cross. Defaults to true.
host_required
list of string, names of other modules to install on host if this module is installed
init_rc
configurable list of string, init.rc files to be installed if this module is installed
installable
bool
ld_flags
list of string, flags to pass to the linker
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
lints
string, name of the lint set that should be used to validate this module.
Possible values are "default" (for using a sensible set of lints
depending on the module's location), "android" (for the strictest
lint set that applies to all Android platform code), "vendor" (for
a relaxed set) and "none" (for ignoring all lint warnings and
errors). The default value is "default".
⊕lto
Control whether LTO is used for the final (Rust) linkage. This does not impact
cross-language LTO.
thin
bool, Whether thin LTO should be enabled. By default this is true.
LTO provides such a large code size benefit for Rust, this should always
be enabled for production builds unless there's a clear need to disable it.
min_sdk_version
string, Minimum OS API level supported by this C or C++ module. This property becomes the value
of the __ANDROID_API__ macro. When the C or C++ module is included in an APEX or an APK,
this property is also used to ensure that the min_sdk_version of the containing module is
not older (i.e. less) than this module's min_sdk_version. When not set, this property
defaults to the value of sdk_version. When this is set to "apex_inherit", this tracks
min_sdk_version of the containing APEX. When the module
is not built for an APEX, "apex_inherit" defaults to sdk_version.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
native_coverage
bool
no_full_install
bool, When set to true, this module is not installed to the full install path (ex: under
out/target/product/<name>/<partition>). It can be installed only to the packaging
modules like android_filesystem.
no_stdlibs
bool, whether to suppress inclusion of standard crates - defaults to false
odm_available
bool, This is the same as the "vendor_available" except that the install path
of the vendor variant is /odm or /vendor/odm.
By replacing "vendor_available: true" with "odm_available: true", the
module will install its vendor variant to the /odm partition or /vendor/odm.
As the modules with "odm_available: true" still create the vendor variants,
they can link to the other vendor modules as the vendor_available modules do.
Also, the vendor modules can link to odm_available modules.
It may not be used for VNDK modules.
odm_dlkm_specific
bool, Install to partition odm_dlkm when set to true.
overrides
list of string, List of module names that are prevented from being installed when this module gets
installed.
owner
string, vendor who owns this module
prefer_rlib
bool, Change the rustlibs linkage to select rlib linkage by default for device targets.
Also link libstd as an rlib as well on device targets.
Note: This is the default behavior for host targets.
This is primarily meant for rust_binary and rust_ffi modules where the default
linkage of libstd might need to be overridden in some use cases. This should
generally be avoided with other module types since it may cause collisions at
linkage if all dependencies of the root binary module do not link against libstd
the same way.
proc_macros
configurable list of string, list of rust proc_macro crate dependencies
product_available
bool, whether this module should be allowed to be directly depended by other
modules with `product_specific: true` or `product_available: true`.
If set to true, an additional product variant will be built separately
that is limited to the set of libraries and headers that are exposed to
/product modules.
The product variant may be used with a different (newer) /system,
so it shouldn't have any unversioned runtime dependencies, or
make assumptions about the system that may not be true in the
future.
If set to false, this module becomes inaccessible from /product modules.
Different from the 'vendor_available' property, the modules with
vndk: {enabled: true} don't have to define 'product_available'. The VNDK
library without 'product_available' may not be depended on by any other
modules that has product variants including the product available VNDKs.
Nothing happens if BOARD_VNDK_VERSION isn't set in the BoardConfig.mk
and PRODUCT_PRODUCT_VNDK_VERSION isn't set.
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.arc
⊕shared_libs
⊕static_libs
⊕srcs
⊕whole_static_libs
⊕product_variables.build_from_text_stub
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕strip.all
⊕strip.keep_symbols
⊕strip.keep_symbols_and_debug_frame
⊕static_libs
⊕whole_static_libs
⊕shared_libs
⊕srcs
⊕product_variables.eng
⊕product_variables.malloc_low_memory
⊕shared_libs
⊕whole_static_libs
⊕static_libs
⊕srcs
⊕product_variables.native_coverage
⊕product_variables.release_aidl_use_unfrozen
⊕required
⊕vintf_fragment_modules
⊕product_variables.selinuxignoreneverallows
⊕product_variables.unbundled_build
⊕enabled
Configurable[bool]
Configurable[bool]
proptools.Configurable[bool]
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
ramdisk_available
bool, Make this module available when building for ramdisk.
On device without a dedicated recovery partition, the module is only
available after switching root into
/first_stage_ramdisk. To expose the module before switching root, install
the recovery variant instead.
recovery
bool, Whether this module is installed to recovery partition
recovery_available
bool, Make this module available when building for recovery
relative_install_path
string, install to a subdirectory of the default install path for the module
required
configurable list of string, names of other modules to install if this module is installed
rlibs
configurable list of string, list of rust rlib crate dependencies
rustlibs
configurable list of string, list of rust automatic crate dependencies.
Rustlibs linkage is rlib for host targets and dylib for device targets.
⊕sanitize
enable AddressSanitizer, HWAddressSanitizer, and others.
address
bool
hwaddress
bool
memtag_heap
bool, Memory-tagging, only available on arm64
if diag.memtag unset or false, enables async memory tagging
fuzzer
bool
Default: true
never
bool
⊕diag
Sanitizers to run in the diagnostic mode (as opposed to the release mode).
Replaces abort() on error with a human-readable error message.
Address and Thread sanitizers always run in diagnostic mode.
memtag_heap
bool, Memory-tagging, only available on arm64
requires sanitizer.memtag: true
if set, enables sync memory tagging
sdk_version
string, The API level that this module is built against. The APIs of this API level will be
visible at build time, but use of any APIs newer than min_sdk_version will render the
module unloadable on older devices. In the future it will be possible to weakly-link new
APIs, making the behavior match Java: such modules will load on older devices, but
calling new APIs on devices that do not support them will result in a crash.
This property has the same behavior as sdk_version does for Java modules. For those
familiar with Android Gradle, the property behaves similarly to how compileSdkVersion
does for Java code.
In addition, setting this property causes two variants to be built, one for the platform
and one for apps.
shared_libs
configurable list of string, list of C shared library dependencies
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
static_executable
bool, Builds this binary as a static binary. Implies prefer_rlib true.
Static executables currently only support for bionic targets. Non-bionic targets will not produce a fully static
binary, but will still implicitly imply prefer_rlib true.
static_libs
configurable list of string, list of C static library dependencies. These dependencies do not normally propagate to dependents
and may need to be redeclared. See whole_static_libs for bundling static dependencies into a library.
stdlibs
configurable list of string, list of Rust system library dependencies.
This is usually only needed when `no_stdlibs` is true, in which case it can be used to depend on system crates
like `core` and `alloc`.
stem
string, sets name of the output
⊕strip
none
bool, Device modules default to stripping enabled leaving mini debuginfo.
Host modules default to stripping disabled, but can be enabled by setting any other
strip boolean property.
all
bool, all forces stripping everything, including the mini debug info.
keep_symbols
bool, keep_symbols enables stripping but keeps all symbols.
keep_symbols_list
list of string, keep_symbols_list specifies a list of symbols to keep if keep_symbols is enabled.
If it is unset then all symbols are kept.
keep_symbols_and_debug_frame
bool, keep_symbols_and_debug_frame enables stripping but keeps all symbols and debug frames.
suffix
string, append to name of output
system_dlkm_specific
bool, Install to partition system_dlkm when set to true.
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
compile_multilib
string
enabled
bool
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
use_expansive_default_srcs
bool, Set this to true to use an expansive default set of source file requirements
(all .rs, .h, .xml, and .md files in the module tree).
This is primarily for tracking sources for RBE purposes. Currently defaults
to true, though this may change in the future.
use_generic_config
bool, Set to true if this module must be generic and does not require product-specific information.
To be included in the system image, this property must be set to true.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_available
bool, whether this module should be allowed to be directly depended by other
modules with `vendor: true`, `proprietary: true`, or `vendor_available:true`.
If set to true, two variants will be built separately, one like
normal, and the other limited to the set of libraries and headers
that are exposed to /vendor modules.
The vendor variant may be used with a different (newer) /system,
so it shouldn't have any unversioned runtime dependencies, or
make assumptions about the system that may not be true in the
future.
If set to false, this module becomes inaccessible from /vendor modules.
The modules with vndk: {enabled: true} must define 'vendor_available'
to 'true'.
Nothing happens if BOARD_VNDK_VERSION isn't set in the BoardConfig.mk
vendor_dlkm_specific
bool, Install to partition vendor_dlkm when set to true.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vendor_ramdisk_available
bool, Make this module available when building for vendor ramdisk.
On device without a dedicated recovery partition, the module is only
available after switching root into
/first_stage_ramdisk. To expose the module before switching root, install
the recovery variant instead
vintf_fragment_modules
configurable list of string, vintf_fragment Modules required from this module.
vintf_fragments
configurable list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
whole_static_libs
configurable list of string, Similar to static_libs, but will bundle the static library dependency into a library. This is helpful
to avoid having to redeclare the dependency for dependents of this library, but in some cases may also
result in bloat if multiple dependencies all include the same static library whole.
The common use case for this is when the static library is unlikely to be a dependency of other modules to avoid
having to redeclare the static library dependency for every dependent module.
If you are not sure what to, for rust_library modules most static dependencies should go in static_libraries,
and for rust_ffi modules most static dependencies should go into whole_static_libraries.
For rust_ffi static variants, these libraries will be included in the resulting static library archive.
For rust_library rlib variants, these libraries will be bundled into the resulting rlib library. This will
include all of the static libraries symbols in any dylibs or binaries which use this rlib as well.
rust_library
rust_library produces all Rust variants (rust_library_dylib and
rust_library_rlib).
name
,
srcs
,
defaults
,
host_supported
,
device_supported
,
afdo
,
aliases
,
apex_available
,
apex_exclude
,
arch
,
bootstrap
,
cargo_env_compat
,
cargo_pkg_version
,
cfgs
,
clippy_lints
,
compile_multilib
,
crate_name
,
crate_root
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
double_loadable
,
dylib
,
edition
,
enabled
,
exclude_from_recovery_snapshot
,
exclude_from_vendor_snapshot
,
export_include_dirs
,
extra_exported_symbols
,
features
,
flags
,
host_cross_supported
,
host_required
,
include_dirs
,
init_rc
,
installable
,
ld_flags
,
licenses
,
lints
,
lto
,
min_sdk_version
,
multilib
,
native_bridge_supported
,
native_coverage
,
no_full_install
,
no_stdlibs
,
odm_available
,
odm_dlkm_specific
,
overrides
,
owner
,
prefer_rlib
,
proc_macros
,
product_available
,
product_specific
,
product_variables.arc
,
product_variables.build_from_text_stub
,
product_variables.debuggable
,
product_variables.eng
,
product_variables.malloc_low_memory
,
product_variables.native_coverage
,
product_variables.release_aidl_use_unfrozen
,
product_variables.selinuxignoreneverallows
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
ramdisk_available
,
recovery
,
recovery_available
,
relative_install_path
,
required
,
rlib
,
rlibs
,
rustlibs
,
sanitize
,
sdk_version
,
shared
,
shared_libs
,
soc_specific
,
static
,
static_libs
,
stdlibs
,
stem
,
strip
,
stubs
,
suffix
,
sysroot
,
system_dlkm_specific
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
use_expansive_default_srcs
,
use_generic_config
,
vendor
,
vendor_available
,
vendor_dlkm_specific
,
vendor_ramdisk
,
vendor_ramdisk_available
,
version_script
,
vintf_fragment_modules
,
vintf_fragments
,
visibility
,
whole_static_libs
name
string, The name of the module. Must be unique across all modules.
srcs
list of string, path to the source file that is the main entry point of the program (e.g. main.rs or lib.rs).
Only a single source file can be defined. Modules which generate source can be included by prefixing
the module name with ":", for example ":libfoo_bindgen"
If no source file is defined, a single generated source module can be defined to be used as the main source.
defaults
list of string
host_supported
bool, If set to true, build a variant of the module for the host. Defaults to false.
device_supported
bool, If set to true, build a variant of the module for the device. Defaults to true.
afdo
bool, Afdo allows developers self-service enroll for
automatic feedback-directed optimization using profile data.
aliases
list of string, Rust crate dependencies to rename. Each entry should be a string of the form "dependencyname:alias".
"dependencyname" here should be the name of the crate, not the Android module. This is
equivalent to writing `alias = { package = "dependencyname" }` in a `Cargo.toml`.
apex_available
list of string, Availability of this module in APEXes. Only the listed APEXes can contain this module. If
the module has stubs then other APEXes and the platform may access it through them
(subject to visibility).
"//apex_available:anyapex" is a pseudo APEX name that matches to any APEX.
"//apex_available:platform" refers to non-APEX partitions like "system.img".
Prefix pattern (com.foo.*) can be used to match with any APEX name with the prefix(com.foo.).
Default is ["//apex_available:platform"].
apex_exclude
bool, Deprecated - exclude this rust_ffi target from being included in APEXes.
TODO(b/362509506): remove this once all apex_exclude uses are switched to stubs.
arch
interface
bootstrap
bool, Allows this module to use non-APEX version of libraries. Useful
for building binaries that are started before APEXes are activated.
cargo_env_compat
bool, Enables emitting certain Cargo environment variables. Only intended to be used for compatibility purposes.
Will set CARGO_CRATE_NAME to the crate_name property's value.
Will set CARGO_BIN_NAME to the output filename value without the extension.
cargo_pkg_version
string, If cargo_env_compat is true, sets the CARGO_PKG_VERSION env var to this value.
cfgs
configurable list of string, list of configuration options to enable for this crate. To enable features, use the "features" property.
clippy_lints
string, name of the lint set that should be used to validate this module.
Possible values are "default" (for using a sensible set of lints
depending on the module's location), "android" (for the strictest
lint set that applies to all Android platform code), "vendor" (for a
relaxed set) and "none" (to disable the execution of clippy). The
default value is "default". See also the `lints` property.
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
crate_name
string, crate name, required for modules which produce Rust libraries: rust_library, rust_ffi and SourceProvider
modules which create library variants (rust_bindgen). This must be the expected extern crate name used in
source, and is required to conform to an enforced format matching library output files (if the output file is
lib<someName><suffix>, the crate_name property must be <someName>).
crate_root
string, Entry point that is passed to rustc to begin the compilation. E.g. main.rs or lib.rs.
When this property is set,
* sandboxing is enabled for this module, and
* the srcs attribute is interpreted as a list of all source files potentially
used in compilation, including the entrypoint, and
* compile_data can be used to add additional files used in compilation that
not directly used as source files.
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
prepend_artifact_with_product
bool, If true, then the artifact file will be prepended with <product name>-. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be coral-foo.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
double_loadable
bool, whether this module is capable of being loaded with other instance
(possibly an older version) of the same module in the same process.
Currently, a shared library that is a member of VNDK (vndk: {enabled: true})
can be double loaded in a vendor process if the library is also a
(direct and indirect) dependency of an LLNDK library. Such libraries must be
explicitly marked as `double_loadable: true` by the owner, or the dependency
from the LLNDK lib should be cut if the lib is not designed to be double loaded.
⊕dylib
VariantLibraryProperties
enabled
bool
srcs
list of string
edition
string, specific rust edition that should be used if the default version is not desired
enabled
configurable bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
exclude_from_recovery_snapshot
bool, Normally Soong uses the directory structure to decide which modules
should be included (framework) or excluded (non-framework) from the
different snapshots (vendor, recovery, etc.), but this property
allows a partner to exclude a module normally thought of as a
framework module from the recovery snapshot.
exclude_from_vendor_snapshot
bool, Normally Soong uses the directory structure to decide which modules
should be included (framework) or excluded (non-framework) from the
different snapshots (vendor, recovery, etc.), but this property
allows a partner to exclude a module normally thought of as a
framework module from the vendor snapshot.
export_include_dirs
list of string, path to include directories to export to cc_* modules, only relevant for static/shared variants.
features
configurable list of string, list of features to enable for this crate
flags
list of string, flags to pass to rustc. To enable configuration options or features, use the "cfgs" or "features" properties.
host_cross_supported
bool, If set to true, build a variant of the module for the host cross. Defaults to true.
host_required
list of string, names of other modules to install on host if this module is installed
include_dirs
list of string, TODO: Remove this when all instances of Include_dirs have been removed from rust_ffi modules.
path to include directories to pass to cc_* modules, only relevant for static/shared variants (deprecated, use export_include_dirs instead).
init_rc
configurable list of string, init.rc files to be installed if this module is installed
installable
bool
ld_flags
list of string, flags to pass to the linker
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
lints
string, name of the lint set that should be used to validate this module.
Possible values are "default" (for using a sensible set of lints
depending on the module's location), "android" (for the strictest
lint set that applies to all Android platform code), "vendor" (for
a relaxed set) and "none" (for ignoring all lint warnings and
errors). The default value is "default".
⊕lto
Control whether LTO is used for the final (Rust) linkage. This does not impact
cross-language LTO.
thin
bool, Whether thin LTO should be enabled. By default this is true.
LTO provides such a large code size benefit for Rust, this should always
be enabled for production builds unless there's a clear need to disable it.
min_sdk_version
string, Minimum OS API level supported by this C or C++ module. This property becomes the value
of the __ANDROID_API__ macro. When the C or C++ module is included in an APEX or an APK,
this property is also used to ensure that the min_sdk_version of the containing module is
not older (i.e. less) than this module's min_sdk_version. When not set, this property
defaults to the value of sdk_version. When this is set to "apex_inherit", this tracks
min_sdk_version of the containing APEX. When the module
is not built for an APEX, "apex_inherit" defaults to sdk_version.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
native_coverage
bool
no_full_install
bool, When set to true, this module is not installed to the full install path (ex: under
out/target/product/<name>/<partition>). It can be installed only to the packaging
modules like android_filesystem.
no_stdlibs
bool, whether to suppress inclusion of standard crates - defaults to false
odm_available
bool, This is the same as the "vendor_available" except that the install path
of the vendor variant is /odm or /vendor/odm.
By replacing "vendor_available: true" with "odm_available: true", the
module will install its vendor variant to the /odm partition or /vendor/odm.
As the modules with "odm_available: true" still create the vendor variants,
they can link to the other vendor modules as the vendor_available modules do.
Also, the vendor modules can link to odm_available modules.
It may not be used for VNDK modules.
odm_dlkm_specific
bool, Install to partition odm_dlkm when set to true.
overrides
list of string, List of module names that are prevented from being installed when this module gets
installed.
owner
string, vendor who owns this module
prefer_rlib
bool, Change the rustlibs linkage to select rlib linkage by default for device targets.
Also link libstd as an rlib as well on device targets.
Note: This is the default behavior for host targets.
This is primarily meant for rust_binary and rust_ffi modules where the default
linkage of libstd might need to be overridden in some use cases. This should
generally be avoided with other module types since it may cause collisions at
linkage if all dependencies of the root binary module do not link against libstd
the same way.
proc_macros
configurable list of string, list of rust proc_macro crate dependencies
product_available
bool, whether this module should be allowed to be directly depended by other
modules with `product_specific: true` or `product_available: true`.
If set to true, an additional product variant will be built separately
that is limited to the set of libraries and headers that are exposed to
/product modules.
The product variant may be used with a different (newer) /system,
so it shouldn't have any unversioned runtime dependencies, or
make assumptions about the system that may not be true in the
future.
If set to false, this module becomes inaccessible from /product modules.
Different from the 'vendor_available' property, the modules with
vndk: {enabled: true} don't have to define 'product_available'. The VNDK
library without 'product_available' may not be depended on by any other
modules that has product variants including the product available VNDKs.
Nothing happens if BOARD_VNDK_VERSION isn't set in the BoardConfig.mk
and PRODUCT_PRODUCT_VNDK_VERSION isn't set.
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.arc
⊕include_dirs
⊕shared_libs
⊕static_libs
⊕srcs
⊕whole_static_libs
⊕product_variables.build_from_text_stub
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕strip.all
⊕strip.keep_symbols
⊕strip.keep_symbols_and_debug_frame
⊕static_libs
⊕whole_static_libs
⊕shared_libs
⊕srcs
⊕product_variables.eng
⊕product_variables.malloc_low_memory
⊕shared_libs
⊕whole_static_libs
⊕static_libs
⊕srcs
⊕product_variables.native_coverage
⊕product_variables.release_aidl_use_unfrozen
⊕required
⊕vintf_fragment_modules
⊕product_variables.selinuxignoreneverallows
⊕product_variables.unbundled_build
⊕enabled
Configurable[bool]
Configurable[bool]
proptools.Configurable[bool]
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
ramdisk_available
bool, Make this module available when building for ramdisk.
On device without a dedicated recovery partition, the module is only
available after switching root into
/first_stage_ramdisk. To expose the module before switching root, install
the recovery variant instead.
recovery
bool, Whether this module is installed to recovery partition
recovery_available
bool, Make this module available when building for recovery
relative_install_path
string, install to a subdirectory of the default install path for the module
required
configurable list of string, names of other modules to install if this module is installed
⊕rlib
VariantLibraryProperties
enabled
bool
srcs
list of string
rlibs
configurable list of string, list of rust rlib crate dependencies
rustlibs
configurable list of string, list of rust automatic crate dependencies.
Rustlibs linkage is rlib for host targets and dylib for device targets.
⊕sanitize
enable AddressSanitizer, HWAddressSanitizer, and others.
address
bool
hwaddress
bool
memtag_heap
bool, Memory-tagging, only available on arm64
if diag.memtag unset or false, enables async memory tagging
fuzzer
bool
never
bool
⊕diag
Sanitizers to run in the diagnostic mode (as opposed to the release mode).
Replaces abort() on error with a human-readable error message.
Address and Thread sanitizers always run in diagnostic mode.
memtag_heap
bool, Memory-tagging, only available on arm64
requires sanitizer.memtag: true
if set, enables sync memory tagging
sdk_version
string, The API level that this module is built against. The APIs of this API level will be
visible at build time, but use of any APIs newer than min_sdk_version will render the
module unloadable on older devices. In the future it will be possible to weakly-link new
APIs, making the behavior match Java: such modules will load on older devices, but
calling new APIs on devices that do not support them will result in a crash.
This property has the same behavior as sdk_version does for Java modules. For those
familiar with Android Gradle, the property behaves similarly to how compileSdkVersion
does for Java code.
In addition, setting this property causes two variants to be built, one for the platform
and one for apps.
⊕shared
VariantLibraryProperties
enabled
bool
srcs
list of string
shared_libs
configurable list of string, list of C shared library dependencies
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
⊕static
VariantLibraryProperties
enabled
bool
srcs
list of string
static_libs
configurable list of string, list of C static library dependencies. These dependencies do not normally propagate to dependents
and may need to be redeclared. See whole_static_libs for bundling static dependencies into a library.
stdlibs
configurable list of string, list of Rust system library dependencies.
This is usually only needed when `no_stdlibs` is true, in which case it can be used to depend on system crates
like `core` and `alloc`.
stem
string, sets name of the output
⊕strip
none
bool, Device modules default to stripping enabled leaving mini debuginfo.
Host modules default to stripping disabled, but can be enabled by setting any other
strip boolean property.
all
bool, all forces stripping everything, including the mini debug info.
keep_symbols
bool, keep_symbols enables stripping but keeps all symbols.
keep_symbols_list
list of string, keep_symbols_list specifies a list of symbols to keep if keep_symbols is enabled.
If it is unset then all symbols are kept.
keep_symbols_and_debug_frame
bool, keep_symbols_and_debug_frame enables stripping but keeps all symbols and debug frames.
⊕stubs
*ast.SelectorExpr
Generate stubs to make this library accessible to APEXes.
Can only be set for modules producing shared libraries.
symbol_file
string, Relative path to the symbol map. The symbol map provides the list of
symbols that are exported for stubs variant of this library.
versions
list of string, List versions to generate stubs libs for. The version name "current" is always
implicitly added.
implementation_installable
bool, Whether to not require the implementation of the library to be installed if a
client of the stubs is installed. Defaults to true; set to false if the
implementation is made available by some other means, e.g. in a Microdroid
virtual machine.
suffix
string, append to name of output
sysroot
bool, Whether this library is part of the Rust toolchain sysroot.
system_dlkm_specific
bool, Install to partition system_dlkm when set to true.
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
compile_multilib
string
enabled
bool
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
use_expansive_default_srcs
bool, Set this to true to use an expansive default set of source file requirements
(all .rs, .h, .xml, and .md files in the module tree).
This is primarily for tracking sources for RBE purposes. Currently defaults
to true, though this may change in the future.
use_generic_config
bool, Set to true if this module must be generic and does not require product-specific information.
To be included in the system image, this property must be set to true.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_available
bool, whether this module should be allowed to be directly depended by other
modules with `vendor: true`, `proprietary: true`, or `vendor_available:true`.
If set to true, two variants will be built separately, one like
normal, and the other limited to the set of libraries and headers
that are exposed to /vendor modules.
The vendor variant may be used with a different (newer) /system,
so it shouldn't have any unversioned runtime dependencies, or
make assumptions about the system that may not be true in the
future.
If set to false, this module becomes inaccessible from /vendor modules.
The modules with vndk: {enabled: true} must define 'vendor_available'
to 'true'.
Nothing happens if BOARD_VNDK_VERSION isn't set in the BoardConfig.mk
vendor_dlkm_specific
bool, Install to partition vendor_dlkm when set to true.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vendor_ramdisk_available
bool, Make this module available when building for vendor ramdisk.
On device without a dedicated recovery partition, the module is only
available after switching root into
/first_stage_ramdisk. To expose the module before switching root, install
the recovery variant instead
version_script
string, Version script to pass to the linker. By default this will replace the
implicit rustc emitted version script to mirror expected behavior in CC.
This is only relevant for rust_ffi_shared modules which are exposing a
versioned C API.
vintf_fragment_modules
configurable list of string, vintf_fragment Modules required from this module.
vintf_fragments
configurable list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
whole_static_libs
configurable list of string, Similar to static_libs, but will bundle the static library dependency into a library. This is helpful
to avoid having to redeclare the dependency for dependents of this library, but in some cases may also
result in bloat if multiple dependencies all include the same static library whole.
The common use case for this is when the static library is unlikely to be a dependency of other modules to avoid
having to redeclare the static library dependency for every dependent module.
If you are not sure what to, for rust_library modules most static dependencies should go in static_libraries,
and for rust_ffi modules most static dependencies should go into whole_static_libraries.
For rust_ffi static variants, these libraries will be included in the resulting static library archive.
For rust_library rlib variants, these libraries will be bundled into the resulting rlib library. This will
include all of the static libraries symbols in any dylibs or binaries which use this rlib as well.
rust_library_dylib
rust_library_dylib produces a Rust dylib (Rust crate type "dylib").
name
,
srcs
,
defaults
,
host_supported
,
device_supported
,
afdo
,
aliases
,
apex_available
,
apex_exclude
,
arch
,
bootstrap
,
cargo_env_compat
,
cargo_pkg_version
,
cfgs
,
clippy_lints
,
compile_multilib
,
crate_name
,
crate_root
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
double_loadable
,
dylib
,
edition
,
enabled
,
exclude_from_recovery_snapshot
,
exclude_from_vendor_snapshot
,
export_include_dirs
,
extra_exported_symbols
,
features
,
flags
,
host_cross_supported
,
host_required
,
include_dirs
,
init_rc
,
installable
,
ld_flags
,
licenses
,
lints
,
lto
,
min_sdk_version
,
multilib
,
native_bridge_supported
,
native_coverage
,
no_full_install
,
no_stdlibs
,
odm_available
,
odm_dlkm_specific
,
overrides
,
owner
,
prefer_rlib
,
proc_macros
,
product_available
,
product_specific
,
product_variables.arc
,
product_variables.build_from_text_stub
,
product_variables.debuggable
,
product_variables.eng
,
product_variables.malloc_low_memory
,
product_variables.native_coverage
,
product_variables.release_aidl_use_unfrozen
,
product_variables.selinuxignoreneverallows
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
ramdisk_available
,
recovery
,
recovery_available
,
relative_install_path
,
required
,
rlib
,
rlibs
,
rustlibs
,
sanitize
,
sdk_version
,
shared
,
shared_libs
,
soc_specific
,
static
,
static_libs
,
stdlibs
,
stem
,
strip
,
stubs
,
suffix
,
sysroot
,
system_dlkm_specific
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
use_expansive_default_srcs
,
use_generic_config
,
vendor
,
vendor_available
,
vendor_dlkm_specific
,
vendor_ramdisk
,
vendor_ramdisk_available
,
version_script
,
vintf_fragment_modules
,
vintf_fragments
,
visibility
,
whole_static_libs
name
string, The name of the module. Must be unique across all modules.
srcs
list of string, path to the source file that is the main entry point of the program (e.g. main.rs or lib.rs).
Only a single source file can be defined. Modules which generate source can be included by prefixing
the module name with ":", for example ":libfoo_bindgen"
If no source file is defined, a single generated source module can be defined to be used as the main source.
defaults
list of string
host_supported
bool, If set to true, build a variant of the module for the host. Defaults to false.
device_supported
bool, If set to true, build a variant of the module for the device. Defaults to true.
afdo
bool, Afdo allows developers self-service enroll for
automatic feedback-directed optimization using profile data.
aliases
list of string, Rust crate dependencies to rename. Each entry should be a string of the form "dependencyname:alias".
"dependencyname" here should be the name of the crate, not the Android module. This is
equivalent to writing `alias = { package = "dependencyname" }` in a `Cargo.toml`.
apex_available
list of string, Availability of this module in APEXes. Only the listed APEXes can contain this module. If
the module has stubs then other APEXes and the platform may access it through them
(subject to visibility).
"//apex_available:anyapex" is a pseudo APEX name that matches to any APEX.
"//apex_available:platform" refers to non-APEX partitions like "system.img".
Prefix pattern (com.foo.*) can be used to match with any APEX name with the prefix(com.foo.).
Default is ["//apex_available:platform"].
apex_exclude
bool, Deprecated - exclude this rust_ffi target from being included in APEXes.
TODO(b/362509506): remove this once all apex_exclude uses are switched to stubs.
arch
interface
bootstrap
bool, Allows this module to use non-APEX version of libraries. Useful
for building binaries that are started before APEXes are activated.
cargo_env_compat
bool, Enables emitting certain Cargo environment variables. Only intended to be used for compatibility purposes.
Will set CARGO_CRATE_NAME to the crate_name property's value.
Will set CARGO_BIN_NAME to the output filename value without the extension.
cargo_pkg_version
string, If cargo_env_compat is true, sets the CARGO_PKG_VERSION env var to this value.
cfgs
configurable list of string, list of configuration options to enable for this crate. To enable features, use the "features" property.
clippy_lints
string, name of the lint set that should be used to validate this module.
Possible values are "default" (for using a sensible set of lints
depending on the module's location), "android" (for the strictest
lint set that applies to all Android platform code), "vendor" (for a
relaxed set) and "none" (to disable the execution of clippy). The
default value is "default". See also the `lints` property.
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
crate_name
string, crate name, required for modules which produce Rust libraries: rust_library, rust_ffi and SourceProvider
modules which create library variants (rust_bindgen). This must be the expected extern crate name used in
source, and is required to conform to an enforced format matching library output files (if the output file is
lib<someName><suffix>, the crate_name property must be <someName>).
crate_root
string, Entry point that is passed to rustc to begin the compilation. E.g. main.rs or lib.rs.
When this property is set,
* sandboxing is enabled for this module, and
* the srcs attribute is interpreted as a list of all source files potentially
used in compilation, including the entrypoint, and
* compile_data can be used to add additional files used in compilation that
not directly used as source files.
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
prepend_artifact_with_product
bool, If true, then the artifact file will be prepended with <product name>-. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be coral-foo.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
double_loadable
bool, whether this module is capable of being loaded with other instance
(possibly an older version) of the same module in the same process.
Currently, a shared library that is a member of VNDK (vndk: {enabled: true})
can be double loaded in a vendor process if the library is also a
(direct and indirect) dependency of an LLNDK library. Such libraries must be
explicitly marked as `double_loadable: true` by the owner, or the dependency
from the LLNDK lib should be cut if the lib is not designed to be double loaded.
⊕dylib
VariantLibraryProperties
enabled
bool
srcs
list of string
edition
string, specific rust edition that should be used if the default version is not desired
enabled
configurable bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
exclude_from_recovery_snapshot
bool, Normally Soong uses the directory structure to decide which modules
should be included (framework) or excluded (non-framework) from the
different snapshots (vendor, recovery, etc.), but this property
allows a partner to exclude a module normally thought of as a
framework module from the recovery snapshot.
exclude_from_vendor_snapshot
bool, Normally Soong uses the directory structure to decide which modules
should be included (framework) or excluded (non-framework) from the
different snapshots (vendor, recovery, etc.), but this property
allows a partner to exclude a module normally thought of as a
framework module from the vendor snapshot.
export_include_dirs
list of string, path to include directories to export to cc_* modules, only relevant for static/shared variants.
features
configurable list of string, list of features to enable for this crate
flags
list of string, flags to pass to rustc. To enable configuration options or features, use the "cfgs" or "features" properties.
host_cross_supported
bool, If set to true, build a variant of the module for the host cross. Defaults to true.
host_required
list of string, names of other modules to install on host if this module is installed
include_dirs
list of string, TODO: Remove this when all instances of Include_dirs have been removed from rust_ffi modules.
path to include directories to pass to cc_* modules, only relevant for static/shared variants (deprecated, use export_include_dirs instead).
init_rc
configurable list of string, init.rc files to be installed if this module is installed
installable
bool
ld_flags
list of string, flags to pass to the linker
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
lints
string, name of the lint set that should be used to validate this module.
Possible values are "default" (for using a sensible set of lints
depending on the module's location), "android" (for the strictest
lint set that applies to all Android platform code), "vendor" (for
a relaxed set) and "none" (for ignoring all lint warnings and
errors). The default value is "default".
⊕lto
Control whether LTO is used for the final (Rust) linkage. This does not impact
cross-language LTO.
thin
bool, Whether thin LTO should be enabled. By default this is true.
LTO provides such a large code size benefit for Rust, this should always
be enabled for production builds unless there's a clear need to disable it.
min_sdk_version
string, Minimum OS API level supported by this C or C++ module. This property becomes the value
of the __ANDROID_API__ macro. When the C or C++ module is included in an APEX or an APK,
this property is also used to ensure that the min_sdk_version of the containing module is
not older (i.e. less) than this module's min_sdk_version. When not set, this property
defaults to the value of sdk_version. When this is set to "apex_inherit", this tracks
min_sdk_version of the containing APEX. When the module
is not built for an APEX, "apex_inherit" defaults to sdk_version.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
native_coverage
bool
no_full_install
bool, When set to true, this module is not installed to the full install path (ex: under
out/target/product/<name>/<partition>). It can be installed only to the packaging
modules like android_filesystem.
no_stdlibs
bool, whether to suppress inclusion of standard crates - defaults to false
odm_available
bool, This is the same as the "vendor_available" except that the install path
of the vendor variant is /odm or /vendor/odm.
By replacing "vendor_available: true" with "odm_available: true", the
module will install its vendor variant to the /odm partition or /vendor/odm.
As the modules with "odm_available: true" still create the vendor variants,
they can link to the other vendor modules as the vendor_available modules do.
Also, the vendor modules can link to odm_available modules.
It may not be used for VNDK modules.
odm_dlkm_specific
bool, Install to partition odm_dlkm when set to true.
overrides
list of string, List of module names that are prevented from being installed when this module gets
installed.
owner
string, vendor who owns this module
prefer_rlib
bool, Change the rustlibs linkage to select rlib linkage by default for device targets.
Also link libstd as an rlib as well on device targets.
Note: This is the default behavior for host targets.
This is primarily meant for rust_binary and rust_ffi modules where the default
linkage of libstd might need to be overridden in some use cases. This should
generally be avoided with other module types since it may cause collisions at
linkage if all dependencies of the root binary module do not link against libstd
the same way.
proc_macros
configurable list of string, list of rust proc_macro crate dependencies
product_available
bool, whether this module should be allowed to be directly depended by other
modules with `product_specific: true` or `product_available: true`.
If set to true, an additional product variant will be built separately
that is limited to the set of libraries and headers that are exposed to
/product modules.
The product variant may be used with a different (newer) /system,
so it shouldn't have any unversioned runtime dependencies, or
make assumptions about the system that may not be true in the
future.
If set to false, this module becomes inaccessible from /product modules.
Different from the 'vendor_available' property, the modules with
vndk: {enabled: true} don't have to define 'product_available'. The VNDK
library without 'product_available' may not be depended on by any other
modules that has product variants including the product available VNDKs.
Nothing happens if BOARD_VNDK_VERSION isn't set in the BoardConfig.mk
and PRODUCT_PRODUCT_VNDK_VERSION isn't set.
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.arc
⊕include_dirs
⊕shared_libs
⊕static_libs
⊕srcs
⊕whole_static_libs
⊕product_variables.build_from_text_stub
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕strip.all
⊕strip.keep_symbols
⊕strip.keep_symbols_and_debug_frame
⊕static_libs
⊕whole_static_libs
⊕shared_libs
⊕srcs
⊕product_variables.eng
⊕product_variables.malloc_low_memory
⊕shared_libs
⊕whole_static_libs
⊕static_libs
⊕srcs
⊕product_variables.native_coverage
⊕product_variables.release_aidl_use_unfrozen
⊕required
⊕vintf_fragment_modules
⊕product_variables.selinuxignoreneverallows
⊕product_variables.unbundled_build
⊕enabled
Configurable[bool]
Configurable[bool]
proptools.Configurable[bool]
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
ramdisk_available
bool, Make this module available when building for ramdisk.
On device without a dedicated recovery partition, the module is only
available after switching root into
/first_stage_ramdisk. To expose the module before switching root, install
the recovery variant instead.
recovery
bool, Whether this module is installed to recovery partition
recovery_available
bool, Make this module available when building for recovery
relative_install_path
string, install to a subdirectory of the default install path for the module
required
configurable list of string, names of other modules to install if this module is installed
⊕rlib
VariantLibraryProperties
enabled
bool
srcs
list of string
rlibs
configurable list of string, list of rust rlib crate dependencies
rustlibs
configurable list of string, list of rust automatic crate dependencies.
Rustlibs linkage is rlib for host targets and dylib for device targets.
⊕sanitize
enable AddressSanitizer, HWAddressSanitizer, and others.
address
bool
hwaddress
bool
memtag_heap
bool, Memory-tagging, only available on arm64
if diag.memtag unset or false, enables async memory tagging
fuzzer
bool
never
bool
⊕diag
Sanitizers to run in the diagnostic mode (as opposed to the release mode).
Replaces abort() on error with a human-readable error message.
Address and Thread sanitizers always run in diagnostic mode.
memtag_heap
bool, Memory-tagging, only available on arm64
requires sanitizer.memtag: true
if set, enables sync memory tagging
sdk_version
string, The API level that this module is built against. The APIs of this API level will be
visible at build time, but use of any APIs newer than min_sdk_version will render the
module unloadable on older devices. In the future it will be possible to weakly-link new
APIs, making the behavior match Java: such modules will load on older devices, but
calling new APIs on devices that do not support them will result in a crash.
This property has the same behavior as sdk_version does for Java modules. For those
familiar with Android Gradle, the property behaves similarly to how compileSdkVersion
does for Java code.
In addition, setting this property causes two variants to be built, one for the platform
and one for apps.
⊕shared
VariantLibraryProperties
enabled
bool
srcs
list of string
shared_libs
configurable list of string, list of C shared library dependencies
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
⊕static
VariantLibraryProperties
enabled
bool
srcs
list of string
static_libs
configurable list of string, list of C static library dependencies. These dependencies do not normally propagate to dependents
and may need to be redeclared. See whole_static_libs for bundling static dependencies into a library.
stdlibs
configurable list of string, list of Rust system library dependencies.
This is usually only needed when `no_stdlibs` is true, in which case it can be used to depend on system crates
like `core` and `alloc`.
stem
string, sets name of the output
⊕strip
none
bool, Device modules default to stripping enabled leaving mini debuginfo.
Host modules default to stripping disabled, but can be enabled by setting any other
strip boolean property.
all
bool, all forces stripping everything, including the mini debug info.
keep_symbols
bool, keep_symbols enables stripping but keeps all symbols.
keep_symbols_list
list of string, keep_symbols_list specifies a list of symbols to keep if keep_symbols is enabled.
If it is unset then all symbols are kept.
keep_symbols_and_debug_frame
bool, keep_symbols_and_debug_frame enables stripping but keeps all symbols and debug frames.
⊕stubs
*ast.SelectorExpr
Generate stubs to make this library accessible to APEXes.
Can only be set for modules producing shared libraries.
symbol_file
string, Relative path to the symbol map. The symbol map provides the list of
symbols that are exported for stubs variant of this library.
versions
list of string, List versions to generate stubs libs for. The version name "current" is always
implicitly added.
implementation_installable
bool, Whether to not require the implementation of the library to be installed if a
client of the stubs is installed. Defaults to true; set to false if the
implementation is made available by some other means, e.g. in a Microdroid
virtual machine.
suffix
string, append to name of output
sysroot
bool, Whether this library is part of the Rust toolchain sysroot.
system_dlkm_specific
bool, Install to partition system_dlkm when set to true.
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
compile_multilib
string
enabled
bool
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
use_expansive_default_srcs
bool, Set this to true to use an expansive default set of source file requirements
(all .rs, .h, .xml, and .md files in the module tree).
This is primarily for tracking sources for RBE purposes. Currently defaults
to true, though this may change in the future.
use_generic_config
bool, Set to true if this module must be generic and does not require product-specific information.
To be included in the system image, this property must be set to true.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_available
bool, whether this module should be allowed to be directly depended by other
modules with `vendor: true`, `proprietary: true`, or `vendor_available:true`.
If set to true, two variants will be built separately, one like
normal, and the other limited to the set of libraries and headers
that are exposed to /vendor modules.
The vendor variant may be used with a different (newer) /system,
so it shouldn't have any unversioned runtime dependencies, or
make assumptions about the system that may not be true in the
future.
If set to false, this module becomes inaccessible from /vendor modules.
The modules with vndk: {enabled: true} must define 'vendor_available'
to 'true'.
Nothing happens if BOARD_VNDK_VERSION isn't set in the BoardConfig.mk
vendor_dlkm_specific
bool, Install to partition vendor_dlkm when set to true.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vendor_ramdisk_available
bool, Make this module available when building for vendor ramdisk.
On device without a dedicated recovery partition, the module is only
available after switching root into
/first_stage_ramdisk. To expose the module before switching root, install
the recovery variant instead
version_script
string, Version script to pass to the linker. By default this will replace the
implicit rustc emitted version script to mirror expected behavior in CC.
This is only relevant for rust_ffi_shared modules which are exposing a
versioned C API.
vintf_fragment_modules
configurable list of string, vintf_fragment Modules required from this module.
vintf_fragments
configurable list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
whole_static_libs
configurable list of string, Similar to static_libs, but will bundle the static library dependency into a library. This is helpful
to avoid having to redeclare the dependency for dependents of this library, but in some cases may also
result in bloat if multiple dependencies all include the same static library whole.
The common use case for this is when the static library is unlikely to be a dependency of other modules to avoid
having to redeclare the static library dependency for every dependent module.
If you are not sure what to, for rust_library modules most static dependencies should go in static_libraries,
and for rust_ffi modules most static dependencies should go into whole_static_libraries.
For rust_ffi static variants, these libraries will be included in the resulting static library archive.
For rust_library rlib variants, these libraries will be bundled into the resulting rlib library. This will
include all of the static libraries symbols in any dylibs or binaries which use this rlib as well.
rust_library_host
rust_library_host produces all Rust variants for the host
(rust_library_dylib_host and rust_library_rlib_host).
name
,
srcs
,
defaults
,
afdo
,
aliases
,
apex_available
,
apex_exclude
,
arch
,
bootstrap
,
cargo_env_compat
,
cargo_pkg_version
,
cfgs
,
clippy_lints
,
compile_multilib
,
crate_name
,
crate_root
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
double_loadable
,
dylib
,
edition
,
enabled
,
exclude_from_recovery_snapshot
,
exclude_from_vendor_snapshot
,
export_include_dirs
,
extra_exported_symbols
,
features
,
flags
,
host_cross_supported
,
host_required
,
include_dirs
,
init_rc
,
installable
,
ld_flags
,
licenses
,
lints
,
lto
,
min_sdk_version
,
multilib
,
native_bridge_supported
,
native_coverage
,
no_full_install
,
no_stdlibs
,
odm_available
,
odm_dlkm_specific
,
overrides
,
owner
,
prefer_rlib
,
proc_macros
,
product_available
,
product_specific
,
product_variables.arc
,
product_variables.build_from_text_stub
,
product_variables.debuggable
,
product_variables.eng
,
product_variables.malloc_low_memory
,
product_variables.native_coverage
,
product_variables.release_aidl_use_unfrozen
,
product_variables.selinuxignoreneverallows
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
ramdisk_available
,
recovery
,
recovery_available
,
relative_install_path
,
required
,
rlib
,
rlibs
,
rustlibs
,
sanitize
,
sdk_version
,
shared
,
shared_libs
,
soc_specific
,
static
,
static_libs
,
stdlibs
,
stem
,
strip
,
stubs
,
suffix
,
sysroot
,
system_dlkm_specific
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
use_expansive_default_srcs
,
use_generic_config
,
vendor
,
vendor_available
,
vendor_dlkm_specific
,
vendor_ramdisk
,
vendor_ramdisk_available
,
version_script
,
vintf_fragment_modules
,
vintf_fragments
,
visibility
,
whole_static_libs
name
string, The name of the module. Must be unique across all modules.
srcs
list of string, path to the source file that is the main entry point of the program (e.g. main.rs or lib.rs).
Only a single source file can be defined. Modules which generate source can be included by prefixing
the module name with ":", for example ":libfoo_bindgen"
If no source file is defined, a single generated source module can be defined to be used as the main source.
defaults
list of string
afdo
bool, Afdo allows developers self-service enroll for
automatic feedback-directed optimization using profile data.
aliases
list of string, Rust crate dependencies to rename. Each entry should be a string of the form "dependencyname:alias".
"dependencyname" here should be the name of the crate, not the Android module. This is
equivalent to writing `alias = { package = "dependencyname" }` in a `Cargo.toml`.
apex_available
list of string, Availability of this module in APEXes. Only the listed APEXes can contain this module. If
the module has stubs then other APEXes and the platform may access it through them
(subject to visibility).
"//apex_available:anyapex" is a pseudo APEX name that matches to any APEX.
"//apex_available:platform" refers to non-APEX partitions like "system.img".
Prefix pattern (com.foo.*) can be used to match with any APEX name with the prefix(com.foo.).
Default is ["//apex_available:platform"].
apex_exclude
bool, Deprecated - exclude this rust_ffi target from being included in APEXes.
TODO(b/362509506): remove this once all apex_exclude uses are switched to stubs.
arch
interface
bootstrap
bool, Allows this module to use non-APEX version of libraries. Useful
for building binaries that are started before APEXes are activated.
cargo_env_compat
bool, Enables emitting certain Cargo environment variables. Only intended to be used for compatibility purposes.
Will set CARGO_CRATE_NAME to the crate_name property's value.
Will set CARGO_BIN_NAME to the output filename value without the extension.
cargo_pkg_version
string, If cargo_env_compat is true, sets the CARGO_PKG_VERSION env var to this value.
cfgs
configurable list of string, list of configuration options to enable for this crate. To enable features, use the "features" property.
clippy_lints
string, name of the lint set that should be used to validate this module.
Possible values are "default" (for using a sensible set of lints
depending on the module's location), "android" (for the strictest
lint set that applies to all Android platform code), "vendor" (for a
relaxed set) and "none" (to disable the execution of clippy). The
default value is "default". See also the `lints` property.
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
crate_name
string, crate name, required for modules which produce Rust libraries: rust_library, rust_ffi and SourceProvider
modules which create library variants (rust_bindgen). This must be the expected extern crate name used in
source, and is required to conform to an enforced format matching library output files (if the output file is
lib<someName><suffix>, the crate_name property must be <someName>).
crate_root
string, Entry point that is passed to rustc to begin the compilation. E.g. main.rs or lib.rs.
When this property is set,
* sandboxing is enabled for this module, and
* the srcs attribute is interpreted as a list of all source files potentially
used in compilation, including the entrypoint, and
* compile_data can be used to add additional files used in compilation that
not directly used as source files.
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
prepend_artifact_with_product
bool, If true, then the artifact file will be prepended with <product name>-. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be coral-foo.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
double_loadable
bool, whether this module is capable of being loaded with other instance
(possibly an older version) of the same module in the same process.
Currently, a shared library that is a member of VNDK (vndk: {enabled: true})
can be double loaded in a vendor process if the library is also a
(direct and indirect) dependency of an LLNDK library. Such libraries must be
explicitly marked as `double_loadable: true` by the owner, or the dependency
from the LLNDK lib should be cut if the lib is not designed to be double loaded.
⊕dylib
VariantLibraryProperties
enabled
bool
srcs
list of string
edition
string, specific rust edition that should be used if the default version is not desired
enabled
configurable bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
exclude_from_recovery_snapshot
bool, Normally Soong uses the directory structure to decide which modules
should be included (framework) or excluded (non-framework) from the
different snapshots (vendor, recovery, etc.), but this property
allows a partner to exclude a module normally thought of as a
framework module from the recovery snapshot.
exclude_from_vendor_snapshot
bool, Normally Soong uses the directory structure to decide which modules
should be included (framework) or excluded (non-framework) from the
different snapshots (vendor, recovery, etc.), but this property
allows a partner to exclude a module normally thought of as a
framework module from the vendor snapshot.
export_include_dirs
list of string, path to include directories to export to cc_* modules, only relevant for static/shared variants.
features
configurable list of string, list of features to enable for this crate
flags
list of string, flags to pass to rustc. To enable configuration options or features, use the "cfgs" or "features" properties.
host_cross_supported
bool, If set to true, build a variant of the module for the host cross. Defaults to true.
host_required
list of string, names of other modules to install on host if this module is installed
include_dirs
list of string, TODO: Remove this when all instances of Include_dirs have been removed from rust_ffi modules.
path to include directories to pass to cc_* modules, only relevant for static/shared variants (deprecated, use export_include_dirs instead).
init_rc
configurable list of string, init.rc files to be installed if this module is installed
installable
bool
ld_flags
list of string, flags to pass to the linker
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
lints
string, name of the lint set that should be used to validate this module.
Possible values are "default" (for using a sensible set of lints
depending on the module's location), "android" (for the strictest
lint set that applies to all Android platform code), "vendor" (for
a relaxed set) and "none" (for ignoring all lint warnings and
errors). The default value is "default".
⊕lto
Control whether LTO is used for the final (Rust) linkage. This does not impact
cross-language LTO.
thin
bool, Whether thin LTO should be enabled. By default this is true.
LTO provides such a large code size benefit for Rust, this should always
be enabled for production builds unless there's a clear need to disable it.
min_sdk_version
string, Minimum OS API level supported by this C or C++ module. This property becomes the value
of the __ANDROID_API__ macro. When the C or C++ module is included in an APEX or an APK,
this property is also used to ensure that the min_sdk_version of the containing module is
not older (i.e. less) than this module's min_sdk_version. When not set, this property
defaults to the value of sdk_version. When this is set to "apex_inherit", this tracks
min_sdk_version of the containing APEX. When the module
is not built for an APEX, "apex_inherit" defaults to sdk_version.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
native_coverage
bool
no_full_install
bool, When set to true, this module is not installed to the full install path (ex: under
out/target/product/<name>/<partition>). It can be installed only to the packaging
modules like android_filesystem.
no_stdlibs
bool, whether to suppress inclusion of standard crates - defaults to false
odm_available
bool, This is the same as the "vendor_available" except that the install path
of the vendor variant is /odm or /vendor/odm.
By replacing "vendor_available: true" with "odm_available: true", the
module will install its vendor variant to the /odm partition or /vendor/odm.
As the modules with "odm_available: true" still create the vendor variants,
they can link to the other vendor modules as the vendor_available modules do.
Also, the vendor modules can link to odm_available modules.
It may not be used for VNDK modules.
odm_dlkm_specific
bool, Install to partition odm_dlkm when set to true.
overrides
list of string, List of module names that are prevented from being installed when this module gets
installed.
owner
string, vendor who owns this module
prefer_rlib
bool, Change the rustlibs linkage to select rlib linkage by default for device targets.
Also link libstd as an rlib as well on device targets.
Note: This is the default behavior for host targets.
This is primarily meant for rust_binary and rust_ffi modules where the default
linkage of libstd might need to be overridden in some use cases. This should
generally be avoided with other module types since it may cause collisions at
linkage if all dependencies of the root binary module do not link against libstd
the same way.
proc_macros
configurable list of string, list of rust proc_macro crate dependencies
product_available
bool, whether this module should be allowed to be directly depended by other
modules with `product_specific: true` or `product_available: true`.
If set to true, an additional product variant will be built separately
that is limited to the set of libraries and headers that are exposed to
/product modules.
The product variant may be used with a different (newer) /system,
so it shouldn't have any unversioned runtime dependencies, or
make assumptions about the system that may not be true in the
future.
If set to false, this module becomes inaccessible from /product modules.
Different from the 'vendor_available' property, the modules with
vndk: {enabled: true} don't have to define 'product_available'. The VNDK
library without 'product_available' may not be depended on by any other
modules that has product variants including the product available VNDKs.
Nothing happens if BOARD_VNDK_VERSION isn't set in the BoardConfig.mk
and PRODUCT_PRODUCT_VNDK_VERSION isn't set.
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.arc
⊕include_dirs
⊕shared_libs
⊕static_libs
⊕srcs
⊕whole_static_libs
⊕product_variables.build_from_text_stub
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕strip.all
⊕strip.keep_symbols
⊕strip.keep_symbols_and_debug_frame
⊕static_libs
⊕whole_static_libs
⊕shared_libs
⊕srcs
⊕product_variables.eng
⊕product_variables.malloc_low_memory
⊕shared_libs
⊕whole_static_libs
⊕static_libs
⊕srcs
⊕product_variables.native_coverage
⊕product_variables.release_aidl_use_unfrozen
⊕required
⊕vintf_fragment_modules
⊕product_variables.selinuxignoreneverallows
⊕product_variables.unbundled_build
⊕enabled
Configurable[bool]
Configurable[bool]
proptools.Configurable[bool]
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
ramdisk_available
bool, Make this module available when building for ramdisk.
On device without a dedicated recovery partition, the module is only
available after switching root into
/first_stage_ramdisk. To expose the module before switching root, install
the recovery variant instead.
recovery
bool, Whether this module is installed to recovery partition
recovery_available
bool, Make this module available when building for recovery
relative_install_path
string, install to a subdirectory of the default install path for the module
required
configurable list of string, names of other modules to install if this module is installed
⊕rlib
VariantLibraryProperties
enabled
bool
srcs
list of string
rlibs
configurable list of string, list of rust rlib crate dependencies
rustlibs
configurable list of string, list of rust automatic crate dependencies.
Rustlibs linkage is rlib for host targets and dylib for device targets.
⊕sanitize
enable AddressSanitizer, HWAddressSanitizer, and others.
address
bool
hwaddress
bool
memtag_heap
bool, Memory-tagging, only available on arm64
if diag.memtag unset or false, enables async memory tagging
fuzzer
bool
never
bool
⊕diag
Sanitizers to run in the diagnostic mode (as opposed to the release mode).
Replaces abort() on error with a human-readable error message.
Address and Thread sanitizers always run in diagnostic mode.
memtag_heap
bool, Memory-tagging, only available on arm64
requires sanitizer.memtag: true
if set, enables sync memory tagging
sdk_version
string, The API level that this module is built against. The APIs of this API level will be
visible at build time, but use of any APIs newer than min_sdk_version will render the
module unloadable on older devices. In the future it will be possible to weakly-link new
APIs, making the behavior match Java: such modules will load on older devices, but
calling new APIs on devices that do not support them will result in a crash.
This property has the same behavior as sdk_version does for Java modules. For those
familiar with Android Gradle, the property behaves similarly to how compileSdkVersion
does for Java code.
In addition, setting this property causes two variants to be built, one for the platform
and one for apps.
⊕shared
VariantLibraryProperties
enabled
bool
srcs
list of string
shared_libs
configurable list of string, list of C shared library dependencies
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
⊕static
VariantLibraryProperties
enabled
bool
srcs
list of string
static_libs
configurable list of string, list of C static library dependencies. These dependencies do not normally propagate to dependents
and may need to be redeclared. See whole_static_libs for bundling static dependencies into a library.
stdlibs
configurable list of string, list of Rust system library dependencies.
This is usually only needed when `no_stdlibs` is true, in which case it can be used to depend on system crates
like `core` and `alloc`.
stem
string, sets name of the output
⊕strip
none
bool, Device modules default to stripping enabled leaving mini debuginfo.
Host modules default to stripping disabled, but can be enabled by setting any other
strip boolean property.
all
bool, all forces stripping everything, including the mini debug info.
keep_symbols
bool, keep_symbols enables stripping but keeps all symbols.
keep_symbols_list
list of string, keep_symbols_list specifies a list of symbols to keep if keep_symbols is enabled.
If it is unset then all symbols are kept.
keep_symbols_and_debug_frame
bool, keep_symbols_and_debug_frame enables stripping but keeps all symbols and debug frames.
⊕stubs
*ast.SelectorExpr
Generate stubs to make this library accessible to APEXes.
Can only be set for modules producing shared libraries.
symbol_file
string, Relative path to the symbol map. The symbol map provides the list of
symbols that are exported for stubs variant of this library.
versions
list of string, List versions to generate stubs libs for. The version name "current" is always
implicitly added.
implementation_installable
bool, Whether to not require the implementation of the library to be installed if a
client of the stubs is installed. Defaults to true; set to false if the
implementation is made available by some other means, e.g. in a Microdroid
virtual machine.
suffix
string, append to name of output
sysroot
bool, Whether this library is part of the Rust toolchain sysroot.
system_dlkm_specific
bool, Install to partition system_dlkm when set to true.
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
compile_multilib
string
enabled
bool
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
use_expansive_default_srcs
bool, Set this to true to use an expansive default set of source file requirements
(all .rs, .h, .xml, and .md files in the module tree).
This is primarily for tracking sources for RBE purposes. Currently defaults
to true, though this may change in the future.
use_generic_config
bool, Set to true if this module must be generic and does not require product-specific information.
To be included in the system image, this property must be set to true.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_available
bool, whether this module should be allowed to be directly depended by other
modules with `vendor: true`, `proprietary: true`, or `vendor_available:true`.
If set to true, two variants will be built separately, one like
normal, and the other limited to the set of libraries and headers
that are exposed to /vendor modules.
The vendor variant may be used with a different (newer) /system,
so it shouldn't have any unversioned runtime dependencies, or
make assumptions about the system that may not be true in the
future.
If set to false, this module becomes inaccessible from /vendor modules.
The modules with vndk: {enabled: true} must define 'vendor_available'
to 'true'.
Nothing happens if BOARD_VNDK_VERSION isn't set in the BoardConfig.mk
vendor_dlkm_specific
bool, Install to partition vendor_dlkm when set to true.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vendor_ramdisk_available
bool, Make this module available when building for vendor ramdisk.
On device without a dedicated recovery partition, the module is only
available after switching root into
/first_stage_ramdisk. To expose the module before switching root, install
the recovery variant instead
version_script
string, Version script to pass to the linker. By default this will replace the
implicit rustc emitted version script to mirror expected behavior in CC.
This is only relevant for rust_ffi_shared modules which are exposing a
versioned C API.
vintf_fragment_modules
configurable list of string, vintf_fragment Modules required from this module.
vintf_fragments
configurable list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
whole_static_libs
configurable list of string, Similar to static_libs, but will bundle the static library dependency into a library. This is helpful
to avoid having to redeclare the dependency for dependents of this library, but in some cases may also
result in bloat if multiple dependencies all include the same static library whole.
The common use case for this is when the static library is unlikely to be a dependency of other modules to avoid
having to redeclare the static library dependency for every dependent module.
If you are not sure what to, for rust_library modules most static dependencies should go in static_libraries,
and for rust_ffi modules most static dependencies should go into whole_static_libraries.
For rust_ffi static variants, these libraries will be included in the resulting static library archive.
For rust_library rlib variants, these libraries will be bundled into the resulting rlib library. This will
include all of the static libraries symbols in any dylibs or binaries which use this rlib as well.
rust_library_host_dylib
rust_library_dylib_host produces a dylib for the host (Rust crate
type "dylib").
name
,
srcs
,
defaults
,
afdo
,
aliases
,
apex_available
,
apex_exclude
,
arch
,
bootstrap
,
cargo_env_compat
,
cargo_pkg_version
,
cfgs
,
clippy_lints
,
compile_multilib
,
crate_name
,
crate_root
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
double_loadable
,
dylib
,
edition
,
enabled
,
exclude_from_recovery_snapshot
,
exclude_from_vendor_snapshot
,
export_include_dirs
,
extra_exported_symbols
,
features
,
flags
,
host_cross_supported
,
host_required
,
include_dirs
,
init_rc
,
installable
,
ld_flags
,
licenses
,
lints
,
lto
,
min_sdk_version
,
multilib
,
native_bridge_supported
,
native_coverage
,
no_full_install
,
no_stdlibs
,
odm_available
,
odm_dlkm_specific
,
overrides
,
owner
,
prefer_rlib
,
proc_macros
,
product_available
,
product_specific
,
product_variables.arc
,
product_variables.build_from_text_stub
,
product_variables.debuggable
,
product_variables.eng
,
product_variables.malloc_low_memory
,
product_variables.native_coverage
,
product_variables.release_aidl_use_unfrozen
,
product_variables.selinuxignoreneverallows
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
ramdisk_available
,
recovery
,
recovery_available
,
relative_install_path
,
required
,
rlib
,
rlibs
,
rustlibs
,
sanitize
,
sdk_version
,
shared
,
shared_libs
,
soc_specific
,
static
,
static_libs
,
stdlibs
,
stem
,
strip
,
stubs
,
suffix
,
sysroot
,
system_dlkm_specific
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
use_expansive_default_srcs
,
use_generic_config
,
vendor
,
vendor_available
,
vendor_dlkm_specific
,
vendor_ramdisk
,
vendor_ramdisk_available
,
version_script
,
vintf_fragment_modules
,
vintf_fragments
,
visibility
,
whole_static_libs
name
string, The name of the module. Must be unique across all modules.
srcs
list of string, path to the source file that is the main entry point of the program (e.g. main.rs or lib.rs).
Only a single source file can be defined. Modules which generate source can be included by prefixing
the module name with ":", for example ":libfoo_bindgen"
If no source file is defined, a single generated source module can be defined to be used as the main source.
defaults
list of string
afdo
bool, Afdo allows developers self-service enroll for
automatic feedback-directed optimization using profile data.
aliases
list of string, Rust crate dependencies to rename. Each entry should be a string of the form "dependencyname:alias".
"dependencyname" here should be the name of the crate, not the Android module. This is
equivalent to writing `alias = { package = "dependencyname" }` in a `Cargo.toml`.
apex_available
list of string, Availability of this module in APEXes. Only the listed APEXes can contain this module. If
the module has stubs then other APEXes and the platform may access it through them
(subject to visibility).
"//apex_available:anyapex" is a pseudo APEX name that matches to any APEX.
"//apex_available:platform" refers to non-APEX partitions like "system.img".
Prefix pattern (com.foo.*) can be used to match with any APEX name with the prefix(com.foo.).
Default is ["//apex_available:platform"].
apex_exclude
bool, Deprecated - exclude this rust_ffi target from being included in APEXes.
TODO(b/362509506): remove this once all apex_exclude uses are switched to stubs.
arch
interface
bootstrap
bool, Allows this module to use non-APEX version of libraries. Useful
for building binaries that are started before APEXes are activated.
cargo_env_compat
bool, Enables emitting certain Cargo environment variables. Only intended to be used for compatibility purposes.
Will set CARGO_CRATE_NAME to the crate_name property's value.
Will set CARGO_BIN_NAME to the output filename value without the extension.
cargo_pkg_version
string, If cargo_env_compat is true, sets the CARGO_PKG_VERSION env var to this value.
cfgs
configurable list of string, list of configuration options to enable for this crate. To enable features, use the "features" property.
clippy_lints
string, name of the lint set that should be used to validate this module.
Possible values are "default" (for using a sensible set of lints
depending on the module's location), "android" (for the strictest
lint set that applies to all Android platform code), "vendor" (for a
relaxed set) and "none" (to disable the execution of clippy). The
default value is "default". See also the `lints` property.
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
crate_name
string, crate name, required for modules which produce Rust libraries: rust_library, rust_ffi and SourceProvider
modules which create library variants (rust_bindgen). This must be the expected extern crate name used in
source, and is required to conform to an enforced format matching library output files (if the output file is
lib<someName><suffix>, the crate_name property must be <someName>).
crate_root
string, Entry point that is passed to rustc to begin the compilation. E.g. main.rs or lib.rs.
When this property is set,
* sandboxing is enabled for this module, and
* the srcs attribute is interpreted as a list of all source files potentially
used in compilation, including the entrypoint, and
* compile_data can be used to add additional files used in compilation that
not directly used as source files.
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
prepend_artifact_with_product
bool, If true, then the artifact file will be prepended with <product name>-. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be coral-foo.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
double_loadable
bool, whether this module is capable of being loaded with other instance
(possibly an older version) of the same module in the same process.
Currently, a shared library that is a member of VNDK (vndk: {enabled: true})
can be double loaded in a vendor process if the library is also a
(direct and indirect) dependency of an LLNDK library. Such libraries must be
explicitly marked as `double_loadable: true` by the owner, or the dependency
from the LLNDK lib should be cut if the lib is not designed to be double loaded.
⊕dylib
VariantLibraryProperties
enabled
bool
srcs
list of string
edition
string, specific rust edition that should be used if the default version is not desired
enabled
configurable bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
exclude_from_recovery_snapshot
bool, Normally Soong uses the directory structure to decide which modules
should be included (framework) or excluded (non-framework) from the
different snapshots (vendor, recovery, etc.), but this property
allows a partner to exclude a module normally thought of as a
framework module from the recovery snapshot.
exclude_from_vendor_snapshot
bool, Normally Soong uses the directory structure to decide which modules
should be included (framework) or excluded (non-framework) from the
different snapshots (vendor, recovery, etc.), but this property
allows a partner to exclude a module normally thought of as a
framework module from the vendor snapshot.
export_include_dirs
list of string, path to include directories to export to cc_* modules, only relevant for static/shared variants.
features
configurable list of string, list of features to enable for this crate
flags
list of string, flags to pass to rustc. To enable configuration options or features, use the "cfgs" or "features" properties.
host_cross_supported
bool, If set to true, build a variant of the module for the host cross. Defaults to true.
host_required
list of string, names of other modules to install on host if this module is installed
include_dirs
list of string, TODO: Remove this when all instances of Include_dirs have been removed from rust_ffi modules.
path to include directories to pass to cc_* modules, only relevant for static/shared variants (deprecated, use export_include_dirs instead).
init_rc
configurable list of string, init.rc files to be installed if this module is installed
installable
bool
ld_flags
list of string, flags to pass to the linker
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
lints
string, name of the lint set that should be used to validate this module.
Possible values are "default" (for using a sensible set of lints
depending on the module's location), "android" (for the strictest
lint set that applies to all Android platform code), "vendor" (for
a relaxed set) and "none" (for ignoring all lint warnings and
errors). The default value is "default".
⊕lto
Control whether LTO is used for the final (Rust) linkage. This does not impact
cross-language LTO.
thin
bool, Whether thin LTO should be enabled. By default this is true.
LTO provides such a large code size benefit for Rust, this should always
be enabled for production builds unless there's a clear need to disable it.
min_sdk_version
string, Minimum OS API level supported by this C or C++ module. This property becomes the value
of the __ANDROID_API__ macro. When the C or C++ module is included in an APEX or an APK,
this property is also used to ensure that the min_sdk_version of the containing module is
not older (i.e. less) than this module's min_sdk_version. When not set, this property
defaults to the value of sdk_version. When this is set to "apex_inherit", this tracks
min_sdk_version of the containing APEX. When the module
is not built for an APEX, "apex_inherit" defaults to sdk_version.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
native_coverage
bool
no_full_install
bool, When set to true, this module is not installed to the full install path (ex: under
out/target/product/<name>/<partition>). It can be installed only to the packaging
modules like android_filesystem.
no_stdlibs
bool, whether to suppress inclusion of standard crates - defaults to false
odm_available
bool, This is the same as the "vendor_available" except that the install path
of the vendor variant is /odm or /vendor/odm.
By replacing "vendor_available: true" with "odm_available: true", the
module will install its vendor variant to the /odm partition or /vendor/odm.
As the modules with "odm_available: true" still create the vendor variants,
they can link to the other vendor modules as the vendor_available modules do.
Also, the vendor modules can link to odm_available modules.
It may not be used for VNDK modules.
odm_dlkm_specific
bool, Install to partition odm_dlkm when set to true.
overrides
list of string, List of module names that are prevented from being installed when this module gets
installed.
owner
string, vendor who owns this module
prefer_rlib
bool, Change the rustlibs linkage to select rlib linkage by default for device targets.
Also link libstd as an rlib as well on device targets.
Note: This is the default behavior for host targets.
This is primarily meant for rust_binary and rust_ffi modules where the default
linkage of libstd might need to be overridden in some use cases. This should
generally be avoided with other module types since it may cause collisions at
linkage if all dependencies of the root binary module do not link against libstd
the same way.
proc_macros
configurable list of string, list of rust proc_macro crate dependencies
product_available
bool, whether this module should be allowed to be directly depended by other
modules with `product_specific: true` or `product_available: true`.
If set to true, an additional product variant will be built separately
that is limited to the set of libraries and headers that are exposed to
/product modules.
The product variant may be used with a different (newer) /system,
so it shouldn't have any unversioned runtime dependencies, or
make assumptions about the system that may not be true in the
future.
If set to false, this module becomes inaccessible from /product modules.
Different from the 'vendor_available' property, the modules with
vndk: {enabled: true} don't have to define 'product_available'. The VNDK
library without 'product_available' may not be depended on by any other
modules that has product variants including the product available VNDKs.
Nothing happens if BOARD_VNDK_VERSION isn't set in the BoardConfig.mk
and PRODUCT_PRODUCT_VNDK_VERSION isn't set.
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.arc
⊕include_dirs
⊕shared_libs
⊕static_libs
⊕srcs
⊕whole_static_libs
⊕product_variables.build_from_text_stub
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕strip.all
⊕strip.keep_symbols
⊕strip.keep_symbols_and_debug_frame
⊕static_libs
⊕whole_static_libs
⊕shared_libs
⊕srcs
⊕product_variables.eng
⊕product_variables.malloc_low_memory
⊕shared_libs
⊕whole_static_libs
⊕static_libs
⊕srcs
⊕product_variables.native_coverage
⊕product_variables.release_aidl_use_unfrozen
⊕required
⊕vintf_fragment_modules
⊕product_variables.selinuxignoreneverallows
⊕product_variables.unbundled_build
⊕enabled
Configurable[bool]
Configurable[bool]
proptools.Configurable[bool]
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
ramdisk_available
bool, Make this module available when building for ramdisk.
On device without a dedicated recovery partition, the module is only
available after switching root into
/first_stage_ramdisk. To expose the module before switching root, install
the recovery variant instead.
recovery
bool, Whether this module is installed to recovery partition
recovery_available
bool, Make this module available when building for recovery
relative_install_path
string, install to a subdirectory of the default install path for the module
required
configurable list of string, names of other modules to install if this module is installed
⊕rlib
VariantLibraryProperties
enabled
bool
srcs
list of string
rlibs
configurable list of string, list of rust rlib crate dependencies
rustlibs
configurable list of string, list of rust automatic crate dependencies.
Rustlibs linkage is rlib for host targets and dylib for device targets.
⊕sanitize
enable AddressSanitizer, HWAddressSanitizer, and others.
address
bool
hwaddress
bool
memtag_heap
bool, Memory-tagging, only available on arm64
if diag.memtag unset or false, enables async memory tagging
fuzzer
bool
never
bool
⊕diag
Sanitizers to run in the diagnostic mode (as opposed to the release mode).
Replaces abort() on error with a human-readable error message.
Address and Thread sanitizers always run in diagnostic mode.
memtag_heap
bool, Memory-tagging, only available on arm64
requires sanitizer.memtag: true
if set, enables sync memory tagging
sdk_version
string, The API level that this module is built against. The APIs of this API level will be
visible at build time, but use of any APIs newer than min_sdk_version will render the
module unloadable on older devices. In the future it will be possible to weakly-link new
APIs, making the behavior match Java: such modules will load on older devices, but
calling new APIs on devices that do not support them will result in a crash.
This property has the same behavior as sdk_version does for Java modules. For those
familiar with Android Gradle, the property behaves similarly to how compileSdkVersion
does for Java code.
In addition, setting this property causes two variants to be built, one for the platform
and one for apps.
⊕shared
VariantLibraryProperties
enabled
bool
srcs
list of string
shared_libs
configurable list of string, list of C shared library dependencies
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
⊕static
VariantLibraryProperties
enabled
bool
srcs
list of string
static_libs
configurable list of string, list of C static library dependencies. These dependencies do not normally propagate to dependents
and may need to be redeclared. See whole_static_libs for bundling static dependencies into a library.
stdlibs
configurable list of string, list of Rust system library dependencies.
This is usually only needed when `no_stdlibs` is true, in which case it can be used to depend on system crates
like `core` and `alloc`.
stem
string, sets name of the output
⊕strip
none
bool, Device modules default to stripping enabled leaving mini debuginfo.
Host modules default to stripping disabled, but can be enabled by setting any other
strip boolean property.
all
bool, all forces stripping everything, including the mini debug info.
keep_symbols
bool, keep_symbols enables stripping but keeps all symbols.
keep_symbols_list
list of string, keep_symbols_list specifies a list of symbols to keep if keep_symbols is enabled.
If it is unset then all symbols are kept.
keep_symbols_and_debug_frame
bool, keep_symbols_and_debug_frame enables stripping but keeps all symbols and debug frames.
⊕stubs
*ast.SelectorExpr
Generate stubs to make this library accessible to APEXes.
Can only be set for modules producing shared libraries.
symbol_file
string, Relative path to the symbol map. The symbol map provides the list of
symbols that are exported for stubs variant of this library.
versions
list of string, List versions to generate stubs libs for. The version name "current" is always
implicitly added.
implementation_installable
bool, Whether to not require the implementation of the library to be installed if a
client of the stubs is installed. Defaults to true; set to false if the
implementation is made available by some other means, e.g. in a Microdroid
virtual machine.
suffix
string, append to name of output
sysroot
bool, Whether this library is part of the Rust toolchain sysroot.
system_dlkm_specific
bool, Install to partition system_dlkm when set to true.
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
compile_multilib
string
enabled
bool
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
use_expansive_default_srcs
bool, Set this to true to use an expansive default set of source file requirements
(all .rs, .h, .xml, and .md files in the module tree).
This is primarily for tracking sources for RBE purposes. Currently defaults
to true, though this may change in the future.
use_generic_config
bool, Set to true if this module must be generic and does not require product-specific information.
To be included in the system image, this property must be set to true.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_available
bool, whether this module should be allowed to be directly depended by other
modules with `vendor: true`, `proprietary: true`, or `vendor_available:true`.
If set to true, two variants will be built separately, one like
normal, and the other limited to the set of libraries and headers
that are exposed to /vendor modules.
The vendor variant may be used with a different (newer) /system,
so it shouldn't have any unversioned runtime dependencies, or
make assumptions about the system that may not be true in the
future.
If set to false, this module becomes inaccessible from /vendor modules.
The modules with vndk: {enabled: true} must define 'vendor_available'
to 'true'.
Nothing happens if BOARD_VNDK_VERSION isn't set in the BoardConfig.mk
vendor_dlkm_specific
bool, Install to partition vendor_dlkm when set to true.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vendor_ramdisk_available
bool, Make this module available when building for vendor ramdisk.
On device without a dedicated recovery partition, the module is only
available after switching root into
/first_stage_ramdisk. To expose the module before switching root, install
the recovery variant instead
version_script
string, Version script to pass to the linker. By default this will replace the
implicit rustc emitted version script to mirror expected behavior in CC.
This is only relevant for rust_ffi_shared modules which are exposing a
versioned C API.
vintf_fragment_modules
configurable list of string, vintf_fragment Modules required from this module.
vintf_fragments
configurable list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
whole_static_libs
configurable list of string, Similar to static_libs, but will bundle the static library dependency into a library. This is helpful
to avoid having to redeclare the dependency for dependents of this library, but in some cases may also
result in bloat if multiple dependencies all include the same static library whole.
The common use case for this is when the static library is unlikely to be a dependency of other modules to avoid
having to redeclare the static library dependency for every dependent module.
If you are not sure what to, for rust_library modules most static dependencies should go in static_libraries,
and for rust_ffi modules most static dependencies should go into whole_static_libraries.
For rust_ffi static variants, these libraries will be included in the resulting static library archive.
For rust_library rlib variants, these libraries will be bundled into the resulting rlib library. This will
include all of the static libraries symbols in any dylibs or binaries which use this rlib as well.
rust_library_host_rlib
rust_library_rlib_host and rust_ffi_static_host produces an rlib for the host
(Rust crate type "rlib").
name
,
srcs
,
defaults
,
afdo
,
aliases
,
apex_available
,
apex_exclude
,
arch
,
bootstrap
,
cargo_env_compat
,
cargo_pkg_version
,
cfgs
,
clippy_lints
,
compile_multilib
,
crate_name
,
crate_root
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
double_loadable
,
dylib
,
edition
,
enabled
,
exclude_from_recovery_snapshot
,
exclude_from_vendor_snapshot
,
export_include_dirs
,
extra_exported_symbols
,
features
,
flags
,
host_cross_supported
,
host_required
,
include_dirs
,
init_rc
,
installable
,
ld_flags
,
licenses
,
lints
,
lto
,
min_sdk_version
,
multilib
,
native_bridge_supported
,
native_coverage
,
no_full_install
,
no_stdlibs
,
odm_available
,
odm_dlkm_specific
,
overrides
,
owner
,
prefer_rlib
,
proc_macros
,
product_available
,
product_specific
,
product_variables.arc
,
product_variables.build_from_text_stub
,
product_variables.debuggable
,
product_variables.eng
,
product_variables.malloc_low_memory
,
product_variables.native_coverage
,
product_variables.release_aidl_use_unfrozen
,
product_variables.selinuxignoreneverallows
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
ramdisk_available
,
recovery
,
recovery_available
,
relative_install_path
,
required
,
rlib
,
rlibs
,
rustlibs
,
sanitize
,
sdk_version
,
shared
,
shared_libs
,
soc_specific
,
static
,
static_libs
,
stdlibs
,
stem
,
strip
,
stubs
,
suffix
,
sysroot
,
system_dlkm_specific
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
use_expansive_default_srcs
,
use_generic_config
,
vendor
,
vendor_available
,
vendor_dlkm_specific
,
vendor_ramdisk
,
vendor_ramdisk_available
,
version_script
,
vintf_fragment_modules
,
vintf_fragments
,
visibility
,
whole_static_libs
name
string, The name of the module. Must be unique across all modules.
srcs
list of string, path to the source file that is the main entry point of the program (e.g. main.rs or lib.rs).
Only a single source file can be defined. Modules which generate source can be included by prefixing
the module name with ":", for example ":libfoo_bindgen"
If no source file is defined, a single generated source module can be defined to be used as the main source.
defaults
list of string
afdo
bool, Afdo allows developers self-service enroll for
automatic feedback-directed optimization using profile data.
aliases
list of string, Rust crate dependencies to rename. Each entry should be a string of the form "dependencyname:alias".
"dependencyname" here should be the name of the crate, not the Android module. This is
equivalent to writing `alias = { package = "dependencyname" }` in a `Cargo.toml`.
apex_available
list of string, Availability of this module in APEXes. Only the listed APEXes can contain this module. If
the module has stubs then other APEXes and the platform may access it through them
(subject to visibility).
"//apex_available:anyapex" is a pseudo APEX name that matches to any APEX.
"//apex_available:platform" refers to non-APEX partitions like "system.img".
Prefix pattern (com.foo.*) can be used to match with any APEX name with the prefix(com.foo.).
Default is ["//apex_available:platform"].
apex_exclude
bool, Deprecated - exclude this rust_ffi target from being included in APEXes.
TODO(b/362509506): remove this once all apex_exclude uses are switched to stubs.
arch
interface
bootstrap
bool, Allows this module to use non-APEX version of libraries. Useful
for building binaries that are started before APEXes are activated.
cargo_env_compat
bool, Enables emitting certain Cargo environment variables. Only intended to be used for compatibility purposes.
Will set CARGO_CRATE_NAME to the crate_name property's value.
Will set CARGO_BIN_NAME to the output filename value without the extension.
cargo_pkg_version
string, If cargo_env_compat is true, sets the CARGO_PKG_VERSION env var to this value.
cfgs
configurable list of string, list of configuration options to enable for this crate. To enable features, use the "features" property.
clippy_lints
string, name of the lint set that should be used to validate this module.
Possible values are "default" (for using a sensible set of lints
depending on the module's location), "android" (for the strictest
lint set that applies to all Android platform code), "vendor" (for a
relaxed set) and "none" (to disable the execution of clippy). The
default value is "default". See also the `lints` property.
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
crate_name
string, crate name, required for modules which produce Rust libraries: rust_library, rust_ffi and SourceProvider
modules which create library variants (rust_bindgen). This must be the expected extern crate name used in
source, and is required to conform to an enforced format matching library output files (if the output file is
lib<someName><suffix>, the crate_name property must be <someName>).
crate_root
string, Entry point that is passed to rustc to begin the compilation. E.g. main.rs or lib.rs.
When this property is set,
* sandboxing is enabled for this module, and
* the srcs attribute is interpreted as a list of all source files potentially
used in compilation, including the entrypoint, and
* compile_data can be used to add additional files used in compilation that
not directly used as source files.
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
prepend_artifact_with_product
bool, If true, then the artifact file will be prepended with <product name>-. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be coral-foo.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
double_loadable
bool, whether this module is capable of being loaded with other instance
(possibly an older version) of the same module in the same process.
Currently, a shared library that is a member of VNDK (vndk: {enabled: true})
can be double loaded in a vendor process if the library is also a
(direct and indirect) dependency of an LLNDK library. Such libraries must be
explicitly marked as `double_loadable: true` by the owner, or the dependency
from the LLNDK lib should be cut if the lib is not designed to be double loaded.
⊕dylib
VariantLibraryProperties
enabled
bool
srcs
list of string
edition
string, specific rust edition that should be used if the default version is not desired
enabled
configurable bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
exclude_from_recovery_snapshot
bool, Normally Soong uses the directory structure to decide which modules
should be included (framework) or excluded (non-framework) from the
different snapshots (vendor, recovery, etc.), but this property
allows a partner to exclude a module normally thought of as a
framework module from the recovery snapshot.
exclude_from_vendor_snapshot
bool, Normally Soong uses the directory structure to decide which modules
should be included (framework) or excluded (non-framework) from the
different snapshots (vendor, recovery, etc.), but this property
allows a partner to exclude a module normally thought of as a
framework module from the vendor snapshot.
export_include_dirs
list of string, path to include directories to export to cc_* modules, only relevant for static/shared variants.
features
configurable list of string, list of features to enable for this crate
flags
list of string, flags to pass to rustc. To enable configuration options or features, use the "cfgs" or "features" properties.
host_cross_supported
bool, If set to true, build a variant of the module for the host cross. Defaults to true.
host_required
list of string, names of other modules to install on host if this module is installed
include_dirs
list of string, TODO: Remove this when all instances of Include_dirs have been removed from rust_ffi modules.
path to include directories to pass to cc_* modules, only relevant for static/shared variants (deprecated, use export_include_dirs instead).
init_rc
configurable list of string, init.rc files to be installed if this module is installed
installable
bool
ld_flags
list of string, flags to pass to the linker
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
lints
string, name of the lint set that should be used to validate this module.
Possible values are "default" (for using a sensible set of lints
depending on the module's location), "android" (for the strictest
lint set that applies to all Android platform code), "vendor" (for
a relaxed set) and "none" (for ignoring all lint warnings and
errors). The default value is "default".
⊕lto
Control whether LTO is used for the final (Rust) linkage. This does not impact
cross-language LTO.
thin
bool, Whether thin LTO should be enabled. By default this is true.
LTO provides such a large code size benefit for Rust, this should always
be enabled for production builds unless there's a clear need to disable it.
min_sdk_version
string, Minimum OS API level supported by this C or C++ module. This property becomes the value
of the __ANDROID_API__ macro. When the C or C++ module is included in an APEX or an APK,
this property is also used to ensure that the min_sdk_version of the containing module is
not older (i.e. less) than this module's min_sdk_version. When not set, this property
defaults to the value of sdk_version. When this is set to "apex_inherit", this tracks
min_sdk_version of the containing APEX. When the module
is not built for an APEX, "apex_inherit" defaults to sdk_version.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
native_coverage
bool
no_full_install
bool, When set to true, this module is not installed to the full install path (ex: under
out/target/product/<name>/<partition>). It can be installed only to the packaging
modules like android_filesystem.
no_stdlibs
bool, whether to suppress inclusion of standard crates - defaults to false
odm_available
bool, This is the same as the "vendor_available" except that the install path
of the vendor variant is /odm or /vendor/odm.
By replacing "vendor_available: true" with "odm_available: true", the
module will install its vendor variant to the /odm partition or /vendor/odm.
As the modules with "odm_available: true" still create the vendor variants,
they can link to the other vendor modules as the vendor_available modules do.
Also, the vendor modules can link to odm_available modules.
It may not be used for VNDK modules.
odm_dlkm_specific
bool, Install to partition odm_dlkm when set to true.
overrides
list of string, List of module names that are prevented from being installed when this module gets
installed.
owner
string, vendor who owns this module
prefer_rlib
bool, Change the rustlibs linkage to select rlib linkage by default for device targets.
Also link libstd as an rlib as well on device targets.
Note: This is the default behavior for host targets.
This is primarily meant for rust_binary and rust_ffi modules where the default
linkage of libstd might need to be overridden in some use cases. This should
generally be avoided with other module types since it may cause collisions at
linkage if all dependencies of the root binary module do not link against libstd
the same way.
proc_macros
configurable list of string, list of rust proc_macro crate dependencies
product_available
bool, whether this module should be allowed to be directly depended by other
modules with `product_specific: true` or `product_available: true`.
If set to true, an additional product variant will be built separately
that is limited to the set of libraries and headers that are exposed to
/product modules.
The product variant may be used with a different (newer) /system,
so it shouldn't have any unversioned runtime dependencies, or
make assumptions about the system that may not be true in the
future.
If set to false, this module becomes inaccessible from /product modules.
Different from the 'vendor_available' property, the modules with
vndk: {enabled: true} don't have to define 'product_available'. The VNDK
library without 'product_available' may not be depended on by any other
modules that has product variants including the product available VNDKs.
Nothing happens if BOARD_VNDK_VERSION isn't set in the BoardConfig.mk
and PRODUCT_PRODUCT_VNDK_VERSION isn't set.
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.arc
⊕include_dirs
⊕shared_libs
⊕static_libs
⊕srcs
⊕whole_static_libs
⊕product_variables.build_from_text_stub
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕strip.all
⊕strip.keep_symbols
⊕strip.keep_symbols_and_debug_frame
⊕static_libs
⊕whole_static_libs
⊕shared_libs
⊕srcs
⊕product_variables.eng
⊕product_variables.malloc_low_memory
⊕shared_libs
⊕whole_static_libs
⊕static_libs
⊕srcs
⊕product_variables.native_coverage
⊕product_variables.release_aidl_use_unfrozen
⊕required
⊕vintf_fragment_modules
⊕product_variables.selinuxignoreneverallows
⊕product_variables.unbundled_build
⊕enabled
Configurable[bool]
Configurable[bool]
proptools.Configurable[bool]
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
ramdisk_available
bool, Make this module available when building for ramdisk.
On device without a dedicated recovery partition, the module is only
available after switching root into
/first_stage_ramdisk. To expose the module before switching root, install
the recovery variant instead.
recovery
bool, Whether this module is installed to recovery partition
recovery_available
bool, Make this module available when building for recovery
relative_install_path
string, install to a subdirectory of the default install path for the module
required
configurable list of string, names of other modules to install if this module is installed
⊕rlib
VariantLibraryProperties
enabled
bool
srcs
list of string
rlibs
configurable list of string, list of rust rlib crate dependencies
rustlibs
configurable list of string, list of rust automatic crate dependencies.
Rustlibs linkage is rlib for host targets and dylib for device targets.
⊕sanitize
enable AddressSanitizer, HWAddressSanitizer, and others.
address
bool
hwaddress
bool
memtag_heap
bool, Memory-tagging, only available on arm64
if diag.memtag unset or false, enables async memory tagging
fuzzer
bool
never
bool
⊕diag
Sanitizers to run in the diagnostic mode (as opposed to the release mode).
Replaces abort() on error with a human-readable error message.
Address and Thread sanitizers always run in diagnostic mode.
memtag_heap
bool, Memory-tagging, only available on arm64
requires sanitizer.memtag: true
if set, enables sync memory tagging
sdk_version
string, The API level that this module is built against. The APIs of this API level will be
visible at build time, but use of any APIs newer than min_sdk_version will render the
module unloadable on older devices. In the future it will be possible to weakly-link new
APIs, making the behavior match Java: such modules will load on older devices, but
calling new APIs on devices that do not support them will result in a crash.
This property has the same behavior as sdk_version does for Java modules. For those
familiar with Android Gradle, the property behaves similarly to how compileSdkVersion
does for Java code.
In addition, setting this property causes two variants to be built, one for the platform
and one for apps.
⊕shared
VariantLibraryProperties
enabled
bool
srcs
list of string
shared_libs
configurable list of string, list of C shared library dependencies
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
⊕static
VariantLibraryProperties
enabled
bool
srcs
list of string
static_libs
configurable list of string, list of C static library dependencies. These dependencies do not normally propagate to dependents
and may need to be redeclared. See whole_static_libs for bundling static dependencies into a library.
stdlibs
configurable list of string, list of Rust system library dependencies.
This is usually only needed when `no_stdlibs` is true, in which case it can be used to depend on system crates
like `core` and `alloc`.
stem
string, sets name of the output
⊕strip
none
bool, Device modules default to stripping enabled leaving mini debuginfo.
Host modules default to stripping disabled, but can be enabled by setting any other
strip boolean property.
all
bool, all forces stripping everything, including the mini debug info.
keep_symbols
bool, keep_symbols enables stripping but keeps all symbols.
keep_symbols_list
list of string, keep_symbols_list specifies a list of symbols to keep if keep_symbols is enabled.
If it is unset then all symbols are kept.
keep_symbols_and_debug_frame
bool, keep_symbols_and_debug_frame enables stripping but keeps all symbols and debug frames.
⊕stubs
*ast.SelectorExpr
Generate stubs to make this library accessible to APEXes.
Can only be set for modules producing shared libraries.
symbol_file
string, Relative path to the symbol map. The symbol map provides the list of
symbols that are exported for stubs variant of this library.
versions
list of string, List versions to generate stubs libs for. The version name "current" is always
implicitly added.
implementation_installable
bool, Whether to not require the implementation of the library to be installed if a
client of the stubs is installed. Defaults to true; set to false if the
implementation is made available by some other means, e.g. in a Microdroid
virtual machine.
suffix
string, append to name of output
sysroot
bool, Whether this library is part of the Rust toolchain sysroot.
system_dlkm_specific
bool, Install to partition system_dlkm when set to true.
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
compile_multilib
string
enabled
bool
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
use_expansive_default_srcs
bool, Set this to true to use an expansive default set of source file requirements
(all .rs, .h, .xml, and .md files in the module tree).
This is primarily for tracking sources for RBE purposes. Currently defaults
to true, though this may change in the future.
use_generic_config
bool, Set to true if this module must be generic and does not require product-specific information.
To be included in the system image, this property must be set to true.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_available
bool, whether this module should be allowed to be directly depended by other
modules with `vendor: true`, `proprietary: true`, or `vendor_available:true`.
If set to true, two variants will be built separately, one like
normal, and the other limited to the set of libraries and headers
that are exposed to /vendor modules.
The vendor variant may be used with a different (newer) /system,
so it shouldn't have any unversioned runtime dependencies, or
make assumptions about the system that may not be true in the
future.
If set to false, this module becomes inaccessible from /vendor modules.
The modules with vndk: {enabled: true} must define 'vendor_available'
to 'true'.
Nothing happens if BOARD_VNDK_VERSION isn't set in the BoardConfig.mk
vendor_dlkm_specific
bool, Install to partition vendor_dlkm when set to true.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vendor_ramdisk_available
bool, Make this module available when building for vendor ramdisk.
On device without a dedicated recovery partition, the module is only
available after switching root into
/first_stage_ramdisk. To expose the module before switching root, install
the recovery variant instead
version_script
string, Version script to pass to the linker. By default this will replace the
implicit rustc emitted version script to mirror expected behavior in CC.
This is only relevant for rust_ffi_shared modules which are exposing a
versioned C API.
vintf_fragment_modules
configurable list of string, vintf_fragment Modules required from this module.
vintf_fragments
configurable list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
whole_static_libs
configurable list of string, Similar to static_libs, but will bundle the static library dependency into a library. This is helpful
to avoid having to redeclare the dependency for dependents of this library, but in some cases may also
result in bloat if multiple dependencies all include the same static library whole.
The common use case for this is when the static library is unlikely to be a dependency of other modules to avoid
having to redeclare the static library dependency for every dependent module.
If you are not sure what to, for rust_library modules most static dependencies should go in static_libraries,
and for rust_ffi modules most static dependencies should go into whole_static_libraries.
For rust_ffi static variants, these libraries will be included in the resulting static library archive.
For rust_library rlib variants, these libraries will be bundled into the resulting rlib library. This will
include all of the static libraries symbols in any dylibs or binaries which use this rlib as well.
rust_library_rlib
rust_library_rlib and rust_ffi_static produces an rlib (Rust crate type "rlib").
name
,
srcs
,
defaults
,
host_supported
,
device_supported
,
afdo
,
aliases
,
apex_available
,
apex_exclude
,
arch
,
bootstrap
,
cargo_env_compat
,
cargo_pkg_version
,
cfgs
,
clippy_lints
,
compile_multilib
,
crate_name
,
crate_root
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
double_loadable
,
dylib
,
edition
,
enabled
,
exclude_from_recovery_snapshot
,
exclude_from_vendor_snapshot
,
export_include_dirs
,
extra_exported_symbols
,
features
,
flags
,
host_cross_supported
,
host_required
,
include_dirs
,
init_rc
,
installable
,
ld_flags
,
licenses
,
lints
,
lto
,
min_sdk_version
,
multilib
,
native_bridge_supported
,
native_coverage
,
no_full_install
,
no_stdlibs
,
odm_available
,
odm_dlkm_specific
,
overrides
,
owner
,
prefer_rlib
,
proc_macros
,
product_available
,
product_specific
,
product_variables.arc
,
product_variables.build_from_text_stub
,
product_variables.debuggable
,
product_variables.eng
,
product_variables.malloc_low_memory
,
product_variables.native_coverage
,
product_variables.release_aidl_use_unfrozen
,
product_variables.selinuxignoreneverallows
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
ramdisk_available
,
recovery
,
recovery_available
,
relative_install_path
,
required
,
rlib
,
rlibs
,
rustlibs
,
sanitize
,
sdk_version
,
shared
,
shared_libs
,
soc_specific
,
static
,
static_libs
,
stdlibs
,
stem
,
strip
,
stubs
,
suffix
,
sysroot
,
system_dlkm_specific
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
use_expansive_default_srcs
,
use_generic_config
,
vendor
,
vendor_available
,
vendor_dlkm_specific
,
vendor_ramdisk
,
vendor_ramdisk_available
,
version_script
,
vintf_fragment_modules
,
vintf_fragments
,
visibility
,
whole_static_libs
name
string, The name of the module. Must be unique across all modules.
srcs
list of string, path to the source file that is the main entry point of the program (e.g. main.rs or lib.rs).
Only a single source file can be defined. Modules which generate source can be included by prefixing
the module name with ":", for example ":libfoo_bindgen"
If no source file is defined, a single generated source module can be defined to be used as the main source.
defaults
list of string
host_supported
bool, If set to true, build a variant of the module for the host. Defaults to false.
device_supported
bool, If set to true, build a variant of the module for the device. Defaults to true.
afdo
bool, Afdo allows developers self-service enroll for
automatic feedback-directed optimization using profile data.
aliases
list of string, Rust crate dependencies to rename. Each entry should be a string of the form "dependencyname:alias".
"dependencyname" here should be the name of the crate, not the Android module. This is
equivalent to writing `alias = { package = "dependencyname" }` in a `Cargo.toml`.
apex_available
list of string, Availability of this module in APEXes. Only the listed APEXes can contain this module. If
the module has stubs then other APEXes and the platform may access it through them
(subject to visibility).
"//apex_available:anyapex" is a pseudo APEX name that matches to any APEX.
"//apex_available:platform" refers to non-APEX partitions like "system.img".
Prefix pattern (com.foo.*) can be used to match with any APEX name with the prefix(com.foo.).
Default is ["//apex_available:platform"].
apex_exclude
bool, Deprecated - exclude this rust_ffi target from being included in APEXes.
TODO(b/362509506): remove this once all apex_exclude uses are switched to stubs.
arch
interface
bootstrap
bool, Allows this module to use non-APEX version of libraries. Useful
for building binaries that are started before APEXes are activated.
cargo_env_compat
bool, Enables emitting certain Cargo environment variables. Only intended to be used for compatibility purposes.
Will set CARGO_CRATE_NAME to the crate_name property's value.
Will set CARGO_BIN_NAME to the output filename value without the extension.
cargo_pkg_version
string, If cargo_env_compat is true, sets the CARGO_PKG_VERSION env var to this value.
cfgs
configurable list of string, list of configuration options to enable for this crate. To enable features, use the "features" property.
clippy_lints
string, name of the lint set that should be used to validate this module.
Possible values are "default" (for using a sensible set of lints
depending on the module's location), "android" (for the strictest
lint set that applies to all Android platform code), "vendor" (for a
relaxed set) and "none" (to disable the execution of clippy). The
default value is "default". See also the `lints` property.
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
crate_name
string, crate name, required for modules which produce Rust libraries: rust_library, rust_ffi and SourceProvider
modules which create library variants (rust_bindgen). This must be the expected extern crate name used in
source, and is required to conform to an enforced format matching library output files (if the output file is
lib<someName><suffix>, the crate_name property must be <someName>).
crate_root
string, Entry point that is passed to rustc to begin the compilation. E.g. main.rs or lib.rs.
When this property is set,
* sandboxing is enabled for this module, and
* the srcs attribute is interpreted as a list of all source files potentially
used in compilation, including the entrypoint, and
* compile_data can be used to add additional files used in compilation that
not directly used as source files.
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
prepend_artifact_with_product
bool, If true, then the artifact file will be prepended with <product name>-. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be coral-foo.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
double_loadable
bool, whether this module is capable of being loaded with other instance
(possibly an older version) of the same module in the same process.
Currently, a shared library that is a member of VNDK (vndk: {enabled: true})
can be double loaded in a vendor process if the library is also a
(direct and indirect) dependency of an LLNDK library. Such libraries must be
explicitly marked as `double_loadable: true` by the owner, or the dependency
from the LLNDK lib should be cut if the lib is not designed to be double loaded.
⊕dylib
VariantLibraryProperties
enabled
bool
srcs
list of string
edition
string, specific rust edition that should be used if the default version is not desired
enabled
configurable bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
exclude_from_recovery_snapshot
bool, Normally Soong uses the directory structure to decide which modules
should be included (framework) or excluded (non-framework) from the
different snapshots (vendor, recovery, etc.), but this property
allows a partner to exclude a module normally thought of as a
framework module from the recovery snapshot.
exclude_from_vendor_snapshot
bool, Normally Soong uses the directory structure to decide which modules
should be included (framework) or excluded (non-framework) from the
different snapshots (vendor, recovery, etc.), but this property
allows a partner to exclude a module normally thought of as a
framework module from the vendor snapshot.
export_include_dirs
list of string, path to include directories to export to cc_* modules, only relevant for static/shared variants.
features
configurable list of string, list of features to enable for this crate
flags
list of string, flags to pass to rustc. To enable configuration options or features, use the "cfgs" or "features" properties.
host_cross_supported
bool, If set to true, build a variant of the module for the host cross. Defaults to true.
host_required
list of string, names of other modules to install on host if this module is installed
include_dirs
list of string, TODO: Remove this when all instances of Include_dirs have been removed from rust_ffi modules.
path to include directories to pass to cc_* modules, only relevant for static/shared variants (deprecated, use export_include_dirs instead).
init_rc
configurable list of string, init.rc files to be installed if this module is installed
installable
bool
ld_flags
list of string, flags to pass to the linker
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
lints
string, name of the lint set that should be used to validate this module.
Possible values are "default" (for using a sensible set of lints
depending on the module's location), "android" (for the strictest
lint set that applies to all Android platform code), "vendor" (for
a relaxed set) and "none" (for ignoring all lint warnings and
errors). The default value is "default".
⊕lto
Control whether LTO is used for the final (Rust) linkage. This does not impact
cross-language LTO.
thin
bool, Whether thin LTO should be enabled. By default this is true.
LTO provides such a large code size benefit for Rust, this should always
be enabled for production builds unless there's a clear need to disable it.
min_sdk_version
string, Minimum OS API level supported by this C or C++ module. This property becomes the value
of the __ANDROID_API__ macro. When the C or C++ module is included in an APEX or an APK,
this property is also used to ensure that the min_sdk_version of the containing module is
not older (i.e. less) than this module's min_sdk_version. When not set, this property
defaults to the value of sdk_version. When this is set to "apex_inherit", this tracks
min_sdk_version of the containing APEX. When the module
is not built for an APEX, "apex_inherit" defaults to sdk_version.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
native_coverage
bool
no_full_install
bool, When set to true, this module is not installed to the full install path (ex: under
out/target/product/<name>/<partition>). It can be installed only to the packaging
modules like android_filesystem.
no_stdlibs
bool, whether to suppress inclusion of standard crates - defaults to false
odm_available
bool, This is the same as the "vendor_available" except that the install path
of the vendor variant is /odm or /vendor/odm.
By replacing "vendor_available: true" with "odm_available: true", the
module will install its vendor variant to the /odm partition or /vendor/odm.
As the modules with "odm_available: true" still create the vendor variants,
they can link to the other vendor modules as the vendor_available modules do.
Also, the vendor modules can link to odm_available modules.
It may not be used for VNDK modules.
odm_dlkm_specific
bool, Install to partition odm_dlkm when set to true.
overrides
list of string, List of module names that are prevented from being installed when this module gets
installed.
owner
string, vendor who owns this module
prefer_rlib
bool, Change the rustlibs linkage to select rlib linkage by default for device targets.
Also link libstd as an rlib as well on device targets.
Note: This is the default behavior for host targets.
This is primarily meant for rust_binary and rust_ffi modules where the default
linkage of libstd might need to be overridden in some use cases. This should
generally be avoided with other module types since it may cause collisions at
linkage if all dependencies of the root binary module do not link against libstd
the same way.
proc_macros
configurable list of string, list of rust proc_macro crate dependencies
product_available
bool, whether this module should be allowed to be directly depended by other
modules with `product_specific: true` or `product_available: true`.
If set to true, an additional product variant will be built separately
that is limited to the set of libraries and headers that are exposed to
/product modules.
The product variant may be used with a different (newer) /system,
so it shouldn't have any unversioned runtime dependencies, or
make assumptions about the system that may not be true in the
future.
If set to false, this module becomes inaccessible from /product modules.
Different from the 'vendor_available' property, the modules with
vndk: {enabled: true} don't have to define 'product_available'. The VNDK
library without 'product_available' may not be depended on by any other
modules that has product variants including the product available VNDKs.
Nothing happens if BOARD_VNDK_VERSION isn't set in the BoardConfig.mk
and PRODUCT_PRODUCT_VNDK_VERSION isn't set.
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.arc
⊕include_dirs
⊕shared_libs
⊕static_libs
⊕srcs
⊕whole_static_libs
⊕product_variables.build_from_text_stub
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕strip.all
⊕strip.keep_symbols
⊕strip.keep_symbols_and_debug_frame
⊕static_libs
⊕whole_static_libs
⊕shared_libs
⊕srcs
⊕product_variables.eng
⊕product_variables.malloc_low_memory
⊕shared_libs
⊕whole_static_libs
⊕static_libs
⊕srcs
⊕product_variables.native_coverage
⊕product_variables.release_aidl_use_unfrozen
⊕required
⊕vintf_fragment_modules
⊕product_variables.selinuxignoreneverallows
⊕product_variables.unbundled_build
⊕enabled
Configurable[bool]
Configurable[bool]
proptools.Configurable[bool]
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
ramdisk_available
bool, Make this module available when building for ramdisk.
On device without a dedicated recovery partition, the module is only
available after switching root into
/first_stage_ramdisk. To expose the module before switching root, install
the recovery variant instead.
recovery
bool, Whether this module is installed to recovery partition
recovery_available
bool, Make this module available when building for recovery
relative_install_path
string, install to a subdirectory of the default install path for the module
required
configurable list of string, names of other modules to install if this module is installed
⊕rlib
VariantLibraryProperties
enabled
bool
srcs
list of string
rlibs
configurable list of string, list of rust rlib crate dependencies
rustlibs
configurable list of string, list of rust automatic crate dependencies.
Rustlibs linkage is rlib for host targets and dylib for device targets.
⊕sanitize
enable AddressSanitizer, HWAddressSanitizer, and others.
address
bool
hwaddress
bool
memtag_heap
bool, Memory-tagging, only available on arm64
if diag.memtag unset or false, enables async memory tagging
fuzzer
bool
never
bool
⊕diag
Sanitizers to run in the diagnostic mode (as opposed to the release mode).
Replaces abort() on error with a human-readable error message.
Address and Thread sanitizers always run in diagnostic mode.
memtag_heap
bool, Memory-tagging, only available on arm64
requires sanitizer.memtag: true
if set, enables sync memory tagging
sdk_version
string, The API level that this module is built against. The APIs of this API level will be
visible at build time, but use of any APIs newer than min_sdk_version will render the
module unloadable on older devices. In the future it will be possible to weakly-link new
APIs, making the behavior match Java: such modules will load on older devices, but
calling new APIs on devices that do not support them will result in a crash.
This property has the same behavior as sdk_version does for Java modules. For those
familiar with Android Gradle, the property behaves similarly to how compileSdkVersion
does for Java code.
In addition, setting this property causes two variants to be built, one for the platform
and one for apps.
⊕shared
VariantLibraryProperties
enabled
bool
srcs
list of string
shared_libs
configurable list of string, list of C shared library dependencies
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
⊕static
VariantLibraryProperties
enabled
bool
srcs
list of string
static_libs
configurable list of string, list of C static library dependencies. These dependencies do not normally propagate to dependents
and may need to be redeclared. See whole_static_libs for bundling static dependencies into a library.
stdlibs
configurable list of string, list of Rust system library dependencies.
This is usually only needed when `no_stdlibs` is true, in which case it can be used to depend on system crates
like `core` and `alloc`.
stem
string, sets name of the output
⊕strip
none
bool, Device modules default to stripping enabled leaving mini debuginfo.
Host modules default to stripping disabled, but can be enabled by setting any other
strip boolean property.
all
bool, all forces stripping everything, including the mini debug info.
keep_symbols
bool, keep_symbols enables stripping but keeps all symbols.
keep_symbols_list
list of string, keep_symbols_list specifies a list of symbols to keep if keep_symbols is enabled.
If it is unset then all symbols are kept.
keep_symbols_and_debug_frame
bool, keep_symbols_and_debug_frame enables stripping but keeps all symbols and debug frames.
⊕stubs
*ast.SelectorExpr
Generate stubs to make this library accessible to APEXes.
Can only be set for modules producing shared libraries.
symbol_file
string, Relative path to the symbol map. The symbol map provides the list of
symbols that are exported for stubs variant of this library.
versions
list of string, List versions to generate stubs libs for. The version name "current" is always
implicitly added.
implementation_installable
bool, Whether to not require the implementation of the library to be installed if a
client of the stubs is installed. Defaults to true; set to false if the
implementation is made available by some other means, e.g. in a Microdroid
virtual machine.
suffix
string, append to name of output
sysroot
bool, Whether this library is part of the Rust toolchain sysroot.
system_dlkm_specific
bool, Install to partition system_dlkm when set to true.
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
compile_multilib
string
enabled
bool
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
use_expansive_default_srcs
bool, Set this to true to use an expansive default set of source file requirements
(all .rs, .h, .xml, and .md files in the module tree).
This is primarily for tracking sources for RBE purposes. Currently defaults
to true, though this may change in the future.
use_generic_config
bool, Set to true if this module must be generic and does not require product-specific information.
To be included in the system image, this property must be set to true.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_available
bool, whether this module should be allowed to be directly depended by other
modules with `vendor: true`, `proprietary: true`, or `vendor_available:true`.
If set to true, two variants will be built separately, one like
normal, and the other limited to the set of libraries and headers
that are exposed to /vendor modules.
The vendor variant may be used with a different (newer) /system,
so it shouldn't have any unversioned runtime dependencies, or
make assumptions about the system that may not be true in the
future.
If set to false, this module becomes inaccessible from /vendor modules.
The modules with vndk: {enabled: true} must define 'vendor_available'
to 'true'.
Nothing happens if BOARD_VNDK_VERSION isn't set in the BoardConfig.mk
vendor_dlkm_specific
bool, Install to partition vendor_dlkm when set to true.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vendor_ramdisk_available
bool, Make this module available when building for vendor ramdisk.
On device without a dedicated recovery partition, the module is only
available after switching root into
/first_stage_ramdisk. To expose the module before switching root, install
the recovery variant instead
version_script
string, Version script to pass to the linker. By default this will replace the
implicit rustc emitted version script to mirror expected behavior in CC.
This is only relevant for rust_ffi_shared modules which are exposing a
versioned C API.
vintf_fragment_modules
configurable list of string, vintf_fragment Modules required from this module.
vintf_fragments
configurable list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
whole_static_libs
configurable list of string, Similar to static_libs, but will bundle the static library dependency into a library. This is helpful
to avoid having to redeclare the dependency for dependents of this library, but in some cases may also
result in bloat if multiple dependencies all include the same static library whole.
The common use case for this is when the static library is unlikely to be a dependency of other modules to avoid
having to redeclare the static library dependency for every dependent module.
If you are not sure what to, for rust_library modules most static dependencies should go in static_libraries,
and for rust_ffi modules most static dependencies should go into whole_static_libraries.
For rust_ffi static variants, these libraries will be included in the resulting static library archive.
For rust_library rlib variants, these libraries will be bundled into the resulting rlib library. This will
include all of the static libraries symbols in any dylibs or binaries which use this rlib as well.
rust_object
rust_object produces an object file.
name
,
srcs
,
defaults
,
host_supported
,
device_supported
,
afdo
,
aliases
,
apex_available
,
arch
,
bootstrap
,
cargo_env_compat
,
cargo_pkg_version
,
cfgs
,
clippy_lints
,
compile_multilib
,
crate_name
,
crate_root
,
crt
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
double_loadable
,
edition
,
enabled
,
exclude_from_recovery_snapshot
,
exclude_from_vendor_snapshot
,
features
,
flags
,
host_cross_supported
,
host_required
,
init_rc
,
installable
,
ld_flags
,
licenses
,
lints
,
lto
,
min_sdk_version
,
multilib
,
native_bridge_supported
,
native_coverage
,
no_full_install
,
no_stdlibs
,
odm_available
,
odm_dlkm_specific
,
overrides
,
owner
,
prefer_rlib
,
proc_macros
,
product_available
,
product_specific
,
product_variables.arc
,
product_variables.build_from_text_stub
,
product_variables.debuggable
,
product_variables.eng
,
product_variables.malloc_low_memory
,
product_variables.native_coverage
,
product_variables.release_aidl_use_unfrozen
,
product_variables.selinuxignoreneverallows
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
ramdisk_available
,
recovery
,
recovery_available
,
relative_install_path
,
required
,
rlibs
,
rustlibs
,
sanitize
,
sdk_version
,
shared_libs
,
soc_specific
,
static_libs
,
stdlibs
,
stem
,
suffix
,
system_dlkm_specific
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
use_expansive_default_srcs
,
use_generic_config
,
vendor
,
vendor_available
,
vendor_dlkm_specific
,
vendor_ramdisk
,
vendor_ramdisk_available
,
vintf_fragment_modules
,
vintf_fragments
,
visibility
,
whole_static_libs
name
string, The name of the module. Must be unique across all modules.
srcs
list of string, path to the source file that is the main entry point of the program (e.g. main.rs or lib.rs).
Only a single source file can be defined. Modules which generate source can be included by prefixing
the module name with ":", for example ":libfoo_bindgen"
If no source file is defined, a single generated source module can be defined to be used as the main source.
defaults
list of string
host_supported
bool, If set to true, build a variant of the module for the host. Defaults to false.
device_supported
bool, If set to true, build a variant of the module for the device. Defaults to true.
afdo
bool, Afdo allows developers self-service enroll for
automatic feedback-directed optimization using profile data.
aliases
list of string, Rust crate dependencies to rename. Each entry should be a string of the form "dependencyname:alias".
"dependencyname" here should be the name of the crate, not the Android module. This is
equivalent to writing `alias = { package = "dependencyname" }` in a `Cargo.toml`.
apex_available
list of string, Availability of this module in APEXes. Only the listed APEXes can contain this module. If
the module has stubs then other APEXes and the platform may access it through them
(subject to visibility).
"//apex_available:anyapex" is a pseudo APEX name that matches to any APEX.
"//apex_available:platform" refers to non-APEX partitions like "system.img".
Prefix pattern (com.foo.*) can be used to match with any APEX name with the prefix(com.foo.).
Default is ["//apex_available:platform"].
arch
interface
bootstrap
bool, Allows this module to use non-APEX version of libraries. Useful
for building binaries that are started before APEXes are activated.
cargo_env_compat
bool, Enables emitting certain Cargo environment variables. Only intended to be used for compatibility purposes.
Will set CARGO_CRATE_NAME to the crate_name property's value.
Will set CARGO_BIN_NAME to the output filename value without the extension.
cargo_pkg_version
string, If cargo_env_compat is true, sets the CARGO_PKG_VERSION env var to this value.
cfgs
configurable list of string, list of configuration options to enable for this crate. To enable features, use the "features" property.
clippy_lints
string, name of the lint set that should be used to validate this module.
Possible values are "default" (for using a sensible set of lints
depending on the module's location), "android" (for the strictest
lint set that applies to all Android platform code), "vendor" (for a
relaxed set) and "none" (to disable the execution of clippy). The
default value is "default". See also the `lints` property.
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
crate_name
string, crate name, required for modules which produce Rust libraries: rust_library, rust_ffi and SourceProvider
modules which create library variants (rust_bindgen). This must be the expected extern crate name used in
source, and is required to conform to an enforced format matching library output files (if the output file is
lib<someName><suffix>, the crate_name property must be <someName>).
crate_root
string, Entry point that is passed to rustc to begin the compilation. E.g. main.rs or lib.rs.
When this property is set,
* sandboxing is enabled for this module, and
* the srcs attribute is interpreted as a list of all source files potentially
used in compilation, including the entrypoint, and
* compile_data can be used to add additional files used in compilation that
not directly used as source files.
crt
bool, Indicates that this module is a CRT object. CRT objects will be split
into a variant per-API level between min_sdk_version and current.
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
prepend_artifact_with_product
bool, If true, then the artifact file will be prepended with <product name>-. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be coral-foo.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
double_loadable
bool, whether this module is capable of being loaded with other instance
(possibly an older version) of the same module in the same process.
Currently, a shared library that is a member of VNDK (vndk: {enabled: true})
can be double loaded in a vendor process if the library is also a
(direct and indirect) dependency of an LLNDK library. Such libraries must be
explicitly marked as `double_loadable: true` by the owner, or the dependency
from the LLNDK lib should be cut if the lib is not designed to be double loaded.
edition
string, specific rust edition that should be used if the default version is not desired
enabled
configurable bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
exclude_from_recovery_snapshot
bool, Normally Soong uses the directory structure to decide which modules
should be included (framework) or excluded (non-framework) from the
different snapshots (vendor, recovery, etc.), but this property
allows a partner to exclude a module normally thought of as a
framework module from the recovery snapshot.
exclude_from_vendor_snapshot
bool, Normally Soong uses the directory structure to decide which modules
should be included (framework) or excluded (non-framework) from the
different snapshots (vendor, recovery, etc.), but this property
allows a partner to exclude a module normally thought of as a
framework module from the vendor snapshot.
features
configurable list of string, list of features to enable for this crate
flags
list of string, flags to pass to rustc. To enable configuration options or features, use the "cfgs" or "features" properties.
host_cross_supported
bool, If set to true, build a variant of the module for the host cross. Defaults to true.
host_required
list of string, names of other modules to install on host if this module is installed
init_rc
configurable list of string, init.rc files to be installed if this module is installed
installable
bool
ld_flags
list of string, flags to pass to the linker
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
lints
string, name of the lint set that should be used to validate this module.
Possible values are "default" (for using a sensible set of lints
depending on the module's location), "android" (for the strictest
lint set that applies to all Android platform code), "vendor" (for
a relaxed set) and "none" (for ignoring all lint warnings and
errors). The default value is "default".
⊕lto
Control whether LTO is used for the final (Rust) linkage. This does not impact
cross-language LTO.
thin
bool, Whether thin LTO should be enabled. By default this is true.
LTO provides such a large code size benefit for Rust, this should always
be enabled for production builds unless there's a clear need to disable it.
min_sdk_version
string, Minimum OS API level supported by this C or C++ module. This property becomes the value
of the __ANDROID_API__ macro. When the C or C++ module is included in an APEX or an APK,
this property is also used to ensure that the min_sdk_version of the containing module is
not older (i.e. less) than this module's min_sdk_version. When not set, this property
defaults to the value of sdk_version. When this is set to "apex_inherit", this tracks
min_sdk_version of the containing APEX. When the module
is not built for an APEX, "apex_inherit" defaults to sdk_version.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
native_coverage
bool
no_full_install
bool, When set to true, this module is not installed to the full install path (ex: under
out/target/product/<name>/<partition>). It can be installed only to the packaging
modules like android_filesystem.
no_stdlibs
bool, whether to suppress inclusion of standard crates - defaults to false
odm_available
bool, This is the same as the "vendor_available" except that the install path
of the vendor variant is /odm or /vendor/odm.
By replacing "vendor_available: true" with "odm_available: true", the
module will install its vendor variant to the /odm partition or /vendor/odm.
As the modules with "odm_available: true" still create the vendor variants,
they can link to the other vendor modules as the vendor_available modules do.
Also, the vendor modules can link to odm_available modules.
It may not be used for VNDK modules.
odm_dlkm_specific
bool, Install to partition odm_dlkm when set to true.
overrides
list of string, List of module names that are prevented from being installed when this module gets
installed.
owner
string, vendor who owns this module
prefer_rlib
bool, Change the rustlibs linkage to select rlib linkage by default for device targets.
Also link libstd as an rlib as well on device targets.
Note: This is the default behavior for host targets.
This is primarily meant for rust_binary and rust_ffi modules where the default
linkage of libstd might need to be overridden in some use cases. This should
generally be avoided with other module types since it may cause collisions at
linkage if all dependencies of the root binary module do not link against libstd
the same way.
proc_macros
configurable list of string, list of rust proc_macro crate dependencies
product_available
bool, whether this module should be allowed to be directly depended by other
modules with `product_specific: true` or `product_available: true`.
If set to true, an additional product variant will be built separately
that is limited to the set of libraries and headers that are exposed to
/product modules.
The product variant may be used with a different (newer) /system,
so it shouldn't have any unversioned runtime dependencies, or
make assumptions about the system that may not be true in the
future.
If set to false, this module becomes inaccessible from /product modules.
Different from the 'vendor_available' property, the modules with
vndk: {enabled: true} don't have to define 'product_available'. The VNDK
library without 'product_available' may not be depended on by any other
modules that has product variants including the product available VNDKs.
Nothing happens if BOARD_VNDK_VERSION isn't set in the BoardConfig.mk
and PRODUCT_PRODUCT_VNDK_VERSION isn't set.
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.arc
⊕shared_libs
⊕static_libs
⊕srcs
⊕whole_static_libs
⊕product_variables.build_from_text_stub
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕static_libs
⊕whole_static_libs
⊕shared_libs
⊕srcs
⊕product_variables.eng
⊕product_variables.malloc_low_memory
⊕shared_libs
⊕whole_static_libs
⊕static_libs
⊕srcs
⊕product_variables.native_coverage
⊕product_variables.release_aidl_use_unfrozen
⊕required
⊕vintf_fragment_modules
⊕product_variables.selinuxignoreneverallows
⊕product_variables.unbundled_build
⊕enabled
Configurable[bool]
Configurable[bool]
proptools.Configurable[bool]
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
ramdisk_available
bool, Make this module available when building for ramdisk.
On device without a dedicated recovery partition, the module is only
available after switching root into
/first_stage_ramdisk. To expose the module before switching root, install
the recovery variant instead.
recovery
bool, Whether this module is installed to recovery partition
recovery_available
bool, Make this module available when building for recovery
relative_install_path
string, install to a subdirectory of the default install path for the module
required
configurable list of string, names of other modules to install if this module is installed
rlibs
configurable list of string, list of rust rlib crate dependencies
rustlibs
configurable list of string, list of rust automatic crate dependencies.
Rustlibs linkage is rlib for host targets and dylib for device targets.
⊕sanitize
enable AddressSanitizer, HWAddressSanitizer, and others.
address
bool
hwaddress
bool
memtag_heap
bool, Memory-tagging, only available on arm64
if diag.memtag unset or false, enables async memory tagging
fuzzer
bool
never
bool
⊕diag
Sanitizers to run in the diagnostic mode (as opposed to the release mode).
Replaces abort() on error with a human-readable error message.
Address and Thread sanitizers always run in diagnostic mode.
memtag_heap
bool, Memory-tagging, only available on arm64
requires sanitizer.memtag: true
if set, enables sync memory tagging
sdk_version
string, The API level that this module is built against. The APIs of this API level will be
visible at build time, but use of any APIs newer than min_sdk_version will render the
module unloadable on older devices. In the future it will be possible to weakly-link new
APIs, making the behavior match Java: such modules will load on older devices, but
calling new APIs on devices that do not support them will result in a crash.
This property has the same behavior as sdk_version does for Java modules. For those
familiar with Android Gradle, the property behaves similarly to how compileSdkVersion
does for Java code.
In addition, setting this property causes two variants to be built, one for the platform
and one for apps.
shared_libs
configurable list of string, list of C shared library dependencies
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
static_libs
configurable list of string, list of C static library dependencies. These dependencies do not normally propagate to dependents
and may need to be redeclared. See whole_static_libs for bundling static dependencies into a library.
stdlibs
configurable list of string, list of Rust system library dependencies.
This is usually only needed when `no_stdlibs` is true, in which case it can be used to depend on system crates
like `core` and `alloc`.
stem
string, sets name of the output
suffix
string, append to name of output
system_dlkm_specific
bool, Install to partition system_dlkm when set to true.
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
compile_multilib
string
enabled
bool
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
use_expansive_default_srcs
bool, Set this to true to use an expansive default set of source file requirements
(all .rs, .h, .xml, and .md files in the module tree).
This is primarily for tracking sources for RBE purposes. Currently defaults
to true, though this may change in the future.
use_generic_config
bool, Set to true if this module must be generic and does not require product-specific information.
To be included in the system image, this property must be set to true.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_available
bool, whether this module should be allowed to be directly depended by other
modules with `vendor: true`, `proprietary: true`, or `vendor_available:true`.
If set to true, two variants will be built separately, one like
normal, and the other limited to the set of libraries and headers
that are exposed to /vendor modules.
The vendor variant may be used with a different (newer) /system,
so it shouldn't have any unversioned runtime dependencies, or
make assumptions about the system that may not be true in the
future.
If set to false, this module becomes inaccessible from /vendor modules.
The modules with vndk: {enabled: true} must define 'vendor_available'
to 'true'.
Nothing happens if BOARD_VNDK_VERSION isn't set in the BoardConfig.mk
vendor_dlkm_specific
bool, Install to partition vendor_dlkm when set to true.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vendor_ramdisk_available
bool, Make this module available when building for vendor ramdisk.
On device without a dedicated recovery partition, the module is only
available after switching root into
/first_stage_ramdisk. To expose the module before switching root, install
the recovery variant instead
vintf_fragment_modules
configurable list of string, vintf_fragment Modules required from this module.
vintf_fragments
configurable list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
whole_static_libs
configurable list of string, Similar to static_libs, but will bundle the static library dependency into a library. This is helpful
to avoid having to redeclare the dependency for dependents of this library, but in some cases may also
result in bloat if multiple dependencies all include the same static library whole.
The common use case for this is when the static library is unlikely to be a dependency of other modules to avoid
having to redeclare the static library dependency for every dependent module.
If you are not sure what to, for rust_library modules most static dependencies should go in static_libraries,
and for rust_ffi modules most static dependencies should go into whole_static_libraries.
For rust_ffi static variants, these libraries will be included in the resulting static library archive.
For rust_library rlib variants, these libraries will be bundled into the resulting rlib library. This will
include all of the static libraries symbols in any dylibs or binaries which use this rlib as well.
rust_object_host
rust_object_host produces an object file for host only.
name
,
srcs
,
defaults
,
afdo
,
aliases
,
apex_available
,
arch
,
bootstrap
,
cargo_env_compat
,
cargo_pkg_version
,
cfgs
,
clippy_lints
,
compile_multilib
,
crate_name
,
crate_root
,
crt
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
double_loadable
,
edition
,
enabled
,
exclude_from_recovery_snapshot
,
exclude_from_vendor_snapshot
,
features
,
flags
,
host_cross_supported
,
host_required
,
init_rc
,
installable
,
ld_flags
,
licenses
,
lints
,
lto
,
min_sdk_version
,
multilib
,
native_bridge_supported
,
native_coverage
,
no_full_install
,
no_stdlibs
,
odm_available
,
odm_dlkm_specific
,
overrides
,
owner
,
prefer_rlib
,
proc_macros
,
product_available
,
product_specific
,
product_variables.arc
,
product_variables.build_from_text_stub
,
product_variables.debuggable
,
product_variables.eng
,
product_variables.malloc_low_memory
,
product_variables.native_coverage
,
product_variables.release_aidl_use_unfrozen
,
product_variables.selinuxignoreneverallows
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
ramdisk_available
,
recovery
,
recovery_available
,
relative_install_path
,
required
,
rlibs
,
rustlibs
,
sanitize
,
sdk_version
,
shared_libs
,
soc_specific
,
static_libs
,
stdlibs
,
stem
,
suffix
,
system_dlkm_specific
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
use_expansive_default_srcs
,
use_generic_config
,
vendor
,
vendor_available
,
vendor_dlkm_specific
,
vendor_ramdisk
,
vendor_ramdisk_available
,
vintf_fragment_modules
,
vintf_fragments
,
visibility
,
whole_static_libs
name
string, The name of the module. Must be unique across all modules.
srcs
list of string, path to the source file that is the main entry point of the program (e.g. main.rs or lib.rs).
Only a single source file can be defined. Modules which generate source can be included by prefixing
the module name with ":", for example ":libfoo_bindgen"
If no source file is defined, a single generated source module can be defined to be used as the main source.
defaults
list of string
afdo
bool, Afdo allows developers self-service enroll for
automatic feedback-directed optimization using profile data.
aliases
list of string, Rust crate dependencies to rename. Each entry should be a string of the form "dependencyname:alias".
"dependencyname" here should be the name of the crate, not the Android module. This is
equivalent to writing `alias = { package = "dependencyname" }` in a `Cargo.toml`.
apex_available
list of string, Availability of this module in APEXes. Only the listed APEXes can contain this module. If
the module has stubs then other APEXes and the platform may access it through them
(subject to visibility).
"//apex_available:anyapex" is a pseudo APEX name that matches to any APEX.
"//apex_available:platform" refers to non-APEX partitions like "system.img".
Prefix pattern (com.foo.*) can be used to match with any APEX name with the prefix(com.foo.).
Default is ["//apex_available:platform"].
arch
interface
bootstrap
bool, Allows this module to use non-APEX version of libraries. Useful
for building binaries that are started before APEXes are activated.
cargo_env_compat
bool, Enables emitting certain Cargo environment variables. Only intended to be used for compatibility purposes.
Will set CARGO_CRATE_NAME to the crate_name property's value.
Will set CARGO_BIN_NAME to the output filename value without the extension.
cargo_pkg_version
string, If cargo_env_compat is true, sets the CARGO_PKG_VERSION env var to this value.
cfgs
configurable list of string, list of configuration options to enable for this crate. To enable features, use the "features" property.
clippy_lints
string, name of the lint set that should be used to validate this module.
Possible values are "default" (for using a sensible set of lints
depending on the module's location), "android" (for the strictest
lint set that applies to all Android platform code), "vendor" (for a
relaxed set) and "none" (to disable the execution of clippy). The
default value is "default". See also the `lints` property.
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
crate_name
string, crate name, required for modules which produce Rust libraries: rust_library, rust_ffi and SourceProvider
modules which create library variants (rust_bindgen). This must be the expected extern crate name used in
source, and is required to conform to an enforced format matching library output files (if the output file is
lib<someName><suffix>, the crate_name property must be <someName>).
crate_root
string, Entry point that is passed to rustc to begin the compilation. E.g. main.rs or lib.rs.
When this property is set,
* sandboxing is enabled for this module, and
* the srcs attribute is interpreted as a list of all source files potentially
used in compilation, including the entrypoint, and
* compile_data can be used to add additional files used in compilation that
not directly used as source files.
crt
bool, Indicates that this module is a CRT object. CRT objects will be split
into a variant per-API level between min_sdk_version and current.
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
prepend_artifact_with_product
bool, If true, then the artifact file will be prepended with <product name>-. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be coral-foo.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
double_loadable
bool, whether this module is capable of being loaded with other instance
(possibly an older version) of the same module in the same process.
Currently, a shared library that is a member of VNDK (vndk: {enabled: true})
can be double loaded in a vendor process if the library is also a
(direct and indirect) dependency of an LLNDK library. Such libraries must be
explicitly marked as `double_loadable: true` by the owner, or the dependency
from the LLNDK lib should be cut if the lib is not designed to be double loaded.
edition
string, specific rust edition that should be used if the default version is not desired
enabled
configurable bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
exclude_from_recovery_snapshot
bool, Normally Soong uses the directory structure to decide which modules
should be included (framework) or excluded (non-framework) from the
different snapshots (vendor, recovery, etc.), but this property
allows a partner to exclude a module normally thought of as a
framework module from the recovery snapshot.
exclude_from_vendor_snapshot
bool, Normally Soong uses the directory structure to decide which modules
should be included (framework) or excluded (non-framework) from the
different snapshots (vendor, recovery, etc.), but this property
allows a partner to exclude a module normally thought of as a
framework module from the vendor snapshot.
features
configurable list of string, list of features to enable for this crate
flags
list of string, flags to pass to rustc. To enable configuration options or features, use the "cfgs" or "features" properties.
host_cross_supported
bool, If set to true, build a variant of the module for the host cross. Defaults to true.
host_required
list of string, names of other modules to install on host if this module is installed
init_rc
configurable list of string, init.rc files to be installed if this module is installed
installable
bool
ld_flags
list of string, flags to pass to the linker
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
lints
string, name of the lint set that should be used to validate this module.
Possible values are "default" (for using a sensible set of lints
depending on the module's location), "android" (for the strictest
lint set that applies to all Android platform code), "vendor" (for
a relaxed set) and "none" (for ignoring all lint warnings and
errors). The default value is "default".
⊕lto
Control whether LTO is used for the final (Rust) linkage. This does not impact
cross-language LTO.
thin
bool, Whether thin LTO should be enabled. By default this is true.
LTO provides such a large code size benefit for Rust, this should always
be enabled for production builds unless there's a clear need to disable it.
min_sdk_version
string, Minimum OS API level supported by this C or C++ module. This property becomes the value
of the __ANDROID_API__ macro. When the C or C++ module is included in an APEX or an APK,
this property is also used to ensure that the min_sdk_version of the containing module is
not older (i.e. less) than this module's min_sdk_version. When not set, this property
defaults to the value of sdk_version. When this is set to "apex_inherit", this tracks
min_sdk_version of the containing APEX. When the module
is not built for an APEX, "apex_inherit" defaults to sdk_version.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
native_coverage
bool
no_full_install
bool, When set to true, this module is not installed to the full install path (ex: under
out/target/product/<name>/<partition>). It can be installed only to the packaging
modules like android_filesystem.
no_stdlibs
bool, whether to suppress inclusion of standard crates - defaults to false
odm_available
bool, This is the same as the "vendor_available" except that the install path
of the vendor variant is /odm or /vendor/odm.
By replacing "vendor_available: true" with "odm_available: true", the
module will install its vendor variant to the /odm partition or /vendor/odm.
As the modules with "odm_available: true" still create the vendor variants,
they can link to the other vendor modules as the vendor_available modules do.
Also, the vendor modules can link to odm_available modules.
It may not be used for VNDK modules.
odm_dlkm_specific
bool, Install to partition odm_dlkm when set to true.
overrides
list of string, List of module names that are prevented from being installed when this module gets
installed.
owner
string, vendor who owns this module
prefer_rlib
bool, Change the rustlibs linkage to select rlib linkage by default for device targets.
Also link libstd as an rlib as well on device targets.
Note: This is the default behavior for host targets.
This is primarily meant for rust_binary and rust_ffi modules where the default
linkage of libstd might need to be overridden in some use cases. This should
generally be avoided with other module types since it may cause collisions at
linkage if all dependencies of the root binary module do not link against libstd
the same way.
proc_macros
configurable list of string, list of rust proc_macro crate dependencies
product_available
bool, whether this module should be allowed to be directly depended by other
modules with `product_specific: true` or `product_available: true`.
If set to true, an additional product variant will be built separately
that is limited to the set of libraries and headers that are exposed to
/product modules.
The product variant may be used with a different (newer) /system,
so it shouldn't have any unversioned runtime dependencies, or
make assumptions about the system that may not be true in the
future.
If set to false, this module becomes inaccessible from /product modules.
Different from the 'vendor_available' property, the modules with
vndk: {enabled: true} don't have to define 'product_available'. The VNDK
library without 'product_available' may not be depended on by any other
modules that has product variants including the product available VNDKs.
Nothing happens if BOARD_VNDK_VERSION isn't set in the BoardConfig.mk
and PRODUCT_PRODUCT_VNDK_VERSION isn't set.
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.arc
⊕shared_libs
⊕static_libs
⊕srcs
⊕whole_static_libs
⊕product_variables.build_from_text_stub
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕static_libs
⊕whole_static_libs
⊕shared_libs
⊕srcs
⊕product_variables.eng
⊕product_variables.malloc_low_memory
⊕shared_libs
⊕whole_static_libs
⊕static_libs
⊕srcs
⊕product_variables.native_coverage
⊕product_variables.release_aidl_use_unfrozen
⊕required
⊕vintf_fragment_modules
⊕product_variables.selinuxignoreneverallows
⊕product_variables.unbundled_build
⊕enabled
Configurable[bool]
Configurable[bool]
proptools.Configurable[bool]
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
ramdisk_available
bool, Make this module available when building for ramdisk.
On device without a dedicated recovery partition, the module is only
available after switching root into
/first_stage_ramdisk. To expose the module before switching root, install
the recovery variant instead.
recovery
bool, Whether this module is installed to recovery partition
recovery_available
bool, Make this module available when building for recovery
relative_install_path
string, install to a subdirectory of the default install path for the module
required
configurable list of string, names of other modules to install if this module is installed
rlibs
configurable list of string, list of rust rlib crate dependencies
rustlibs
configurable list of string, list of rust automatic crate dependencies.
Rustlibs linkage is rlib for host targets and dylib for device targets.
⊕sanitize
enable AddressSanitizer, HWAddressSanitizer, and others.
address
bool
hwaddress
bool
memtag_heap
bool, Memory-tagging, only available on arm64
if diag.memtag unset or false, enables async memory tagging
fuzzer
bool
never
bool
⊕diag
Sanitizers to run in the diagnostic mode (as opposed to the release mode).
Replaces abort() on error with a human-readable error message.
Address and Thread sanitizers always run in diagnostic mode.
memtag_heap
bool, Memory-tagging, only available on arm64
requires sanitizer.memtag: true
if set, enables sync memory tagging
sdk_version
string, The API level that this module is built against. The APIs of this API level will be
visible at build time, but use of any APIs newer than min_sdk_version will render the
module unloadable on older devices. In the future it will be possible to weakly-link new
APIs, making the behavior match Java: such modules will load on older devices, but
calling new APIs on devices that do not support them will result in a crash.
This property has the same behavior as sdk_version does for Java modules. For those
familiar with Android Gradle, the property behaves similarly to how compileSdkVersion
does for Java code.
In addition, setting this property causes two variants to be built, one for the platform
and one for apps.
shared_libs
configurable list of string, list of C shared library dependencies
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
static_libs
configurable list of string, list of C static library dependencies. These dependencies do not normally propagate to dependents
and may need to be redeclared. See whole_static_libs for bundling static dependencies into a library.
stdlibs
configurable list of string, list of Rust system library dependencies.
This is usually only needed when `no_stdlibs` is true, in which case it can be used to depend on system crates
like `core` and `alloc`.
stem
string, sets name of the output
suffix
string, append to name of output
system_dlkm_specific
bool, Install to partition system_dlkm when set to true.
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
compile_multilib
string
enabled
bool
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
use_expansive_default_srcs
bool, Set this to true to use an expansive default set of source file requirements
(all .rs, .h, .xml, and .md files in the module tree).
This is primarily for tracking sources for RBE purposes. Currently defaults
to true, though this may change in the future.
use_generic_config
bool, Set to true if this module must be generic and does not require product-specific information.
To be included in the system image, this property must be set to true.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_available
bool, whether this module should be allowed to be directly depended by other
modules with `vendor: true`, `proprietary: true`, or `vendor_available:true`.
If set to true, two variants will be built separately, one like
normal, and the other limited to the set of libraries and headers
that are exposed to /vendor modules.
The vendor variant may be used with a different (newer) /system,
so it shouldn't have any unversioned runtime dependencies, or
make assumptions about the system that may not be true in the
future.
If set to false, this module becomes inaccessible from /vendor modules.
The modules with vndk: {enabled: true} must define 'vendor_available'
to 'true'.
Nothing happens if BOARD_VNDK_VERSION isn't set in the BoardConfig.mk
vendor_dlkm_specific
bool, Install to partition vendor_dlkm when set to true.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vendor_ramdisk_available
bool, Make this module available when building for vendor ramdisk.
On device without a dedicated recovery partition, the module is only
available after switching root into
/first_stage_ramdisk. To expose the module before switching root, install
the recovery variant instead
vintf_fragment_modules
configurable list of string, vintf_fragment Modules required from this module.
vintf_fragments
configurable list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
whole_static_libs
configurable list of string, Similar to static_libs, but will bundle the static library dependency into a library. This is helpful
to avoid having to redeclare the dependency for dependents of this library, but in some cases may also
result in bloat if multiple dependencies all include the same static library whole.
The common use case for this is when the static library is unlikely to be a dependency of other modules to avoid
having to redeclare the static library dependency for every dependent module.
If you are not sure what to, for rust_library modules most static dependencies should go in static_libraries,
and for rust_ffi modules most static dependencies should go into whole_static_libraries.
For rust_ffi static variants, these libraries will be included in the resulting static library archive.
For rust_library rlib variants, these libraries will be bundled into the resulting rlib library. This will
include all of the static libraries symbols in any dylibs or binaries which use this rlib as well.
rust_prebuilt_dylib
name
,
srcs
,
defaults
,
host_supported
,
device_supported
,
afdo
,
aliases
,
apex_available
,
apex_exclude
,
arch
,
bootstrap
,
cargo_env_compat
,
cargo_pkg_version
,
cfgs
,
clippy_lints
,
compile_multilib
,
crate_name
,
crate_root
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
double_loadable
,
dylib
,
edition
,
enabled
,
exclude_from_recovery_snapshot
,
exclude_from_vendor_snapshot
,
export_include_dirs
,
extra_exported_symbols
,
features
,
flags
,
force_use_prebuilt
,
host_cross_supported
,
host_required
,
include_dirs
,
init_rc
,
installable
,
ld_flags
,
licenses
,
link_dirs
,
lints
,
lto
,
min_sdk_version
,
multilib
,
native_bridge_supported
,
native_coverage
,
no_full_install
,
no_stdlibs
,
odm_available
,
odm_dlkm_specific
,
overrides
,
owner
,
prefer
,
prefer_rlib
,
proc_macros
,
product_available
,
product_specific
,
product_variables.arc
,
product_variables.build_from_text_stub
,
product_variables.debuggable
,
product_variables.eng
,
product_variables.malloc_low_memory
,
product_variables.native_coverage
,
product_variables.release_aidl_use_unfrozen
,
product_variables.selinuxignoreneverallows
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
ramdisk_available
,
recovery
,
recovery_available
,
relative_install_path
,
required
,
rlib
,
rlibs
,
rustlibs
,
sanitize
,
sdk_version
,
shared
,
shared_libs
,
soc_specific
,
static
,
static_libs
,
stdlibs
,
stem
,
strip
,
stubs
,
suffix
,
sysroot
,
system_dlkm_specific
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
use_expansive_default_srcs
,
use_generic_config
,
use_source_config_var
,
vendor
,
vendor_available
,
vendor_dlkm_specific
,
vendor_ramdisk
,
vendor_ramdisk_available
,
version_script
,
vintf_fragment_modules
,
vintf_fragments
,
visibility
,
whole_static_libs
name
string, The name of the module. Must be unique across all modules.
srcs
list of string, path to the source file that is the main entry point of the program (e.g. main.rs or lib.rs).
Only a single source file can be defined. Modules which generate source can be included by prefixing
the module name with ":", for example ":libfoo_bindgen"
If no source file is defined, a single generated source module can be defined to be used as the main source.
defaults
list of string
host_supported
bool, If set to true, build a variant of the module for the host. Defaults to false.
device_supported
bool, If set to true, build a variant of the module for the device. Defaults to true.
afdo
bool, Afdo allows developers self-service enroll for
automatic feedback-directed optimization using profile data.
aliases
list of string, Rust crate dependencies to rename. Each entry should be a string of the form "dependencyname:alias".
"dependencyname" here should be the name of the crate, not the Android module. This is
equivalent to writing `alias = { package = "dependencyname" }` in a `Cargo.toml`.
apex_available
list of string, Availability of this module in APEXes. Only the listed APEXes can contain this module. If
the module has stubs then other APEXes and the platform may access it through them
(subject to visibility).
"//apex_available:anyapex" is a pseudo APEX name that matches to any APEX.
"//apex_available:platform" refers to non-APEX partitions like "system.img".
Prefix pattern (com.foo.*) can be used to match with any APEX name with the prefix(com.foo.).
Default is ["//apex_available:platform"].
apex_exclude
bool, Deprecated - exclude this rust_ffi target from being included in APEXes.
TODO(b/362509506): remove this once all apex_exclude uses are switched to stubs.
arch
interface
bootstrap
bool, Allows this module to use non-APEX version of libraries. Useful
for building binaries that are started before APEXes are activated.
cargo_env_compat
bool, Enables emitting certain Cargo environment variables. Only intended to be used for compatibility purposes.
Will set CARGO_CRATE_NAME to the crate_name property's value.
Will set CARGO_BIN_NAME to the output filename value without the extension.
cargo_pkg_version
string, If cargo_env_compat is true, sets the CARGO_PKG_VERSION env var to this value.
cfgs
configurable list of string, list of configuration options to enable for this crate. To enable features, use the "features" property.
clippy_lints
string, name of the lint set that should be used to validate this module.
Possible values are "default" (for using a sensible set of lints
depending on the module's location), "android" (for the strictest
lint set that applies to all Android platform code), "vendor" (for a
relaxed set) and "none" (to disable the execution of clippy). The
default value is "default". See also the `lints` property.
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
crate_name
string, crate name, required for modules which produce Rust libraries: rust_library, rust_ffi and SourceProvider
modules which create library variants (rust_bindgen). This must be the expected extern crate name used in
source, and is required to conform to an enforced format matching library output files (if the output file is
lib<someName><suffix>, the crate_name property must be <someName>).
crate_root
string, Entry point that is passed to rustc to begin the compilation. E.g. main.rs or lib.rs.
When this property is set,
* sandboxing is enabled for this module, and
* the srcs attribute is interpreted as a list of all source files potentially
used in compilation, including the entrypoint, and
* compile_data can be used to add additional files used in compilation that
not directly used as source files.
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
prepend_artifact_with_product
bool, If true, then the artifact file will be prepended with <product name>-. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be coral-foo.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
double_loadable
bool, whether this module is capable of being loaded with other instance
(possibly an older version) of the same module in the same process.
Currently, a shared library that is a member of VNDK (vndk: {enabled: true})
can be double loaded in a vendor process if the library is also a
(direct and indirect) dependency of an LLNDK library. Such libraries must be
explicitly marked as `double_loadable: true` by the owner, or the dependency
from the LLNDK lib should be cut if the lib is not designed to be double loaded.
⊕dylib
VariantLibraryProperties
enabled
bool
srcs
list of string
edition
string, specific rust edition that should be used if the default version is not desired
enabled
configurable bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
exclude_from_recovery_snapshot
bool, Normally Soong uses the directory structure to decide which modules
should be included (framework) or excluded (non-framework) from the
different snapshots (vendor, recovery, etc.), but this property
allows a partner to exclude a module normally thought of as a
framework module from the recovery snapshot.
exclude_from_vendor_snapshot
bool, Normally Soong uses the directory structure to decide which modules
should be included (framework) or excluded (non-framework) from the
different snapshots (vendor, recovery, etc.), but this property
allows a partner to exclude a module normally thought of as a
framework module from the vendor snapshot.
export_include_dirs
list of string, path to include directories to export to cc_* modules, only relevant for static/shared variants.
features
configurable list of string, list of features to enable for this crate
flags
list of string, flags to pass to rustc. To enable configuration options or features, use the "cfgs" or "features" properties.
force_use_prebuilt
bool
host_cross_supported
bool, If set to true, build a variant of the module for the host cross. Defaults to true.
host_required
list of string, names of other modules to install on host if this module is installed
include_dirs
list of string, TODO: Remove this when all instances of Include_dirs have been removed from rust_ffi modules.
path to include directories to pass to cc_* modules, only relevant for static/shared variants (deprecated, use export_include_dirs instead).
init_rc
configurable list of string, init.rc files to be installed if this module is installed
installable
bool
ld_flags
list of string, flags to pass to the linker
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
link_dirs
list of string, directories containing associated rlib dependencies
lints
string, name of the lint set that should be used to validate this module.
Possible values are "default" (for using a sensible set of lints
depending on the module's location), "android" (for the strictest
lint set that applies to all Android platform code), "vendor" (for
a relaxed set) and "none" (for ignoring all lint warnings and
errors). The default value is "default".
⊕lto
Control whether LTO is used for the final (Rust) linkage. This does not impact
cross-language LTO.
thin
bool, Whether thin LTO should be enabled. By default this is true.
LTO provides such a large code size benefit for Rust, this should always
be enabled for production builds unless there's a clear need to disable it.
min_sdk_version
string, Minimum OS API level supported by this C or C++ module. This property becomes the value
of the __ANDROID_API__ macro. When the C or C++ module is included in an APEX or an APK,
this property is also used to ensure that the min_sdk_version of the containing module is
not older (i.e. less) than this module's min_sdk_version. When not set, this property
defaults to the value of sdk_version. When this is set to "apex_inherit", this tracks
min_sdk_version of the containing APEX. When the module
is not built for an APEX, "apex_inherit" defaults to sdk_version.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
native_coverage
bool
no_full_install
bool, When set to true, this module is not installed to the full install path (ex: under
out/target/product/<name>/<partition>). It can be installed only to the packaging
modules like android_filesystem.
no_stdlibs
bool, whether to suppress inclusion of standard crates - defaults to false
Default: true
odm_available
bool, This is the same as the "vendor_available" except that the install path
of the vendor variant is /odm or /vendor/odm.
By replacing "vendor_available: true" with "odm_available: true", the
module will install its vendor variant to the /odm partition or /vendor/odm.
As the modules with "odm_available: true" still create the vendor variants,
they can link to the other vendor modules as the vendor_available modules do.
Also, the vendor modules can link to odm_available modules.
It may not be used for VNDK modules.
odm_dlkm_specific
bool, Install to partition odm_dlkm when set to true.
overrides
list of string, List of module names that are prevented from being installed when this module gets
installed.
owner
string, vendor who owns this module
prefer
configurable bool, When prefer is set to true the prebuilt will be used instead of any source module with
a matching name.
prefer_rlib
bool, Change the rustlibs linkage to select rlib linkage by default for device targets.
Also link libstd as an rlib as well on device targets.
Note: This is the default behavior for host targets.
This is primarily meant for rust_binary and rust_ffi modules where the default
linkage of libstd might need to be overridden in some use cases. This should
generally be avoided with other module types since it may cause collisions at
linkage if all dependencies of the root binary module do not link against libstd
the same way.
proc_macros
configurable list of string, list of rust proc_macro crate dependencies
product_available
bool, whether this module should be allowed to be directly depended by other
modules with `product_specific: true` or `product_available: true`.
If set to true, an additional product variant will be built separately
that is limited to the set of libraries and headers that are exposed to
/product modules.
The product variant may be used with a different (newer) /system,
so it shouldn't have any unversioned runtime dependencies, or
make assumptions about the system that may not be true in the
future.
If set to false, this module becomes inaccessible from /product modules.
Different from the 'vendor_available' property, the modules with
vndk: {enabled: true} don't have to define 'product_available'. The VNDK
library without 'product_available' may not be depended on by any other
modules that has product variants including the product available VNDKs.
Nothing happens if BOARD_VNDK_VERSION isn't set in the BoardConfig.mk
and PRODUCT_PRODUCT_VNDK_VERSION isn't set.
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.arc
⊕include_dirs
⊕shared_libs
⊕static_libs
⊕srcs
⊕whole_static_libs
⊕product_variables.build_from_text_stub
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕strip.all
⊕strip.keep_symbols
⊕strip.keep_symbols_and_debug_frame
⊕static_libs
⊕whole_static_libs
⊕shared_libs
⊕srcs
⊕product_variables.eng
⊕product_variables.malloc_low_memory
⊕shared_libs
⊕whole_static_libs
⊕static_libs
⊕srcs
⊕product_variables.native_coverage
⊕product_variables.release_aidl_use_unfrozen
⊕required
⊕vintf_fragment_modules
⊕product_variables.selinuxignoreneverallows
⊕product_variables.unbundled_build
⊕enabled
Configurable[bool]
Configurable[bool]
proptools.Configurable[bool]
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
ramdisk_available
bool, Make this module available when building for ramdisk.
On device without a dedicated recovery partition, the module is only
available after switching root into
/first_stage_ramdisk. To expose the module before switching root, install
the recovery variant instead.
recovery
bool, Whether this module is installed to recovery partition
recovery_available
bool, Make this module available when building for recovery
relative_install_path
string, install to a subdirectory of the default install path for the module
required
configurable list of string, names of other modules to install if this module is installed
⊕rlib
VariantLibraryProperties
enabled
bool
srcs
list of string
rlibs
configurable list of string, list of rust rlib crate dependencies
rustlibs
configurable list of string, list of rust automatic crate dependencies.
Rustlibs linkage is rlib for host targets and dylib for device targets.
⊕sanitize
enable AddressSanitizer, HWAddressSanitizer, and others.
address
bool
hwaddress
bool
memtag_heap
bool, Memory-tagging, only available on arm64
if diag.memtag unset or false, enables async memory tagging
fuzzer
bool
never
bool
⊕diag
Sanitizers to run in the diagnostic mode (as opposed to the release mode).
Replaces abort() on error with a human-readable error message.
Address and Thread sanitizers always run in diagnostic mode.
memtag_heap
bool, Memory-tagging, only available on arm64
requires sanitizer.memtag: true
if set, enables sync memory tagging
sdk_version
string, The API level that this module is built against. The APIs of this API level will be
visible at build time, but use of any APIs newer than min_sdk_version will render the
module unloadable on older devices. In the future it will be possible to weakly-link new
APIs, making the behavior match Java: such modules will load on older devices, but
calling new APIs on devices that do not support them will result in a crash.
This property has the same behavior as sdk_version does for Java modules. For those
familiar with Android Gradle, the property behaves similarly to how compileSdkVersion
does for Java code.
In addition, setting this property causes two variants to be built, one for the platform
and one for apps.
⊕shared
VariantLibraryProperties
enabled
bool
srcs
list of string
shared_libs
configurable list of string, list of C shared library dependencies
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
⊕static
VariantLibraryProperties
enabled
bool
srcs
list of string
static_libs
configurable list of string, list of C static library dependencies. These dependencies do not normally propagate to dependents
and may need to be redeclared. See whole_static_libs for bundling static dependencies into a library.
stdlibs
configurable list of string, list of Rust system library dependencies.
This is usually only needed when `no_stdlibs` is true, in which case it can be used to depend on system crates
like `core` and `alloc`.
stem
string, sets name of the output
⊕strip
none
bool, Device modules default to stripping enabled leaving mini debuginfo.
Host modules default to stripping disabled, but can be enabled by setting any other
strip boolean property.
all
bool, all forces stripping everything, including the mini debug info.
keep_symbols
bool, keep_symbols enables stripping but keeps all symbols.
keep_symbols_list
list of string, keep_symbols_list specifies a list of symbols to keep if keep_symbols is enabled.
If it is unset then all symbols are kept.
keep_symbols_and_debug_frame
bool, keep_symbols_and_debug_frame enables stripping but keeps all symbols and debug frames.
⊕stubs
*ast.SelectorExpr
Generate stubs to make this library accessible to APEXes.
Can only be set for modules producing shared libraries.
symbol_file
string, Relative path to the symbol map. The symbol map provides the list of
symbols that are exported for stubs variant of this library.
versions
list of string, List versions to generate stubs libs for. The version name "current" is always
implicitly added.
implementation_installable
bool, Whether to not require the implementation of the library to be installed if a
client of the stubs is installed. Defaults to true; set to false if the
implementation is made available by some other means, e.g. in a Microdroid
virtual machine.
suffix
string, append to name of output
sysroot
bool, Whether this library is part of the Rust toolchain sysroot.
system_dlkm_specific
bool, Install to partition system_dlkm when set to true.
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
compile_multilib
string
enabled
bool
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
use_expansive_default_srcs
bool, Set this to true to use an expansive default set of source file requirements
(all .rs, .h, .xml, and .md files in the module tree).
This is primarily for tracking sources for RBE purposes. Currently defaults
to true, though this may change in the future.
use_generic_config
bool, Set to true if this module must be generic and does not require product-specific information.
To be included in the system image, this property must be set to true.
use_source_config_var
ConfigVarProperties, When specified this names a Soong config variable that controls the prefer property.
If the value of the named Soong config variable is true then prefer is set to false and vice
versa. If the Soong config variable is not set then it defaults to false, so prefer defaults
to true.
If specified then the prefer property is ignored in favor of the value of the Soong config
variable.
DEPRECATED: This property is being deprecated b/308188211.
Use RELEASE_APEX_CONTRIBUTIONS build flags to select prebuilts of mainline modules.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_available
bool, whether this module should be allowed to be directly depended by other
modules with `vendor: true`, `proprietary: true`, or `vendor_available:true`.
If set to true, two variants will be built separately, one like
normal, and the other limited to the set of libraries and headers
that are exposed to /vendor modules.
The vendor variant may be used with a different (newer) /system,
so it shouldn't have any unversioned runtime dependencies, or
make assumptions about the system that may not be true in the
future.
If set to false, this module becomes inaccessible from /vendor modules.
The modules with vndk: {enabled: true} must define 'vendor_available'
to 'true'.
Nothing happens if BOARD_VNDK_VERSION isn't set in the BoardConfig.mk
vendor_dlkm_specific
bool, Install to partition vendor_dlkm when set to true.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vendor_ramdisk_available
bool, Make this module available when building for vendor ramdisk.
On device without a dedicated recovery partition, the module is only
available after switching root into
/first_stage_ramdisk. To expose the module before switching root, install
the recovery variant instead
version_script
string, Version script to pass to the linker. By default this will replace the
implicit rustc emitted version script to mirror expected behavior in CC.
This is only relevant for rust_ffi_shared modules which are exposing a
versioned C API.
vintf_fragment_modules
configurable list of string, vintf_fragment Modules required from this module.
vintf_fragments
configurable list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
whole_static_libs
configurable list of string, Similar to static_libs, but will bundle the static library dependency into a library. This is helpful
to avoid having to redeclare the dependency for dependents of this library, but in some cases may also
result in bloat if multiple dependencies all include the same static library whole.
The common use case for this is when the static library is unlikely to be a dependency of other modules to avoid
having to redeclare the static library dependency for every dependent module.
If you are not sure what to, for rust_library modules most static dependencies should go in static_libraries,
and for rust_ffi modules most static dependencies should go into whole_static_libraries.
For rust_ffi static variants, these libraries will be included in the resulting static library archive.
For rust_library rlib variants, these libraries will be bundled into the resulting rlib library. This will
include all of the static libraries symbols in any dylibs or binaries which use this rlib as well.
rust_prebuilt_library
name
,
srcs
,
defaults
,
host_supported
,
device_supported
,
afdo
,
aliases
,
apex_available
,
apex_exclude
,
arch
,
bootstrap
,
cargo_env_compat
,
cargo_pkg_version
,
cfgs
,
clippy_lints
,
compile_multilib
,
crate_name
,
crate_root
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
double_loadable
,
dylib
,
edition
,
enabled
,
exclude_from_recovery_snapshot
,
exclude_from_vendor_snapshot
,
export_include_dirs
,
extra_exported_symbols
,
features
,
flags
,
force_use_prebuilt
,
host_cross_supported
,
host_required
,
include_dirs
,
init_rc
,
installable
,
ld_flags
,
licenses
,
link_dirs
,
lints
,
lto
,
min_sdk_version
,
multilib
,
native_bridge_supported
,
native_coverage
,
no_full_install
,
no_stdlibs
,
odm_available
,
odm_dlkm_specific
,
overrides
,
owner
,
prefer
,
prefer_rlib
,
proc_macros
,
product_available
,
product_specific
,
product_variables.arc
,
product_variables.build_from_text_stub
,
product_variables.debuggable
,
product_variables.eng
,
product_variables.malloc_low_memory
,
product_variables.native_coverage
,
product_variables.release_aidl_use_unfrozen
,
product_variables.selinuxignoreneverallows
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
ramdisk_available
,
recovery
,
recovery_available
,
relative_install_path
,
required
,
rlib
,
rlibs
,
rustlibs
,
sanitize
,
sdk_version
,
shared
,
shared_libs
,
soc_specific
,
static
,
static_libs
,
stdlibs
,
stem
,
strip
,
stubs
,
suffix
,
sysroot
,
system_dlkm_specific
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
use_expansive_default_srcs
,
use_generic_config
,
use_source_config_var
,
vendor
,
vendor_available
,
vendor_dlkm_specific
,
vendor_ramdisk
,
vendor_ramdisk_available
,
version_script
,
vintf_fragment_modules
,
vintf_fragments
,
visibility
,
whole_static_libs
name
string, The name of the module. Must be unique across all modules.
srcs
list of string, path to the source file that is the main entry point of the program (e.g. main.rs or lib.rs).
Only a single source file can be defined. Modules which generate source can be included by prefixing
the module name with ":", for example ":libfoo_bindgen"
If no source file is defined, a single generated source module can be defined to be used as the main source.
defaults
list of string
host_supported
bool, If set to true, build a variant of the module for the host. Defaults to false.
device_supported
bool, If set to true, build a variant of the module for the device. Defaults to true.
afdo
bool, Afdo allows developers self-service enroll for
automatic feedback-directed optimization using profile data.
aliases
list of string, Rust crate dependencies to rename. Each entry should be a string of the form "dependencyname:alias".
"dependencyname" here should be the name of the crate, not the Android module. This is
equivalent to writing `alias = { package = "dependencyname" }` in a `Cargo.toml`.
apex_available
list of string, Availability of this module in APEXes. Only the listed APEXes can contain this module. If
the module has stubs then other APEXes and the platform may access it through them
(subject to visibility).
"//apex_available:anyapex" is a pseudo APEX name that matches to any APEX.
"//apex_available:platform" refers to non-APEX partitions like "system.img".
Prefix pattern (com.foo.*) can be used to match with any APEX name with the prefix(com.foo.).
Default is ["//apex_available:platform"].
apex_exclude
bool, Deprecated - exclude this rust_ffi target from being included in APEXes.
TODO(b/362509506): remove this once all apex_exclude uses are switched to stubs.
arch
interface
bootstrap
bool, Allows this module to use non-APEX version of libraries. Useful
for building binaries that are started before APEXes are activated.
cargo_env_compat
bool, Enables emitting certain Cargo environment variables. Only intended to be used for compatibility purposes.
Will set CARGO_CRATE_NAME to the crate_name property's value.
Will set CARGO_BIN_NAME to the output filename value without the extension.
cargo_pkg_version
string, If cargo_env_compat is true, sets the CARGO_PKG_VERSION env var to this value.
cfgs
configurable list of string, list of configuration options to enable for this crate. To enable features, use the "features" property.
clippy_lints
string, name of the lint set that should be used to validate this module.
Possible values are "default" (for using a sensible set of lints
depending on the module's location), "android" (for the strictest
lint set that applies to all Android platform code), "vendor" (for a
relaxed set) and "none" (to disable the execution of clippy). The
default value is "default". See also the `lints` property.
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
crate_name
string, crate name, required for modules which produce Rust libraries: rust_library, rust_ffi and SourceProvider
modules which create library variants (rust_bindgen). This must be the expected extern crate name used in
source, and is required to conform to an enforced format matching library output files (if the output file is
lib<someName><suffix>, the crate_name property must be <someName>).
crate_root
string, Entry point that is passed to rustc to begin the compilation. E.g. main.rs or lib.rs.
When this property is set,
* sandboxing is enabled for this module, and
* the srcs attribute is interpreted as a list of all source files potentially
used in compilation, including the entrypoint, and
* compile_data can be used to add additional files used in compilation that
not directly used as source files.
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
prepend_artifact_with_product
bool, If true, then the artifact file will be prepended with <product name>-. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be coral-foo.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
double_loadable
bool, whether this module is capable of being loaded with other instance
(possibly an older version) of the same module in the same process.
Currently, a shared library that is a member of VNDK (vndk: {enabled: true})
can be double loaded in a vendor process if the library is also a
(direct and indirect) dependency of an LLNDK library. Such libraries must be
explicitly marked as `double_loadable: true` by the owner, or the dependency
from the LLNDK lib should be cut if the lib is not designed to be double loaded.
⊕dylib
VariantLibraryProperties
enabled
bool
srcs
list of string
edition
string, specific rust edition that should be used if the default version is not desired
enabled
configurable bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
exclude_from_recovery_snapshot
bool, Normally Soong uses the directory structure to decide which modules
should be included (framework) or excluded (non-framework) from the
different snapshots (vendor, recovery, etc.), but this property
allows a partner to exclude a module normally thought of as a
framework module from the recovery snapshot.
exclude_from_vendor_snapshot
bool, Normally Soong uses the directory structure to decide which modules
should be included (framework) or excluded (non-framework) from the
different snapshots (vendor, recovery, etc.), but this property
allows a partner to exclude a module normally thought of as a
framework module from the vendor snapshot.
export_include_dirs
list of string, path to include directories to export to cc_* modules, only relevant for static/shared variants.
features
configurable list of string, list of features to enable for this crate
flags
list of string, flags to pass to rustc. To enable configuration options or features, use the "cfgs" or "features" properties.
force_use_prebuilt
bool
host_cross_supported
bool, If set to true, build a variant of the module for the host cross. Defaults to true.
host_required
list of string, names of other modules to install on host if this module is installed
include_dirs
list of string, TODO: Remove this when all instances of Include_dirs have been removed from rust_ffi modules.
path to include directories to pass to cc_* modules, only relevant for static/shared variants (deprecated, use export_include_dirs instead).
init_rc
configurable list of string, init.rc files to be installed if this module is installed
installable
bool
ld_flags
list of string, flags to pass to the linker
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
link_dirs
list of string, directories containing associated rlib dependencies
lints
string, name of the lint set that should be used to validate this module.
Possible values are "default" (for using a sensible set of lints
depending on the module's location), "android" (for the strictest
lint set that applies to all Android platform code), "vendor" (for
a relaxed set) and "none" (for ignoring all lint warnings and
errors). The default value is "default".
⊕lto
Control whether LTO is used for the final (Rust) linkage. This does not impact
cross-language LTO.
thin
bool, Whether thin LTO should be enabled. By default this is true.
LTO provides such a large code size benefit for Rust, this should always
be enabled for production builds unless there's a clear need to disable it.
min_sdk_version
string, Minimum OS API level supported by this C or C++ module. This property becomes the value
of the __ANDROID_API__ macro. When the C or C++ module is included in an APEX or an APK,
this property is also used to ensure that the min_sdk_version of the containing module is
not older (i.e. less) than this module's min_sdk_version. When not set, this property
defaults to the value of sdk_version. When this is set to "apex_inherit", this tracks
min_sdk_version of the containing APEX. When the module
is not built for an APEX, "apex_inherit" defaults to sdk_version.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
native_coverage
bool
no_full_install
bool, When set to true, this module is not installed to the full install path (ex: under
out/target/product/<name>/<partition>). It can be installed only to the packaging
modules like android_filesystem.
no_stdlibs
bool, whether to suppress inclusion of standard crates - defaults to false
Default: true
odm_available
bool, This is the same as the "vendor_available" except that the install path
of the vendor variant is /odm or /vendor/odm.
By replacing "vendor_available: true" with "odm_available: true", the
module will install its vendor variant to the /odm partition or /vendor/odm.
As the modules with "odm_available: true" still create the vendor variants,
they can link to the other vendor modules as the vendor_available modules do.
Also, the vendor modules can link to odm_available modules.
It may not be used for VNDK modules.
odm_dlkm_specific
bool, Install to partition odm_dlkm when set to true.
overrides
list of string, List of module names that are prevented from being installed when this module gets
installed.
owner
string, vendor who owns this module
prefer
configurable bool, When prefer is set to true the prebuilt will be used instead of any source module with
a matching name.
prefer_rlib
bool, Change the rustlibs linkage to select rlib linkage by default for device targets.
Also link libstd as an rlib as well on device targets.
Note: This is the default behavior for host targets.
This is primarily meant for rust_binary and rust_ffi modules where the default
linkage of libstd might need to be overridden in some use cases. This should
generally be avoided with other module types since it may cause collisions at
linkage if all dependencies of the root binary module do not link against libstd
the same way.
proc_macros
configurable list of string, list of rust proc_macro crate dependencies
product_available
bool, whether this module should be allowed to be directly depended by other
modules with `product_specific: true` or `product_available: true`.
If set to true, an additional product variant will be built separately
that is limited to the set of libraries and headers that are exposed to
/product modules.
The product variant may be used with a different (newer) /system,
so it shouldn't have any unversioned runtime dependencies, or
make assumptions about the system that may not be true in the
future.
If set to false, this module becomes inaccessible from /product modules.
Different from the 'vendor_available' property, the modules with
vndk: {enabled: true} don't have to define 'product_available'. The VNDK
library without 'product_available' may not be depended on by any other
modules that has product variants including the product available VNDKs.
Nothing happens if BOARD_VNDK_VERSION isn't set in the BoardConfig.mk
and PRODUCT_PRODUCT_VNDK_VERSION isn't set.
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.arc
⊕include_dirs
⊕shared_libs
⊕static_libs
⊕srcs
⊕whole_static_libs
⊕product_variables.build_from_text_stub
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕strip.all
⊕strip.keep_symbols
⊕strip.keep_symbols_and_debug_frame
⊕static_libs
⊕whole_static_libs
⊕shared_libs
⊕srcs
⊕product_variables.eng
⊕product_variables.malloc_low_memory
⊕shared_libs
⊕whole_static_libs
⊕static_libs
⊕srcs
⊕product_variables.native_coverage
⊕product_variables.release_aidl_use_unfrozen
⊕required
⊕vintf_fragment_modules
⊕product_variables.selinuxignoreneverallows
⊕product_variables.unbundled_build
⊕enabled
Configurable[bool]
Configurable[bool]
proptools.Configurable[bool]
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
ramdisk_available
bool, Make this module available when building for ramdisk.
On device without a dedicated recovery partition, the module is only
available after switching root into
/first_stage_ramdisk. To expose the module before switching root, install
the recovery variant instead.
recovery
bool, Whether this module is installed to recovery partition
recovery_available
bool, Make this module available when building for recovery
relative_install_path
string, install to a subdirectory of the default install path for the module
required
configurable list of string, names of other modules to install if this module is installed
⊕rlib
VariantLibraryProperties
enabled
bool
srcs
list of string
rlibs
configurable list of string, list of rust rlib crate dependencies
rustlibs
configurable list of string, list of rust automatic crate dependencies.
Rustlibs linkage is rlib for host targets and dylib for device targets.
⊕sanitize
enable AddressSanitizer, HWAddressSanitizer, and others.
address
bool
hwaddress
bool
memtag_heap
bool, Memory-tagging, only available on arm64
if diag.memtag unset or false, enables async memory tagging
fuzzer
bool
never
bool
⊕diag
Sanitizers to run in the diagnostic mode (as opposed to the release mode).
Replaces abort() on error with a human-readable error message.
Address and Thread sanitizers always run in diagnostic mode.
memtag_heap
bool, Memory-tagging, only available on arm64
requires sanitizer.memtag: true
if set, enables sync memory tagging
sdk_version
string, The API level that this module is built against. The APIs of this API level will be
visible at build time, but use of any APIs newer than min_sdk_version will render the
module unloadable on older devices. In the future it will be possible to weakly-link new
APIs, making the behavior match Java: such modules will load on older devices, but
calling new APIs on devices that do not support them will result in a crash.
This property has the same behavior as sdk_version does for Java modules. For those
familiar with Android Gradle, the property behaves similarly to how compileSdkVersion
does for Java code.
In addition, setting this property causes two variants to be built, one for the platform
and one for apps.
⊕shared
VariantLibraryProperties
enabled
bool
srcs
list of string
shared_libs
configurable list of string, list of C shared library dependencies
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
⊕static
VariantLibraryProperties
enabled
bool
srcs
list of string
static_libs
configurable list of string, list of C static library dependencies. These dependencies do not normally propagate to dependents
and may need to be redeclared. See whole_static_libs for bundling static dependencies into a library.
stdlibs
configurable list of string, list of Rust system library dependencies.
This is usually only needed when `no_stdlibs` is true, in which case it can be used to depend on system crates
like `core` and `alloc`.
stem
string, sets name of the output
⊕strip
none
bool, Device modules default to stripping enabled leaving mini debuginfo.
Host modules default to stripping disabled, but can be enabled by setting any other
strip boolean property.
all
bool, all forces stripping everything, including the mini debug info.
keep_symbols
bool, keep_symbols enables stripping but keeps all symbols.
keep_symbols_list
list of string, keep_symbols_list specifies a list of symbols to keep if keep_symbols is enabled.
If it is unset then all symbols are kept.
keep_symbols_and_debug_frame
bool, keep_symbols_and_debug_frame enables stripping but keeps all symbols and debug frames.
⊕stubs
*ast.SelectorExpr
Generate stubs to make this library accessible to APEXes.
Can only be set for modules producing shared libraries.
symbol_file
string, Relative path to the symbol map. The symbol map provides the list of
symbols that are exported for stubs variant of this library.
versions
list of string, List versions to generate stubs libs for. The version name "current" is always
implicitly added.
implementation_installable
bool, Whether to not require the implementation of the library to be installed if a
client of the stubs is installed. Defaults to true; set to false if the
implementation is made available by some other means, e.g. in a Microdroid
virtual machine.
suffix
string, append to name of output
sysroot
bool, Whether this library is part of the Rust toolchain sysroot.
system_dlkm_specific
bool, Install to partition system_dlkm when set to true.
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
compile_multilib
string
enabled
bool
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
use_expansive_default_srcs
bool, Set this to true to use an expansive default set of source file requirements
(all .rs, .h, .xml, and .md files in the module tree).
This is primarily for tracking sources for RBE purposes. Currently defaults
to true, though this may change in the future.
use_generic_config
bool, Set to true if this module must be generic and does not require product-specific information.
To be included in the system image, this property must be set to true.
use_source_config_var
ConfigVarProperties, When specified this names a Soong config variable that controls the prefer property.
If the value of the named Soong config variable is true then prefer is set to false and vice
versa. If the Soong config variable is not set then it defaults to false, so prefer defaults
to true.
If specified then the prefer property is ignored in favor of the value of the Soong config
variable.
DEPRECATED: This property is being deprecated b/308188211.
Use RELEASE_APEX_CONTRIBUTIONS build flags to select prebuilts of mainline modules.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_available
bool, whether this module should be allowed to be directly depended by other
modules with `vendor: true`, `proprietary: true`, or `vendor_available:true`.
If set to true, two variants will be built separately, one like
normal, and the other limited to the set of libraries and headers
that are exposed to /vendor modules.
The vendor variant may be used with a different (newer) /system,
so it shouldn't have any unversioned runtime dependencies, or
make assumptions about the system that may not be true in the
future.
If set to false, this module becomes inaccessible from /vendor modules.
The modules with vndk: {enabled: true} must define 'vendor_available'
to 'true'.
Nothing happens if BOARD_VNDK_VERSION isn't set in the BoardConfig.mk
vendor_dlkm_specific
bool, Install to partition vendor_dlkm when set to true.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vendor_ramdisk_available
bool, Make this module available when building for vendor ramdisk.
On device without a dedicated recovery partition, the module is only
available after switching root into
/first_stage_ramdisk. To expose the module before switching root, install
the recovery variant instead
version_script
string, Version script to pass to the linker. By default this will replace the
implicit rustc emitted version script to mirror expected behavior in CC.
This is only relevant for rust_ffi_shared modules which are exposing a
versioned C API.
vintf_fragment_modules
configurable list of string, vintf_fragment Modules required from this module.
vintf_fragments
configurable list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
whole_static_libs
configurable list of string, Similar to static_libs, but will bundle the static library dependency into a library. This is helpful
to avoid having to redeclare the dependency for dependents of this library, but in some cases may also
result in bloat if multiple dependencies all include the same static library whole.
The common use case for this is when the static library is unlikely to be a dependency of other modules to avoid
having to redeclare the static library dependency for every dependent module.
If you are not sure what to, for rust_library modules most static dependencies should go in static_libraries,
and for rust_ffi modules most static dependencies should go into whole_static_libraries.
For rust_ffi static variants, these libraries will be included in the resulting static library archive.
For rust_library rlib variants, these libraries will be bundled into the resulting rlib library. This will
include all of the static libraries symbols in any dylibs or binaries which use this rlib as well.
rust_prebuilt_proc_macro
name
,
srcs
,
defaults
,
afdo
,
aliases
,
apex_available
,
arch
,
bootstrap
,
cargo_env_compat
,
cargo_pkg_version
,
cfgs
,
clippy_lints
,
compile_multilib
,
crate_name
,
crate_root
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
double_loadable
,
edition
,
enabled
,
exclude_from_recovery_snapshot
,
exclude_from_vendor_snapshot
,
features
,
flags
,
force_use_prebuilt
,
host_required
,
init_rc
,
installable
,
ld_flags
,
licenses
,
link_dirs
,
lints
,
lto
,
min_sdk_version
,
multilib
,
native_bridge_supported
,
native_coverage
,
no_full_install
,
no_stdlibs
,
odm_available
,
odm_dlkm_specific
,
overrides
,
owner
,
prefer
,
prefer_rlib
,
proc_macros
,
product_available
,
product_specific
,
product_variables.arc
,
product_variables.build_from_text_stub
,
product_variables.debuggable
,
product_variables.malloc_low_memory
,
product_variables.native_coverage
,
product_variables.release_aidl_use_unfrozen
,
product_variables.selinuxignoreneverallows
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
ramdisk_available
,
recovery
,
recovery_available
,
relative_install_path
,
required
,
rlibs
,
rustlibs
,
sdk_version
,
shared_libs
,
soc_specific
,
static_libs
,
stdlibs
,
stem
,
suffix
,
system_dlkm_specific
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
use_expansive_default_srcs
,
use_generic_config
,
use_source_config_var
,
vendor
,
vendor_available
,
vendor_dlkm_specific
,
vendor_ramdisk
,
vendor_ramdisk_available
,
vintf_fragment_modules
,
vintf_fragments
,
visibility
,
whole_static_libs
name
string, The name of the module. Must be unique across all modules.
srcs
list of string, path to the prebuilt file
defaults
list of string
afdo
bool, Afdo allows developers self-service enroll for
automatic feedback-directed optimization using profile data.
aliases
list of string, Rust crate dependencies to rename. Each entry should be a string of the form "dependencyname:alias".
"dependencyname" here should be the name of the crate, not the Android module. This is
equivalent to writing `alias = { package = "dependencyname" }` in a `Cargo.toml`.
apex_available
list of string, Availability of this module in APEXes. Only the listed APEXes can contain this module. If
the module has stubs then other APEXes and the platform may access it through them
(subject to visibility).
"//apex_available:anyapex" is a pseudo APEX name that matches to any APEX.
"//apex_available:platform" refers to non-APEX partitions like "system.img".
Prefix pattern (com.foo.*) can be used to match with any APEX name with the prefix(com.foo.).
Default is ["//apex_available:platform"].
arch
interface
bootstrap
bool, Allows this module to use non-APEX version of libraries. Useful
for building binaries that are started before APEXes are activated.
cargo_env_compat
bool, Enables emitting certain Cargo environment variables. Only intended to be used for compatibility purposes.
Will set CARGO_CRATE_NAME to the crate_name property's value.
Will set CARGO_BIN_NAME to the output filename value without the extension.
cargo_pkg_version
string, If cargo_env_compat is true, sets the CARGO_PKG_VERSION env var to this value.
cfgs
configurable list of string, list of configuration options to enable for this crate. To enable features, use the "features" property.
clippy_lints
string, name of the lint set that should be used to validate this module.
Possible values are "default" (for using a sensible set of lints
depending on the module's location), "android" (for the strictest
lint set that applies to all Android platform code), "vendor" (for a
relaxed set) and "none" (to disable the execution of clippy). The
default value is "default". See also the `lints` property.
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
crate_name
string, crate name, required for modules which produce Rust libraries: rust_library, rust_ffi and SourceProvider
modules which create library variants (rust_bindgen). This must be the expected extern crate name used in
source, and is required to conform to an enforced format matching library output files (if the output file is
lib<someName><suffix>, the crate_name property must be <someName>).
crate_root
string, Entry point that is passed to rustc to begin the compilation. E.g. main.rs or lib.rs.
When this property is set,
* sandboxing is enabled for this module, and
* the srcs attribute is interpreted as a list of all source files potentially
used in compilation, including the entrypoint, and
* compile_data can be used to add additional files used in compilation that
not directly used as source files.
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
prepend_artifact_with_product
bool, If true, then the artifact file will be prepended with <product name>-. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be coral-foo.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
double_loadable
bool, whether this module is capable of being loaded with other instance
(possibly an older version) of the same module in the same process.
Currently, a shared library that is a member of VNDK (vndk: {enabled: true})
can be double loaded in a vendor process if the library is also a
(direct and indirect) dependency of an LLNDK library. Such libraries must be
explicitly marked as `double_loadable: true` by the owner, or the dependency
from the LLNDK lib should be cut if the lib is not designed to be double loaded.
edition
string, specific rust edition that should be used if the default version is not desired
enabled
configurable bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
exclude_from_recovery_snapshot
bool, Normally Soong uses the directory structure to decide which modules
should be included (framework) or excluded (non-framework) from the
different snapshots (vendor, recovery, etc.), but this property
allows a partner to exclude a module normally thought of as a
framework module from the recovery snapshot.
exclude_from_vendor_snapshot
bool, Normally Soong uses the directory structure to decide which modules
should be included (framework) or excluded (non-framework) from the
different snapshots (vendor, recovery, etc.), but this property
allows a partner to exclude a module normally thought of as a
framework module from the vendor snapshot.
features
configurable list of string, list of features to enable for this crate
flags
list of string, flags to pass to rustc. To enable configuration options or features, use the "cfgs" or "features" properties.
force_use_prebuilt
bool
host_required
list of string, names of other modules to install on host if this module is installed
init_rc
configurable list of string, init.rc files to be installed if this module is installed
installable
bool
ld_flags
list of string, flags to pass to the linker
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
link_dirs
list of string, directories containing associated rlib dependencies
lints
string, name of the lint set that should be used to validate this module.
Possible values are "default" (for using a sensible set of lints
depending on the module's location), "android" (for the strictest
lint set that applies to all Android platform code), "vendor" (for
a relaxed set) and "none" (for ignoring all lint warnings and
errors). The default value is "default".
⊕lto
Control whether LTO is used for the final (Rust) linkage. This does not impact
cross-language LTO.
thin
bool, Whether thin LTO should be enabled. By default this is true.
LTO provides such a large code size benefit for Rust, this should always
be enabled for production builds unless there's a clear need to disable it.
min_sdk_version
string, Minimum OS API level supported by this C or C++ module. This property becomes the value
of the __ANDROID_API__ macro. When the C or C++ module is included in an APEX or an APK,
this property is also used to ensure that the min_sdk_version of the containing module is
not older (i.e. less) than this module's min_sdk_version. When not set, this property
defaults to the value of sdk_version. When this is set to "apex_inherit", this tracks
min_sdk_version of the containing APEX. When the module
is not built for an APEX, "apex_inherit" defaults to sdk_version.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
native_coverage
bool
no_full_install
bool, When set to true, this module is not installed to the full install path (ex: under
out/target/product/<name>/<partition>). It can be installed only to the packaging
modules like android_filesystem.
no_stdlibs
bool, whether to suppress inclusion of standard crates - defaults to false
odm_available
bool, This is the same as the "vendor_available" except that the install path
of the vendor variant is /odm or /vendor/odm.
By replacing "vendor_available: true" with "odm_available: true", the
module will install its vendor variant to the /odm partition or /vendor/odm.
As the modules with "odm_available: true" still create the vendor variants,
they can link to the other vendor modules as the vendor_available modules do.
Also, the vendor modules can link to odm_available modules.
It may not be used for VNDK modules.
odm_dlkm_specific
bool, Install to partition odm_dlkm when set to true.
overrides
list of string, List of module names that are prevented from being installed when this module gets
installed.
owner
string, vendor who owns this module
prefer
configurable bool, When prefer is set to true the prebuilt will be used instead of any source module with
a matching name.
prefer_rlib
bool, Change the rustlibs linkage to select rlib linkage by default for device targets.
Also link libstd as an rlib as well on device targets.
Note: This is the default behavior for host targets.
This is primarily meant for rust_binary and rust_ffi modules where the default
linkage of libstd might need to be overridden in some use cases. This should
generally be avoided with other module types since it may cause collisions at
linkage if all dependencies of the root binary module do not link against libstd
the same way.
proc_macros
configurable list of string, list of rust proc_macro crate dependencies
product_available
bool, whether this module should be allowed to be directly depended by other
modules with `product_specific: true` or `product_available: true`.
If set to true, an additional product variant will be built separately
that is limited to the set of libraries and headers that are exposed to
/product modules.
The product variant may be used with a different (newer) /system,
so it shouldn't have any unversioned runtime dependencies, or
make assumptions about the system that may not be true in the
future.
If set to false, this module becomes inaccessible from /product modules.
Different from the 'vendor_available' property, the modules with
vndk: {enabled: true} don't have to define 'product_available'. The VNDK
library without 'product_available' may not be depended on by any other
modules that has product variants including the product available VNDKs.
Nothing happens if BOARD_VNDK_VERSION isn't set in the BoardConfig.mk
and PRODUCT_PRODUCT_VNDK_VERSION isn't set.
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.arc
⊕shared_libs
⊕static_libs
⊕srcs
⊕whole_static_libs
⊕product_variables.build_from_text_stub
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕static_libs
⊕whole_static_libs
⊕shared_libs
⊕srcs
⊕product_variables.malloc_low_memory
⊕shared_libs
⊕whole_static_libs
⊕static_libs
⊕srcs
⊕product_variables.native_coverage
⊕product_variables.release_aidl_use_unfrozen
⊕required
⊕vintf_fragment_modules
⊕product_variables.selinuxignoreneverallows
⊕product_variables.unbundled_build
⊕enabled
Configurable[bool]
Configurable[bool]
proptools.Configurable[bool]
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
ramdisk_available
bool, Make this module available when building for ramdisk.
On device without a dedicated recovery partition, the module is only
available after switching root into
/first_stage_ramdisk. To expose the module before switching root, install
the recovery variant instead.
recovery
bool, Whether this module is installed to recovery partition
recovery_available
bool, Make this module available when building for recovery
relative_install_path
string, install to a subdirectory of the default install path for the module
required
configurable list of string, names of other modules to install if this module is installed
rlibs
configurable list of string, list of rust rlib crate dependencies
rustlibs
configurable list of string, list of rust automatic crate dependencies.
Rustlibs linkage is rlib for host targets and dylib for device targets.
sdk_version
string, The API level that this module is built against. The APIs of this API level will be
visible at build time, but use of any APIs newer than min_sdk_version will render the
module unloadable on older devices. In the future it will be possible to weakly-link new
APIs, making the behavior match Java: such modules will load on older devices, but
calling new APIs on devices that do not support them will result in a crash.
This property has the same behavior as sdk_version does for Java modules. For those
familiar with Android Gradle, the property behaves similarly to how compileSdkVersion
does for Java code.
In addition, setting this property causes two variants to be built, one for the platform
and one for apps.
shared_libs
configurable list of string, list of C shared library dependencies
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
static_libs
configurable list of string, list of C static library dependencies. These dependencies do not normally propagate to dependents
and may need to be redeclared. See whole_static_libs for bundling static dependencies into a library.
stdlibs
configurable list of string, list of Rust system library dependencies.
This is usually only needed when `no_stdlibs` is true, in which case it can be used to depend on system crates
like `core` and `alloc`.
stem
string, sets name of the output
suffix
string, append to name of output
system_dlkm_specific
bool, Install to partition system_dlkm when set to true.
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
compile_multilib
string
enabled
bool
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
use_expansive_default_srcs
bool, Set this to true to use an expansive default set of source file requirements
(all .rs, .h, .xml, and .md files in the module tree).
This is primarily for tracking sources for RBE purposes. Currently defaults
to true, though this may change in the future.
use_generic_config
bool, Set to true if this module must be generic and does not require product-specific information.
To be included in the system image, this property must be set to true.
use_source_config_var
ConfigVarProperties, When specified this names a Soong config variable that controls the prefer property.
If the value of the named Soong config variable is true then prefer is set to false and vice
versa. If the Soong config variable is not set then it defaults to false, so prefer defaults
to true.
If specified then the prefer property is ignored in favor of the value of the Soong config
variable.
DEPRECATED: This property is being deprecated b/308188211.
Use RELEASE_APEX_CONTRIBUTIONS build flags to select prebuilts of mainline modules.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_available
bool, whether this module should be allowed to be directly depended by other
modules with `vendor: true`, `proprietary: true`, or `vendor_available:true`.
If set to true, two variants will be built separately, one like
normal, and the other limited to the set of libraries and headers
that are exposed to /vendor modules.
The vendor variant may be used with a different (newer) /system,
so it shouldn't have any unversioned runtime dependencies, or
make assumptions about the system that may not be true in the
future.
If set to false, this module becomes inaccessible from /vendor modules.
The modules with vndk: {enabled: true} must define 'vendor_available'
to 'true'.
Nothing happens if BOARD_VNDK_VERSION isn't set in the BoardConfig.mk
vendor_dlkm_specific
bool, Install to partition vendor_dlkm when set to true.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vendor_ramdisk_available
bool, Make this module available when building for vendor ramdisk.
On device without a dedicated recovery partition, the module is only
available after switching root into
/first_stage_ramdisk. To expose the module before switching root, install
the recovery variant instead
vintf_fragment_modules
configurable list of string, vintf_fragment Modules required from this module.
vintf_fragments
configurable list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
whole_static_libs
configurable list of string, Similar to static_libs, but will bundle the static library dependency into a library. This is helpful
to avoid having to redeclare the dependency for dependents of this library, but in some cases may also
result in bloat if multiple dependencies all include the same static library whole.
The common use case for this is when the static library is unlikely to be a dependency of other modules to avoid
having to redeclare the static library dependency for every dependent module.
If you are not sure what to, for rust_library modules most static dependencies should go in static_libraries,
and for rust_ffi modules most static dependencies should go into whole_static_libraries.
For rust_ffi static variants, these libraries will be included in the resulting static library archive.
For rust_library rlib variants, these libraries will be bundled into the resulting rlib library. This will
include all of the static libraries symbols in any dylibs or binaries which use this rlib as well.
rust_prebuilt_rlib
name
,
srcs
,
defaults
,
host_supported
,
device_supported
,
afdo
,
aliases
,
apex_available
,
apex_exclude
,
arch
,
bootstrap
,
cargo_env_compat
,
cargo_pkg_version
,
cfgs
,
clippy_lints
,
compile_multilib
,
crate_name
,
crate_root
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
double_loadable
,
dylib
,
edition
,
enabled
,
exclude_from_recovery_snapshot
,
exclude_from_vendor_snapshot
,
export_include_dirs
,
extra_exported_symbols
,
features
,
flags
,
force_use_prebuilt
,
host_cross_supported
,
host_required
,
include_dirs
,
init_rc
,
installable
,
ld_flags
,
licenses
,
link_dirs
,
lints
,
lto
,
min_sdk_version
,
multilib
,
native_bridge_supported
,
native_coverage
,
no_full_install
,
no_stdlibs
,
odm_available
,
odm_dlkm_specific
,
overrides
,
owner
,
prefer
,
prefer_rlib
,
proc_macros
,
product_available
,
product_specific
,
product_variables.arc
,
product_variables.build_from_text_stub
,
product_variables.debuggable
,
product_variables.eng
,
product_variables.malloc_low_memory
,
product_variables.native_coverage
,
product_variables.release_aidl_use_unfrozen
,
product_variables.selinuxignoreneverallows
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
ramdisk_available
,
recovery
,
recovery_available
,
relative_install_path
,
required
,
rlib
,
rlibs
,
rustlibs
,
sanitize
,
sdk_version
,
shared
,
shared_libs
,
soc_specific
,
static
,
static_libs
,
stdlibs
,
stem
,
strip
,
stubs
,
suffix
,
sysroot
,
system_dlkm_specific
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
use_expansive_default_srcs
,
use_generic_config
,
use_source_config_var
,
vendor
,
vendor_available
,
vendor_dlkm_specific
,
vendor_ramdisk
,
vendor_ramdisk_available
,
version_script
,
vintf_fragment_modules
,
vintf_fragments
,
visibility
,
whole_static_libs
name
string, The name of the module. Must be unique across all modules.
srcs
list of string, path to the source file that is the main entry point of the program (e.g. main.rs or lib.rs).
Only a single source file can be defined. Modules which generate source can be included by prefixing
the module name with ":", for example ":libfoo_bindgen"
If no source file is defined, a single generated source module can be defined to be used as the main source.
defaults
list of string
host_supported
bool, If set to true, build a variant of the module for the host. Defaults to false.
device_supported
bool, If set to true, build a variant of the module for the device. Defaults to true.
afdo
bool, Afdo allows developers self-service enroll for
automatic feedback-directed optimization using profile data.
aliases
list of string, Rust crate dependencies to rename. Each entry should be a string of the form "dependencyname:alias".
"dependencyname" here should be the name of the crate, not the Android module. This is
equivalent to writing `alias = { package = "dependencyname" }` in a `Cargo.toml`.
apex_available
list of string, Availability of this module in APEXes. Only the listed APEXes can contain this module. If
the module has stubs then other APEXes and the platform may access it through them
(subject to visibility).
"//apex_available:anyapex" is a pseudo APEX name that matches to any APEX.
"//apex_available:platform" refers to non-APEX partitions like "system.img".
Prefix pattern (com.foo.*) can be used to match with any APEX name with the prefix(com.foo.).
Default is ["//apex_available:platform"].
apex_exclude
bool, Deprecated - exclude this rust_ffi target from being included in APEXes.
TODO(b/362509506): remove this once all apex_exclude uses are switched to stubs.
arch
interface
bootstrap
bool, Allows this module to use non-APEX version of libraries. Useful
for building binaries that are started before APEXes are activated.
cargo_env_compat
bool, Enables emitting certain Cargo environment variables. Only intended to be used for compatibility purposes.
Will set CARGO_CRATE_NAME to the crate_name property's value.
Will set CARGO_BIN_NAME to the output filename value without the extension.
cargo_pkg_version
string, If cargo_env_compat is true, sets the CARGO_PKG_VERSION env var to this value.
cfgs
configurable list of string, list of configuration options to enable for this crate. To enable features, use the "features" property.
clippy_lints
string, name of the lint set that should be used to validate this module.
Possible values are "default" (for using a sensible set of lints
depending on the module's location), "android" (for the strictest
lint set that applies to all Android platform code), "vendor" (for a
relaxed set) and "none" (to disable the execution of clippy). The
default value is "default". See also the `lints` property.
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
crate_name
string, crate name, required for modules which produce Rust libraries: rust_library, rust_ffi and SourceProvider
modules which create library variants (rust_bindgen). This must be the expected extern crate name used in
source, and is required to conform to an enforced format matching library output files (if the output file is
lib<someName><suffix>, the crate_name property must be <someName>).
crate_root
string, Entry point that is passed to rustc to begin the compilation. E.g. main.rs or lib.rs.
When this property is set,
* sandboxing is enabled for this module, and
* the srcs attribute is interpreted as a list of all source files potentially
used in compilation, including the entrypoint, and
* compile_data can be used to add additional files used in compilation that
not directly used as source files.
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
prepend_artifact_with_product
bool, If true, then the artifact file will be prepended with <product name>-. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be coral-foo.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
double_loadable
bool, whether this module is capable of being loaded with other instance
(possibly an older version) of the same module in the same process.
Currently, a shared library that is a member of VNDK (vndk: {enabled: true})
can be double loaded in a vendor process if the library is also a
(direct and indirect) dependency of an LLNDK library. Such libraries must be
explicitly marked as `double_loadable: true` by the owner, or the dependency
from the LLNDK lib should be cut if the lib is not designed to be double loaded.
⊕dylib
VariantLibraryProperties
enabled
bool
srcs
list of string
edition
string, specific rust edition that should be used if the default version is not desired
enabled
configurable bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
exclude_from_recovery_snapshot
bool, Normally Soong uses the directory structure to decide which modules
should be included (framework) or excluded (non-framework) from the
different snapshots (vendor, recovery, etc.), but this property
allows a partner to exclude a module normally thought of as a
framework module from the recovery snapshot.
exclude_from_vendor_snapshot
bool, Normally Soong uses the directory structure to decide which modules
should be included (framework) or excluded (non-framework) from the
different snapshots (vendor, recovery, etc.), but this property
allows a partner to exclude a module normally thought of as a
framework module from the vendor snapshot.
export_include_dirs
list of string, path to include directories to export to cc_* modules, only relevant for static/shared variants.
features
configurable list of string, list of features to enable for this crate
flags
list of string, flags to pass to rustc. To enable configuration options or features, use the "cfgs" or "features" properties.
force_use_prebuilt
bool
host_cross_supported
bool, If set to true, build a variant of the module for the host cross. Defaults to true.
host_required
list of string, names of other modules to install on host if this module is installed
include_dirs
list of string, TODO: Remove this when all instances of Include_dirs have been removed from rust_ffi modules.
path to include directories to pass to cc_* modules, only relevant for static/shared variants (deprecated, use export_include_dirs instead).
init_rc
configurable list of string, init.rc files to be installed if this module is installed
installable
bool
ld_flags
list of string, flags to pass to the linker
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
link_dirs
list of string, directories containing associated rlib dependencies
lints
string, name of the lint set that should be used to validate this module.
Possible values are "default" (for using a sensible set of lints
depending on the module's location), "android" (for the strictest
lint set that applies to all Android platform code), "vendor" (for
a relaxed set) and "none" (for ignoring all lint warnings and
errors). The default value is "default".
⊕lto
Control whether LTO is used for the final (Rust) linkage. This does not impact
cross-language LTO.
thin
bool, Whether thin LTO should be enabled. By default this is true.
LTO provides such a large code size benefit for Rust, this should always
be enabled for production builds unless there's a clear need to disable it.
min_sdk_version
string, Minimum OS API level supported by this C or C++ module. This property becomes the value
of the __ANDROID_API__ macro. When the C or C++ module is included in an APEX or an APK,
this property is also used to ensure that the min_sdk_version of the containing module is
not older (i.e. less) than this module's min_sdk_version. When not set, this property
defaults to the value of sdk_version. When this is set to "apex_inherit", this tracks
min_sdk_version of the containing APEX. When the module
is not built for an APEX, "apex_inherit" defaults to sdk_version.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
native_coverage
bool
no_full_install
bool, When set to true, this module is not installed to the full install path (ex: under
out/target/product/<name>/<partition>). It can be installed only to the packaging
modules like android_filesystem.
no_stdlibs
bool, whether to suppress inclusion of standard crates - defaults to false
Default: true
odm_available
bool, This is the same as the "vendor_available" except that the install path
of the vendor variant is /odm or /vendor/odm.
By replacing "vendor_available: true" with "odm_available: true", the
module will install its vendor variant to the /odm partition or /vendor/odm.
As the modules with "odm_available: true" still create the vendor variants,
they can link to the other vendor modules as the vendor_available modules do.
Also, the vendor modules can link to odm_available modules.
It may not be used for VNDK modules.
odm_dlkm_specific
bool, Install to partition odm_dlkm when set to true.
overrides
list of string, List of module names that are prevented from being installed when this module gets
installed.
owner
string, vendor who owns this module
prefer
configurable bool, When prefer is set to true the prebuilt will be used instead of any source module with
a matching name.
prefer_rlib
bool, Change the rustlibs linkage to select rlib linkage by default for device targets.
Also link libstd as an rlib as well on device targets.
Note: This is the default behavior for host targets.
This is primarily meant for rust_binary and rust_ffi modules where the default
linkage of libstd might need to be overridden in some use cases. This should
generally be avoided with other module types since it may cause collisions at
linkage if all dependencies of the root binary module do not link against libstd
the same way.
proc_macros
configurable list of string, list of rust proc_macro crate dependencies
product_available
bool, whether this module should be allowed to be directly depended by other
modules with `product_specific: true` or `product_available: true`.
If set to true, an additional product variant will be built separately
that is limited to the set of libraries and headers that are exposed to
/product modules.
The product variant may be used with a different (newer) /system,
so it shouldn't have any unversioned runtime dependencies, or
make assumptions about the system that may not be true in the
future.
If set to false, this module becomes inaccessible from /product modules.
Different from the 'vendor_available' property, the modules with
vndk: {enabled: true} don't have to define 'product_available'. The VNDK
library without 'product_available' may not be depended on by any other
modules that has product variants including the product available VNDKs.
Nothing happens if BOARD_VNDK_VERSION isn't set in the BoardConfig.mk
and PRODUCT_PRODUCT_VNDK_VERSION isn't set.
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.arc
⊕include_dirs
⊕shared_libs
⊕static_libs
⊕srcs
⊕whole_static_libs
⊕product_variables.build_from_text_stub
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕strip.all
⊕strip.keep_symbols
⊕strip.keep_symbols_and_debug_frame
⊕static_libs
⊕whole_static_libs
⊕shared_libs
⊕srcs
⊕product_variables.eng
⊕product_variables.malloc_low_memory
⊕shared_libs
⊕whole_static_libs
⊕static_libs
⊕srcs
⊕product_variables.native_coverage
⊕product_variables.release_aidl_use_unfrozen
⊕required
⊕vintf_fragment_modules
⊕product_variables.selinuxignoreneverallows
⊕product_variables.unbundled_build
⊕enabled
Configurable[bool]
Configurable[bool]
proptools.Configurable[bool]
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
ramdisk_available
bool, Make this module available when building for ramdisk.
On device without a dedicated recovery partition, the module is only
available after switching root into
/first_stage_ramdisk. To expose the module before switching root, install
the recovery variant instead.
recovery
bool, Whether this module is installed to recovery partition
recovery_available
bool, Make this module available when building for recovery
relative_install_path
string, install to a subdirectory of the default install path for the module
required
configurable list of string, names of other modules to install if this module is installed
⊕rlib
VariantLibraryProperties
enabled
bool
srcs
list of string
rlibs
configurable list of string, list of rust rlib crate dependencies
rustlibs
configurable list of string, list of rust automatic crate dependencies.
Rustlibs linkage is rlib for host targets and dylib for device targets.
⊕sanitize
enable AddressSanitizer, HWAddressSanitizer, and others.
address
bool
hwaddress
bool
memtag_heap
bool, Memory-tagging, only available on arm64
if diag.memtag unset or false, enables async memory tagging
fuzzer
bool
never
bool
⊕diag
Sanitizers to run in the diagnostic mode (as opposed to the release mode).
Replaces abort() on error with a human-readable error message.
Address and Thread sanitizers always run in diagnostic mode.
memtag_heap
bool, Memory-tagging, only available on arm64
requires sanitizer.memtag: true
if set, enables sync memory tagging
sdk_version
string, The API level that this module is built against. The APIs of this API level will be
visible at build time, but use of any APIs newer than min_sdk_version will render the
module unloadable on older devices. In the future it will be possible to weakly-link new
APIs, making the behavior match Java: such modules will load on older devices, but
calling new APIs on devices that do not support them will result in a crash.
This property has the same behavior as sdk_version does for Java modules. For those
familiar with Android Gradle, the property behaves similarly to how compileSdkVersion
does for Java code.
In addition, setting this property causes two variants to be built, one for the platform
and one for apps.
⊕shared
VariantLibraryProperties
enabled
bool
srcs
list of string
shared_libs
configurable list of string, list of C shared library dependencies
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
⊕static
VariantLibraryProperties
enabled
bool
srcs
list of string
static_libs
configurable list of string, list of C static library dependencies. These dependencies do not normally propagate to dependents
and may need to be redeclared. See whole_static_libs for bundling static dependencies into a library.
stdlibs
configurable list of string, list of Rust system library dependencies.
This is usually only needed when `no_stdlibs` is true, in which case it can be used to depend on system crates
like `core` and `alloc`.
stem
string, sets name of the output
⊕strip
none
bool, Device modules default to stripping enabled leaving mini debuginfo.
Host modules default to stripping disabled, but can be enabled by setting any other
strip boolean property.
all
bool, all forces stripping everything, including the mini debug info.
keep_symbols
bool, keep_symbols enables stripping but keeps all symbols.
keep_symbols_list
list of string, keep_symbols_list specifies a list of symbols to keep if keep_symbols is enabled.
If it is unset then all symbols are kept.
keep_symbols_and_debug_frame
bool, keep_symbols_and_debug_frame enables stripping but keeps all symbols and debug frames.
⊕stubs
*ast.SelectorExpr
Generate stubs to make this library accessible to APEXes.
Can only be set for modules producing shared libraries.
symbol_file
string, Relative path to the symbol map. The symbol map provides the list of
symbols that are exported for stubs variant of this library.
versions
list of string, List versions to generate stubs libs for. The version name "current" is always
implicitly added.
implementation_installable
bool, Whether to not require the implementation of the library to be installed if a
client of the stubs is installed. Defaults to true; set to false if the
implementation is made available by some other means, e.g. in a Microdroid
virtual machine.
suffix
string, append to name of output
sysroot
bool, Whether this library is part of the Rust toolchain sysroot.
system_dlkm_specific
bool, Install to partition system_dlkm when set to true.
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
compile_multilib
string
enabled
bool
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
use_expansive_default_srcs
bool, Set this to true to use an expansive default set of source file requirements
(all .rs, .h, .xml, and .md files in the module tree).
This is primarily for tracking sources for RBE purposes. Currently defaults
to true, though this may change in the future.
use_generic_config
bool, Set to true if this module must be generic and does not require product-specific information.
To be included in the system image, this property must be set to true.
use_source_config_var
ConfigVarProperties, When specified this names a Soong config variable that controls the prefer property.
If the value of the named Soong config variable is true then prefer is set to false and vice
versa. If the Soong config variable is not set then it defaults to false, so prefer defaults
to true.
If specified then the prefer property is ignored in favor of the value of the Soong config
variable.
DEPRECATED: This property is being deprecated b/308188211.
Use RELEASE_APEX_CONTRIBUTIONS build flags to select prebuilts of mainline modules.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_available
bool, whether this module should be allowed to be directly depended by other
modules with `vendor: true`, `proprietary: true`, or `vendor_available:true`.
If set to true, two variants will be built separately, one like
normal, and the other limited to the set of libraries and headers
that are exposed to /vendor modules.
The vendor variant may be used with a different (newer) /system,
so it shouldn't have any unversioned runtime dependencies, or
make assumptions about the system that may not be true in the
future.
If set to false, this module becomes inaccessible from /vendor modules.
The modules with vndk: {enabled: true} must define 'vendor_available'
to 'true'.
Nothing happens if BOARD_VNDK_VERSION isn't set in the BoardConfig.mk
vendor_dlkm_specific
bool, Install to partition vendor_dlkm when set to true.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vendor_ramdisk_available
bool, Make this module available when building for vendor ramdisk.
On device without a dedicated recovery partition, the module is only
available after switching root into
/first_stage_ramdisk. To expose the module before switching root, install
the recovery variant instead
version_script
string, Version script to pass to the linker. By default this will replace the
implicit rustc emitted version script to mirror expected behavior in CC.
This is only relevant for rust_ffi_shared modules which are exposing a
versioned C API.
vintf_fragment_modules
configurable list of string, vintf_fragment Modules required from this module.
vintf_fragments
configurable list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
whole_static_libs
configurable list of string, Similar to static_libs, but will bundle the static library dependency into a library. This is helpful
to avoid having to redeclare the dependency for dependents of this library, but in some cases may also
result in bloat if multiple dependencies all include the same static library whole.
The common use case for this is when the static library is unlikely to be a dependency of other modules to avoid
having to redeclare the static library dependency for every dependent module.
If you are not sure what to, for rust_library modules most static dependencies should go in static_libraries,
and for rust_ffi modules most static dependencies should go into whole_static_libraries.
For rust_ffi static variants, these libraries will be included in the resulting static library archive.
For rust_library rlib variants, these libraries will be bundled into the resulting rlib library. This will
include all of the static libraries symbols in any dylibs or binaries which use this rlib as well.
rust_proc_macro
name
,
srcs
,
defaults
,
afdo
,
aliases
,
apex_available
,
arch
,
bootstrap
,
cargo_env_compat
,
cargo_pkg_version
,
cfgs
,
clippy_lints
,
compile_multilib
,
crate_name
,
crate_root
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
double_loadable
,
edition
,
enabled
,
exclude_from_recovery_snapshot
,
exclude_from_vendor_snapshot
,
features
,
flags
,
host_required
,
init_rc
,
installable
,
ld_flags
,
licenses
,
lints
,
lto
,
min_sdk_version
,
multilib
,
native_bridge_supported
,
native_coverage
,
no_full_install
,
no_stdlibs
,
odm_available
,
odm_dlkm_specific
,
overrides
,
owner
,
prefer_rlib
,
proc_macros
,
product_available
,
product_specific
,
product_variables.arc
,
product_variables.build_from_text_stub
,
product_variables.debuggable
,
product_variables.malloc_low_memory
,
product_variables.native_coverage
,
product_variables.release_aidl_use_unfrozen
,
product_variables.selinuxignoreneverallows
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
ramdisk_available
,
recovery
,
recovery_available
,
relative_install_path
,
required
,
rlibs
,
rustlibs
,
sdk_version
,
shared_libs
,
soc_specific
,
static_libs
,
stdlibs
,
stem
,
suffix
,
system_dlkm_specific
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
use_expansive_default_srcs
,
use_generic_config
,
vendor
,
vendor_available
,
vendor_dlkm_specific
,
vendor_ramdisk
,
vendor_ramdisk_available
,
vintf_fragment_modules
,
vintf_fragments
,
visibility
,
whole_static_libs
name
string, The name of the module. Must be unique across all modules.
srcs
list of string, path to the source file that is the main entry point of the program (e.g. main.rs or lib.rs).
Only a single source file can be defined. Modules which generate source can be included by prefixing
the module name with ":", for example ":libfoo_bindgen"
If no source file is defined, a single generated source module can be defined to be used as the main source.
defaults
list of string
afdo
bool, Afdo allows developers self-service enroll for
automatic feedback-directed optimization using profile data.
aliases
list of string, Rust crate dependencies to rename. Each entry should be a string of the form "dependencyname:alias".
"dependencyname" here should be the name of the crate, not the Android module. This is
equivalent to writing `alias = { package = "dependencyname" }` in a `Cargo.toml`.
apex_available
list of string, Availability of this module in APEXes. Only the listed APEXes can contain this module. If
the module has stubs then other APEXes and the platform may access it through them
(subject to visibility).
"//apex_available:anyapex" is a pseudo APEX name that matches to any APEX.
"//apex_available:platform" refers to non-APEX partitions like "system.img".
Prefix pattern (com.foo.*) can be used to match with any APEX name with the prefix(com.foo.).
Default is ["//apex_available:platform"].
arch
interface
bootstrap
bool, Allows this module to use non-APEX version of libraries. Useful
for building binaries that are started before APEXes are activated.
cargo_env_compat
bool, Enables emitting certain Cargo environment variables. Only intended to be used for compatibility purposes.
Will set CARGO_CRATE_NAME to the crate_name property's value.
Will set CARGO_BIN_NAME to the output filename value without the extension.
cargo_pkg_version
string, If cargo_env_compat is true, sets the CARGO_PKG_VERSION env var to this value.
cfgs
configurable list of string, list of configuration options to enable for this crate. To enable features, use the "features" property.
clippy_lints
string, name of the lint set that should be used to validate this module.
Possible values are "default" (for using a sensible set of lints
depending on the module's location), "android" (for the strictest
lint set that applies to all Android platform code), "vendor" (for a
relaxed set) and "none" (to disable the execution of clippy). The
default value is "default". See also the `lints` property.
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
crate_name
string, crate name, required for modules which produce Rust libraries: rust_library, rust_ffi and SourceProvider
modules which create library variants (rust_bindgen). This must be the expected extern crate name used in
source, and is required to conform to an enforced format matching library output files (if the output file is
lib<someName><suffix>, the crate_name property must be <someName>).
crate_root
string, Entry point that is passed to rustc to begin the compilation. E.g. main.rs or lib.rs.
When this property is set,
* sandboxing is enabled for this module, and
* the srcs attribute is interpreted as a list of all source files potentially
used in compilation, including the entrypoint, and
* compile_data can be used to add additional files used in compilation that
not directly used as source files.
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
prepend_artifact_with_product
bool, If true, then the artifact file will be prepended with <product name>-. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be coral-foo.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
double_loadable
bool, whether this module is capable of being loaded with other instance
(possibly an older version) of the same module in the same process.
Currently, a shared library that is a member of VNDK (vndk: {enabled: true})
can be double loaded in a vendor process if the library is also a
(direct and indirect) dependency of an LLNDK library. Such libraries must be
explicitly marked as `double_loadable: true` by the owner, or the dependency
from the LLNDK lib should be cut if the lib is not designed to be double loaded.
edition
string, specific rust edition that should be used if the default version is not desired
enabled
configurable bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
exclude_from_recovery_snapshot
bool, Normally Soong uses the directory structure to decide which modules
should be included (framework) or excluded (non-framework) from the
different snapshots (vendor, recovery, etc.), but this property
allows a partner to exclude a module normally thought of as a
framework module from the recovery snapshot.
exclude_from_vendor_snapshot
bool, Normally Soong uses the directory structure to decide which modules
should be included (framework) or excluded (non-framework) from the
different snapshots (vendor, recovery, etc.), but this property
allows a partner to exclude a module normally thought of as a
framework module from the vendor snapshot.
features
configurable list of string, list of features to enable for this crate
flags
list of string, flags to pass to rustc. To enable configuration options or features, use the "cfgs" or "features" properties.
host_required
list of string, names of other modules to install on host if this module is installed
init_rc
configurable list of string, init.rc files to be installed if this module is installed
installable
bool
ld_flags
list of string, flags to pass to the linker
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
lints
string, name of the lint set that should be used to validate this module.
Possible values are "default" (for using a sensible set of lints
depending on the module's location), "android" (for the strictest
lint set that applies to all Android platform code), "vendor" (for
a relaxed set) and "none" (for ignoring all lint warnings and
errors). The default value is "default".
⊕lto
Control whether LTO is used for the final (Rust) linkage. This does not impact
cross-language LTO.
thin
bool, Whether thin LTO should be enabled. By default this is true.
LTO provides such a large code size benefit for Rust, this should always
be enabled for production builds unless there's a clear need to disable it.
min_sdk_version
string, Minimum OS API level supported by this C or C++ module. This property becomes the value
of the __ANDROID_API__ macro. When the C or C++ module is included in an APEX or an APK,
this property is also used to ensure that the min_sdk_version of the containing module is
not older (i.e. less) than this module's min_sdk_version. When not set, this property
defaults to the value of sdk_version. When this is set to "apex_inherit", this tracks
min_sdk_version of the containing APEX. When the module
is not built for an APEX, "apex_inherit" defaults to sdk_version.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
native_coverage
bool
no_full_install
bool, When set to true, this module is not installed to the full install path (ex: under
out/target/product/<name>/<partition>). It can be installed only to the packaging
modules like android_filesystem.
no_stdlibs
bool, whether to suppress inclusion of standard crates - defaults to false
odm_available
bool, This is the same as the "vendor_available" except that the install path
of the vendor variant is /odm or /vendor/odm.
By replacing "vendor_available: true" with "odm_available: true", the
module will install its vendor variant to the /odm partition or /vendor/odm.
As the modules with "odm_available: true" still create the vendor variants,
they can link to the other vendor modules as the vendor_available modules do.
Also, the vendor modules can link to odm_available modules.
It may not be used for VNDK modules.
odm_dlkm_specific
bool, Install to partition odm_dlkm when set to true.
overrides
list of string, List of module names that are prevented from being installed when this module gets
installed.
owner
string, vendor who owns this module
prefer_rlib
bool, Change the rustlibs linkage to select rlib linkage by default for device targets.
Also link libstd as an rlib as well on device targets.
Note: This is the default behavior for host targets.
This is primarily meant for rust_binary and rust_ffi modules where the default
linkage of libstd might need to be overridden in some use cases. This should
generally be avoided with other module types since it may cause collisions at
linkage if all dependencies of the root binary module do not link against libstd
the same way.
proc_macros
configurable list of string, list of rust proc_macro crate dependencies
product_available
bool, whether this module should be allowed to be directly depended by other
modules with `product_specific: true` or `product_available: true`.
If set to true, an additional product variant will be built separately
that is limited to the set of libraries and headers that are exposed to
/product modules.
The product variant may be used with a different (newer) /system,
so it shouldn't have any unversioned runtime dependencies, or
make assumptions about the system that may not be true in the
future.
If set to false, this module becomes inaccessible from /product modules.
Different from the 'vendor_available' property, the modules with
vndk: {enabled: true} don't have to define 'product_available'. The VNDK
library without 'product_available' may not be depended on by any other
modules that has product variants including the product available VNDKs.
Nothing happens if BOARD_VNDK_VERSION isn't set in the BoardConfig.mk
and PRODUCT_PRODUCT_VNDK_VERSION isn't set.
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.arc
⊕shared_libs
⊕static_libs
⊕srcs
⊕whole_static_libs
⊕product_variables.build_from_text_stub
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕static_libs
⊕whole_static_libs
⊕shared_libs
⊕srcs
⊕product_variables.malloc_low_memory
⊕shared_libs
⊕whole_static_libs
⊕static_libs
⊕srcs
⊕product_variables.native_coverage
⊕product_variables.release_aidl_use_unfrozen
⊕required
⊕vintf_fragment_modules
⊕product_variables.selinuxignoreneverallows
⊕product_variables.unbundled_build
⊕enabled
Configurable[bool]
Configurable[bool]
proptools.Configurable[bool]
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
ramdisk_available
bool, Make this module available when building for ramdisk.
On device without a dedicated recovery partition, the module is only
available after switching root into
/first_stage_ramdisk. To expose the module before switching root, install
the recovery variant instead.
recovery
bool, Whether this module is installed to recovery partition
recovery_available
bool, Make this module available when building for recovery
relative_install_path
string, install to a subdirectory of the default install path for the module
required
configurable list of string, names of other modules to install if this module is installed
rlibs
configurable list of string, list of rust rlib crate dependencies
rustlibs
configurable list of string, list of rust automatic crate dependencies.
Rustlibs linkage is rlib for host targets and dylib for device targets.
sdk_version
string, The API level that this module is built against. The APIs of this API level will be
visible at build time, but use of any APIs newer than min_sdk_version will render the
module unloadable on older devices. In the future it will be possible to weakly-link new
APIs, making the behavior match Java: such modules will load on older devices, but
calling new APIs on devices that do not support them will result in a crash.
This property has the same behavior as sdk_version does for Java modules. For those
familiar with Android Gradle, the property behaves similarly to how compileSdkVersion
does for Java code.
In addition, setting this property causes two variants to be built, one for the platform
and one for apps.
shared_libs
configurable list of string, list of C shared library dependencies
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
static_libs
configurable list of string, list of C static library dependencies. These dependencies do not normally propagate to dependents
and may need to be redeclared. See whole_static_libs for bundling static dependencies into a library.
stdlibs
configurable list of string, list of Rust system library dependencies.
This is usually only needed when `no_stdlibs` is true, in which case it can be used to depend on system crates
like `core` and `alloc`.
stem
string, sets name of the output
suffix
string, append to name of output
system_dlkm_specific
bool, Install to partition system_dlkm when set to true.
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
compile_multilib
string
enabled
bool
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
use_expansive_default_srcs
bool, Set this to true to use an expansive default set of source file requirements
(all .rs, .h, .xml, and .md files in the module tree).
This is primarily for tracking sources for RBE purposes. Currently defaults
to true, though this may change in the future.
use_generic_config
bool, Set to true if this module must be generic and does not require product-specific information.
To be included in the system image, this property must be set to true.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_available
bool, whether this module should be allowed to be directly depended by other
modules with `vendor: true`, `proprietary: true`, or `vendor_available:true`.
If set to true, two variants will be built separately, one like
normal, and the other limited to the set of libraries and headers
that are exposed to /vendor modules.
The vendor variant may be used with a different (newer) /system,
so it shouldn't have any unversioned runtime dependencies, or
make assumptions about the system that may not be true in the
future.
If set to false, this module becomes inaccessible from /vendor modules.
The modules with vndk: {enabled: true} must define 'vendor_available'
to 'true'.
Nothing happens if BOARD_VNDK_VERSION isn't set in the BoardConfig.mk
vendor_dlkm_specific
bool, Install to partition vendor_dlkm when set to true.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vendor_ramdisk_available
bool, Make this module available when building for vendor ramdisk.
On device without a dedicated recovery partition, the module is only
available after switching root into
/first_stage_ramdisk. To expose the module before switching root, install
the recovery variant instead
vintf_fragment_modules
configurable list of string, vintf_fragment Modules required from this module.
vintf_fragments
configurable list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
whole_static_libs
configurable list of string, Similar to static_libs, but will bundle the static library dependency into a library. This is helpful
to avoid having to redeclare the dependency for dependents of this library, but in some cases may also
result in bloat if multiple dependencies all include the same static library whole.
The common use case for this is when the static library is unlikely to be a dependency of other modules to avoid
having to redeclare the static library dependency for every dependent module.
If you are not sure what to, for rust_library modules most static dependencies should go in static_libraries,
and for rust_ffi modules most static dependencies should go into whole_static_libraries.
For rust_ffi static variants, these libraries will be included in the resulting static library archive.
For rust_library rlib variants, these libraries will be bundled into the resulting rlib library. This will
include all of the static libraries symbols in any dylibs or binaries which use this rlib as well.
rust_protobuf
rust_protobuf generates protobuf rust code from the provided proto file. This uses the protoc-gen-rust plugin for
protoc. Additional flags to the protoc command can be passed via the proto_flags property. This module type will
create library variants that can be used as a crate dependency by adding it to the rlibs and rustlibs
properties of other modules.
name
,
srcs
,
defaults
,
host_supported
,
device_supported
,
afdo
,
aliases
,
apex_available
,
apex_exclude
,
arch
,
bootstrap
,
cargo_env_compat
,
cargo_pkg_version
,
cfgs
,
clippy_lints
,
compile_multilib
,
crate_name
,
crate_root
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
double_loadable
,
dylib
,
edition
,
enabled
,
exclude_from_recovery_snapshot
,
exclude_from_vendor_snapshot
,
export_include_dirs
,
exported_include_dirs
,
extra_exported_symbols
,
features
,
flags
,
grpc_protos
,
header_libs
,
host_cross_supported
,
host_required
,
include_dirs
,
init_rc
,
installable
,
ld_flags
,
licenses
,
lints
,
lto
,
min_sdk_version
,
multilib
,
native_bridge_supported
,
native_coverage
,
no_full_install
,
no_stdlibs
,
odm_available
,
odm_dlkm_specific
,
overrides
,
owner
,
prefer_rlib
,
proc_macros
,
product_available
,
product_specific
,
product_variables.arc
,
product_variables.build_from_text_stub
,
product_variables.debuggable
,
product_variables.eng
,
product_variables.malloc_low_memory
,
product_variables.native_coverage
,
product_variables.release_aidl_use_unfrozen
,
product_variables.selinuxignoreneverallows
,
product_variables.unbundled_build
,
proprietary
,
proto_flags
,
protos
,
ramdisk
,
ramdisk_available
,
recovery
,
recovery_available
,
relative_install_path
,
required
,
rlib
,
rlibs
,
rustlibs
,
sanitize
,
sdk_version
,
shared
,
shared_libs
,
soc_specific
,
source_stem
,
static
,
static_libs
,
stdlibs
,
stem
,
strip
,
stubs
,
suffix
,
sysroot
,
system_dlkm_specific
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
use_expansive_default_srcs
,
use_generic_config
,
vendor
,
vendor_available
,
vendor_dlkm_specific
,
vendor_ramdisk
,
vendor_ramdisk_available
,
version_script
,
vintf_fragment_modules
,
vintf_fragments
,
visibility
,
whole_static_libs
name
string, The name of the module. Must be unique across all modules.
srcs
list of string, path to the source file that is the main entry point of the program (e.g. main.rs or lib.rs).
Only a single source file can be defined. Modules which generate source can be included by prefixing
the module name with ":", for example ":libfoo_bindgen"
If no source file is defined, a single generated source module can be defined to be used as the main source.
defaults
list of string
host_supported
bool, If set to true, build a variant of the module for the host. Defaults to false.
device_supported
bool, If set to true, build a variant of the module for the device. Defaults to true.
afdo
bool, Afdo allows developers self-service enroll for
automatic feedback-directed optimization using profile data.
aliases
list of string, Rust crate dependencies to rename. Each entry should be a string of the form "dependencyname:alias".
"dependencyname" here should be the name of the crate, not the Android module. This is
equivalent to writing `alias = { package = "dependencyname" }` in a `Cargo.toml`.
apex_available
list of string, Availability of this module in APEXes. Only the listed APEXes can contain this module. If
the module has stubs then other APEXes and the platform may access it through them
(subject to visibility).
"//apex_available:anyapex" is a pseudo APEX name that matches to any APEX.
"//apex_available:platform" refers to non-APEX partitions like "system.img".
Prefix pattern (com.foo.*) can be used to match with any APEX name with the prefix(com.foo.).
Default is ["//apex_available:platform"].
apex_exclude
bool, Deprecated - exclude this rust_ffi target from being included in APEXes.
TODO(b/362509506): remove this once all apex_exclude uses are switched to stubs.
arch
interface
bootstrap
bool, Allows this module to use non-APEX version of libraries. Useful
for building binaries that are started before APEXes are activated.
cargo_env_compat
bool, Enables emitting certain Cargo environment variables. Only intended to be used for compatibility purposes.
Will set CARGO_CRATE_NAME to the crate_name property's value.
Will set CARGO_BIN_NAME to the output filename value without the extension.
cargo_pkg_version
string, If cargo_env_compat is true, sets the CARGO_PKG_VERSION env var to this value.
cfgs
configurable list of string, list of configuration options to enable for this crate. To enable features, use the "features" property.
clippy_lints
string, name of the lint set that should be used to validate this module.
Possible values are "default" (for using a sensible set of lints
depending on the module's location), "android" (for the strictest
lint set that applies to all Android platform code), "vendor" (for a
relaxed set) and "none" (to disable the execution of clippy). The
default value is "default". See also the `lints` property.
Default: none
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
crate_name
string, crate name, required for modules which produce Rust libraries: rust_library, rust_ffi and SourceProvider
modules which create library variants (rust_bindgen). This must be the expected extern crate name used in
source, and is required to conform to an enforced format matching library output files (if the output file is
lib<someName><suffix>, the crate_name property must be <someName>).
crate_root
string, Entry point that is passed to rustc to begin the compilation. E.g. main.rs or lib.rs.
When this property is set,
* sandboxing is enabled for this module, and
* the srcs attribute is interpreted as a list of all source files potentially
used in compilation, including the entrypoint, and
* compile_data can be used to add additional files used in compilation that
not directly used as source files.
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
prepend_artifact_with_product
bool, If true, then the artifact file will be prepended with <product name>-. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be coral-foo.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
double_loadable
bool, whether this module is capable of being loaded with other instance
(possibly an older version) of the same module in the same process.
Currently, a shared library that is a member of VNDK (vndk: {enabled: true})
can be double loaded in a vendor process if the library is also a
(direct and indirect) dependency of an LLNDK library. Such libraries must be
explicitly marked as `double_loadable: true` by the owner, or the dependency
from the LLNDK lib should be cut if the lib is not designed to be double loaded.
⊕dylib
VariantLibraryProperties
enabled
bool
srcs
list of string
edition
string, specific rust edition that should be used if the default version is not desired
enabled
configurable bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
exclude_from_recovery_snapshot
bool, Normally Soong uses the directory structure to decide which modules
should be included (framework) or excluded (non-framework) from the
different snapshots (vendor, recovery, etc.), but this property
allows a partner to exclude a module normally thought of as a
framework module from the recovery snapshot.
exclude_from_vendor_snapshot
bool, Normally Soong uses the directory structure to decide which modules
should be included (framework) or excluded (non-framework) from the
different snapshots (vendor, recovery, etc.), but this property
allows a partner to exclude a module normally thought of as a
framework module from the vendor snapshot.
export_include_dirs
list of string, path to include directories to export to cc_* modules, only relevant for static/shared variants.
exported_include_dirs
list of string, List of exported include paths containing proto files for dependent rust_protobuf modules.
features
configurable list of string, list of features to enable for this crate
flags
list of string, flags to pass to rustc. To enable configuration options or features, use the "cfgs" or "features" properties.
grpc_protos
list of string, List of relative paths to GRPC-containing proto files that will be used to generate the source.
Either this or protos must be defined.
host_cross_supported
bool, If set to true, build a variant of the module for the host cross. Defaults to true.
host_required
list of string, names of other modules to install on host if this module is installed
include_dirs
list of string, TODO: Remove this when all instances of Include_dirs have been removed from rust_ffi modules.
path to include directories to pass to cc_* modules, only relevant for static/shared variants (deprecated, use export_include_dirs instead).
init_rc
configurable list of string, init.rc files to be installed if this module is installed
installable
bool
ld_flags
list of string, flags to pass to the linker
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
lints
string, name of the lint set that should be used to validate this module.
Possible values are "default" (for using a sensible set of lints
depending on the module's location), "android" (for the strictest
lint set that applies to all Android platform code), "vendor" (for
a relaxed set) and "none" (for ignoring all lint warnings and
errors). The default value is "default".
Default: none
⊕lto
Control whether LTO is used for the final (Rust) linkage. This does not impact
cross-language LTO.
thin
bool, Whether thin LTO should be enabled. By default this is true.
LTO provides such a large code size benefit for Rust, this should always
be enabled for production builds unless there's a clear need to disable it.
min_sdk_version
string, Minimum OS API level supported by this C or C++ module. This property becomes the value
of the __ANDROID_API__ macro. When the C or C++ module is included in an APEX or an APK,
this property is also used to ensure that the min_sdk_version of the containing module is
not older (i.e. less) than this module's min_sdk_version. When not set, this property
defaults to the value of sdk_version. When this is set to "apex_inherit", this tracks
min_sdk_version of the containing APEX. When the module
is not built for an APEX, "apex_inherit" defaults to sdk_version.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
native_coverage
bool
no_full_install
bool, When set to true, this module is not installed to the full install path (ex: under
out/target/product/<name>/<partition>). It can be installed only to the packaging
modules like android_filesystem.
no_stdlibs
bool, whether to suppress inclusion of standard crates - defaults to false
odm_available
bool, This is the same as the "vendor_available" except that the install path
of the vendor variant is /odm or /vendor/odm.
By replacing "vendor_available: true" with "odm_available: true", the
module will install its vendor variant to the /odm partition or /vendor/odm.
As the modules with "odm_available: true" still create the vendor variants,
they can link to the other vendor modules as the vendor_available modules do.
Also, the vendor modules can link to odm_available modules.
It may not be used for VNDK modules.
odm_dlkm_specific
bool, Install to partition odm_dlkm when set to true.
overrides
list of string, List of module names that are prevented from being installed when this module gets
installed.
owner
string, vendor who owns this module
prefer_rlib
bool, Change the rustlibs linkage to select rlib linkage by default for device targets.
Also link libstd as an rlib as well on device targets.
Note: This is the default behavior for host targets.
This is primarily meant for rust_binary and rust_ffi modules where the default
linkage of libstd might need to be overridden in some use cases. This should
generally be avoided with other module types since it may cause collisions at
linkage if all dependencies of the root binary module do not link against libstd
the same way.
proc_macros
configurable list of string, list of rust proc_macro crate dependencies
product_available
bool, whether this module should be allowed to be directly depended by other
modules with `product_specific: true` or `product_available: true`.
If set to true, an additional product variant will be built separately
that is limited to the set of libraries and headers that are exposed to
/product modules.
The product variant may be used with a different (newer) /system,
so it shouldn't have any unversioned runtime dependencies, or
make assumptions about the system that may not be true in the
future.
If set to false, this module becomes inaccessible from /product modules.
Different from the 'vendor_available' property, the modules with
vndk: {enabled: true} don't have to define 'product_available'. The VNDK
library without 'product_available' may not be depended on by any other
modules that has product variants including the product available VNDKs.
Nothing happens if BOARD_VNDK_VERSION isn't set in the BoardConfig.mk
and PRODUCT_PRODUCT_VNDK_VERSION isn't set.
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.arc
⊕include_dirs
⊕shared_libs
⊕static_libs
⊕srcs
⊕whole_static_libs
⊕product_variables.build_from_text_stub
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕strip.all
⊕strip.keep_symbols
⊕strip.keep_symbols_and_debug_frame
⊕static_libs
⊕whole_static_libs
⊕shared_libs
⊕srcs
⊕product_variables.eng
⊕product_variables.malloc_low_memory
⊕shared_libs
⊕whole_static_libs
⊕static_libs
⊕srcs
⊕product_variables.native_coverage
⊕product_variables.release_aidl_use_unfrozen
⊕required
⊕vintf_fragment_modules
⊕product_variables.selinuxignoreneverallows
⊕product_variables.unbundled_build
⊕enabled
Configurable[bool]
Configurable[bool]
proptools.Configurable[bool]
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
proto_flags
list of string, List of additional flags to pass to aprotoc
protos
list of string, List of relative paths to proto files that will be used to generate the source.
Either this or grpc_protos must be defined.
ramdisk
bool, Whether this module is installed to ramdisk
ramdisk_available
bool, Make this module available when building for ramdisk.
On device without a dedicated recovery partition, the module is only
available after switching root into
/first_stage_ramdisk. To expose the module before switching root, install
the recovery variant instead.
recovery
bool, Whether this module is installed to recovery partition
recovery_available
bool, Make this module available when building for recovery
relative_install_path
string, install to a subdirectory of the default install path for the module
required
configurable list of string, names of other modules to install if this module is installed
⊕rlib
VariantLibraryProperties
enabled
bool
srcs
list of string
rlibs
configurable list of string, list of rust rlib crate dependencies
rustlibs
configurable list of string, list of rust automatic crate dependencies.
Rustlibs linkage is rlib for host targets and dylib for device targets.
⊕sanitize
enable AddressSanitizer, HWAddressSanitizer, and others.
address
bool
hwaddress
bool
memtag_heap
bool, Memory-tagging, only available on arm64
if diag.memtag unset or false, enables async memory tagging
fuzzer
bool
never
bool
⊕diag
Sanitizers to run in the diagnostic mode (as opposed to the release mode).
Replaces abort() on error with a human-readable error message.
Address and Thread sanitizers always run in diagnostic mode.
memtag_heap
bool, Memory-tagging, only available on arm64
requires sanitizer.memtag: true
if set, enables sync memory tagging
sdk_version
string, The API level that this module is built against. The APIs of this API level will be
visible at build time, but use of any APIs newer than min_sdk_version will render the
module unloadable on older devices. In the future it will be possible to weakly-link new
APIs, making the behavior match Java: such modules will load on older devices, but
calling new APIs on devices that do not support them will result in a crash.
This property has the same behavior as sdk_version does for Java modules. For those
familiar with Android Gradle, the property behaves similarly to how compileSdkVersion
does for Java code.
In addition, setting this property causes two variants to be built, one for the platform
and one for apps.
⊕shared
VariantLibraryProperties
enabled
bool
srcs
list of string
shared_libs
configurable list of string, list of C shared library dependencies
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
source_stem
string, filename for the generated source file (<source_stem>.rs). This field is required.
The inherited "stem" property sets the output filename for the generated library variants only.
⊕static
VariantLibraryProperties
enabled
bool
srcs
list of string
static_libs
configurable list of string, list of C static library dependencies. These dependencies do not normally propagate to dependents
and may need to be redeclared. See whole_static_libs for bundling static dependencies into a library.
stdlibs
configurable list of string, list of Rust system library dependencies.
This is usually only needed when `no_stdlibs` is true, in which case it can be used to depend on system crates
like `core` and `alloc`.
stem
string, sets name of the output
⊕strip
none
bool, Device modules default to stripping enabled leaving mini debuginfo.
Host modules default to stripping disabled, but can be enabled by setting any other
strip boolean property.
all
bool, all forces stripping everything, including the mini debug info.
keep_symbols
bool, keep_symbols enables stripping but keeps all symbols.
keep_symbols_list
list of string, keep_symbols_list specifies a list of symbols to keep if keep_symbols is enabled.
If it is unset then all symbols are kept.
keep_symbols_and_debug_frame
bool, keep_symbols_and_debug_frame enables stripping but keeps all symbols and debug frames.
⊕stubs
*ast.SelectorExpr
Generate stubs to make this library accessible to APEXes.
Can only be set for modules producing shared libraries.
symbol_file
string, Relative path to the symbol map. The symbol map provides the list of
symbols that are exported for stubs variant of this library.
versions
list of string, List versions to generate stubs libs for. The version name "current" is always
implicitly added.
implementation_installable
bool, Whether to not require the implementation of the library to be installed if a
client of the stubs is installed. Defaults to true; set to false if the
implementation is made available by some other means, e.g. in a Microdroid
virtual machine.
suffix
string, append to name of output
sysroot
bool, Whether this library is part of the Rust toolchain sysroot.
system_dlkm_specific
bool, Install to partition system_dlkm when set to true.
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
compile_multilib
string
enabled
bool
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
use_expansive_default_srcs
bool, Set this to true to use an expansive default set of source file requirements
(all .rs, .h, .xml, and .md files in the module tree).
This is primarily for tracking sources for RBE purposes. Currently defaults
to true, though this may change in the future.
use_generic_config
bool, Set to true if this module must be generic and does not require product-specific information.
To be included in the system image, this property must be set to true.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_available
bool, whether this module should be allowed to be directly depended by other
modules with `vendor: true`, `proprietary: true`, or `vendor_available:true`.
If set to true, two variants will be built separately, one like
normal, and the other limited to the set of libraries and headers
that are exposed to /vendor modules.
The vendor variant may be used with a different (newer) /system,
so it shouldn't have any unversioned runtime dependencies, or
make assumptions about the system that may not be true in the
future.
If set to false, this module becomes inaccessible from /vendor modules.
The modules with vndk: {enabled: true} must define 'vendor_available'
to 'true'.
Nothing happens if BOARD_VNDK_VERSION isn't set in the BoardConfig.mk
vendor_dlkm_specific
bool, Install to partition vendor_dlkm when set to true.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vendor_ramdisk_available
bool, Make this module available when building for vendor ramdisk.
On device without a dedicated recovery partition, the module is only
available after switching root into
/first_stage_ramdisk. To expose the module before switching root, install
the recovery variant instead
version_script
string, Version script to pass to the linker. By default this will replace the
implicit rustc emitted version script to mirror expected behavior in CC.
This is only relevant for rust_ffi_shared modules which are exposing a
versioned C API.
vintf_fragment_modules
configurable list of string, vintf_fragment Modules required from this module.
vintf_fragments
configurable list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
whole_static_libs
configurable list of string, Similar to static_libs, but will bundle the static library dependency into a library. This is helpful
to avoid having to redeclare the dependency for dependents of this library, but in some cases may also
result in bloat if multiple dependencies all include the same static library whole.
The common use case for this is when the static library is unlikely to be a dependency of other modules to avoid
having to redeclare the static library dependency for every dependent module.
If you are not sure what to, for rust_library modules most static dependencies should go in static_libraries,
and for rust_ffi modules most static dependencies should go into whole_static_libraries.
For rust_ffi static variants, these libraries will be included in the resulting static library archive.
For rust_library rlib variants, these libraries will be bundled into the resulting rlib library. This will
include all of the static libraries symbols in any dylibs or binaries which use this rlib as well.
rust_protobuf_host
A host-only variant of rust_protobuf. Refer to rust_protobuf for more details.
name
,
srcs
,
defaults
,
afdo
,
aliases
,
apex_available
,
apex_exclude
,
arch
,
bootstrap
,
cargo_env_compat
,
cargo_pkg_version
,
cfgs
,
clippy_lints
,
compile_multilib
,
crate_name
,
crate_root
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
double_loadable
,
dylib
,
edition
,
enabled
,
exclude_from_recovery_snapshot
,
exclude_from_vendor_snapshot
,
export_include_dirs
,
exported_include_dirs
,
extra_exported_symbols
,
features
,
flags
,
grpc_protos
,
header_libs
,
host_cross_supported
,
host_required
,
include_dirs
,
init_rc
,
installable
,
ld_flags
,
licenses
,
lints
,
lto
,
min_sdk_version
,
multilib
,
native_bridge_supported
,
native_coverage
,
no_full_install
,
no_stdlibs
,
odm_available
,
odm_dlkm_specific
,
overrides
,
owner
,
prefer_rlib
,
proc_macros
,
product_available
,
product_specific
,
product_variables.arc
,
product_variables.build_from_text_stub
,
product_variables.debuggable
,
product_variables.eng
,
product_variables.malloc_low_memory
,
product_variables.native_coverage
,
product_variables.release_aidl_use_unfrozen
,
product_variables.selinuxignoreneverallows
,
product_variables.unbundled_build
,
proprietary
,
proto_flags
,
protos
,
ramdisk
,
ramdisk_available
,
recovery
,
recovery_available
,
relative_install_path
,
required
,
rlib
,
rlibs
,
rustlibs
,
sanitize
,
sdk_version
,
shared
,
shared_libs
,
soc_specific
,
source_stem
,
static
,
static_libs
,
stdlibs
,
stem
,
strip
,
stubs
,
suffix
,
sysroot
,
system_dlkm_specific
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
use_expansive_default_srcs
,
use_generic_config
,
vendor
,
vendor_available
,
vendor_dlkm_specific
,
vendor_ramdisk
,
vendor_ramdisk_available
,
version_script
,
vintf_fragment_modules
,
vintf_fragments
,
visibility
,
whole_static_libs
name
string, The name of the module. Must be unique across all modules.
srcs
list of string, path to the source file that is the main entry point of the program (e.g. main.rs or lib.rs).
Only a single source file can be defined. Modules which generate source can be included by prefixing
the module name with ":", for example ":libfoo_bindgen"
If no source file is defined, a single generated source module can be defined to be used as the main source.
defaults
list of string
afdo
bool, Afdo allows developers self-service enroll for
automatic feedback-directed optimization using profile data.
aliases
list of string, Rust crate dependencies to rename. Each entry should be a string of the form "dependencyname:alias".
"dependencyname" here should be the name of the crate, not the Android module. This is
equivalent to writing `alias = { package = "dependencyname" }` in a `Cargo.toml`.
apex_available
list of string, Availability of this module in APEXes. Only the listed APEXes can contain this module. If
the module has stubs then other APEXes and the platform may access it through them
(subject to visibility).
"//apex_available:anyapex" is a pseudo APEX name that matches to any APEX.
"//apex_available:platform" refers to non-APEX partitions like "system.img".
Prefix pattern (com.foo.*) can be used to match with any APEX name with the prefix(com.foo.).
Default is ["//apex_available:platform"].
apex_exclude
bool, Deprecated - exclude this rust_ffi target from being included in APEXes.
TODO(b/362509506): remove this once all apex_exclude uses are switched to stubs.
arch
interface
bootstrap
bool, Allows this module to use non-APEX version of libraries. Useful
for building binaries that are started before APEXes are activated.
cargo_env_compat
bool, Enables emitting certain Cargo environment variables. Only intended to be used for compatibility purposes.
Will set CARGO_CRATE_NAME to the crate_name property's value.
Will set CARGO_BIN_NAME to the output filename value without the extension.
cargo_pkg_version
string, If cargo_env_compat is true, sets the CARGO_PKG_VERSION env var to this value.
cfgs
configurable list of string, list of configuration options to enable for this crate. To enable features, use the "features" property.
clippy_lints
string, name of the lint set that should be used to validate this module.
Possible values are "default" (for using a sensible set of lints
depending on the module's location), "android" (for the strictest
lint set that applies to all Android platform code), "vendor" (for a
relaxed set) and "none" (to disable the execution of clippy). The
default value is "default". See also the `lints` property.
Default: none
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
crate_name
string, crate name, required for modules which produce Rust libraries: rust_library, rust_ffi and SourceProvider
modules which create library variants (rust_bindgen). This must be the expected extern crate name used in
source, and is required to conform to an enforced format matching library output files (if the output file is
lib<someName><suffix>, the crate_name property must be <someName>).
crate_root
string, Entry point that is passed to rustc to begin the compilation. E.g. main.rs or lib.rs.
When this property is set,
* sandboxing is enabled for this module, and
* the srcs attribute is interpreted as a list of all source files potentially
used in compilation, including the entrypoint, and
* compile_data can be used to add additional files used in compilation that
not directly used as source files.
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
prepend_artifact_with_product
bool, If true, then the artifact file will be prepended with <product name>-. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be coral-foo.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
double_loadable
bool, whether this module is capable of being loaded with other instance
(possibly an older version) of the same module in the same process.
Currently, a shared library that is a member of VNDK (vndk: {enabled: true})
can be double loaded in a vendor process if the library is also a
(direct and indirect) dependency of an LLNDK library. Such libraries must be
explicitly marked as `double_loadable: true` by the owner, or the dependency
from the LLNDK lib should be cut if the lib is not designed to be double loaded.
⊕dylib
VariantLibraryProperties
enabled
bool
srcs
list of string
edition
string, specific rust edition that should be used if the default version is not desired
enabled
configurable bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
exclude_from_recovery_snapshot
bool, Normally Soong uses the directory structure to decide which modules
should be included (framework) or excluded (non-framework) from the
different snapshots (vendor, recovery, etc.), but this property
allows a partner to exclude a module normally thought of as a
framework module from the recovery snapshot.
exclude_from_vendor_snapshot
bool, Normally Soong uses the directory structure to decide which modules
should be included (framework) or excluded (non-framework) from the
different snapshots (vendor, recovery, etc.), but this property
allows a partner to exclude a module normally thought of as a
framework module from the vendor snapshot.
export_include_dirs
list of string, path to include directories to export to cc_* modules, only relevant for static/shared variants.
exported_include_dirs
list of string, List of exported include paths containing proto files for dependent rust_protobuf modules.
features
configurable list of string, list of features to enable for this crate
flags
list of string, flags to pass to rustc. To enable configuration options or features, use the "cfgs" or "features" properties.
grpc_protos
list of string, List of relative paths to GRPC-containing proto files that will be used to generate the source.
Either this or protos must be defined.
host_cross_supported
bool, If set to true, build a variant of the module for the host cross. Defaults to true.
host_required
list of string, names of other modules to install on host if this module is installed
include_dirs
list of string, TODO: Remove this when all instances of Include_dirs have been removed from rust_ffi modules.
path to include directories to pass to cc_* modules, only relevant for static/shared variants (deprecated, use export_include_dirs instead).
init_rc
configurable list of string, init.rc files to be installed if this module is installed
installable
bool
ld_flags
list of string, flags to pass to the linker
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
lints
string, name of the lint set that should be used to validate this module.
Possible values are "default" (for using a sensible set of lints
depending on the module's location), "android" (for the strictest
lint set that applies to all Android platform code), "vendor" (for
a relaxed set) and "none" (for ignoring all lint warnings and
errors). The default value is "default".
Default: none
⊕lto
Control whether LTO is used for the final (Rust) linkage. This does not impact
cross-language LTO.
thin
bool, Whether thin LTO should be enabled. By default this is true.
LTO provides such a large code size benefit for Rust, this should always
be enabled for production builds unless there's a clear need to disable it.
min_sdk_version
string, Minimum OS API level supported by this C or C++ module. This property becomes the value
of the __ANDROID_API__ macro. When the C or C++ module is included in an APEX or an APK,
this property is also used to ensure that the min_sdk_version of the containing module is
not older (i.e. less) than this module's min_sdk_version. When not set, this property
defaults to the value of sdk_version. When this is set to "apex_inherit", this tracks
min_sdk_version of the containing APEX. When the module
is not built for an APEX, "apex_inherit" defaults to sdk_version.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
native_coverage
bool
no_full_install
bool, When set to true, this module is not installed to the full install path (ex: under
out/target/product/<name>/<partition>). It can be installed only to the packaging
modules like android_filesystem.
no_stdlibs
bool, whether to suppress inclusion of standard crates - defaults to false
odm_available
bool, This is the same as the "vendor_available" except that the install path
of the vendor variant is /odm or /vendor/odm.
By replacing "vendor_available: true" with "odm_available: true", the
module will install its vendor variant to the /odm partition or /vendor/odm.
As the modules with "odm_available: true" still create the vendor variants,
they can link to the other vendor modules as the vendor_available modules do.
Also, the vendor modules can link to odm_available modules.
It may not be used for VNDK modules.
odm_dlkm_specific
bool, Install to partition odm_dlkm when set to true.
overrides
list of string, List of module names that are prevented from being installed when this module gets
installed.
owner
string, vendor who owns this module
prefer_rlib
bool, Change the rustlibs linkage to select rlib linkage by default for device targets.
Also link libstd as an rlib as well on device targets.
Note: This is the default behavior for host targets.
This is primarily meant for rust_binary and rust_ffi modules where the default
linkage of libstd might need to be overridden in some use cases. This should
generally be avoided with other module types since it may cause collisions at
linkage if all dependencies of the root binary module do not link against libstd
the same way.
proc_macros
configurable list of string, list of rust proc_macro crate dependencies
product_available
bool, whether this module should be allowed to be directly depended by other
modules with `product_specific: true` or `product_available: true`.
If set to true, an additional product variant will be built separately
that is limited to the set of libraries and headers that are exposed to
/product modules.
The product variant may be used with a different (newer) /system,
so it shouldn't have any unversioned runtime dependencies, or
make assumptions about the system that may not be true in the
future.
If set to false, this module becomes inaccessible from /product modules.
Different from the 'vendor_available' property, the modules with
vndk: {enabled: true} don't have to define 'product_available'. The VNDK
library without 'product_available' may not be depended on by any other
modules that has product variants including the product available VNDKs.
Nothing happens if BOARD_VNDK_VERSION isn't set in the BoardConfig.mk
and PRODUCT_PRODUCT_VNDK_VERSION isn't set.
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.arc
⊕include_dirs
⊕shared_libs
⊕static_libs
⊕srcs
⊕whole_static_libs
⊕product_variables.build_from_text_stub
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕strip.all
⊕strip.keep_symbols
⊕strip.keep_symbols_and_debug_frame
⊕static_libs
⊕whole_static_libs
⊕shared_libs
⊕srcs
⊕product_variables.eng
⊕product_variables.malloc_low_memory
⊕shared_libs
⊕whole_static_libs
⊕static_libs
⊕srcs
⊕product_variables.native_coverage
⊕product_variables.release_aidl_use_unfrozen
⊕required
⊕vintf_fragment_modules
⊕product_variables.selinuxignoreneverallows
⊕product_variables.unbundled_build
⊕enabled
Configurable[bool]
Configurable[bool]
proptools.Configurable[bool]
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
proto_flags
list of string, List of additional flags to pass to aprotoc
protos
list of string, List of relative paths to proto files that will be used to generate the source.
Either this or grpc_protos must be defined.
ramdisk
bool, Whether this module is installed to ramdisk
ramdisk_available
bool, Make this module available when building for ramdisk.
On device without a dedicated recovery partition, the module is only
available after switching root into
/first_stage_ramdisk. To expose the module before switching root, install
the recovery variant instead.
recovery
bool, Whether this module is installed to recovery partition
recovery_available
bool, Make this module available when building for recovery
relative_install_path
string, install to a subdirectory of the default install path for the module
required
configurable list of string, names of other modules to install if this module is installed
⊕rlib
VariantLibraryProperties
enabled
bool
srcs
list of string
rlibs
configurable list of string, list of rust rlib crate dependencies
rustlibs
configurable list of string, list of rust automatic crate dependencies.
Rustlibs linkage is rlib for host targets and dylib for device targets.
⊕sanitize
enable AddressSanitizer, HWAddressSanitizer, and others.
address
bool
hwaddress
bool
memtag_heap
bool, Memory-tagging, only available on arm64
if diag.memtag unset or false, enables async memory tagging
fuzzer
bool
never
bool
⊕diag
Sanitizers to run in the diagnostic mode (as opposed to the release mode).
Replaces abort() on error with a human-readable error message.
Address and Thread sanitizers always run in diagnostic mode.
memtag_heap
bool, Memory-tagging, only available on arm64
requires sanitizer.memtag: true
if set, enables sync memory tagging
sdk_version
string, The API level that this module is built against. The APIs of this API level will be
visible at build time, but use of any APIs newer than min_sdk_version will render the
module unloadable on older devices. In the future it will be possible to weakly-link new
APIs, making the behavior match Java: such modules will load on older devices, but
calling new APIs on devices that do not support them will result in a crash.
This property has the same behavior as sdk_version does for Java modules. For those
familiar with Android Gradle, the property behaves similarly to how compileSdkVersion
does for Java code.
In addition, setting this property causes two variants to be built, one for the platform
and one for apps.
⊕shared
VariantLibraryProperties
enabled
bool
srcs
list of string
shared_libs
configurable list of string, list of C shared library dependencies
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
source_stem
string, filename for the generated source file (<source_stem>.rs). This field is required.
The inherited "stem" property sets the output filename for the generated library variants only.
⊕static
VariantLibraryProperties
enabled
bool
srcs
list of string
static_libs
configurable list of string, list of C static library dependencies. These dependencies do not normally propagate to dependents
and may need to be redeclared. See whole_static_libs for bundling static dependencies into a library.
stdlibs
configurable list of string, list of Rust system library dependencies.
This is usually only needed when `no_stdlibs` is true, in which case it can be used to depend on system crates
like `core` and `alloc`.
stem
string, sets name of the output
⊕strip
none
bool, Device modules default to stripping enabled leaving mini debuginfo.
Host modules default to stripping disabled, but can be enabled by setting any other
strip boolean property.
all
bool, all forces stripping everything, including the mini debug info.
keep_symbols
bool, keep_symbols enables stripping but keeps all symbols.
keep_symbols_list
list of string, keep_symbols_list specifies a list of symbols to keep if keep_symbols is enabled.
If it is unset then all symbols are kept.
keep_symbols_and_debug_frame
bool, keep_symbols_and_debug_frame enables stripping but keeps all symbols and debug frames.
⊕stubs
*ast.SelectorExpr
Generate stubs to make this library accessible to APEXes.
Can only be set for modules producing shared libraries.
symbol_file
string, Relative path to the symbol map. The symbol map provides the list of
symbols that are exported for stubs variant of this library.
versions
list of string, List versions to generate stubs libs for. The version name "current" is always
implicitly added.
implementation_installable
bool, Whether to not require the implementation of the library to be installed if a
client of the stubs is installed. Defaults to true; set to false if the
implementation is made available by some other means, e.g. in a Microdroid
virtual machine.
suffix
string, append to name of output
sysroot
bool, Whether this library is part of the Rust toolchain sysroot.
system_dlkm_specific
bool, Install to partition system_dlkm when set to true.
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
compile_multilib
string
enabled
bool
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
use_expansive_default_srcs
bool, Set this to true to use an expansive default set of source file requirements
(all .rs, .h, .xml, and .md files in the module tree).
This is primarily for tracking sources for RBE purposes. Currently defaults
to true, though this may change in the future.
use_generic_config
bool, Set to true if this module must be generic and does not require product-specific information.
To be included in the system image, this property must be set to true.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_available
bool, whether this module should be allowed to be directly depended by other
modules with `vendor: true`, `proprietary: true`, or `vendor_available:true`.
If set to true, two variants will be built separately, one like
normal, and the other limited to the set of libraries and headers
that are exposed to /vendor modules.
The vendor variant may be used with a different (newer) /system,
so it shouldn't have any unversioned runtime dependencies, or
make assumptions about the system that may not be true in the
future.
If set to false, this module becomes inaccessible from /vendor modules.
The modules with vndk: {enabled: true} must define 'vendor_available'
to 'true'.
Nothing happens if BOARD_VNDK_VERSION isn't set in the BoardConfig.mk
vendor_dlkm_specific
bool, Install to partition vendor_dlkm when set to true.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vendor_ramdisk_available
bool, Make this module available when building for vendor ramdisk.
On device without a dedicated recovery partition, the module is only
available after switching root into
/first_stage_ramdisk. To expose the module before switching root, install
the recovery variant instead
version_script
string, Version script to pass to the linker. By default this will replace the
implicit rustc emitted version script to mirror expected behavior in CC.
This is only relevant for rust_ffi_shared modules which are exposing a
versioned C API.
vintf_fragment_modules
configurable list of string, vintf_fragment Modules required from this module.
vintf_fragments
configurable list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
whole_static_libs
configurable list of string, Similar to static_libs, but will bundle the static library dependency into a library. This is helpful
to avoid having to redeclare the dependency for dependents of this library, but in some cases may also
result in bloat if multiple dependencies all include the same static library whole.
The common use case for this is when the static library is unlikely to be a dependency of other modules to avoid
having to redeclare the static library dependency for every dependent module.
If you are not sure what to, for rust_library modules most static dependencies should go in static_libraries,
and for rust_ffi modules most static dependencies should go into whole_static_libraries.
For rust_ffi static variants, these libraries will be included in the resulting static library archive.
For rust_library rlib variants, these libraries will be bundled into the resulting rlib library. This will
include all of the static libraries symbols in any dylibs or binaries which use this rlib as well.
rust_test
name
,
srcs
,
defaults
,
host_supported
,
device_supported
,
afdo
,
aliases
,
apex_available
,
arch
,
auto_gen_config
,
bootstrap
,
cargo_env_compat
,
cargo_pkg_version
,
cfgs
,
clippy_lints
,
compile_multilib
,
crate_name
,
crate_root
,
data
,
data_bins
,
data_libs
,
debug_ramdisk
,
device_common_data
,
device_specific
,
dist
,
dists
,
double_loadable
,
edition
,
enabled
,
exclude_from_recovery_snapshot
,
exclude_from_vendor_snapshot
,
features
,
flags
,
host_common_data
,
host_cross_supported
,
host_required
,
init_rc
,
installable
,
ld_flags
,
licenses
,
lints
,
lto
,
min_sdk_version
,
multilib
,
native_bridge_supported
,
native_coverage
,
no_full_install
,
no_named_install_directory
,
no_stdlibs
,
odm_available
,
odm_dlkm_specific
,
overrides
,
owner
,
prefer_rlib
,
proc_macros
,
product_available
,
product_specific
,
product_variables.arc
,
product_variables.build_from_text_stub
,
product_variables.debuggable
,
product_variables.eng
,
product_variables.malloc_low_memory
,
product_variables.native_coverage
,
product_variables.release_aidl_use_unfrozen
,
product_variables.selinuxignoreneverallows
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
ramdisk_available
,
recovery
,
recovery_available
,
relative_install_path
,
require_root
,
required
,
rlibs
,
rustlibs
,
sanitize
,
sdk_version
,
shared_libs
,
soc_specific
,
static_executable
,
static_libs
,
stdlibs
,
stem
,
strip
,
suffix
,
system_dlkm_specific
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
test_config
,
test_config_template
,
test_harness
,
test_options
,
test_suites
,
use_expansive_default_srcs
,
use_generic_config
,
vendor
,
vendor_available
,
vendor_dlkm_specific
,
vendor_ramdisk
,
vendor_ramdisk_available
,
vintf_fragment_modules
,
vintf_fragments
,
visibility
,
whole_static_libs
name
string, The name of the module. Must be unique across all modules.
srcs
list of string, path to the source file that is the main entry point of the program (e.g. main.rs or lib.rs).
Only a single source file can be defined. Modules which generate source can be included by prefixing
the module name with ":", for example ":libfoo_bindgen"
If no source file is defined, a single generated source module can be defined to be used as the main source.
defaults
list of string
host_supported
bool, If set to true, build a variant of the module for the host. Defaults to false.
device_supported
bool, If set to true, build a variant of the module for the device. Defaults to true.
afdo
bool, Afdo allows developers self-service enroll for
automatic feedback-directed optimization using profile data.
aliases
list of string, Rust crate dependencies to rename. Each entry should be a string of the form "dependencyname:alias".
"dependencyname" here should be the name of the crate, not the Android module. This is
equivalent to writing `alias = { package = "dependencyname" }` in a `Cargo.toml`.
apex_available
list of string, Availability of this module in APEXes. Only the listed APEXes can contain this module. If
the module has stubs then other APEXes and the platform may access it through them
(subject to visibility).
"//apex_available:anyapex" is a pseudo APEX name that matches to any APEX.
"//apex_available:platform" refers to non-APEX partitions like "system.img".
Prefix pattern (com.foo.*) can be used to match with any APEX name with the prefix(com.foo.).
Default is ["//apex_available:platform"].
arch
interface
auto_gen_config
bool, Flag to indicate whether or not to create test config automatically. If AndroidTest.xml
doesn't exist next to the Android.bp, this attribute doesn't need to be set to true
explicitly.
bootstrap
bool, Allows this module to use non-APEX version of libraries. Useful
for building binaries that are started before APEXes are activated.
cargo_env_compat
bool, Enables emitting certain Cargo environment variables. Only intended to be used for compatibility purposes.
Will set CARGO_CRATE_NAME to the crate_name property's value.
Will set CARGO_BIN_NAME to the output filename value without the extension.
cargo_pkg_version
string, If cargo_env_compat is true, sets the CARGO_PKG_VERSION env var to this value.
cfgs
configurable list of string, list of configuration options to enable for this crate. To enable features, use the "features" property.
clippy_lints
string, name of the lint set that should be used to validate this module.
Possible values are "default" (for using a sensible set of lints
depending on the module's location), "android" (for the strictest
lint set that applies to all Android platform code), "vendor" (for a
relaxed set) and "none" (to disable the execution of clippy). The
default value is "default". See also the `lints` property.
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
crate_name
string, crate name, required for modules which produce Rust libraries: rust_library, rust_ffi and SourceProvider
modules which create library variants (rust_bindgen). This must be the expected extern crate name used in
source, and is required to conform to an enforced format matching library output files (if the output file is
lib<someName><suffix>, the crate_name property must be <someName>).
crate_root
string, Entry point that is passed to rustc to begin the compilation. E.g. main.rs or lib.rs.
When this property is set,
* sandboxing is enabled for this module, and
* the srcs attribute is interpreted as a list of all source files potentially
used in compilation, including the entrypoint, and
* compile_data can be used to add additional files used in compilation that
not directly used as source files.
data
list of string, list of files or filegroup modules that provide data that should be installed alongside
the test
data_bins
list of string, list of binary modules that should be installed alongside the test
data_libs
list of string, list of shared library modules that should be installed alongside the test
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_common_data
list of string, Same as data, but adds dependencies on modules using the device's os variant, and common
architecture's variant. Can be useful to add device-built apps to the data of a host
test.
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
prepend_artifact_with_product
bool, If true, then the artifact file will be prepended with <product name>-. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be coral-foo.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
double_loadable
bool, whether this module is capable of being loaded with other instance
(possibly an older version) of the same module in the same process.
Currently, a shared library that is a member of VNDK (vndk: {enabled: true})
can be double loaded in a vendor process if the library is also a
(direct and indirect) dependency of an LLNDK library. Such libraries must be
explicitly marked as `double_loadable: true` by the owner, or the dependency
from the LLNDK lib should be cut if the lib is not designed to be double loaded.
edition
string, specific rust edition that should be used if the default version is not desired
enabled
configurable bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
exclude_from_recovery_snapshot
bool, Normally Soong uses the directory structure to decide which modules
should be included (framework) or excluded (non-framework) from the
different snapshots (vendor, recovery, etc.), but this property
allows a partner to exclude a module normally thought of as a
framework module from the recovery snapshot.
exclude_from_vendor_snapshot
bool, Normally Soong uses the directory structure to decide which modules
should be included (framework) or excluded (non-framework) from the
different snapshots (vendor, recovery, etc.), but this property
allows a partner to exclude a module normally thought of as a
framework module from the vendor snapshot.
features
configurable list of string, list of features to enable for this crate
flags
list of string, flags to pass to rustc. To enable configuration options or features, use the "cfgs" or "features" properties.
host_common_data
list of string, Same as data, but will add dependencies on modules using the host's os variation and
the common arch variation. Useful for a device test that wants to depend on a host
module, for example to include a custom Tradefed test runner.
host_cross_supported
bool, If set to true, build a variant of the module for the host cross. Defaults to true.
host_required
list of string, names of other modules to install on host if this module is installed
init_rc
configurable list of string, init.rc files to be installed if this module is installed
installable
bool
ld_flags
list of string, flags to pass to the linker
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
lints
string, name of the lint set that should be used to validate this module.
Possible values are "default" (for using a sensible set of lints
depending on the module's location), "android" (for the strictest
lint set that applies to all Android platform code), "vendor" (for
a relaxed set) and "none" (for ignoring all lint warnings and
errors). The default value is "default".
⊕lto
Control whether LTO is used for the final (Rust) linkage. This does not impact
cross-language LTO.
thin
bool, Whether thin LTO should be enabled. By default this is true.
LTO provides such a large code size benefit for Rust, this should always
be enabled for production builds unless there's a clear need to disable it.
min_sdk_version
string, Minimum OS API level supported by this C or C++ module. This property becomes the value
of the __ANDROID_API__ macro. When the C or C++ module is included in an APEX or an APK,
this property is also used to ensure that the min_sdk_version of the containing module is
not older (i.e. less) than this module's min_sdk_version. When not set, this property
defaults to the value of sdk_version. When this is set to "apex_inherit", this tracks
min_sdk_version of the containing APEX. When the module
is not built for an APEX, "apex_inherit" defaults to sdk_version.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
native_coverage
bool
no_full_install
bool, When set to true, this module is not installed to the full install path (ex: under
out/target/product/<name>/<partition>). It can be installed only to the packaging
modules like android_filesystem.
no_named_install_directory
bool, Disables the creation of a test-specific directory when used with
relative_install_path. Useful if several tests need to be in the same
directory.
no_stdlibs
bool, whether to suppress inclusion of standard crates - defaults to false
odm_available
bool, This is the same as the "vendor_available" except that the install path
of the vendor variant is /odm or /vendor/odm.
By replacing "vendor_available: true" with "odm_available: true", the
module will install its vendor variant to the /odm partition or /vendor/odm.
As the modules with "odm_available: true" still create the vendor variants,
they can link to the other vendor modules as the vendor_available modules do.
Also, the vendor modules can link to odm_available modules.
It may not be used for VNDK modules.
odm_dlkm_specific
bool, Install to partition odm_dlkm when set to true.
overrides
list of string, List of module names that are prevented from being installed when this module gets
installed.
owner
string, vendor who owns this module
prefer_rlib
bool, Change the rustlibs linkage to select rlib linkage by default for device targets.
Also link libstd as an rlib as well on device targets.
Note: This is the default behavior for host targets.
This is primarily meant for rust_binary and rust_ffi modules where the default
linkage of libstd might need to be overridden in some use cases. This should
generally be avoided with other module types since it may cause collisions at
linkage if all dependencies of the root binary module do not link against libstd
the same way.
proc_macros
configurable list of string, list of rust proc_macro crate dependencies
product_available
bool, whether this module should be allowed to be directly depended by other
modules with `product_specific: true` or `product_available: true`.
If set to true, an additional product variant will be built separately
that is limited to the set of libraries and headers that are exposed to
/product modules.
The product variant may be used with a different (newer) /system,
so it shouldn't have any unversioned runtime dependencies, or
make assumptions about the system that may not be true in the
future.
If set to false, this module becomes inaccessible from /product modules.
Different from the 'vendor_available' property, the modules with
vndk: {enabled: true} don't have to define 'product_available'. The VNDK
library without 'product_available' may not be depended on by any other
modules that has product variants including the product available VNDKs.
Nothing happens if BOARD_VNDK_VERSION isn't set in the BoardConfig.mk
and PRODUCT_PRODUCT_VNDK_VERSION isn't set.
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.arc
⊕shared_libs
⊕static_libs
⊕srcs
⊕whole_static_libs
⊕product_variables.build_from_text_stub
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕strip.all
⊕strip.keep_symbols
⊕strip.keep_symbols_and_debug_frame
⊕static_libs
⊕whole_static_libs
⊕shared_libs
⊕srcs
⊕product_variables.eng
⊕product_variables.malloc_low_memory
⊕shared_libs
⊕whole_static_libs
⊕static_libs
⊕srcs
⊕product_variables.native_coverage
⊕product_variables.release_aidl_use_unfrozen
⊕required
⊕vintf_fragment_modules
⊕product_variables.selinuxignoreneverallows
⊕product_variables.unbundled_build
⊕enabled
Configurable[bool]
Configurable[bool]
proptools.Configurable[bool]
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
ramdisk_available
bool, Make this module available when building for ramdisk.
On device without a dedicated recovery partition, the module is only
available after switching root into
/first_stage_ramdisk. To expose the module before switching root, install
the recovery variant instead.
recovery
bool, Whether this module is installed to recovery partition
recovery_available
bool, Make this module available when building for recovery
relative_install_path
string, install to a subdirectory of the default install path for the module
require_root
bool, Add RootTargetPreparer to auto generated test config. This guarantees the test to run
with root permission.
required
configurable list of string, names of other modules to install if this module is installed
rlibs
configurable list of string, list of rust rlib crate dependencies
rustlibs
configurable list of string, list of rust automatic crate dependencies.
Rustlibs linkage is rlib for host targets and dylib for device targets.
⊕sanitize
enable AddressSanitizer, HWAddressSanitizer, and others.
address
bool
hwaddress
bool
memtag_heap
bool, Memory-tagging, only available on arm64
if diag.memtag unset or false, enables async memory tagging
fuzzer
bool
never
bool
⊕diag
Sanitizers to run in the diagnostic mode (as opposed to the release mode).
Replaces abort() on error with a human-readable error message.
Address and Thread sanitizers always run in diagnostic mode.
memtag_heap
bool, Memory-tagging, only available on arm64
requires sanitizer.memtag: true
if set, enables sync memory tagging
sdk_version
string, The API level that this module is built against. The APIs of this API level will be
visible at build time, but use of any APIs newer than min_sdk_version will render the
module unloadable on older devices. In the future it will be possible to weakly-link new
APIs, making the behavior match Java: such modules will load on older devices, but
calling new APIs on devices that do not support them will result in a crash.
This property has the same behavior as sdk_version does for Java modules. For those
familiar with Android Gradle, the property behaves similarly to how compileSdkVersion
does for Java code.
In addition, setting this property causes two variants to be built, one for the platform
and one for apps.
shared_libs
configurable list of string, list of C shared library dependencies
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
static_executable
bool, Builds this binary as a static binary. Implies prefer_rlib true.
Static executables currently only support for bionic targets. Non-bionic targets will not produce a fully static
binary, but will still implicitly imply prefer_rlib true.
static_libs
configurable list of string, list of C static library dependencies. These dependencies do not normally propagate to dependents
and may need to be redeclared. See whole_static_libs for bundling static dependencies into a library.
stdlibs
configurable list of string, list of Rust system library dependencies.
This is usually only needed when `no_stdlibs` is true, in which case it can be used to depend on system crates
like `core` and `alloc`.
stem
string, sets name of the output
⊕strip
none
bool, Device modules default to stripping enabled leaving mini debuginfo.
Host modules default to stripping disabled, but can be enabled by setting any other
strip boolean property.
all
bool, all forces stripping everything, including the mini debug info.
keep_symbols
bool, keep_symbols enables stripping but keeps all symbols.
keep_symbols_list
list of string, keep_symbols_list specifies a list of symbols to keep if keep_symbols is enabled.
If it is unset then all symbols are kept.
keep_symbols_and_debug_frame
bool, keep_symbols_and_debug_frame enables stripping but keeps all symbols and debug frames.
suffix
string, append to name of output
system_dlkm_specific
bool, Install to partition system_dlkm when set to true.
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
compile_multilib
string
enabled
bool
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
test_config
string, the name of the test configuration (for example "AndroidTest.xml") that should be
installed with the module.
test_config_template
string, the name of the test configuration template (for example "AndroidTestTemplate.xml") that
should be installed with the module.
test_harness
bool, if set, build with the standard Rust test harness. Defaults to true.
⊕test_options
*ast.SelectorExpr
Test options.
unit_test
bool, If the test is a hostside (no device required) unittest that shall be run
during presubmit check.
tags
list of string, Tags provide additional metadata to customize test execution by downstream
test runners. The tags have no special meaning to Soong.
test_suites
list of string, list of compatibility suites (for example "cts", "vts") that the module should be
installed into.
use_expansive_default_srcs
bool, Set this to true to use an expansive default set of source file requirements
(all .rs, .h, .xml, and .md files in the module tree).
This is primarily for tracking sources for RBE purposes. Currently defaults
to true, though this may change in the future.
use_generic_config
bool, Set to true if this module must be generic and does not require product-specific information.
To be included in the system image, this property must be set to true.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_available
bool, whether this module should be allowed to be directly depended by other
modules with `vendor: true`, `proprietary: true`, or `vendor_available:true`.
If set to true, two variants will be built separately, one like
normal, and the other limited to the set of libraries and headers
that are exposed to /vendor modules.
The vendor variant may be used with a different (newer) /system,
so it shouldn't have any unversioned runtime dependencies, or
make assumptions about the system that may not be true in the
future.
If set to false, this module becomes inaccessible from /vendor modules.
The modules with vndk: {enabled: true} must define 'vendor_available'
to 'true'.
Nothing happens if BOARD_VNDK_VERSION isn't set in the BoardConfig.mk
vendor_dlkm_specific
bool, Install to partition vendor_dlkm when set to true.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vendor_ramdisk_available
bool, Make this module available when building for vendor ramdisk.
On device without a dedicated recovery partition, the module is only
available after switching root into
/first_stage_ramdisk. To expose the module before switching root, install
the recovery variant instead
vintf_fragment_modules
configurable list of string, vintf_fragment Modules required from this module.
vintf_fragments
configurable list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
whole_static_libs
configurable list of string, Similar to static_libs, but will bundle the static library dependency into a library. This is helpful
to avoid having to redeclare the dependency for dependents of this library, but in some cases may also
result in bloat if multiple dependencies all include the same static library whole.
The common use case for this is when the static library is unlikely to be a dependency of other modules to avoid
having to redeclare the static library dependency for every dependent module.
If you are not sure what to, for rust_library modules most static dependencies should go in static_libraries,
and for rust_ffi modules most static dependencies should go into whole_static_libraries.
For rust_ffi static variants, these libraries will be included in the resulting static library archive.
For rust_library rlib variants, these libraries will be bundled into the resulting rlib library. This will
include all of the static libraries symbols in any dylibs or binaries which use this rlib as well.
rust_test_host
name
,
srcs
,
defaults
,
afdo
,
aliases
,
apex_available
,
arch
,
auto_gen_config
,
bootstrap
,
cargo_env_compat
,
cargo_pkg_version
,
cfgs
,
clippy_lints
,
compile_multilib
,
crate_name
,
crate_root
,
data
,
data_bins
,
data_libs
,
debug_ramdisk
,
device_common_data
,
device_specific
,
dist
,
dists
,
double_loadable
,
edition
,
enabled
,
exclude_from_recovery_snapshot
,
exclude_from_vendor_snapshot
,
features
,
flags
,
host_common_data
,
host_cross_supported
,
host_required
,
init_rc
,
installable
,
ld_flags
,
licenses
,
lints
,
lto
,
min_sdk_version
,
multilib
,
native_bridge_supported
,
native_coverage
,
no_full_install
,
no_named_install_directory
,
no_stdlibs
,
odm_available
,
odm_dlkm_specific
,
overrides
,
owner
,
prefer_rlib
,
proc_macros
,
product_available
,
product_specific
,
product_variables.arc
,
product_variables.build_from_text_stub
,
product_variables.debuggable
,
product_variables.eng
,
product_variables.malloc_low_memory
,
product_variables.native_coverage
,
product_variables.release_aidl_use_unfrozen
,
product_variables.selinuxignoreneverallows
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
ramdisk_available
,
recovery
,
recovery_available
,
relative_install_path
,
require_root
,
required
,
rlibs
,
rustlibs
,
sanitize
,
sdk_version
,
shared_libs
,
soc_specific
,
static_executable
,
static_libs
,
stdlibs
,
stem
,
strip
,
suffix
,
system_dlkm_specific
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
test_config
,
test_config_template
,
test_harness
,
test_options
,
test_suites
,
use_expansive_default_srcs
,
use_generic_config
,
vendor
,
vendor_available
,
vendor_dlkm_specific
,
vendor_ramdisk
,
vendor_ramdisk_available
,
vintf_fragment_modules
,
vintf_fragments
,
visibility
,
whole_static_libs
name
string, The name of the module. Must be unique across all modules.
srcs
list of string, path to the source file that is the main entry point of the program (e.g. main.rs or lib.rs).
Only a single source file can be defined. Modules which generate source can be included by prefixing
the module name with ":", for example ":libfoo_bindgen"
If no source file is defined, a single generated source module can be defined to be used as the main source.
defaults
list of string
afdo
bool, Afdo allows developers self-service enroll for
automatic feedback-directed optimization using profile data.
aliases
list of string, Rust crate dependencies to rename. Each entry should be a string of the form "dependencyname:alias".
"dependencyname" here should be the name of the crate, not the Android module. This is
equivalent to writing `alias = { package = "dependencyname" }` in a `Cargo.toml`.
apex_available
list of string, Availability of this module in APEXes. Only the listed APEXes can contain this module. If
the module has stubs then other APEXes and the platform may access it through them
(subject to visibility).
"//apex_available:anyapex" is a pseudo APEX name that matches to any APEX.
"//apex_available:platform" refers to non-APEX partitions like "system.img".
Prefix pattern (com.foo.*) can be used to match with any APEX name with the prefix(com.foo.).
Default is ["//apex_available:platform"].
arch
interface
auto_gen_config
bool, Flag to indicate whether or not to create test config automatically. If AndroidTest.xml
doesn't exist next to the Android.bp, this attribute doesn't need to be set to true
explicitly.
bootstrap
bool, Allows this module to use non-APEX version of libraries. Useful
for building binaries that are started before APEXes are activated.
cargo_env_compat
bool, Enables emitting certain Cargo environment variables. Only intended to be used for compatibility purposes.
Will set CARGO_CRATE_NAME to the crate_name property's value.
Will set CARGO_BIN_NAME to the output filename value without the extension.
cargo_pkg_version
string, If cargo_env_compat is true, sets the CARGO_PKG_VERSION env var to this value.
cfgs
configurable list of string, list of configuration options to enable for this crate. To enable features, use the "features" property.
clippy_lints
string, name of the lint set that should be used to validate this module.
Possible values are "default" (for using a sensible set of lints
depending on the module's location), "android" (for the strictest
lint set that applies to all Android platform code), "vendor" (for a
relaxed set) and "none" (to disable the execution of clippy). The
default value is "default". See also the `lints` property.
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
crate_name
string, crate name, required for modules which produce Rust libraries: rust_library, rust_ffi and SourceProvider
modules which create library variants (rust_bindgen). This must be the expected extern crate name used in
source, and is required to conform to an enforced format matching library output files (if the output file is
lib<someName><suffix>, the crate_name property must be <someName>).
crate_root
string, Entry point that is passed to rustc to begin the compilation. E.g. main.rs or lib.rs.
When this property is set,
* sandboxing is enabled for this module, and
* the srcs attribute is interpreted as a list of all source files potentially
used in compilation, including the entrypoint, and
* compile_data can be used to add additional files used in compilation that
not directly used as source files.
data
list of string, list of files or filegroup modules that provide data that should be installed alongside
the test
data_bins
list of string, list of binary modules that should be installed alongside the test
data_libs
list of string, list of shared library modules that should be installed alongside the test
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_common_data
list of string, Same as data, but adds dependencies on modules using the device's os variant, and common
architecture's variant. Can be useful to add device-built apps to the data of a host
test.
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
prepend_artifact_with_product
bool, If true, then the artifact file will be prepended with <product name>-. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be coral-foo.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
double_loadable
bool, whether this module is capable of being loaded with other instance
(possibly an older version) of the same module in the same process.
Currently, a shared library that is a member of VNDK (vndk: {enabled: true})
can be double loaded in a vendor process if the library is also a
(direct and indirect) dependency of an LLNDK library. Such libraries must be
explicitly marked as `double_loadable: true` by the owner, or the dependency
from the LLNDK lib should be cut if the lib is not designed to be double loaded.
edition
string, specific rust edition that should be used if the default version is not desired
enabled
configurable bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
exclude_from_recovery_snapshot
bool, Normally Soong uses the directory structure to decide which modules
should be included (framework) or excluded (non-framework) from the
different snapshots (vendor, recovery, etc.), but this property
allows a partner to exclude a module normally thought of as a
framework module from the recovery snapshot.
exclude_from_vendor_snapshot
bool, Normally Soong uses the directory structure to decide which modules
should be included (framework) or excluded (non-framework) from the
different snapshots (vendor, recovery, etc.), but this property
allows a partner to exclude a module normally thought of as a
framework module from the vendor snapshot.
features
configurable list of string, list of features to enable for this crate
flags
list of string, flags to pass to rustc. To enable configuration options or features, use the "cfgs" or "features" properties.
host_common_data
list of string, Same as data, but will add dependencies on modules using the host's os variation and
the common arch variation. Useful for a device test that wants to depend on a host
module, for example to include a custom Tradefed test runner.
host_cross_supported
bool, If set to true, build a variant of the module for the host cross. Defaults to true.
host_required
list of string, names of other modules to install on host if this module is installed
init_rc
configurable list of string, init.rc files to be installed if this module is installed
installable
bool
ld_flags
list of string, flags to pass to the linker
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
lints
string, name of the lint set that should be used to validate this module.
Possible values are "default" (for using a sensible set of lints
depending on the module's location), "android" (for the strictest
lint set that applies to all Android platform code), "vendor" (for
a relaxed set) and "none" (for ignoring all lint warnings and
errors). The default value is "default".
⊕lto
Control whether LTO is used for the final (Rust) linkage. This does not impact
cross-language LTO.
thin
bool, Whether thin LTO should be enabled. By default this is true.
LTO provides such a large code size benefit for Rust, this should always
be enabled for production builds unless there's a clear need to disable it.
min_sdk_version
string, Minimum OS API level supported by this C or C++ module. This property becomes the value
of the __ANDROID_API__ macro. When the C or C++ module is included in an APEX or an APK,
this property is also used to ensure that the min_sdk_version of the containing module is
not older (i.e. less) than this module's min_sdk_version. When not set, this property
defaults to the value of sdk_version. When this is set to "apex_inherit", this tracks
min_sdk_version of the containing APEX. When the module
is not built for an APEX, "apex_inherit" defaults to sdk_version.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
native_coverage
bool
no_full_install
bool, When set to true, this module is not installed to the full install path (ex: under
out/target/product/<name>/<partition>). It can be installed only to the packaging
modules like android_filesystem.
no_named_install_directory
bool, Disables the creation of a test-specific directory when used with
relative_install_path. Useful if several tests need to be in the same
directory.
no_stdlibs
bool, whether to suppress inclusion of standard crates - defaults to false
odm_available
bool, This is the same as the "vendor_available" except that the install path
of the vendor variant is /odm or /vendor/odm.
By replacing "vendor_available: true" with "odm_available: true", the
module will install its vendor variant to the /odm partition or /vendor/odm.
As the modules with "odm_available: true" still create the vendor variants,
they can link to the other vendor modules as the vendor_available modules do.
Also, the vendor modules can link to odm_available modules.
It may not be used for VNDK modules.
odm_dlkm_specific
bool, Install to partition odm_dlkm when set to true.
overrides
list of string, List of module names that are prevented from being installed when this module gets
installed.
owner
string, vendor who owns this module
prefer_rlib
bool, Change the rustlibs linkage to select rlib linkage by default for device targets.
Also link libstd as an rlib as well on device targets.
Note: This is the default behavior for host targets.
This is primarily meant for rust_binary and rust_ffi modules where the default
linkage of libstd might need to be overridden in some use cases. This should
generally be avoided with other module types since it may cause collisions at
linkage if all dependencies of the root binary module do not link against libstd
the same way.
proc_macros
configurable list of string, list of rust proc_macro crate dependencies
product_available
bool, whether this module should be allowed to be directly depended by other
modules with `product_specific: true` or `product_available: true`.
If set to true, an additional product variant will be built separately
that is limited to the set of libraries and headers that are exposed to
/product modules.
The product variant may be used with a different (newer) /system,
so it shouldn't have any unversioned runtime dependencies, or
make assumptions about the system that may not be true in the
future.
If set to false, this module becomes inaccessible from /product modules.
Different from the 'vendor_available' property, the modules with
vndk: {enabled: true} don't have to define 'product_available'. The VNDK
library without 'product_available' may not be depended on by any other
modules that has product variants including the product available VNDKs.
Nothing happens if BOARD_VNDK_VERSION isn't set in the BoardConfig.mk
and PRODUCT_PRODUCT_VNDK_VERSION isn't set.
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.arc
⊕shared_libs
⊕static_libs
⊕srcs
⊕whole_static_libs
⊕product_variables.build_from_text_stub
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕strip.all
⊕strip.keep_symbols
⊕strip.keep_symbols_and_debug_frame
⊕static_libs
⊕whole_static_libs
⊕shared_libs
⊕srcs
⊕product_variables.eng
⊕product_variables.malloc_low_memory
⊕shared_libs
⊕whole_static_libs
⊕static_libs
⊕srcs
⊕product_variables.native_coverage
⊕product_variables.release_aidl_use_unfrozen
⊕required
⊕vintf_fragment_modules
⊕product_variables.selinuxignoreneverallows
⊕product_variables.unbundled_build
⊕enabled
Configurable[bool]
Configurable[bool]
proptools.Configurable[bool]
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
ramdisk_available
bool, Make this module available when building for ramdisk.
On device without a dedicated recovery partition, the module is only
available after switching root into
/first_stage_ramdisk. To expose the module before switching root, install
the recovery variant instead.
recovery
bool, Whether this module is installed to recovery partition
recovery_available
bool, Make this module available when building for recovery
relative_install_path
string, install to a subdirectory of the default install path for the module
require_root
bool, Add RootTargetPreparer to auto generated test config. This guarantees the test to run
with root permission.
required
configurable list of string, names of other modules to install if this module is installed
rlibs
configurable list of string, list of rust rlib crate dependencies
rustlibs
configurable list of string, list of rust automatic crate dependencies.
Rustlibs linkage is rlib for host targets and dylib for device targets.
⊕sanitize
enable AddressSanitizer, HWAddressSanitizer, and others.
address
bool
hwaddress
bool
memtag_heap
bool, Memory-tagging, only available on arm64
if diag.memtag unset or false, enables async memory tagging
fuzzer
bool
never
bool
⊕diag
Sanitizers to run in the diagnostic mode (as opposed to the release mode).
Replaces abort() on error with a human-readable error message.
Address and Thread sanitizers always run in diagnostic mode.
memtag_heap
bool, Memory-tagging, only available on arm64
requires sanitizer.memtag: true
if set, enables sync memory tagging
sdk_version
string, The API level that this module is built against. The APIs of this API level will be
visible at build time, but use of any APIs newer than min_sdk_version will render the
module unloadable on older devices. In the future it will be possible to weakly-link new
APIs, making the behavior match Java: such modules will load on older devices, but
calling new APIs on devices that do not support them will result in a crash.
This property has the same behavior as sdk_version does for Java modules. For those
familiar with Android Gradle, the property behaves similarly to how compileSdkVersion
does for Java code.
In addition, setting this property causes two variants to be built, one for the platform
and one for apps.
shared_libs
configurable list of string, list of C shared library dependencies
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
static_executable
bool, Builds this binary as a static binary. Implies prefer_rlib true.
Static executables currently only support for bionic targets. Non-bionic targets will not produce a fully static
binary, but will still implicitly imply prefer_rlib true.
static_libs
configurable list of string, list of C static library dependencies. These dependencies do not normally propagate to dependents
and may need to be redeclared. See whole_static_libs for bundling static dependencies into a library.
stdlibs
configurable list of string, list of Rust system library dependencies.
This is usually only needed when `no_stdlibs` is true, in which case it can be used to depend on system crates
like `core` and `alloc`.
stem
string, sets name of the output
⊕strip
none
bool, Device modules default to stripping enabled leaving mini debuginfo.
Host modules default to stripping disabled, but can be enabled by setting any other
strip boolean property.
all
bool, all forces stripping everything, including the mini debug info.
keep_symbols
bool, keep_symbols enables stripping but keeps all symbols.
keep_symbols_list
list of string, keep_symbols_list specifies a list of symbols to keep if keep_symbols is enabled.
If it is unset then all symbols are kept.
keep_symbols_and_debug_frame
bool, keep_symbols_and_debug_frame enables stripping but keeps all symbols and debug frames.
suffix
string, append to name of output
system_dlkm_specific
bool, Install to partition system_dlkm when set to true.
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
compile_multilib
string
enabled
bool
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
test_config
string, the name of the test configuration (for example "AndroidTest.xml") that should be
installed with the module.
test_config_template
string, the name of the test configuration template (for example "AndroidTestTemplate.xml") that
should be installed with the module.
test_harness
bool, if set, build with the standard Rust test harness. Defaults to true.
⊕test_options
*ast.SelectorExpr
Test options.
unit_test
bool, If the test is a hostside (no device required) unittest that shall be run
during presubmit check.
tags
list of string, Tags provide additional metadata to customize test execution by downstream
test runners. The tags have no special meaning to Soong.
test_suites
list of string, list of compatibility suites (for example "cts", "vts") that the module should be
installed into.
use_expansive_default_srcs
bool, Set this to true to use an expansive default set of source file requirements
(all .rs, .h, .xml, and .md files in the module tree).
This is primarily for tracking sources for RBE purposes. Currently defaults
to true, though this may change in the future.
use_generic_config
bool, Set to true if this module must be generic and does not require product-specific information.
To be included in the system image, this property must be set to true.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_available
bool, whether this module should be allowed to be directly depended by other
modules with `vendor: true`, `proprietary: true`, or `vendor_available:true`.
If set to true, two variants will be built separately, one like
normal, and the other limited to the set of libraries and headers
that are exposed to /vendor modules.
The vendor variant may be used with a different (newer) /system,
so it shouldn't have any unversioned runtime dependencies, or
make assumptions about the system that may not be true in the
future.
If set to false, this module becomes inaccessible from /vendor modules.
The modules with vndk: {enabled: true} must define 'vendor_available'
to 'true'.
Nothing happens if BOARD_VNDK_VERSION isn't set in the BoardConfig.mk
vendor_dlkm_specific
bool, Install to partition vendor_dlkm when set to true.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vendor_ramdisk_available
bool, Make this module available when building for vendor ramdisk.
On device without a dedicated recovery partition, the module is only
available after switching root into
/first_stage_ramdisk. To expose the module before switching root, install
the recovery variant instead
vintf_fragment_modules
configurable list of string, vintf_fragment Modules required from this module.
vintf_fragments
configurable list of string, VINTF manifest fragments to be installed if this module is installed
visibility
list of string, Controls the visibility of this module to other modules. Allowable values are one or more of
these formats:
["//visibility:public"]: Anyone can use this module.
["//visibility:private"]: Only rules in the module's package (not its subpackages) can use
this module.
["//visibility:override"]: Discards any rules inherited from defaults or a creating module.
Can only be used at the beginning of a list of visibility rules.
["//some/package:__pkg__", "//other/package:__pkg__"]: Only modules in some/package and
other/package (defined in some/package/*.bp and other/package/*.bp) have access to
this module. Note that sub-packages do not have access to the rule; for example,
//some/package/foo:bar or //other/package/testing:bla wouldn't have access. __pkg__
is a special module and must be used verbatim. It represents all of the modules in the
package.
["//project:__subpackages__", "//other:__subpackages__"]: Only modules in packages project
or other or in one of their sub-packages have access to this module. For example,
//project:rule, //project/library:lib or //other/testing/internal:munge are allowed
to depend on this rule (but not //independent:evil)
["//project"]: This is shorthand for ["//project:__pkg__"]
[":__subpackages__"]: This is shorthand for ["//project:__subpackages__"] where
//project is the module's package. e.g. using [":__subpackages__"] in
packages/apps/Settings/Android.bp is equivalent to
//packages/apps/Settings:__subpackages__.
["//visibility:legacy_public"]: The default visibility, behaves as //visibility:public
for now. It is an error if it is used in a module.
If a module does not specify the `visibility` property then it uses the
`default_visibility` property of the `package` module in the module's package.
If the `default_visibility` property is not set for the module's package then
it will use the `default_visibility` of its closest ancestor package for which
a `default_visibility` property is specified.
If no `default_visibility` property can be found then the module uses the
global default of `//visibility:legacy_public`.
The `visibility` property has no effect on a defaults module although it does
apply to any non-defaults module that uses it. To set the visibility of a
defaults module, use the `defaults_visibility` property on the defaults module;
not to be confused with the `default_visibility` property on the package module.
See https://android.googlesource.com/platform/build/soong/+/main/README.md#visibility for
more details.
whole_static_libs
configurable list of string, Similar to static_libs, but will bundle the static library dependency into a library. This is helpful
to avoid having to redeclare the dependency for dependents of this library, but in some cases may also
result in bloat if multiple dependencies all include the same static library whole.
The common use case for this is when the static library is unlikely to be a dependency of other modules to avoid
having to redeclare the static library dependency for every dependent module.
If you are not sure what to, for rust_library modules most static dependencies should go in static_libraries,
and for rust_ffi modules most static dependencies should go into whole_static_libraries.
For rust_ffi static variants, these libraries will be included in the resulting static library archive.
For rust_library rlib variants, these libraries will be bundled into the resulting rlib library. This will
include all of the static libraries symbols in any dylibs or binaries which use this rlib as well.
rust_toolchain_library produces all rust variants.
name
,
srcs
,
defaults
,
host_supported
,
device_supported
,
afdo
,
aliases
,
apex_available
,
apex_exclude
,
arch
,
bootstrap
,
cargo_env_compat
,
cargo_pkg_version
,
cfgs
,
clippy_lints
,
compile_multilib
,
crate_name
,
crate_root
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
double_loadable
,
dylib
,
edition
,
enabled
,
exclude_from_recovery_snapshot
,
exclude_from_vendor_snapshot
,
export_include_dirs
,
extra_exported_symbols
,
features
,
flags
,
host_cross_supported
,
host_required
,
include_dirs
,
init_rc
,
installable
,
ld_flags
,
licenses
,
lints
,
lto
,
min_sdk_version
,
multilib
,
native_bridge_supported
,
native_coverage
,
no_full_install
,
no_stdlibs
,
odm_available
,
odm_dlkm_specific
,
overrides
,
owner
,
prefer_rlib
,
proc_macros
,
product_available
,
product_specific
,
product_variables.arc
,
product_variables.build_from_text_stub
,
product_variables.debuggable
,
product_variables.eng
,
product_variables.malloc_low_memory
,
product_variables.native_coverage
,
product_variables.release_aidl_use_unfrozen
,
product_variables.selinuxignoreneverallows
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
ramdisk_available
,
recovery
,
recovery_available
,
relative_install_path
,
required
,
rlib
,
rlibs
,
rustlibs
,
sanitize
,
sdk_version
,
shared
,
shared_libs
,
soc_specific
,
static
,
static_libs
,
stdlibs
,
stem
,
strip
,
stubs
,
suffix
,
sysroot
,
system_dlkm_specific
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
toolchain_crate_root
,
toolchain_srcs
,
use_expansive_default_srcs
,
use_generic_config
,
vendor
,
vendor_available
,
vendor_dlkm_specific
,
vendor_ramdisk
,
vendor_ramdisk_available
,
version_script
,
vintf_fragment_modules
,
vintf_fragments
,
visibility
,
whole_static_libs
name
string, The name of the module. Must be unique across all modules.
srcs
list of string, path to the source file that is the main entry point of the program (e.g. main.rs or lib.rs).
Only a single source file can be defined. Modules which generate source can be included by prefixing
the module name with ":", for example ":libfoo_bindgen"
If no source file is defined, a single generated source module can be defined to be used as the main source.
defaults
list of string
host_supported
bool, If set to true, build a variant of the module for the host. Defaults to false.
device_supported
bool, If set to true, build a variant of the module for the device. Defaults to true.
afdo
bool, Afdo allows developers self-service enroll for
automatic feedback-directed optimization using profile data.
aliases
list of string, Rust crate dependencies to rename. Each entry should be a string of the form "dependencyname:alias".
"dependencyname" here should be the name of the crate, not the Android module. This is
equivalent to writing `alias = { package = "dependencyname" }` in a `Cargo.toml`.
apex_available
list of string, Availability of this module in APEXes. Only the listed APEXes can contain this module. If
the module has stubs then other APEXes and the platform may access it through them
(subject to visibility).
"//apex_available:anyapex" is a pseudo APEX name that matches to any APEX.
"//apex_available:platform" refers to non-APEX partitions like "system.img".
Prefix pattern (com.foo.*) can be used to match with any APEX name with the prefix(com.foo.).
Default is ["//apex_available:platform"].
apex_exclude
bool, Deprecated - exclude this rust_ffi target from being included in APEXes.
TODO(b/362509506): remove this once all apex_exclude uses are switched to stubs.
arch
interface
bootstrap
bool, Allows this module to use non-APEX version of libraries. Useful
for building binaries that are started before APEXes are activated.
cargo_env_compat
bool, Enables emitting certain Cargo environment variables. Only intended to be used for compatibility purposes.
Will set CARGO_CRATE_NAME to the crate_name property's value.
Will set CARGO_BIN_NAME to the output filename value without the extension.
cargo_pkg_version
string, If cargo_env_compat is true, sets the CARGO_PKG_VERSION env var to this value.
cfgs
configurable list of string, list of configuration options to enable for this crate. To enable features, use the "features" property.
clippy_lints
string, name of the lint set that should be used to validate this module.
Possible values are "default" (for using a sensible set of lints
depending on the module's location), "android" (for the strictest
lint set that applies to all Android platform code), "vendor" (for a
relaxed set) and "none" (to disable the execution of clippy). The
default value is "default". See also the `lints` property.
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
crate_name
string, crate name, required for modules which produce Rust libraries: rust_library, rust_ffi and SourceProvider
modules which create library variants (rust_bindgen). This must be the expected extern crate name used in
source, and is required to conform to an enforced format matching library output files (if the output file is
lib<someName><suffix>, the crate_name property must be <someName>).
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
prepend_artifact_with_product
bool, If true, then the artifact file will be prepended with <product name>-. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be coral-foo.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
double_loadable
bool, whether this module is capable of being loaded with other instance
(possibly an older version) of the same module in the same process.
Currently, a shared library that is a member of VNDK (vndk: {enabled: true})
can be double loaded in a vendor process if the library is also a
(direct and indirect) dependency of an LLNDK library. Such libraries must be
explicitly marked as `double_loadable: true` by the owner, or the dependency
from the LLNDK lib should be cut if the lib is not designed to be double loaded.
⊕dylib
VariantLibraryProperties
enabled
bool
srcs
list of string
edition
string, specific rust edition that should be used if the default version is not desired
enabled
configurable bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
exclude_from_recovery_snapshot
bool, Normally Soong uses the directory structure to decide which modules
should be included (framework) or excluded (non-framework) from the
different snapshots (vendor, recovery, etc.), but this property
allows a partner to exclude a module normally thought of as a
framework module from the recovery snapshot.
exclude_from_vendor_snapshot
bool, Normally Soong uses the directory structure to decide which modules
should be included (framework) or excluded (non-framework) from the
different snapshots (vendor, recovery, etc.), but this property
allows a partner to exclude a module normally thought of as a
framework module from the vendor snapshot.
export_include_dirs
list of string, path to include directories to export to cc_* modules, only relevant for static/shared variants.
features
configurable list of string, list of features to enable for this crate
flags
list of string, flags to pass to rustc. To enable configuration options or features, use the "cfgs" or "features" properties.
host_cross_supported
bool, If set to true, build a variant of the module for the host cross. Defaults to true.
host_required
list of string, names of other modules to install on host if this module is installed
include_dirs
list of string, TODO: Remove this when all instances of Include_dirs have been removed from rust_ffi modules.
path to include directories to pass to cc_* modules, only relevant for static/shared variants (deprecated, use export_include_dirs instead).
init_rc
configurable list of string, init.rc files to be installed if this module is installed
installable
bool
ld_flags
list of string, flags to pass to the linker
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
lints
string, name of the lint set that should be used to validate this module.
Possible values are "default" (for using a sensible set of lints
depending on the module's location), "android" (for the strictest
lint set that applies to all Android platform code), "vendor" (for
a relaxed set) and "none" (for ignoring all lint warnings and
errors). The default value is "default".
⊕lto
Control whether LTO is used for the final (Rust) linkage. This does not impact
cross-language LTO.
thin
bool, Whether thin LTO should be enabled. By default this is true.
LTO provides such a large code size benefit for Rust, this should always
be enabled for production builds unless there's a clear need to disable it.
min_sdk_version
string, Minimum OS API level supported by this C or C++ module. This property becomes the value
of the __ANDROID_API__ macro. When the C or C++ module is included in an APEX or an APK,
this property is also used to ensure that the min_sdk_version of the containing module is
not older (i.e. less) than this module's min_sdk_version. When not set, this property
defaults to the value of sdk_version. When this is set to "apex_inherit", this tracks
min_sdk_version of the containing APEX. When the module
is not built for an APEX, "apex_inherit" defaults to sdk_version.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
native_coverage
bool
no_full_install
bool, When set to true, this module is not installed to the full install path (ex: under
out/target/product/<name>/<partition>). It can be installed only to the packaging
modules like android_filesystem.
no_stdlibs
bool, whether to suppress inclusion of standard crates - defaults to false
odm_available
bool, This is the same as the "vendor_available" except that the install path
of the vendor variant is /odm or /vendor/odm.
By replacing "vendor_available: true" with "odm_available: true", the
module will install its vendor variant to the /odm partition or /vendor/odm.
As the modules with "odm_available: true" still create the vendor variants,
they can link to the other vendor modules as the vendor_available modules do.
Also, the vendor modules can link to odm_available modules.
It may not be used for VNDK modules.
odm_dlkm_specific
bool, Install to partition odm_dlkm when set to true.
overrides
list of string, List of module names that are prevented from being installed when this module gets
installed.
owner
string, vendor who owns this module
prefer_rlib
bool, Change the rustlibs linkage to select rlib linkage by default for device targets.
Also link libstd as an rlib as well on device targets.
Note: This is the default behavior for host targets.
This is primarily meant for rust_binary and rust_ffi modules where the default
linkage of libstd might need to be overridden in some use cases. This should
generally be avoided with other module types since it may cause collisions at
linkage if all dependencies of the root binary module do not link against libstd
the same way.
proc_macros
configurable list of string, list of rust proc_macro crate dependencies
product_available
bool, whether this module should be allowed to be directly depended by other
modules with `product_specific: true` or `product_available: true`.
If set to true, an additional product variant will be built separately
that is limited to the set of libraries and headers that are exposed to
/product modules.
The product variant may be used with a different (newer) /system,
so it shouldn't have any unversioned runtime dependencies, or
make assumptions about the system that may not be true in the
future.
If set to false, this module becomes inaccessible from /product modules.
Different from the 'vendor_available' property, the modules with
vndk: {enabled: true} don't have to define 'product_available'. The VNDK
library without 'product_available' may not be depended on by any other
modules that has product variants including the product available VNDKs.
Nothing happens if BOARD_VNDK_VERSION isn't set in the BoardConfig.mk
and PRODUCT_PRODUCT_VNDK_VERSION isn't set.
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.arc
⊕include_dirs
⊕shared_libs
⊕static_libs
⊕srcs
⊕whole_static_libs
⊕product_variables.build_from_text_stub
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕strip.all
⊕strip.keep_symbols
⊕strip.keep_symbols_and_debug_frame
⊕static_libs
⊕whole_static_libs
⊕shared_libs
⊕srcs
⊕product_variables.eng
⊕product_variables.malloc_low_memory
⊕shared_libs
⊕whole_static_libs
⊕static_libs
⊕srcs
⊕product_variables.native_coverage
⊕product_variables.release_aidl_use_unfrozen
⊕required
⊕vintf_fragment_modules
⊕product_variables.selinuxignoreneverallows
⊕product_variables.unbundled_build
⊕enabled
Configurable[bool]
Configurable[bool]
proptools.Configurable[bool]
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
ramdisk_available
bool, Make this module available when building for ramdisk.
On device without a dedicated recovery partition, the module is only
available after switching root into
/first_stage_ramdisk. To expose the module before switching root, install
the recovery variant instead.
recovery
bool, Whether this module is installed to recovery partition
recovery_available
bool, Make this module available when building for recovery
relative_install_path
string, install to a subdirectory of the default install path for the module
required
configurable list of string, names of other modules to install if this module is installed
⊕rlib
VariantLibraryProperties
enabled
bool
srcs
list of string
rlibs
configurable list of string, list of rust rlib crate dependencies
rustlibs
configurable list of string, list of rust automatic crate dependencies.
Rustlibs linkage is rlib for host targets and dylib for device targets.
⊕sanitize
enable AddressSanitizer, HWAddressSanitizer, and others.
address
bool
hwaddress
bool
memtag_heap
bool, Memory-tagging, only available on arm64
if diag.memtag unset or false, enables async memory tagging
fuzzer
bool
never
bool
⊕diag
Sanitizers to run in the diagnostic mode (as opposed to the release mode).
Replaces abort() on error with a human-readable error message.
Address and Thread sanitizers always run in diagnostic mode.
memtag_heap
bool, Memory-tagging, only available on arm64
requires sanitizer.memtag: true
if set, enables sync memory tagging
sdk_version
string, The API level that this module is built against. The APIs of this API level will be
visible at build time, but use of any APIs newer than min_sdk_version will render the
module unloadable on older devices. In the future it will be possible to weakly-link new
APIs, making the behavior match Java: such modules will load on older devices, but
calling new APIs on devices that do not support them will result in a crash.
This property has the same behavior as sdk_version does for Java modules. For those
familiar with Android Gradle, the property behaves similarly to how compileSdkVersion
does for Java code.
In addition, setting this property causes two variants to be built, one for the platform
and one for apps.
⊕shared
VariantLibraryProperties
enabled
bool
srcs
list of string
shared_libs
configurable list of string, list of C shared library dependencies
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
⊕static
VariantLibraryProperties
enabled
bool
srcs
list of string
static_libs
configurable list of string, list of C static library dependencies. These dependencies do not normally propagate to dependents
and may need to be redeclared. See whole_static_libs for bundling static dependencies into a library.
stdlibs
configurable list of string, list of Rust system library dependencies.
This is usually only needed when `no_stdlibs` is true, in which case it can be used to depend on system crates
like `core` and `alloc`.
stem
string, sets name of the output
⊕strip
none
bool, Device modules default to stripping enabled leaving mini debuginfo.
Host modules default to stripping disabled, but can be enabled by setting any other
strip boolean property.
all
bool, all forces stripping everything, including the mini debug info.
keep_symbols
bool, keep_symbols enables stripping but keeps all symbols.
keep_symbols_list
list of string, keep_symbols_list specifies a list of symbols to keep if keep_symbols is enabled.
If it is unset then all symbols are kept.
keep_symbols_and_debug_frame
bool, keep_symbols_and_debug_frame enables stripping but keeps all symbols and debug frames.
⊕stubs
*ast.SelectorExpr
Generate stubs to make this library accessible to APEXes.
Can only be set for modules producing shared libraries.
symbol_file
string, Relative path to the symbol map. The symbol map provides the list of
symbols that are exported for stubs variant of this library.
versions
list of string, List versions to generate stubs libs for. The version name "current" is always
implicitly added.
implementation_installable
bool, Whether to not require the implementation of the library to be installed if a
client of the stubs is installed. Defaults to true; set to false if the
implementation is made available by some other means, e.g. in a Microdroid
virtual machine.
suffix
string, append to name of output
sysroot
bool, Whether this library is part of the Rust toolchain sysroot.
system_dlkm_specific
bool, Install to partition system_dlkm when set to true.
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
compile_multilib
string
enabled
bool
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
toolchain_crate_root
string, path to the toolchain crate root, relative to the top of the toolchain source
toolchain_srcs
list of string, path to the rest of the toolchain srcs, relative to the top of the toolchain source
use_expansive_default_srcs
bool, Set this to true to use an expansive default set of source file requirements
(all .rs, .h, .xml, and .md files in the module tree).
This is primarily for tracking sources for RBE purposes. Currently defaults
to true, though this may change in the future.
use_generic_config
bool, Set to true if this module must be generic and does not require product-specific information.
To be included in the system image, this property must be set to true.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_available
bool, whether this module should be allowed to be directly depended by other
modules with `vendor: true`, `proprietary: true`, or `vendor_available:true`.
If set to true, two variants will be built separately, one like
normal, and the other limited to the set of libraries and headers
that are exposed to /vendor modules.
The vendor variant may be used with a different (newer) /system,
so it shouldn't have any unversioned runtime dependencies, or
make assumptions about the system that may not be true in the
future.
If set to false, this module becomes inaccessible from /vendor modules.
The modules with vndk: {enabled: true} must define 'vendor_available'
to 'true'.
Nothing happens if BOARD_VNDK_VERSION isn't set in the BoardConfig.mk
vendor_dlkm_specific
bool, Install to partition vendor_dlkm when set to true.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vendor_ramdisk_available
bool, Make this module available when building for vendor ramdisk.
On device without a dedicated recovery partition, the module is only
available after switching root into
/first_stage_ramdisk. To expose the module before switching root, install
the recovery variant instead
version_script
string, Version script to pass to the linker. By default this will replace the
implicit rustc emitted version script to mirror expected behavior in CC.
This is only relevant for rust_ffi_shared modules which are exposing a
versioned C API.
vintf_fragment_modules
configurable list of string, vintf_fragment Modules required from this module.
vintf_fragments
configurable list of string, VINTF manifest fragments to be installed if this module is installed
whole_static_libs
configurable list of string, Similar to static_libs, but will bundle the static library dependency into a library. This is helpful
to avoid having to redeclare the dependency for dependents of this library, but in some cases may also
result in bloat if multiple dependencies all include the same static library whole.
The common use case for this is when the static library is unlikely to be a dependency of other modules to avoid
having to redeclare the static library dependency for every dependent module.
If you are not sure what to, for rust_library modules most static dependencies should go in static_libraries,
and for rust_ffi modules most static dependencies should go into whole_static_libraries.
For rust_ffi static variants, these libraries will be included in the resulting static library archive.
For rust_library rlib variants, these libraries will be bundled into the resulting rlib library. This will
include all of the static libraries symbols in any dylibs or binaries which use this rlib as well.
rust_toolchain_library_dylib produces a dylib.
name
,
srcs
,
defaults
,
host_supported
,
device_supported
,
afdo
,
aliases
,
apex_available
,
apex_exclude
,
arch
,
bootstrap
,
cargo_env_compat
,
cargo_pkg_version
,
cfgs
,
clippy_lints
,
compile_multilib
,
crate_name
,
crate_root
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
double_loadable
,
dylib
,
edition
,
enabled
,
exclude_from_recovery_snapshot
,
exclude_from_vendor_snapshot
,
export_include_dirs
,
extra_exported_symbols
,
features
,
flags
,
host_cross_supported
,
host_required
,
include_dirs
,
init_rc
,
installable
,
ld_flags
,
licenses
,
lints
,
lto
,
min_sdk_version
,
multilib
,
native_bridge_supported
,
native_coverage
,
no_full_install
,
no_stdlibs
,
odm_available
,
odm_dlkm_specific
,
overrides
,
owner
,
prefer_rlib
,
proc_macros
,
product_available
,
product_specific
,
product_variables.arc
,
product_variables.build_from_text_stub
,
product_variables.debuggable
,
product_variables.eng
,
product_variables.malloc_low_memory
,
product_variables.native_coverage
,
product_variables.release_aidl_use_unfrozen
,
product_variables.selinuxignoreneverallows
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
ramdisk_available
,
recovery
,
recovery_available
,
relative_install_path
,
required
,
rlib
,
rlibs
,
rustlibs
,
sanitize
,
sdk_version
,
shared
,
shared_libs
,
soc_specific
,
static
,
static_libs
,
stdlibs
,
stem
,
strip
,
stubs
,
suffix
,
sysroot
,
system_dlkm_specific
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
toolchain_crate_root
,
toolchain_srcs
,
use_expansive_default_srcs
,
use_generic_config
,
vendor
,
vendor_available
,
vendor_dlkm_specific
,
vendor_ramdisk
,
vendor_ramdisk_available
,
version_script
,
vintf_fragment_modules
,
vintf_fragments
,
visibility
,
whole_static_libs
name
string, The name of the module. Must be unique across all modules.
srcs
list of string, path to the source file that is the main entry point of the program (e.g. main.rs or lib.rs).
Only a single source file can be defined. Modules which generate source can be included by prefixing
the module name with ":", for example ":libfoo_bindgen"
If no source file is defined, a single generated source module can be defined to be used as the main source.
defaults
list of string
host_supported
bool, If set to true, build a variant of the module for the host. Defaults to false.
device_supported
bool, If set to true, build a variant of the module for the device. Defaults to true.
afdo
bool, Afdo allows developers self-service enroll for
automatic feedback-directed optimization using profile data.
aliases
list of string, Rust crate dependencies to rename. Each entry should be a string of the form "dependencyname:alias".
"dependencyname" here should be the name of the crate, not the Android module. This is
equivalent to writing `alias = { package = "dependencyname" }` in a `Cargo.toml`.
apex_available
list of string, Availability of this module in APEXes. Only the listed APEXes can contain this module. If
the module has stubs then other APEXes and the platform may access it through them
(subject to visibility).
"//apex_available:anyapex" is a pseudo APEX name that matches to any APEX.
"//apex_available:platform" refers to non-APEX partitions like "system.img".
Prefix pattern (com.foo.*) can be used to match with any APEX name with the prefix(com.foo.).
Default is ["//apex_available:platform"].
apex_exclude
bool, Deprecated - exclude this rust_ffi target from being included in APEXes.
TODO(b/362509506): remove this once all apex_exclude uses are switched to stubs.
arch
interface
bootstrap
bool, Allows this module to use non-APEX version of libraries. Useful
for building binaries that are started before APEXes are activated.
cargo_env_compat
bool, Enables emitting certain Cargo environment variables. Only intended to be used for compatibility purposes.
Will set CARGO_CRATE_NAME to the crate_name property's value.
Will set CARGO_BIN_NAME to the output filename value without the extension.
cargo_pkg_version
string, If cargo_env_compat is true, sets the CARGO_PKG_VERSION env var to this value.
cfgs
configurable list of string, list of configuration options to enable for this crate. To enable features, use the "features" property.
clippy_lints
string, name of the lint set that should be used to validate this module.
Possible values are "default" (for using a sensible set of lints
depending on the module's location), "android" (for the strictest
lint set that applies to all Android platform code), "vendor" (for a
relaxed set) and "none" (to disable the execution of clippy). The
default value is "default". See also the `lints` property.
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
crate_name
string, crate name, required for modules which produce Rust libraries: rust_library, rust_ffi and SourceProvider
modules which create library variants (rust_bindgen). This must be the expected extern crate name used in
source, and is required to conform to an enforced format matching library output files (if the output file is
lib<someName><suffix>, the crate_name property must be <someName>).
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
prepend_artifact_with_product
bool, If true, then the artifact file will be prepended with <product name>-. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be coral-foo.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
double_loadable
bool, whether this module is capable of being loaded with other instance
(possibly an older version) of the same module in the same process.
Currently, a shared library that is a member of VNDK (vndk: {enabled: true})
can be double loaded in a vendor process if the library is also a
(direct and indirect) dependency of an LLNDK library. Such libraries must be
explicitly marked as `double_loadable: true` by the owner, or the dependency
from the LLNDK lib should be cut if the lib is not designed to be double loaded.
⊕dylib
VariantLibraryProperties
enabled
bool
srcs
list of string
edition
string, specific rust edition that should be used if the default version is not desired
enabled
configurable bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
exclude_from_recovery_snapshot
bool, Normally Soong uses the directory structure to decide which modules
should be included (framework) or excluded (non-framework) from the
different snapshots (vendor, recovery, etc.), but this property
allows a partner to exclude a module normally thought of as a
framework module from the recovery snapshot.
exclude_from_vendor_snapshot
bool, Normally Soong uses the directory structure to decide which modules
should be included (framework) or excluded (non-framework) from the
different snapshots (vendor, recovery, etc.), but this property
allows a partner to exclude a module normally thought of as a
framework module from the vendor snapshot.
export_include_dirs
list of string, path to include directories to export to cc_* modules, only relevant for static/shared variants.
features
configurable list of string, list of features to enable for this crate
flags
list of string, flags to pass to rustc. To enable configuration options or features, use the "cfgs" or "features" properties.
host_cross_supported
bool, If set to true, build a variant of the module for the host cross. Defaults to true.
host_required
list of string, names of other modules to install on host if this module is installed
include_dirs
list of string, TODO: Remove this when all instances of Include_dirs have been removed from rust_ffi modules.
path to include directories to pass to cc_* modules, only relevant for static/shared variants (deprecated, use export_include_dirs instead).
init_rc
configurable list of string, init.rc files to be installed if this module is installed
installable
bool
ld_flags
list of string, flags to pass to the linker
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
lints
string, name of the lint set that should be used to validate this module.
Possible values are "default" (for using a sensible set of lints
depending on the module's location), "android" (for the strictest
lint set that applies to all Android platform code), "vendor" (for
a relaxed set) and "none" (for ignoring all lint warnings and
errors). The default value is "default".
⊕lto
Control whether LTO is used for the final (Rust) linkage. This does not impact
cross-language LTO.
thin
bool, Whether thin LTO should be enabled. By default this is true.
LTO provides such a large code size benefit for Rust, this should always
be enabled for production builds unless there's a clear need to disable it.
min_sdk_version
string, Minimum OS API level supported by this C or C++ module. This property becomes the value
of the __ANDROID_API__ macro. When the C or C++ module is included in an APEX or an APK,
this property is also used to ensure that the min_sdk_version of the containing module is
not older (i.e. less) than this module's min_sdk_version. When not set, this property
defaults to the value of sdk_version. When this is set to "apex_inherit", this tracks
min_sdk_version of the containing APEX. When the module
is not built for an APEX, "apex_inherit" defaults to sdk_version.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
native_coverage
bool
no_full_install
bool, When set to true, this module is not installed to the full install path (ex: under
out/target/product/<name>/<partition>). It can be installed only to the packaging
modules like android_filesystem.
no_stdlibs
bool, whether to suppress inclusion of standard crates - defaults to false
odm_available
bool, This is the same as the "vendor_available" except that the install path
of the vendor variant is /odm or /vendor/odm.
By replacing "vendor_available: true" with "odm_available: true", the
module will install its vendor variant to the /odm partition or /vendor/odm.
As the modules with "odm_available: true" still create the vendor variants,
they can link to the other vendor modules as the vendor_available modules do.
Also, the vendor modules can link to odm_available modules.
It may not be used for VNDK modules.
odm_dlkm_specific
bool, Install to partition odm_dlkm when set to true.
overrides
list of string, List of module names that are prevented from being installed when this module gets
installed.
owner
string, vendor who owns this module
prefer_rlib
bool, Change the rustlibs linkage to select rlib linkage by default for device targets.
Also link libstd as an rlib as well on device targets.
Note: This is the default behavior for host targets.
This is primarily meant for rust_binary and rust_ffi modules where the default
linkage of libstd might need to be overridden in some use cases. This should
generally be avoided with other module types since it may cause collisions at
linkage if all dependencies of the root binary module do not link against libstd
the same way.
proc_macros
configurable list of string, list of rust proc_macro crate dependencies
product_available
bool, whether this module should be allowed to be directly depended by other
modules with `product_specific: true` or `product_available: true`.
If set to true, an additional product variant will be built separately
that is limited to the set of libraries and headers that are exposed to
/product modules.
The product variant may be used with a different (newer) /system,
so it shouldn't have any unversioned runtime dependencies, or
make assumptions about the system that may not be true in the
future.
If set to false, this module becomes inaccessible from /product modules.
Different from the 'vendor_available' property, the modules with
vndk: {enabled: true} don't have to define 'product_available'. The VNDK
library without 'product_available' may not be depended on by any other
modules that has product variants including the product available VNDKs.
Nothing happens if BOARD_VNDK_VERSION isn't set in the BoardConfig.mk
and PRODUCT_PRODUCT_VNDK_VERSION isn't set.
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.arc
⊕include_dirs
⊕shared_libs
⊕static_libs
⊕srcs
⊕whole_static_libs
⊕product_variables.build_from_text_stub
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕strip.all
⊕strip.keep_symbols
⊕strip.keep_symbols_and_debug_frame
⊕static_libs
⊕whole_static_libs
⊕shared_libs
⊕srcs
⊕product_variables.eng
⊕product_variables.malloc_low_memory
⊕shared_libs
⊕whole_static_libs
⊕static_libs
⊕srcs
⊕product_variables.native_coverage
⊕product_variables.release_aidl_use_unfrozen
⊕required
⊕vintf_fragment_modules
⊕product_variables.selinuxignoreneverallows
⊕product_variables.unbundled_build
⊕enabled
Configurable[bool]
Configurable[bool]
proptools.Configurable[bool]
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
ramdisk_available
bool, Make this module available when building for ramdisk.
On device without a dedicated recovery partition, the module is only
available after switching root into
/first_stage_ramdisk. To expose the module before switching root, install
the recovery variant instead.
recovery
bool, Whether this module is installed to recovery partition
recovery_available
bool, Make this module available when building for recovery
relative_install_path
string, install to a subdirectory of the default install path for the module
required
configurable list of string, names of other modules to install if this module is installed
⊕rlib
VariantLibraryProperties
enabled
bool
srcs
list of string
rlibs
configurable list of string, list of rust rlib crate dependencies
rustlibs
configurable list of string, list of rust automatic crate dependencies.
Rustlibs linkage is rlib for host targets and dylib for device targets.
⊕sanitize
enable AddressSanitizer, HWAddressSanitizer, and others.
address
bool
hwaddress
bool
memtag_heap
bool, Memory-tagging, only available on arm64
if diag.memtag unset or false, enables async memory tagging
fuzzer
bool
never
bool
⊕diag
Sanitizers to run in the diagnostic mode (as opposed to the release mode).
Replaces abort() on error with a human-readable error message.
Address and Thread sanitizers always run in diagnostic mode.
memtag_heap
bool, Memory-tagging, only available on arm64
requires sanitizer.memtag: true
if set, enables sync memory tagging
sdk_version
string, The API level that this module is built against. The APIs of this API level will be
visible at build time, but use of any APIs newer than min_sdk_version will render the
module unloadable on older devices. In the future it will be possible to weakly-link new
APIs, making the behavior match Java: such modules will load on older devices, but
calling new APIs on devices that do not support them will result in a crash.
This property has the same behavior as sdk_version does for Java modules. For those
familiar with Android Gradle, the property behaves similarly to how compileSdkVersion
does for Java code.
In addition, setting this property causes two variants to be built, one for the platform
and one for apps.
⊕shared
VariantLibraryProperties
enabled
bool
srcs
list of string
shared_libs
configurable list of string, list of C shared library dependencies
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
⊕static
VariantLibraryProperties
enabled
bool
srcs
list of string
static_libs
configurable list of string, list of C static library dependencies. These dependencies do not normally propagate to dependents
and may need to be redeclared. See whole_static_libs for bundling static dependencies into a library.
stdlibs
configurable list of string, list of Rust system library dependencies.
This is usually only needed when `no_stdlibs` is true, in which case it can be used to depend on system crates
like `core` and `alloc`.
stem
string, sets name of the output
⊕strip
none
bool, Device modules default to stripping enabled leaving mini debuginfo.
Host modules default to stripping disabled, but can be enabled by setting any other
strip boolean property.
all
bool, all forces stripping everything, including the mini debug info.
keep_symbols
bool, keep_symbols enables stripping but keeps all symbols.
keep_symbols_list
list of string, keep_symbols_list specifies a list of symbols to keep if keep_symbols is enabled.
If it is unset then all symbols are kept.
keep_symbols_and_debug_frame
bool, keep_symbols_and_debug_frame enables stripping but keeps all symbols and debug frames.
⊕stubs
*ast.SelectorExpr
Generate stubs to make this library accessible to APEXes.
Can only be set for modules producing shared libraries.
symbol_file
string, Relative path to the symbol map. The symbol map provides the list of
symbols that are exported for stubs variant of this library.
versions
list of string, List versions to generate stubs libs for. The version name "current" is always
implicitly added.
implementation_installable
bool, Whether to not require the implementation of the library to be installed if a
client of the stubs is installed. Defaults to true; set to false if the
implementation is made available by some other means, e.g. in a Microdroid
virtual machine.
suffix
string, append to name of output
sysroot
bool, Whether this library is part of the Rust toolchain sysroot.
system_dlkm_specific
bool, Install to partition system_dlkm when set to true.
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
compile_multilib
string
enabled
bool
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
toolchain_crate_root
string, path to the toolchain crate root, relative to the top of the toolchain source
toolchain_srcs
list of string, path to the rest of the toolchain srcs, relative to the top of the toolchain source
use_expansive_default_srcs
bool, Set this to true to use an expansive default set of source file requirements
(all .rs, .h, .xml, and .md files in the module tree).
This is primarily for tracking sources for RBE purposes. Currently defaults
to true, though this may change in the future.
use_generic_config
bool, Set to true if this module must be generic and does not require product-specific information.
To be included in the system image, this property must be set to true.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_available
bool, whether this module should be allowed to be directly depended by other
modules with `vendor: true`, `proprietary: true`, or `vendor_available:true`.
If set to true, two variants will be built separately, one like
normal, and the other limited to the set of libraries and headers
that are exposed to /vendor modules.
The vendor variant may be used with a different (newer) /system,
so it shouldn't have any unversioned runtime dependencies, or
make assumptions about the system that may not be true in the
future.
If set to false, this module becomes inaccessible from /vendor modules.
The modules with vndk: {enabled: true} must define 'vendor_available'
to 'true'.
Nothing happens if BOARD_VNDK_VERSION isn't set in the BoardConfig.mk
vendor_dlkm_specific
bool, Install to partition vendor_dlkm when set to true.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vendor_ramdisk_available
bool, Make this module available when building for vendor ramdisk.
On device without a dedicated recovery partition, the module is only
available after switching root into
/first_stage_ramdisk. To expose the module before switching root, install
the recovery variant instead
version_script
string, Version script to pass to the linker. By default this will replace the
implicit rustc emitted version script to mirror expected behavior in CC.
This is only relevant for rust_ffi_shared modules which are exposing a
versioned C API.
vintf_fragment_modules
configurable list of string, vintf_fragment Modules required from this module.
vintf_fragments
configurable list of string, VINTF manifest fragments to be installed if this module is installed
whole_static_libs
configurable list of string, Similar to static_libs, but will bundle the static library dependency into a library. This is helpful
to avoid having to redeclare the dependency for dependents of this library, but in some cases may also
result in bloat if multiple dependencies all include the same static library whole.
The common use case for this is when the static library is unlikely to be a dependency of other modules to avoid
having to redeclare the static library dependency for every dependent module.
If you are not sure what to, for rust_library modules most static dependencies should go in static_libraries,
and for rust_ffi modules most static dependencies should go into whole_static_libraries.
For rust_ffi static variants, these libraries will be included in the resulting static library archive.
For rust_library rlib variants, these libraries will be bundled into the resulting rlib library. This will
include all of the static libraries symbols in any dylibs or binaries which use this rlib as well.
rust_toolchain_library_rlib produces an rlib.
name
,
srcs
,
defaults
,
host_supported
,
device_supported
,
afdo
,
aliases
,
apex_available
,
apex_exclude
,
arch
,
bootstrap
,
cargo_env_compat
,
cargo_pkg_version
,
cfgs
,
clippy_lints
,
compile_multilib
,
crate_name
,
crate_root
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
double_loadable
,
dylib
,
edition
,
enabled
,
exclude_from_recovery_snapshot
,
exclude_from_vendor_snapshot
,
export_include_dirs
,
extra_exported_symbols
,
features
,
flags
,
host_cross_supported
,
host_required
,
include_dirs
,
init_rc
,
installable
,
ld_flags
,
licenses
,
lints
,
lto
,
min_sdk_version
,
multilib
,
native_bridge_supported
,
native_coverage
,
no_full_install
,
no_stdlibs
,
odm_available
,
odm_dlkm_specific
,
overrides
,
owner
,
prefer_rlib
,
proc_macros
,
product_available
,
product_specific
,
product_variables.arc
,
product_variables.build_from_text_stub
,
product_variables.debuggable
,
product_variables.eng
,
product_variables.malloc_low_memory
,
product_variables.native_coverage
,
product_variables.release_aidl_use_unfrozen
,
product_variables.selinuxignoreneverallows
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
ramdisk_available
,
recovery
,
recovery_available
,
relative_install_path
,
required
,
rlib
,
rlibs
,
rustlibs
,
sanitize
,
sdk_version
,
shared
,
shared_libs
,
soc_specific
,
static
,
static_libs
,
stdlibs
,
stem
,
strip
,
stubs
,
suffix
,
sysroot
,
system_dlkm_specific
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
toolchain_crate_root
,
toolchain_srcs
,
use_expansive_default_srcs
,
use_generic_config
,
vendor
,
vendor_available
,
vendor_dlkm_specific
,
vendor_ramdisk
,
vendor_ramdisk_available
,
version_script
,
vintf_fragment_modules
,
vintf_fragments
,
visibility
,
whole_static_libs
name
string, The name of the module. Must be unique across all modules.
srcs
list of string, path to the source file that is the main entry point of the program (e.g. main.rs or lib.rs).
Only a single source file can be defined. Modules which generate source can be included by prefixing
the module name with ":", for example ":libfoo_bindgen"
If no source file is defined, a single generated source module can be defined to be used as the main source.
defaults
list of string
host_supported
bool, If set to true, build a variant of the module for the host. Defaults to false.
device_supported
bool, If set to true, build a variant of the module for the device. Defaults to true.
afdo
bool, Afdo allows developers self-service enroll for
automatic feedback-directed optimization using profile data.
aliases
list of string, Rust crate dependencies to rename. Each entry should be a string of the form "dependencyname:alias".
"dependencyname" here should be the name of the crate, not the Android module. This is
equivalent to writing `alias = { package = "dependencyname" }` in a `Cargo.toml`.
apex_available
list of string, Availability of this module in APEXes. Only the listed APEXes can contain this module. If
the module has stubs then other APEXes and the platform may access it through them
(subject to visibility).
"//apex_available:anyapex" is a pseudo APEX name that matches to any APEX.
"//apex_available:platform" refers to non-APEX partitions like "system.img".
Prefix pattern (com.foo.*) can be used to match with any APEX name with the prefix(com.foo.).
Default is ["//apex_available:platform"].
apex_exclude
bool, Deprecated - exclude this rust_ffi target from being included in APEXes.
TODO(b/362509506): remove this once all apex_exclude uses are switched to stubs.
arch
interface
bootstrap
bool, Allows this module to use non-APEX version of libraries. Useful
for building binaries that are started before APEXes are activated.
cargo_env_compat
bool, Enables emitting certain Cargo environment variables. Only intended to be used for compatibility purposes.
Will set CARGO_CRATE_NAME to the crate_name property's value.
Will set CARGO_BIN_NAME to the output filename value without the extension.
cargo_pkg_version
string, If cargo_env_compat is true, sets the CARGO_PKG_VERSION env var to this value.
cfgs
configurable list of string, list of configuration options to enable for this crate. To enable features, use the "features" property.
clippy_lints
string, name of the lint set that should be used to validate this module.
Possible values are "default" (for using a sensible set of lints
depending on the module's location), "android" (for the strictest
lint set that applies to all Android platform code), "vendor" (for a
relaxed set) and "none" (to disable the execution of clippy). The
default value is "default". See also the `lints` property.
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
crate_name
string, crate name, required for modules which produce Rust libraries: rust_library, rust_ffi and SourceProvider
modules which create library variants (rust_bindgen). This must be the expected extern crate name used in
source, and is required to conform to an enforced format matching library output files (if the output file is
lib<someName><suffix>, the crate_name property must be <someName>).
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
prepend_artifact_with_product
bool, If true, then the artifact file will be prepended with <product name>-. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be coral-foo.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
double_loadable
bool, whether this module is capable of being loaded with other instance
(possibly an older version) of the same module in the same process.
Currently, a shared library that is a member of VNDK (vndk: {enabled: true})
can be double loaded in a vendor process if the library is also a
(direct and indirect) dependency of an LLNDK library. Such libraries must be
explicitly marked as `double_loadable: true` by the owner, or the dependency
from the LLNDK lib should be cut if the lib is not designed to be double loaded.
⊕dylib
VariantLibraryProperties
enabled
bool
srcs
list of string
edition
string, specific rust edition that should be used if the default version is not desired
enabled
configurable bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
exclude_from_recovery_snapshot
bool, Normally Soong uses the directory structure to decide which modules
should be included (framework) or excluded (non-framework) from the
different snapshots (vendor, recovery, etc.), but this property
allows a partner to exclude a module normally thought of as a
framework module from the recovery snapshot.
exclude_from_vendor_snapshot
bool, Normally Soong uses the directory structure to decide which modules
should be included (framework) or excluded (non-framework) from the
different snapshots (vendor, recovery, etc.), but this property
allows a partner to exclude a module normally thought of as a
framework module from the vendor snapshot.
export_include_dirs
list of string, path to include directories to export to cc_* modules, only relevant for static/shared variants.
features
configurable list of string, list of features to enable for this crate
flags
list of string, flags to pass to rustc. To enable configuration options or features, use the "cfgs" or "features" properties.
host_cross_supported
bool, If set to true, build a variant of the module for the host cross. Defaults to true.
host_required
list of string, names of other modules to install on host if this module is installed
include_dirs
list of string, TODO: Remove this when all instances of Include_dirs have been removed from rust_ffi modules.
path to include directories to pass to cc_* modules, only relevant for static/shared variants (deprecated, use export_include_dirs instead).
init_rc
configurable list of string, init.rc files to be installed if this module is installed
installable
bool
ld_flags
list of string, flags to pass to the linker
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
lints
string, name of the lint set that should be used to validate this module.
Possible values are "default" (for using a sensible set of lints
depending on the module's location), "android" (for the strictest
lint set that applies to all Android platform code), "vendor" (for
a relaxed set) and "none" (for ignoring all lint warnings and
errors). The default value is "default".
⊕lto
Control whether LTO is used for the final (Rust) linkage. This does not impact
cross-language LTO.
thin
bool, Whether thin LTO should be enabled. By default this is true.
LTO provides such a large code size benefit for Rust, this should always
be enabled for production builds unless there's a clear need to disable it.
min_sdk_version
string, Minimum OS API level supported by this C or C++ module. This property becomes the value
of the __ANDROID_API__ macro. When the C or C++ module is included in an APEX or an APK,
this property is also used to ensure that the min_sdk_version of the containing module is
not older (i.e. less) than this module's min_sdk_version. When not set, this property
defaults to the value of sdk_version. When this is set to "apex_inherit", this tracks
min_sdk_version of the containing APEX. When the module
is not built for an APEX, "apex_inherit" defaults to sdk_version.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
native_coverage
bool
no_full_install
bool, When set to true, this module is not installed to the full install path (ex: under
out/target/product/<name>/<partition>). It can be installed only to the packaging
modules like android_filesystem.
no_stdlibs
bool, whether to suppress inclusion of standard crates - defaults to false
odm_available
bool, This is the same as the "vendor_available" except that the install path
of the vendor variant is /odm or /vendor/odm.
By replacing "vendor_available: true" with "odm_available: true", the
module will install its vendor variant to the /odm partition or /vendor/odm.
As the modules with "odm_available: true" still create the vendor variants,
they can link to the other vendor modules as the vendor_available modules do.
Also, the vendor modules can link to odm_available modules.
It may not be used for VNDK modules.
odm_dlkm_specific
bool, Install to partition odm_dlkm when set to true.
overrides
list of string, List of module names that are prevented from being installed when this module gets
installed.
owner
string, vendor who owns this module
prefer_rlib
bool, Change the rustlibs linkage to select rlib linkage by default for device targets.
Also link libstd as an rlib as well on device targets.
Note: This is the default behavior for host targets.
This is primarily meant for rust_binary and rust_ffi modules where the default
linkage of libstd might need to be overridden in some use cases. This should
generally be avoided with other module types since it may cause collisions at
linkage if all dependencies of the root binary module do not link against libstd
the same way.
proc_macros
configurable list of string, list of rust proc_macro crate dependencies
product_available
bool, whether this module should be allowed to be directly depended by other
modules with `product_specific: true` or `product_available: true`.
If set to true, an additional product variant will be built separately
that is limited to the set of libraries and headers that are exposed to
/product modules.
The product variant may be used with a different (newer) /system,
so it shouldn't have any unversioned runtime dependencies, or
make assumptions about the system that may not be true in the
future.
If set to false, this module becomes inaccessible from /product modules.
Different from the 'vendor_available' property, the modules with
vndk: {enabled: true} don't have to define 'product_available'. The VNDK
library without 'product_available' may not be depended on by any other
modules that has product variants including the product available VNDKs.
Nothing happens if BOARD_VNDK_VERSION isn't set in the BoardConfig.mk
and PRODUCT_PRODUCT_VNDK_VERSION isn't set.
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.arc
⊕include_dirs
⊕shared_libs
⊕static_libs
⊕srcs
⊕whole_static_libs
⊕product_variables.build_from_text_stub
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕strip.all
⊕strip.keep_symbols
⊕strip.keep_symbols_and_debug_frame
⊕static_libs
⊕whole_static_libs
⊕shared_libs
⊕srcs
⊕product_variables.eng
⊕product_variables.malloc_low_memory
⊕shared_libs
⊕whole_static_libs
⊕static_libs
⊕srcs
⊕product_variables.native_coverage
⊕product_variables.release_aidl_use_unfrozen
⊕required
⊕vintf_fragment_modules
⊕product_variables.selinuxignoreneverallows
⊕product_variables.unbundled_build
⊕enabled
Configurable[bool]
Configurable[bool]
proptools.Configurable[bool]
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
ramdisk_available
bool, Make this module available when building for ramdisk.
On device without a dedicated recovery partition, the module is only
available after switching root into
/first_stage_ramdisk. To expose the module before switching root, install
the recovery variant instead.
recovery
bool, Whether this module is installed to recovery partition
recovery_available
bool, Make this module available when building for recovery
relative_install_path
string, install to a subdirectory of the default install path for the module
required
configurable list of string, names of other modules to install if this module is installed
⊕rlib
VariantLibraryProperties
enabled
bool
srcs
list of string
rlibs
configurable list of string, list of rust rlib crate dependencies
rustlibs
configurable list of string, list of rust automatic crate dependencies.
Rustlibs linkage is rlib for host targets and dylib for device targets.
⊕sanitize
enable AddressSanitizer, HWAddressSanitizer, and others.
address
bool
hwaddress
bool
memtag_heap
bool, Memory-tagging, only available on arm64
if diag.memtag unset or false, enables async memory tagging
fuzzer
bool
never
bool
⊕diag
Sanitizers to run in the diagnostic mode (as opposed to the release mode).
Replaces abort() on error with a human-readable error message.
Address and Thread sanitizers always run in diagnostic mode.
memtag_heap
bool, Memory-tagging, only available on arm64
requires sanitizer.memtag: true
if set, enables sync memory tagging
sdk_version
string, The API level that this module is built against. The APIs of this API level will be
visible at build time, but use of any APIs newer than min_sdk_version will render the
module unloadable on older devices. In the future it will be possible to weakly-link new
APIs, making the behavior match Java: such modules will load on older devices, but
calling new APIs on devices that do not support them will result in a crash.
This property has the same behavior as sdk_version does for Java modules. For those
familiar with Android Gradle, the property behaves similarly to how compileSdkVersion
does for Java code.
In addition, setting this property causes two variants to be built, one for the platform
and one for apps.
⊕shared
VariantLibraryProperties
enabled
bool
srcs
list of string
shared_libs
configurable list of string, list of C shared library dependencies
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
⊕static
VariantLibraryProperties
enabled
bool
srcs
list of string
static_libs
configurable list of string, list of C static library dependencies. These dependencies do not normally propagate to dependents
and may need to be redeclared. See whole_static_libs for bundling static dependencies into a library.
stdlibs
configurable list of string, list of Rust system library dependencies.
This is usually only needed when `no_stdlibs` is true, in which case it can be used to depend on system crates
like `core` and `alloc`.
stem
string, sets name of the output
⊕strip
none
bool, Device modules default to stripping enabled leaving mini debuginfo.
Host modules default to stripping disabled, but can be enabled by setting any other
strip boolean property.
all
bool, all forces stripping everything, including the mini debug info.
keep_symbols
bool, keep_symbols enables stripping but keeps all symbols.
keep_symbols_list
list of string, keep_symbols_list specifies a list of symbols to keep if keep_symbols is enabled.
If it is unset then all symbols are kept.
keep_symbols_and_debug_frame
bool, keep_symbols_and_debug_frame enables stripping but keeps all symbols and debug frames.
⊕stubs
*ast.SelectorExpr
Generate stubs to make this library accessible to APEXes.
Can only be set for modules producing shared libraries.
symbol_file
string, Relative path to the symbol map. The symbol map provides the list of
symbols that are exported for stubs variant of this library.
versions
list of string, List versions to generate stubs libs for. The version name "current" is always
implicitly added.
implementation_installable
bool, Whether to not require the implementation of the library to be installed if a
client of the stubs is installed. Defaults to true; set to false if the
implementation is made available by some other means, e.g. in a Microdroid
virtual machine.
suffix
string, append to name of output
sysroot
bool, Whether this library is part of the Rust toolchain sysroot.
system_dlkm_specific
bool, Install to partition system_dlkm when set to true.
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
compile_multilib
string
enabled
bool
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
toolchain_crate_root
string, path to the toolchain crate root, relative to the top of the toolchain source
toolchain_srcs
list of string, path to the rest of the toolchain srcs, relative to the top of the toolchain source
use_expansive_default_srcs
bool, Set this to true to use an expansive default set of source file requirements
(all .rs, .h, .xml, and .md files in the module tree).
This is primarily for tracking sources for RBE purposes. Currently defaults
to true, though this may change in the future.
use_generic_config
bool, Set to true if this module must be generic and does not require product-specific information.
To be included in the system image, this property must be set to true.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_available
bool, whether this module should be allowed to be directly depended by other
modules with `vendor: true`, `proprietary: true`, or `vendor_available:true`.
If set to true, two variants will be built separately, one like
normal, and the other limited to the set of libraries and headers
that are exposed to /vendor modules.
The vendor variant may be used with a different (newer) /system,
so it shouldn't have any unversioned runtime dependencies, or
make assumptions about the system that may not be true in the
future.
If set to false, this module becomes inaccessible from /vendor modules.
The modules with vndk: {enabled: true} must define 'vendor_available'
to 'true'.
Nothing happens if BOARD_VNDK_VERSION isn't set in the BoardConfig.mk
vendor_dlkm_specific
bool, Install to partition vendor_dlkm when set to true.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vendor_ramdisk_available
bool, Make this module available when building for vendor ramdisk.
On device without a dedicated recovery partition, the module is only
available after switching root into
/first_stage_ramdisk. To expose the module before switching root, install
the recovery variant instead
version_script
string, Version script to pass to the linker. By default this will replace the
implicit rustc emitted version script to mirror expected behavior in CC.
This is only relevant for rust_ffi_shared modules which are exposing a
versioned C API.
vintf_fragment_modules
configurable list of string, vintf_fragment Modules required from this module.
vintf_fragments
configurable list of string, VINTF manifest fragments to be installed if this module is installed
whole_static_libs
configurable list of string, Similar to static_libs, but will bundle the static library dependency into a library. This is helpful
to avoid having to redeclare the dependency for dependents of this library, but in some cases may also
result in bloat if multiple dependencies all include the same static library whole.
The common use case for this is when the static library is unlikely to be a dependency of other modules to avoid
having to redeclare the static library dependency for every dependent module.
If you are not sure what to, for rust_library modules most static dependencies should go in static_libraries,
and for rust_ffi modules most static dependencies should go into whole_static_libraries.
For rust_ffi static variants, these libraries will be included in the resulting static library archive.
For rust_library rlib variants, these libraries will be bundled into the resulting rlib library. This will
include all of the static libraries symbols in any dylibs or binaries which use this rlib as well.
rust_toolchain_library produces all rust variants.
name
,
srcs
,
defaults
,
host_supported
,
device_supported
,
afdo
,
aliases
,
apex_available
,
arch
,
bootstrap
,
cargo_env_compat
,
cargo_pkg_version
,
cfgs
,
clippy_lints
,
compile_multilib
,
crate_name
,
crate_root
,
crt
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
double_loadable
,
edition
,
enabled
,
exclude_from_recovery_snapshot
,
exclude_from_vendor_snapshot
,
features
,
flags
,
host_cross_supported
,
host_required
,
init_rc
,
installable
,
ld_flags
,
licenses
,
lints
,
lto
,
min_sdk_version
,
multilib
,
native_bridge_supported
,
native_coverage
,
no_full_install
,
no_stdlibs
,
odm_available
,
odm_dlkm_specific
,
overrides
,
owner
,
prefer_rlib
,
proc_macros
,
product_available
,
product_specific
,
product_variables.arc
,
product_variables.build_from_text_stub
,
product_variables.debuggable
,
product_variables.eng
,
product_variables.malloc_low_memory
,
product_variables.native_coverage
,
product_variables.release_aidl_use_unfrozen
,
product_variables.selinuxignoreneverallows
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
ramdisk_available
,
recovery
,
recovery_available
,
relative_install_path
,
required
,
rlibs
,
rustlibs
,
sanitize
,
sdk_version
,
shared_libs
,
soc_specific
,
static_libs
,
stdlibs
,
stem
,
suffix
,
system_dlkm_specific
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
toolchain_crate_root
,
toolchain_srcs
,
use_expansive_default_srcs
,
use_generic_config
,
vendor
,
vendor_available
,
vendor_dlkm_specific
,
vendor_ramdisk
,
vendor_ramdisk_available
,
vintf_fragment_modules
,
vintf_fragments
,
visibility
,
whole_static_libs
name
string, The name of the module. Must be unique across all modules.
srcs
list of string, path to the source file that is the main entry point of the program (e.g. main.rs or lib.rs).
Only a single source file can be defined. Modules which generate source can be included by prefixing
the module name with ":", for example ":libfoo_bindgen"
If no source file is defined, a single generated source module can be defined to be used as the main source.
defaults
list of string
host_supported
bool, If set to true, build a variant of the module for the host. Defaults to false.
device_supported
bool, If set to true, build a variant of the module for the device. Defaults to true.
afdo
bool, Afdo allows developers self-service enroll for
automatic feedback-directed optimization using profile data.
aliases
list of string, Rust crate dependencies to rename. Each entry should be a string of the form "dependencyname:alias".
"dependencyname" here should be the name of the crate, not the Android module. This is
equivalent to writing `alias = { package = "dependencyname" }` in a `Cargo.toml`.
apex_available
list of string, Availability of this module in APEXes. Only the listed APEXes can contain this module. If
the module has stubs then other APEXes and the platform may access it through them
(subject to visibility).
"//apex_available:anyapex" is a pseudo APEX name that matches to any APEX.
"//apex_available:platform" refers to non-APEX partitions like "system.img".
Prefix pattern (com.foo.*) can be used to match with any APEX name with the prefix(com.foo.).
Default is ["//apex_available:platform"].
arch
interface
bootstrap
bool, Allows this module to use non-APEX version of libraries. Useful
for building binaries that are started before APEXes are activated.
cargo_env_compat
bool, Enables emitting certain Cargo environment variables. Only intended to be used for compatibility purposes.
Will set CARGO_CRATE_NAME to the crate_name property's value.
Will set CARGO_BIN_NAME to the output filename value without the extension.
cargo_pkg_version
string, If cargo_env_compat is true, sets the CARGO_PKG_VERSION env var to this value.
cfgs
configurable list of string, list of configuration options to enable for this crate. To enable features, use the "features" property.
clippy_lints
string, name of the lint set that should be used to validate this module.
Possible values are "default" (for using a sensible set of lints
depending on the module's location), "android" (for the strictest
lint set that applies to all Android platform code), "vendor" (for a
relaxed set) and "none" (to disable the execution of clippy). The
default value is "default". See also the `lints` property.
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
crate_name
string, crate name, required for modules which produce Rust libraries: rust_library, rust_ffi and SourceProvider
modules which create library variants (rust_bindgen). This must be the expected extern crate name used in
source, and is required to conform to an enforced format matching library output files (if the output file is
lib<someName><suffix>, the crate_name property must be <someName>).
crt
bool, Indicates that this module is a CRT object. CRT objects will be split
into a variant per-API level between min_sdk_version and current.
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
prepend_artifact_with_product
bool, If true, then the artifact file will be prepended with <product name>-. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be coral-foo.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
double_loadable
bool, whether this module is capable of being loaded with other instance
(possibly an older version) of the same module in the same process.
Currently, a shared library that is a member of VNDK (vndk: {enabled: true})
can be double loaded in a vendor process if the library is also a
(direct and indirect) dependency of an LLNDK library. Such libraries must be
explicitly marked as `double_loadable: true` by the owner, or the dependency
from the LLNDK lib should be cut if the lib is not designed to be double loaded.
edition
string, specific rust edition that should be used if the default version is not desired
enabled
configurable bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
exclude_from_recovery_snapshot
bool, Normally Soong uses the directory structure to decide which modules
should be included (framework) or excluded (non-framework) from the
different snapshots (vendor, recovery, etc.), but this property
allows a partner to exclude a module normally thought of as a
framework module from the recovery snapshot.
exclude_from_vendor_snapshot
bool, Normally Soong uses the directory structure to decide which modules
should be included (framework) or excluded (non-framework) from the
different snapshots (vendor, recovery, etc.), but this property
allows a partner to exclude a module normally thought of as a
framework module from the vendor snapshot.
features
configurable list of string, list of features to enable for this crate
flags
list of string, flags to pass to rustc. To enable configuration options or features, use the "cfgs" or "features" properties.
host_cross_supported
bool, If set to true, build a variant of the module for the host cross. Defaults to true.
host_required
list of string, names of other modules to install on host if this module is installed
init_rc
configurable list of string, init.rc files to be installed if this module is installed
installable
bool
ld_flags
list of string, flags to pass to the linker
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
lints
string, name of the lint set that should be used to validate this module.
Possible values are "default" (for using a sensible set of lints
depending on the module's location), "android" (for the strictest
lint set that applies to all Android platform code), "vendor" (for
a relaxed set) and "none" (for ignoring all lint warnings and
errors). The default value is "default".
⊕lto
Control whether LTO is used for the final (Rust) linkage. This does not impact
cross-language LTO.
thin
bool, Whether thin LTO should be enabled. By default this is true.
LTO provides such a large code size benefit for Rust, this should always
be enabled for production builds unless there's a clear need to disable it.
min_sdk_version
string, Minimum OS API level supported by this C or C++ module. This property becomes the value
of the __ANDROID_API__ macro. When the C or C++ module is included in an APEX or an APK,
this property is also used to ensure that the min_sdk_version of the containing module is
not older (i.e. less) than this module's min_sdk_version. When not set, this property
defaults to the value of sdk_version. When this is set to "apex_inherit", this tracks
min_sdk_version of the containing APEX. When the module
is not built for an APEX, "apex_inherit" defaults to sdk_version.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
native_coverage
bool
no_full_install
bool, When set to true, this module is not installed to the full install path (ex: under
out/target/product/<name>/<partition>). It can be installed only to the packaging
modules like android_filesystem.
no_stdlibs
bool, whether to suppress inclusion of standard crates - defaults to false
odm_available
bool, This is the same as the "vendor_available" except that the install path
of the vendor variant is /odm or /vendor/odm.
By replacing "vendor_available: true" with "odm_available: true", the
module will install its vendor variant to the /odm partition or /vendor/odm.
As the modules with "odm_available: true" still create the vendor variants,
they can link to the other vendor modules as the vendor_available modules do.
Also, the vendor modules can link to odm_available modules.
It may not be used for VNDK modules.
odm_dlkm_specific
bool, Install to partition odm_dlkm when set to true.
overrides
list of string, List of module names that are prevented from being installed when this module gets
installed.
owner
string, vendor who owns this module
prefer_rlib
bool, Change the rustlibs linkage to select rlib linkage by default for device targets.
Also link libstd as an rlib as well on device targets.
Note: This is the default behavior for host targets.
This is primarily meant for rust_binary and rust_ffi modules where the default
linkage of libstd might need to be overridden in some use cases. This should
generally be avoided with other module types since it may cause collisions at
linkage if all dependencies of the root binary module do not link against libstd
the same way.
proc_macros
configurable list of string, list of rust proc_macro crate dependencies
product_available
bool, whether this module should be allowed to be directly depended by other
modules with `product_specific: true` or `product_available: true`.
If set to true, an additional product variant will be built separately
that is limited to the set of libraries and headers that are exposed to
/product modules.
The product variant may be used with a different (newer) /system,
so it shouldn't have any unversioned runtime dependencies, or
make assumptions about the system that may not be true in the
future.
If set to false, this module becomes inaccessible from /product modules.
Different from the 'vendor_available' property, the modules with
vndk: {enabled: true} don't have to define 'product_available'. The VNDK
library without 'product_available' may not be depended on by any other
modules that has product variants including the product available VNDKs.
Nothing happens if BOARD_VNDK_VERSION isn't set in the BoardConfig.mk
and PRODUCT_PRODUCT_VNDK_VERSION isn't set.
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.arc
⊕shared_libs
⊕static_libs
⊕srcs
⊕whole_static_libs
⊕product_variables.build_from_text_stub
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕static_libs
⊕whole_static_libs
⊕shared_libs
⊕srcs
⊕product_variables.eng
⊕product_variables.malloc_low_memory
⊕shared_libs
⊕whole_static_libs
⊕static_libs
⊕srcs
⊕product_variables.native_coverage
⊕product_variables.release_aidl_use_unfrozen
⊕required
⊕vintf_fragment_modules
⊕product_variables.selinuxignoreneverallows
⊕product_variables.unbundled_build
⊕enabled
Configurable[bool]
Configurable[bool]
proptools.Configurable[bool]
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
ramdisk_available
bool, Make this module available when building for ramdisk.
On device without a dedicated recovery partition, the module is only
available after switching root into
/first_stage_ramdisk. To expose the module before switching root, install
the recovery variant instead.
recovery
bool, Whether this module is installed to recovery partition
recovery_available
bool, Make this module available when building for recovery
relative_install_path
string, install to a subdirectory of the default install path for the module
required
configurable list of string, names of other modules to install if this module is installed
rlibs
configurable list of string, list of rust rlib crate dependencies
rustlibs
configurable list of string, list of rust automatic crate dependencies.
Rustlibs linkage is rlib for host targets and dylib for device targets.
⊕sanitize
enable AddressSanitizer, HWAddressSanitizer, and others.
address
bool
hwaddress
bool
memtag_heap
bool, Memory-tagging, only available on arm64
if diag.memtag unset or false, enables async memory tagging
fuzzer
bool
never
bool
⊕diag
Sanitizers to run in the diagnostic mode (as opposed to the release mode).
Replaces abort() on error with a human-readable error message.
Address and Thread sanitizers always run in diagnostic mode.
memtag_heap
bool, Memory-tagging, only available on arm64
requires sanitizer.memtag: true
if set, enables sync memory tagging
sdk_version
string, The API level that this module is built against. The APIs of this API level will be
visible at build time, but use of any APIs newer than min_sdk_version will render the
module unloadable on older devices. In the future it will be possible to weakly-link new
APIs, making the behavior match Java: such modules will load on older devices, but
calling new APIs on devices that do not support them will result in a crash.
This property has the same behavior as sdk_version does for Java modules. For those
familiar with Android Gradle, the property behaves similarly to how compileSdkVersion
does for Java code.
In addition, setting this property causes two variants to be built, one for the platform
and one for apps.
shared_libs
configurable list of string, list of C shared library dependencies
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
static_libs
configurable list of string, list of C static library dependencies. These dependencies do not normally propagate to dependents
and may need to be redeclared. See whole_static_libs for bundling static dependencies into a library.
stdlibs
configurable list of string, list of Rust system library dependencies.
This is usually only needed when `no_stdlibs` is true, in which case it can be used to depend on system crates
like `core` and `alloc`.
stem
string, sets name of the output
suffix
string, append to name of output
system_dlkm_specific
bool, Install to partition system_dlkm when set to true.
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
compile_multilib
string
enabled
bool
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
toolchain_crate_root
string, path to the toolchain object crate root, relative to the top of the toolchain source
toolchain_srcs
list of string, path to the rest of the toolchain srcs, relative to the top of the toolchain source
use_expansive_default_srcs
bool, Set this to true to use an expansive default set of source file requirements
(all .rs, .h, .xml, and .md files in the module tree).
This is primarily for tracking sources for RBE purposes. Currently defaults
to true, though this may change in the future.
use_generic_config
bool, Set to true if this module must be generic and does not require product-specific information.
To be included in the system image, this property must be set to true.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_available
bool, whether this module should be allowed to be directly depended by other
modules with `vendor: true`, `proprietary: true`, or `vendor_available:true`.
If set to true, two variants will be built separately, one like
normal, and the other limited to the set of libraries and headers
that are exposed to /vendor modules.
The vendor variant may be used with a different (newer) /system,
so it shouldn't have any unversioned runtime dependencies, or
make assumptions about the system that may not be true in the
future.
If set to false, this module becomes inaccessible from /vendor modules.
The modules with vndk: {enabled: true} must define 'vendor_available'
to 'true'.
Nothing happens if BOARD_VNDK_VERSION isn't set in the BoardConfig.mk
vendor_dlkm_specific
bool, Install to partition vendor_dlkm when set to true.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vendor_ramdisk_available
bool, Make this module available when building for vendor ramdisk.
On device without a dedicated recovery partition, the module is only
available after switching root into
/first_stage_ramdisk. To expose the module before switching root, install
the recovery variant instead
vintf_fragment_modules
configurable list of string, vintf_fragment Modules required from this module.
vintf_fragments
configurable list of string, VINTF manifest fragments to be installed if this module is installed
whole_static_libs
configurable list of string, Similar to static_libs, but will bundle the static library dependency into a library. This is helpful
to avoid having to redeclare the dependency for dependents of this library, but in some cases may also
result in bloat if multiple dependencies all include the same static library whole.
The common use case for this is when the static library is unlikely to be a dependency of other modules to avoid
having to redeclare the static library dependency for every dependent module.
If you are not sure what to, for rust_library modules most static dependencies should go in static_libraries,
and for rust_ffi modules most static dependencies should go into whole_static_libraries.
For rust_ffi static variants, these libraries will be included in the resulting static library archive.
For rust_library rlib variants, these libraries will be bundled into the resulting rlib library. This will
include all of the static libraries symbols in any dylibs or binaries which use this rlib as well.
rust_toolchain_library produces all rust variants.
name
,
srcs
,
defaults
,
afdo
,
aliases
,
apex_available
,
arch
,
bootstrap
,
cargo_env_compat
,
cargo_pkg_version
,
cfgs
,
clippy_lints
,
compile_multilib
,
crate_name
,
crate_root
,
crt
,
debug_ramdisk
,
device_specific
,
dist
,
dists
,
double_loadable
,
edition
,
enabled
,
exclude_from_recovery_snapshot
,
exclude_from_vendor_snapshot
,
features
,
flags
,
host_cross_supported
,
host_required
,
init_rc
,
installable
,
ld_flags
,
licenses
,
lints
,
lto
,
min_sdk_version
,
multilib
,
native_bridge_supported
,
native_coverage
,
no_full_install
,
no_stdlibs
,
odm_available
,
odm_dlkm_specific
,
overrides
,
owner
,
prefer_rlib
,
proc_macros
,
product_available
,
product_specific
,
product_variables.arc
,
product_variables.build_from_text_stub
,
product_variables.debuggable
,
product_variables.eng
,
product_variables.malloc_low_memory
,
product_variables.native_coverage
,
product_variables.release_aidl_use_unfrozen
,
product_variables.selinuxignoreneverallows
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
ramdisk_available
,
recovery
,
recovery_available
,
relative_install_path
,
required
,
rlibs
,
rustlibs
,
sanitize
,
sdk_version
,
shared_libs
,
soc_specific
,
static_libs
,
stdlibs
,
stem
,
suffix
,
system_dlkm_specific
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
toolchain_crate_root
,
toolchain_srcs
,
use_expansive_default_srcs
,
use_generic_config
,
vendor
,
vendor_available
,
vendor_dlkm_specific
,
vendor_ramdisk
,
vendor_ramdisk_available
,
vintf_fragment_modules
,
vintf_fragments
,
visibility
,
whole_static_libs
name
string, The name of the module. Must be unique across all modules.
srcs
list of string, path to the source file that is the main entry point of the program (e.g. main.rs or lib.rs).
Only a single source file can be defined. Modules which generate source can be included by prefixing
the module name with ":", for example ":libfoo_bindgen"
If no source file is defined, a single generated source module can be defined to be used as the main source.
defaults
list of string
afdo
bool, Afdo allows developers self-service enroll for
automatic feedback-directed optimization using profile data.
aliases
list of string, Rust crate dependencies to rename. Each entry should be a string of the form "dependencyname:alias".
"dependencyname" here should be the name of the crate, not the Android module. This is
equivalent to writing `alias = { package = "dependencyname" }` in a `Cargo.toml`.
apex_available
list of string, Availability of this module in APEXes. Only the listed APEXes can contain this module. If
the module has stubs then other APEXes and the platform may access it through them
(subject to visibility).
"//apex_available:anyapex" is a pseudo APEX name that matches to any APEX.
"//apex_available:platform" refers to non-APEX partitions like "system.img".
Prefix pattern (com.foo.*) can be used to match with any APEX name with the prefix(com.foo.).
Default is ["//apex_available:platform"].
arch
interface
bootstrap
bool, Allows this module to use non-APEX version of libraries. Useful
for building binaries that are started before APEXes are activated.
cargo_env_compat
bool, Enables emitting certain Cargo environment variables. Only intended to be used for compatibility purposes.
Will set CARGO_CRATE_NAME to the crate_name property's value.
Will set CARGO_BIN_NAME to the output filename value without the extension.
cargo_pkg_version
string, If cargo_env_compat is true, sets the CARGO_PKG_VERSION env var to this value.
cfgs
configurable list of string, list of configuration options to enable for this crate. To enable features, use the "features" property.
clippy_lints
string, name of the lint set that should be used to validate this module.
Possible values are "default" (for using a sensible set of lints
depending on the module's location), "android" (for the strictest
lint set that applies to all Android platform code), "vendor" (for a
relaxed set) and "none" (to disable the execution of clippy). The
default value is "default". See also the `lints` property.
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
crate_name
string, crate name, required for modules which produce Rust libraries: rust_library, rust_ffi and SourceProvider
modules which create library variants (rust_bindgen). This must be the expected extern crate name used in
source, and is required to conform to an enforced format matching library output files (if the output file is
lib<someName><suffix>, the crate_name property must be <someName>).
crt
bool, Indicates that this module is a CRT object. CRT objects will be split
into a variant per-API level between min_sdk_version and current.
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
prepend_artifact_with_product
bool, If true, then the artifact file will be prepended with <product name>-. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be coral-foo.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
double_loadable
bool, whether this module is capable of being loaded with other instance
(possibly an older version) of the same module in the same process.
Currently, a shared library that is a member of VNDK (vndk: {enabled: true})
can be double loaded in a vendor process if the library is also a
(direct and indirect) dependency of an LLNDK library. Such libraries must be
explicitly marked as `double_loadable: true` by the owner, or the dependency
from the LLNDK lib should be cut if the lib is not designed to be double loaded.
edition
string, specific rust edition that should be used if the default version is not desired
enabled
configurable bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
exclude_from_recovery_snapshot
bool, Normally Soong uses the directory structure to decide which modules
should be included (framework) or excluded (non-framework) from the
different snapshots (vendor, recovery, etc.), but this property
allows a partner to exclude a module normally thought of as a
framework module from the recovery snapshot.
exclude_from_vendor_snapshot
bool, Normally Soong uses the directory structure to decide which modules
should be included (framework) or excluded (non-framework) from the
different snapshots (vendor, recovery, etc.), but this property
allows a partner to exclude a module normally thought of as a
framework module from the vendor snapshot.
features
configurable list of string, list of features to enable for this crate
flags
list of string, flags to pass to rustc. To enable configuration options or features, use the "cfgs" or "features" properties.
host_cross_supported
bool, If set to true, build a variant of the module for the host cross. Defaults to true.
host_required
list of string, names of other modules to install on host if this module is installed
init_rc
configurable list of string, init.rc files to be installed if this module is installed
installable
bool
ld_flags
list of string, flags to pass to the linker
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
lints
string, name of the lint set that should be used to validate this module.
Possible values are "default" (for using a sensible set of lints
depending on the module's location), "android" (for the strictest
lint set that applies to all Android platform code), "vendor" (for
a relaxed set) and "none" (for ignoring all lint warnings and
errors). The default value is "default".
⊕lto
Control whether LTO is used for the final (Rust) linkage. This does not impact
cross-language LTO.
thin
bool, Whether thin LTO should be enabled. By default this is true.
LTO provides such a large code size benefit for Rust, this should always
be enabled for production builds unless there's a clear need to disable it.
min_sdk_version
string, Minimum OS API level supported by this C or C++ module. This property becomes the value
of the __ANDROID_API__ macro. When the C or C++ module is included in an APEX or an APK,
this property is also used to ensure that the min_sdk_version of the containing module is
not older (i.e. less) than this module's min_sdk_version. When not set, this property
defaults to the value of sdk_version. When this is set to "apex_inherit", this tracks
min_sdk_version of the containing APEX. When the module
is not built for an APEX, "apex_inherit" defaults to sdk_version.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
native_coverage
bool
no_full_install
bool, When set to true, this module is not installed to the full install path (ex: under
out/target/product/<name>/<partition>). It can be installed only to the packaging
modules like android_filesystem.
no_stdlibs
bool, whether to suppress inclusion of standard crates - defaults to false
odm_available
bool, This is the same as the "vendor_available" except that the install path
of the vendor variant is /odm or /vendor/odm.
By replacing "vendor_available: true" with "odm_available: true", the
module will install its vendor variant to the /odm partition or /vendor/odm.
As the modules with "odm_available: true" still create the vendor variants,
they can link to the other vendor modules as the vendor_available modules do.
Also, the vendor modules can link to odm_available modules.
It may not be used for VNDK modules.
odm_dlkm_specific
bool, Install to partition odm_dlkm when set to true.
overrides
list of string, List of module names that are prevented from being installed when this module gets
installed.
owner
string, vendor who owns this module
prefer_rlib
bool, Change the rustlibs linkage to select rlib linkage by default for device targets.
Also link libstd as an rlib as well on device targets.
Note: This is the default behavior for host targets.
This is primarily meant for rust_binary and rust_ffi modules where the default
linkage of libstd might need to be overridden in some use cases. This should
generally be avoided with other module types since it may cause collisions at
linkage if all dependencies of the root binary module do not link against libstd
the same way.
proc_macros
configurable list of string, list of rust proc_macro crate dependencies
product_available
bool, whether this module should be allowed to be directly depended by other
modules with `product_specific: true` or `product_available: true`.
If set to true, an additional product variant will be built separately
that is limited to the set of libraries and headers that are exposed to
/product modules.
The product variant may be used with a different (newer) /system,
so it shouldn't have any unversioned runtime dependencies, or
make assumptions about the system that may not be true in the
future.
If set to false, this module becomes inaccessible from /product modules.
Different from the 'vendor_available' property, the modules with
vndk: {enabled: true} don't have to define 'product_available'. The VNDK
library without 'product_available' may not be depended on by any other
modules that has product variants including the product available VNDKs.
Nothing happens if BOARD_VNDK_VERSION isn't set in the BoardConfig.mk
and PRODUCT_PRODUCT_VNDK_VERSION isn't set.
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.arc
⊕shared_libs
⊕static_libs
⊕srcs
⊕whole_static_libs
⊕product_variables.build_from_text_stub
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕static_libs
⊕whole_static_libs
⊕shared_libs
⊕srcs
⊕product_variables.eng
⊕product_variables.malloc_low_memory
⊕shared_libs
⊕whole_static_libs
⊕static_libs
⊕srcs
⊕product_variables.native_coverage
⊕product_variables.release_aidl_use_unfrozen
⊕required
⊕vintf_fragment_modules
⊕product_variables.selinuxignoreneverallows
⊕product_variables.unbundled_build
⊕enabled
Configurable[bool]
Configurable[bool]
proptools.Configurable[bool]
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
ramdisk_available
bool, Make this module available when building for ramdisk.
On device without a dedicated recovery partition, the module is only
available after switching root into
/first_stage_ramdisk. To expose the module before switching root, install
the recovery variant instead.
recovery
bool, Whether this module is installed to recovery partition
recovery_available
bool, Make this module available when building for recovery
relative_install_path
string, install to a subdirectory of the default install path for the module
required
configurable list of string, names of other modules to install if this module is installed
rlibs
configurable list of string, list of rust rlib crate dependencies
rustlibs
configurable list of string, list of rust automatic crate dependencies.
Rustlibs linkage is rlib for host targets and dylib for device targets.
⊕sanitize
enable AddressSanitizer, HWAddressSanitizer, and others.
address
bool
hwaddress
bool
memtag_heap
bool, Memory-tagging, only available on arm64
if diag.memtag unset or false, enables async memory tagging
fuzzer
bool
never
bool
⊕diag
Sanitizers to run in the diagnostic mode (as opposed to the release mode).
Replaces abort() on error with a human-readable error message.
Address and Thread sanitizers always run in diagnostic mode.
memtag_heap
bool, Memory-tagging, only available on arm64
requires sanitizer.memtag: true
if set, enables sync memory tagging
sdk_version
string, The API level that this module is built against. The APIs of this API level will be
visible at build time, but use of any APIs newer than min_sdk_version will render the
module unloadable on older devices. In the future it will be possible to weakly-link new
APIs, making the behavior match Java: such modules will load on older devices, but
calling new APIs on devices that do not support them will result in a crash.
This property has the same behavior as sdk_version does for Java modules. For those
familiar with Android Gradle, the property behaves similarly to how compileSdkVersion
does for Java code.
In addition, setting this property causes two variants to be built, one for the platform
and one for apps.
shared_libs
configurable list of string, list of C shared library dependencies
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
static_libs
configurable list of string, list of C static library dependencies. These dependencies do not normally propagate to dependents
and may need to be redeclared. See whole_static_libs for bundling static dependencies into a library.
stdlibs
configurable list of string, list of Rust system library dependencies.
This is usually only needed when `no_stdlibs` is true, in which case it can be used to depend on system crates
like `core` and `alloc`.
stem
string, sets name of the output
suffix
string, append to name of output
system_dlkm_specific
bool, Install to partition system_dlkm when set to true.
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
compile_multilib
string
enabled
bool
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
toolchain_crate_root
string, path to the toolchain object crate root, relative to the top of the toolchain source
toolchain_srcs
list of string, path to the rest of the toolchain srcs, relative to the top of the toolchain source
use_expansive_default_srcs
bool, Set this to true to use an expansive default set of source file requirements
(all .rs, .h, .xml, and .md files in the module tree).
This is primarily for tracking sources for RBE purposes. Currently defaults
to true, though this may change in the future.
use_generic_config
bool, Set to true if this module must be generic and does not require product-specific information.
To be included in the system image, this property must be set to true.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_available
bool, whether this module should be allowed to be directly depended by other
modules with `vendor: true`, `proprietary: true`, or `vendor_available:true`.
If set to true, two variants will be built separately, one like
normal, and the other limited to the set of libraries and headers
that are exposed to /vendor modules.
The vendor variant may be used with a different (newer) /system,
so it shouldn't have any unversioned runtime dependencies, or
make assumptions about the system that may not be true in the
future.
If set to false, this module becomes inaccessible from /vendor modules.
The modules with vndk: {enabled: true} must define 'vendor_available'
to 'true'.
Nothing happens if BOARD_VNDK_VERSION isn't set in the BoardConfig.mk
vendor_dlkm_specific
bool, Install to partition vendor_dlkm when set to true.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vendor_ramdisk_available
bool, Make this module available when building for vendor ramdisk.
On device without a dedicated recovery partition, the module is only
available after switching root into
/first_stage_ramdisk. To expose the module before switching root, install
the recovery variant instead
vintf_fragment_modules
configurable list of string, vintf_fragment Modules required from this module.
vintf_fragments
configurable list of string, VINTF manifest fragments to be installed if this module is installed
whole_static_libs
configurable list of string, Similar to static_libs, but will bundle the static library dependency into a library. This is helpful
to avoid having to redeclare the dependency for dependents of this library, but in some cases may also
result in bloat if multiple dependencies all include the same static library whole.
The common use case for this is when the static library is unlikely to be a dependency of other modules to avoid
having to redeclare the static library dependency for every dependent module.
If you are not sure what to, for rust_library modules most static dependencies should go in static_libraries,
and for rust_ffi modules most static dependencies should go into whole_static_libraries.
For rust_ffi static variants, these libraries will be included in the resulting static library archive.
For rust_library rlib variants, these libraries will be bundled into the resulting rlib library. This will
include all of the static libraries symbols in any dylibs or binaries which use this rlib as well.
name
,
src
,
arch
,
compile_multilib
,
debug_ramdisk
,
deps
,
device_specific
,
dist
,
dists
,
enabled
,
export_to_make_var
,
host_required
,
init_rc
,
licenses
,
multilib
,
native_bridge_supported
,
no_full_install
,
odm_dlkm_specific
,
overrides
,
owner
,
prefer
,
product_specific
,
product_variables.debuggable
,
product_variables.native_coverage
,
product_variables.release_aidl_use_unfrozen
,
product_variables.selinuxignoreneverallows
,
product_variables.unbundled_build
,
proprietary
,
ramdisk
,
recovery
,
required
,
soc_specific
,
system_dlkm_specific
,
system_ext_specific
,
target
,
target.android
,
target.host
,
target_required
,
team
,
toolchain_deps
,
toolchain_prebuilt_src
,
use_generic_config
,
use_source_config_var
,
vendor
,
vendor_dlkm_specific
,
vendor_ramdisk
,
vintf_fragment_modules
,
vintf_fragments
,
visibility
name
string, The name of the module. Must be unique across all modules.
src
string, Source file to be executed for this build tool
arch
interface
compile_multilib
string, control whether this module compiles for 32-bit, 64-bit, or both. Possible values
are "32" (compile for 32-bit only), "64" (compile for 64-bit only), "both" (compile for both
architectures), or "first" (compile for 64-bit on a 64-bit platform, and 32-bit on a 32-bit
platform).
debug_ramdisk
bool, Whether this module is installed to debug ramdisk
deps
list of string, Extra files that should trigger rules using this tool to rebuild
device_specific
bool, whether this module is specific to a device, not only for SoC, but also for off-chip
peripherals. When set to true, it is installed into /odm (or /vendor/odm if odm partition
does not exist, or /system/vendor/odm if both odm and vendor partitions do not exist).
This implies `soc_specific:true`.
⊕dist
Dist
configuration to distribute output files from this module to the distribution
directory (default: $OUT/dist, configurable with $DIST_DIR)
targets
list of string, Copy the output of this module to the $DIST_DIR when `dist` is specified on the
command line and any of these targets are also on the command line, or otherwise
built
dest
string, The name of the output artifact. This defaults to the basename of the output of
the module.
dir
string, The directory within the dist directory to store the artifact. Defaults to the
top level directory ("").
suffix
string, A suffix to add to the artifact file name (before any extension).
append_artifact_with_product
bool, If true, then the artifact file will be appended with _<product name>. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be foo_coral.apk. If false, there is
no change to the artifact file name.
prepend_artifact_with_product
bool, If true, then the artifact file will be prepended with <product name>-. For
example, if the product is coral and the module is an android_app module
of name foo, then the artifact would be coral-foo.apk. If false, there is
no change to the artifact file name.
tag
string, A string tag to select the OutputFiles associated with the tag.
If no tag is specified then it will select the default dist paths provided
by the module type. If a tag of "" is specified then it will return the
default output files provided by the modules, i.e. the result of calling
OutputFiles("").
dists
list of Dist, a list of configurations to distribute output files from this module to the
distribution directory (default: $OUT/dist, configurable with $DIST_DIR)
enabled
configurable bool, emit build rules for this module
Disabling a module should only be done for those modules that cannot be built
in the current environment. Modules that can build in the current environment
but are not usually required (e.g. superceded by a prebuilt) should not be
disabled as that will prevent them from being built by the checkbuild target
and so prevent early detection of changes that have broken those modules.
export_to_make_var
string, Create a make variable with the specified name that contains the path to
this prebuilt built tool, relative to the root of the source tree.
host_required
list of string, names of other modules to install on host if this module is installed
init_rc
configurable list of string, init.rc files to be installed if this module is installed
licenses
list of string, Describes the licenses applicable to this module. Must reference license modules.
multilib
interface
native_bridge_supported
bool, Whether this module is built for non-native architectures (also known as native bridge binary)
no_full_install
bool, When set to true, this module is not installed to the full install path (ex: under
out/target/product/<name>/<partition>). It can be installed only to the packaging
modules like android_filesystem.
odm_dlkm_specific
bool, Install to partition odm_dlkm when set to true.
overrides
list of string, List of module names that are prevented from being installed when this module gets
installed.
owner
string, vendor who owns this module
prefer
configurable bool, When prefer is set to true the prebuilt will be used instead of any source module with
a matching name.
product_specific
bool, whether this module is specific to a software configuration of a product (e.g. country,
network operator, etc). When set to true, it is installed into /product (or
/system/product if product partition does not exist).
⊕product_variables.debuggable
⊕init_rc
⊕required
⊕host_required
⊕target_required
⊕deps
⊕product_variables.native_coverage
⊕product_variables.release_aidl_use_unfrozen
⊕required
⊕vintf_fragment_modules
⊕product_variables.selinuxignoreneverallows
⊕product_variables.unbundled_build
⊕enabled
Configurable[bool]
Configurable[bool]
proptools.Configurable[bool]
proprietary
bool, whether this is a proprietary vendor module, and should be installed into /vendor
ramdisk
bool, Whether this module is installed to ramdisk
recovery
bool, Whether this module is installed to recovery partition
required
configurable list of string, names of other modules to install if this module is installed
soc_specific
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
system_dlkm_specific
bool, Install to partition system_dlkm when set to true.
system_ext_specific
bool, whether this module extends system. When set to true, it is installed into /system_ext
(or /system/system_ext if system_ext partition does not exist).
target
interface
⊕target.android
compile_multilib
string
enabled
bool
⊕target.host
target_required
list of string, names of other modules to install on target if this module is installed
team
string, The team (defined by the owner/vendor) who owns the property.
toolchain_deps
list of string, path to deps, relative to the top of the toolchain source
toolchain_prebuilt_src
string, path to rustc prebuilt, relative to the top of the toolchain source
use_generic_config
bool, Set to true if this module must be generic and does not require product-specific information.
To be included in the system image, this property must be set to true.
use_source_config_var
ConfigVarProperties, When specified this names a Soong config variable that controls the prefer property.
If the value of the named Soong config variable is true then prefer is set to false and vice
versa. If the Soong config variable is not set then it defaults to false, so prefer defaults
to true.
If specified then the prefer property is ignored in favor of the value of the Soong config
variable.
DEPRECATED: This property is being deprecated b/308188211.
Use RELEASE_APEX_CONTRIBUTIONS build flags to select prebuilts of mainline modules.
vendor
bool, whether this module is specific to an SoC (System-On-a-Chip). When set to true,
it is installed into /vendor (or /system/vendor if vendor partition does not exist).
Use `soc_specific` instead for better meaning.
vendor_dlkm_specific
bool, Install to partition vendor_dlkm when set to true.
vendor_ramdisk
bool, Whether this module is installed to vendor ramdisk
vintf_fragment_modules
configurable list of string, vintf_fragment Modules required from this module.
vintf_fragments
configurable list of string, VINTF manifest fragments to be installed if this module is installed