android.ModuleContext should replace the blueprint.ModuleContext
methods with ones that take android.Module parameters instead of
blueprint.Module parameters. As a first step, don't include
blueprint.ModuleContext in android.ModuleContext and manually
specify the methods from blueprint.ModuleContext that we need.
Future patches will replace these methods with ones that take
android.* types. Also do the same for TopDownMutatorContext.
Test: m checkbuild
Change-Id: If11c298eed98bc65712b4942d0283cafa058726c
Putting a genrule dependency after a glob in a srcs property
was causing the generated files to be treated as globbed files
and hitting an interface conversion panic.
Bug: 67364649
Test: TestGeneratedSources in later patch
Change-Id: I8a076c9998fdd07e53769922be433a793ca575a9
This reverts commit 2370af0e23.
Reason for revert: New Build Breakage: aosp-master/aosp_arm64_ab-userdebug @ 4376965
Change-Id: Ibe4b819c4292457c454bf42e6d94fba3071ec04b
Add a notice property to all modules which, if set, propagates to
LOCAL_NOTICE_FILE in make.
Test: m -j checkbuild, examine out/soong/Android*.mk
Change-Id: I565a5624dfd7b376b976b1a43dac5cea96869026
Split InstallFileName into InstallExecutable that does chmod +x
after copying the file. Also remove InstallFile and rename
InstallFileName to InstallFile.
Test: m -j checkbuild
Change-Id: Id41ad4eafe521f6cd5d8cc250b7747ecb3da8dfc
If owner is specified in a defaults module, we shouldn't concat that
with the owner specified in a module using that defaults module. A
string pointer will produce the correct behavior (overriding the default)
Bug: 37330627
Test: out/soong/Android-*.mk looks correct after this change
Change-Id: I64574e2ba81c11b042248d7a44702ec4534ee932
Fix mutator registration for tests to allow different tests
in the same package to register different mutators.
Allow tests to track the resulting ModuleBuildParams objects
to use in assertions, and provide helpers for getting them.
For example:
config := android.TestConfig(buildDir)
ctx := android.NewTestContext()
ctx.RegisterModuleType(...)
ctx.MockFileSystem(...)
ctx.ParseBlueprintsFile("Android.bp")
ctx.PrepareBuildActions(config)
ctx.Register()
// Get the Inputs value passed to the javac rule for the foo module
inputs := ctx.ModuleForTests("foo".Rule("javac").Inputs
Test: java_test.go
Change-Id: I10c82967f5f3586d2c176f169906b571ed82fc73
cc_defaults {
name: boo,
device_supported: false,
}
cc_library_static {
name: foo,
defaults: [boo],
}
Soong still tried to build foo_android_arm/arm64 device target which is not what we
expected.
Test: m -j checkbuild
Change-Id: I26a67c9ea024f5458f0818def0fa10cecc5fb7cf
Change module factories from returning a blueprint.Module and a list
of property structs to returning an android.Module, which holds the
list of property structs.
Test: build.ninja identical except for Factory: comment lines
Change-Id: Ica1d823f009db812c518f271a386fbff39c9766f
Descriptions currently look like:
[ 0% 4/29328] cc out-soong/.intermediates/external/clang/lib/Sema/libclangSema/android_arm_armv7-a-neon_denver_static_core/obj/external/clang/lib/Sema/SemaCodeComplete.o
This is not very helpful - most of the characters are used to show the
output path, which contains useful information like target architecture,
but also contains most of the path to the source files twice, and less
useful information like the exact variant name used by soong.
Make the descriptions look like:
[ 0% 3/29329] //external/clang/lib/Sema:libclangSema clang++ SemaTemplateInstantiate.cpp
This is //path/to/module:modulename tool relative/path/to/source/file
Test: builds, looks pretty
Change-Id: I3087aa7d4eb1860ef6239d77407b8b35445616d7
Turn on installation in the mega device build, it is necessary for the ndk
sysroot installation. Partially fixes mega device builds, they also need
to run without -w dupbuild=err on the ninja command line because multiple
variants of the same architecture try to install to the same ndk sysroot.
Test: mega device build
Change-Id: I982d77f9ff19f5bc29fc9fe54a0df8db3579c3e3
The vendor image will have more than just proprietary modules in it
under Treble, so let's stop marking open source code as proprietary just
to move it to vendor.
Bug: 36452052
Bug: 37134596
Test: compare build.ninja before/after, no changes.
Test: Set vendor: true, ensure it works.
Change-Id: I44b0ec7007d0e311bdcbd44b238b1ef2d05cc6ff
This CL moves the location of ASAN-ified libraries on disk in the
following manner:
/data/lib* --> /data/asan/system/lib*
/data/vendor/* --> /data/asan/vendor/*
There are a couple of advantages to this, including better isolation
from other components, and more transparent linker renaming and
SELinux policies.
Bug: 36574794
Bug: 36674745
Test: m -j40 && SANITIZE_TARGET="address" m -j40 and the device
boots. All sanitized libraries are correctly located in /data/asan/*.
Change-Id: I06bf459260ec451d4495a02562f640ad622f34c2
Instead of having a module define `use_vndk: true`, assume that we're
building with the VNDK if we're installed on the vendor partition, and
BOARD_VNDK_VERSION==current. This now matches our behavior in Make.
Once BOARD_VNDK_VERSION!=current, we'll need to disable modules that
need to otherwise compile against the VNDK, since we can only compile
against the current VNDK.
Test: build.ninja for aosp_arm is the same before/after
Test: Ensure there are no boards that set BOARD_VNDK_VERSION
Change-Id: If937fa7bdb119648137af52daebadf486163484b
Support owner properties in Android.bp files and propagate the value
to make using LOCAL_MODULE_OWNER.
Bug: 36413696
Test: builds
Change-Id: Iac1cf7f2a14c9e3e6d85d6e09d5adb08a7078d00
This breaks when I enable a second host configuration for host bionic.
Make non-arch modules !Device and !Host by adding "Generic" as the zero
value. Make the SkipDeviceInstall config only apply to Device modules.
Test: out/soong/build.ninja is identical expect for comments
Change-Id: I6e2bd3814a9968554d3901a508d822d5c79d08a0
The "required" field within "phony" module in .bp file has to be
non-empty. And "phony" module doesn't contain any "src" files.
Bug: b/32981153
Test: make -j out/soong/build.ninja
Change-Id: Iaa2009467c44702572b97ca9cbd02c1d368c8d83
Allow tests to specify a data property that lists files or filegroup
modules that will be packaged alongside the test. Also add a path
property to filegroup modules to allow shifting the path of the
packaged files, and add ExpandSourcesSubDir to expand the filegroup
sources while including a shifted relative path in the Paths objects.
Test: soong tests, manually adding data to a module
Change-Id: I52a48942660e12755d313ef13279313361b4fc35
filegroup is a module that contains a list of files, and can be used
to export files across package boundaries. filegroups (and genrules)
can be referenced from srcs properties of other modules using the
syntax ":module".
Test: m -j
Change-Id: I3d6fc4819c0b4225b474e0ad42f0d947f55a5961
In lieu of having an environment variable to override prebuilts
preferences (for now), fall back to prebuilts whenever the source
module is disabled. Complicated source modules (like LLVM) that
already have Go logic can then use an environment variariable to
disable their source module whenever they want to use prebuilts.
Computes UsePrebuilt once using information from both the source
and prebuilt modules, and stores the result in the prebuilt module.
Test: m -j libLLVM
Test: m -j libLLVM FORCE_BUILD_LLVM_COMPONENTS=true
Change-Id: Ib0819a03e9492e55f55de3402e05b3a043644a39
If a genrule sets deps_file: true, use a file in the gen directory
as a GCC-style deps file.
Test: m -j libLLVMObject
Change-Id: Id410165847e4eaea1853a392512e38787c431523
Currently our only default-disabled Os is Windows since it's HostCross,
but we'll be adding non-default Host and Device types in the future.
Bug: 31559095
Test: out/soong/build.ninja is identical
Change-Id: I2bc3a3cc76f2c95ea040bc34ba6706fcc178c68d
Move Soong's globbing-with-dependencies support into Blueprint so it can
be used for subdirs= lines in Android.bp files.
Blueprint has a slight change in behavior around subname= lines, it now
always uses the subname and doesn't fall back to Blueprints. To support
the Blueprints files in build/blueprint, use them directly with build=.
Test: build, add source file that matches glob, rebuild
Change-Id: Ifd0b0d3bc061aae0a16d6c7ca9a1cd8672656b4d
This field points to the license file for the headers being shipped.
Test: make ndk && less $SOONG_OUT/ndk/NOTICE
Bug: None
Change-Id: I386f4e6f6d9776f422ffc09b8dab69e1911b08a4
Support prebuilt shared libraries as an initial proof-of-concept of
prebuilts. Future changes will support binaries and static libraries,
and the ability to select which to use based on something besides
blueprint properties.
Test: TestPrebuilts run during m -j
Change-Id: I6e84da667e9005ae11844bad01d25cbe4ced1ce3
Blueprint is going to abdicate responsibility for determining the name
of a module. Add a name property, and a method to retreive the name.
Test: build.ninja identical
Change-Id: I09c6f5283cd6e28ad4b04c24c5ab8b00f71ae2ab
Register mutators inside lambdas that are called in a defined order to
correctly order mutators before and after the arch and deps mutators.
Test: build.ninja identical
Change-Id: Iefe2a3515aee8570e76a6e76925db4cda0e9e822
Mutator registration is tightly coupled with the android package, move
all registration from the soong package to the android package.
Test: build.ninja identical
Change-Id: Ie183d0b52cc7431c9e05b231934d189208ef1efe
The google-benchmark library is disabled on Darwin, so we cannot create
host benchmarks. Instead of having every user specify this, put the
logic in Soong. Then if we decide to support it later, it's an easier
switch.
Test: build.ninja identical before/after on Linux
Test: Ignores failing cc_benchmark_host on Darwin
Change-Id: I61f3a571fd160d8e479a512992bc68601f1c9b28
The toc optimization had been disabled for host builds to ensure that
the timestamp of the final binary changed whenever its implementation
changed, in order to support rerunning host tools that were modified
during incremental builds. However, only the final install rule must be
re-run to update the timestamp, and not the link rule.
Update the shared library install dependencies to use normal
dependencies instead of order-only dependencies for host modules, and
then enable the the toc optimization for host modules. If the
implementation of a library changes it will be reinstalled, and
libraries or binaries that depend on it will also be reinstalled.
Also move toc generation to happen on the packed, stripped library,
which is what will be used for linking, to ensure that it is available
at link time when depending only on the toc file.
Bug: 26015464
Test: m -j; touch system/tools/hidl/Annotation.cpp; m -j, verify
out/soong/host/linux-x86/bin/hidl-gen is updated
Change-Id: I8953261d2209376f3dccbf0b1a93f7af4e45c4d0
The soong checkbuild target is created by the last varaint of each
module. Don't return early if the variant is disabled, which would
prevent creating the checkbuild target.
Test: m -j checkbuild
Change-Id: Ib260bae7fb4be7255f5c1b34dfbd50225f308005
Replace PropertyCustomizer with a more extensible hooks mechanism.
Instead of passing an object that satisifies an interface, pass a
function pointer that takes a context interface as an argument. Callers
can use lambdas to capture any other necessary parameters like property
structs.
Also add two new hooks, arch hooks that occur after splitting modules
into arch variants, and install hooks that occur each time a file is
installed to the output directory.
Change-Id: I3a3e34aa97f1a92d3a31e5004b4b1ba68869d242
Track the primary architecture selected for each class based on the
module's multilib setting and the global config. Fixes building
binaries with multlib set to first and DevicePrefer32BitExecutables set,
and fixes symlinks to binaries with multilib set to prefer32.
Bug: 31452121
Test: mmma -j art HOST_PREFER_32_BIT=true
Change-Id: I75094df42f3273f6d613e4058eaa565957174c28
Allow multilib to be set to "prefer32", which will compile as 32-bit if
available, otherwise as 64-bit.
Add target.device.compile_multilib and target.host.compile_multilib. If
set, they override the top-level compile_multlib property.
Change-Id: If658a035b5f441547bc74526feb1d34f773776ff
Add a symlink_preferred_arch property to binaries to allow compiling the
binary for multiple architectures and then creating a symlink to the
preferred archicture, for example dalvikvm32 and dalvikvm64, with
dalvikvm symlinked to dalvikvm64.
Test: mmma -j art/dalvikvm
Change-Id: Ied15f2be9d52c01006fe8ac207c175b78558eab1
Allow any module factory to insert a PropertyCustomizer on the module,
which will be called before any other mutators. The PropertyCustomizer
can append or prepend to any properties, allowing module types to extend
other module types by modifying the public, stable interface provided by
the properties.
Change-Id: Idff02be80d939a70df1c6bbccffdd1f04ff975d2
Add DeviceConfig to store per-device configuration information. Put a
OncePer object inside Config and DeviceConfig, which computes a value
once per key per object to allow build logic to store arbitrary
per-build or per-device computed values.
Change-Id: I1a38b426f29d223ef5e803e0d4d9604500de2fd2
This adds LOCAL_REQUIRED_MODULES to the generated Android.mk for any
dependencies in the "required" list of a module.
Change-Id: Ibcfe89dce7d247eb441af94e37388a59e71a75a9