Commit graph

341 commits

Author SHA1 Message Date
Simran Basi
3e73e2bca6 base_rules.mk : Support subconfigs for testcases.
Updates the test module build rules to also copy over any
extra test configs that match the naming convention of
LOCAL_MODULE_*.config

Bug: 37315907
Test: forrest test HelloWorldTests_HalloWelt
Change-Id: Ie476285fe780cb19264f1fb0294008b21893a4ed
2017-04-24 11:43:36 -07:00
Simran Basi
8a431d9c7d Common testcase directories: Clean up duplicates
This CL addresses the problem that native tests build for multiple
architectures and also build for host.

First it restructures each testcase folder to the following layout:
<testcase>/<testcase>.config
<testcase>/<arch 1>/testcase
<testcase>/<arch 2>/testcase

Secondly it now uses the new soong-zip prefix capability to
separate out host and target testcases in the device-tests &
general-tests zip files.

Bug:36692141
Test: `make device-tests general-tests cts -j` &
      ensured all built successfully.

Change-Id: I4e8b084ee56fa8940914911649ff35507d87eb27
2017-04-05 13:38:20 -07:00
Dan Willemsen
05a2b931e9 Add LOCAL_VENDOR_MODULE as a synonym to LOCAL_PROPRIETARY_MODULE
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
Test: compare build-aosp_arm.ninja before/after, no changes.
Test: Try defining LOCAL_VENDOR_MODULE / LOCAL_PROPRIETARY_MODULE in the
same and different ways, ensure it works.
Change-Id: I0ab046bcb7563a20d44ed00667e18497ef0873a8
2017-03-20 20:57:04 -07:00
Dan Willemsen
de4e71b27b Revert "install *.so in different paths for their types"
This reverts commit 842a985f90. It's
causing test failures, warnings and complaints, so backing it out and
we'll resolve those before putting it back in.

This also bundles in the revert of a minor warning/error fixup for this
code, and does the correct thing with the CleanSpec.mk (which can't just
be reverted).

Bug: 33681361
Test: m -j
Change-Id: Ic889ce6a4737a497ad6bf633424ce1860713f7d0
2017-03-16 16:54:40 -07:00
Jiyong Park
79f5918199 Silence module path warnings for a while
Warning messages like, "libart_fake: framework library must be installed
to system/lib64 but requested to be installed at system/fake-libs64.
Please fix.", are temporarily muted since some of those warnings might
be false alarms.

Let's just silence the warning for everybody and investigate the cases
internally by turning on the build flag SHOW_MODULE_PATH_WARNINGS.

Test: the warning messages should not be shown unless built with
SHOW_MODULE_PATH_WARNINGS=true.

Change-Id: I5eb3ab3385c92a5192723ff1008277c321162191
2017-03-16 12:57:21 +09:00
Jiyong Park
d4ca89bfd6 fix: cannot determine the type of modules with class 'samples'
Test: make sdk should not break

Change-Id: I849befde3c6b91f0b417aa6b11a909c6c4aad627
2017-03-14 09:40:29 +09:00
Treehugger Robot
55b14bdaa4 Merge "install *.so in different paths for their types" 2017-03-14 00:15:50 +00:00
Jiyong Park
842a985f90 install *.so in different paths for their types
Shared libraries are now installed to different directories depending on
their types.

* NDK libraries: /system/lib/ndk (with symlink from /system/lib)
* VNDK libraries: /system/lib/vndk
* VNDK-ext libraries: /system/lib/vndk-ext
* Framework-only libraries: /system/lib
* Vendor-only libraries: /vendor/lib
* Same-process HALs: /vendor/lib/sameprocess

However, if LOCAL_MODULE_PATH is explicitly set, then it is respected,
with a warning message. Module owners are highly encouraged to
investigate the warnings and use alternatives to LOCAL_MODULE_PATH;
combination of LOCAL_[PROPRIETARY|OEM|ODM]_MODULE, LOCAL_MODULE_CLASS
and LOCAL_RELATIVE_PATH will cover most of the cases.

Furthermore, for each shared libraries whose path is changed, a symolic
link from the original path to the new path is *temporarily* generated.
e.g. /system/lib/libbase.so -> vndk/libbase.so. This is
to prevent sudden breakage of the code expecting the lib from the old
path. This symbolic links will eventually be removed before O launch
(b/34917183).

Finally, BOARD_SAME_PROCESS_HAL_DEPS is added. It contains the list of
shared libraries implementing the same-process HALs and its internal sub
libraries. This is designed to be defined in BoardConfig.mk

Bug: 33681361
Test: build & run. Libraries must be in the correct directories.
Symlinks from the old path to the new path must exist.

Change-Id: I46130aac09ae65400fd4d0abbc2e12dddd154fb1
2017-03-13 08:27:09 +09:00
Treehugger Robot
6abedc9b3e Merge "Add support for multiple LOCAL_COMPATIBILITY_SUITES & undefined testcase directories." 2017-02-28 23:42:18 +00:00
Simran Basi
6bea37c7fa Add support for multiple LOCAL_COMPATIBILITY_SUITES & undefined testcase directories.
1) Updates the LOCAL_COMPATIBILITY_SUITE line to allow for a
   testcase to belong to multiple suites.
2) Building testcases no longer fails if
   COMPATIBILITY_TESTCASES_OUT_<suite> is not defined. This
   testcase will just not output to that directory.
   This will be utilized by the device-tests and general-tests
   suites that don't require any extra output besides the common
   testcase directory.

Bug: 35394351
Test: 1) Added multiple *TS testcases to cts & vts and verified they
       ended up in the common directory and each suite's testcase
       directory. Specifically tested CtsSplitApp to ensure the
       split usecase still works as well.
      2) Added a CTS testcase to the device-tests suite, built
       device-tests and verified the cts/android-cts/testcases
       copy was not produced.

Change-Id: Ic4c4e87e62be4fc0c5e394d88cc359518346dffa
2017-02-28 12:41:40 -08:00
Dan Willemsen
1e4fb7f161 Improve module tags warnings
Stop blaming base_rules.mk, put the module makefile at the beginning
of the line. That way scripts like warn.py can parse this better.

Test: multiproduct_kati, grep logs
Change-Id: I5e6844097b44e47b8126159c1760b7524134310d
2017-02-24 23:52:22 +00:00
Dan Willemsen
8dae49c5e1 Add Header Library support to Make
We currently use static libraries without any source files to represent
header libraries, but Soong actually has cc_library_headers. So to
export those in a separate namespace from static libraries, implement
them in Make as well.

This also adds a nice pretty-warning / pretty-error macro that can be
used to print out standard warning messages pointing to the real source
file having the problem.

Test: Use a header library exported by Soong in a Make module
Change-Id: I3486539e247524cb82a20620745fc7be03014e14
2017-02-15 16:04:49 -08:00
Dan Willemsen
b2a5c7b369 Fix init rc installation in vendor when LOCAL_MODULE_PATH is set
The init.rc path selection uses the same partition_tag detection to
select an installation partition. So make sure that we always set
partition_tag even if we've been given an explicit module path.

Bug: 35314904
Test: set proprietary: true to Soong module with an init rc, verify
      that was the only change to build-aosp_arm64.ninja
Change-Id: Ic6ffd7a5177959db96a34a24896b242ee5b09e41
2017-02-13 14:19:47 -08:00
Alex Deymo
06f3258694 Merge "Include the LOCAL_REQUIRED_MODULES when packaging." 2017-02-13 16:01:35 +00:00
Simran Basi
3fb354cca0 Output *TS testcases to their own subdir in the common testcase folders.
Instead of dumping all *TS testcases into the common testcase
directory directly, place them all in their own subdirectory.

Bug: 35153177
Test: `make cts -j` and checked the contents of both:
out/host/linux-x86/testcases/ &
out/host/linux-x86/cts/android-cts/testcases/

Change-Id: I22a768dba58d40be1e61885534fb813e7ff08c99
2017-02-08 15:53:32 -08:00
Simran Basi
7166d1f43a Output *TS testcases to common testcase folders.
Aggregates the different *TS testcases into two common folders,
one under each the host and product hierarchies.

Bug: 34715822
Test: `make cts -j` and checked the contents of both:
out/host/linux-x86/testcases/ &
out/host/linux-x86/cts/android-cts/testcases/

Change-Id: I7d5201998ddcb011ecc687c272a0d0a36da248b7
2017-02-07 14:49:06 -08:00
Alex Deymo
00dc66760e Include the LOCAL_REQUIRED_MODULES when packaging.
When building test modules, dependencies added by the test modules get
build but don't get included in the packaged tests .zip file.

When packaging modules into a .zip file, this patch includes the modules
explicitly listed as a dependency in LOCAL_REQUIRED_MODULES for the
requested modules to package.

If these LOCAL_REQUIRED_MODULES dependencies are not used in the base
system image, they were build as part of the "tests" target but weree
not included in the package nor in the system image. This patch includes
those modules, making it easier to define dependencies of a test
module in the Android.mk file that defined said module, instead of
requiring to re-list all the dependent modules when packaging test
modules.

Bug: 27348226

Change-Id: Ic6f60cf2916b3fae0fa39f84aee8a4f440af9539
2017-01-05 12:12:42 -08:00
Dan Willemsen
d07ba4e2a6 Implement LOCAL_TEST_DATA to ship data with tests
This can be used to ship source data as test artifacts next to native
tests. It works for both local builds and the test bundles using
package_modules.mk.

You just specify a file list relative to the local directory, and those
files will be copied next to the executable under
/data/nativetest*/<module>/...:

  LOCAL_MODULE := mytest
  LOCAL_TEST_DATA := data/file1 file2

  /data/nativetest/mytest/mytest
  /data/nativetest/mytest/data/file1
  /data/nativetest/mytest/file2

If the data is in another directory, you may also specify a different
prefix for the source files:

  LOCAL_TEST_DATA := external/skia:resources/f.xml

  /data/nativetest/skia_test/resources/f.xml

And there's a new convenience macro to find a list of files in this
format:

  LOCAL_TEST_DATA := $(call find-test-data-in-subdirs,external/skia,"*.xml",resources)

I'll expand this to native benchmarks and fuzz tests in a later change,
since they don't have their own module classes yet.

Bug: 30564705
Test: m -j minikin_tests; ls $OUT/data/nativetest*/minikin_tests
Test: m -j continuous_native_tests dist; zipinfo -1 out/dist/*continuous_native_tests*.zip
Change-Id: Ic76a7b62e7f567f259c4ab1510ee97d26600ba9a
2016-12-13 17:18:36 -08:00
Treehugger Robot
d1b10b20f6 Merge "Fix PDK dupbuild issues" 2016-12-10 07:14:12 +00:00
Dan Willemsen
e0bba6fa12 Fix PDK dupbuild issues
The PDK uses pattern rules in order to install files from the PDK. When
those files already have build rules, the explicit rules override the
pattern rules, and everything works. But because Make (and Kati) doesn't
attempt to clean the file paths, if one of the rules has a redundant /,
we'll export two ninja rules, and ninja will error out with a dupbuild
error.

The PDK pattern rules are clean, but the explicit notice file creation
was not, it was always adding a double // in between NOTICE_FILES/src
and the module path.

Some modules were also setting a LOCAL_MODULE_PATH with a trailing /,
which is redundant, and also hits the above problem. Instead of fixing
all of the modules, just strip a trailing / from my_module_path.

Bug: 33451638
Test: Build with a PDK
Change-Id: Iff3e98fd191ea90626b9b89f179537e8a75f5ef2
2016-12-09 21:15:41 -08:00
Colin Cross
d76e2e63ae Add more module targets for host, host-cross, host32, host64
Previously, clang-host would build the clang module for 32-bit and
64-bit for the host and for windows.  Make clang-host only compile
for host, and add clang-host-cross for windows.  Also add targets
that only build 32-bit or 64-bit: clang-host32, clang-host64,
clang-host-cross32, clang-host-cross64, clang-target32, and
clang-target64.

Test: inspect build.ninja
Change-Id: I7676f9497dfc852f2a0255dda8da06c88eec0db8
2016-12-09 13:08:27 -08:00
Dan Willemsen
323efd3035 Add basic VNDK support in Make
am: bab0fa6928

Change-Id: Ie2bc9062891b2f8000b1db471b27f58c74190e92
2016-11-29 20:42:32 +00:00
Dan Willemsen
bab0fa6928 Add basic VNDK support in Make
Add BOARD_VNDK_VERSION and LOCAL_USE_VNDK to specify the version of the
VNDK that will be used globally, and whether to use the VNDK on a module
basis.

If the board is using the VNDK:

* LOCAL_COPY_HEADERS may only be used by modules defining LOCAL_USE_VNDK
* LOCAL_USE_VNDK modules will compile against the NDK headers and stub
  libraries, but continue to use the platform libc++.
* LOCAL_USE_VNDK modules will not have the global includes like
  system/core/include, but it will use device-specific kernel headers.

This change does not attempt to enforce any linking constraints, that
will come in a later patch.

Test: out/build-aosp_arm.ninja is identical before/after
Change-Id: Icce65d4974f085093d500b5b2516983788fe2905
2016-11-28 13:46:17 -08:00
Jakub Adamek
44dd3e2842 Install runtime resource overlay without subdir.
am: a08a1015bc

Change-Id: I1ca2e029b79bf125145d2031a722914fe24dd299
2016-10-05 20:03:45 +00:00
Jakub Adamek
a08a1015bc Install runtime resource overlay without subdir.
Runtime resource overlay is a bare APK with just the overlaid
resources. There is no need for additional subdir.
See http://go/sku-colors.

Bug: 31692079
Change-Id: Iff3d58f941e764a7be3ec04cafeefd592bd8b944
2016-10-05 10:03:28 +01:00
Colin Cross
d2ff157159 Enable toc optimization for host builds
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.

Bug: 26015464
Test: m -j; touch art/disassembler/disassembler_x86.cc; m -j, verify
      out/host/linux-x86/bin/oatdump is updated
Change-Id: I0a14decc1994eb55ad269d841943aef66e320c63
2016-10-03 17:53:44 -07:00
Colin Cross
aaf888a09a Build symlinks for -host and -target phony modules
Move extra module dependencies like symlinks from dependencies of
$(my_register_name) to $(my_all_targets), and make $(my_register_name)
and other convenience phony modules depend on $(my_all_targets).  Move
$(LOCAL_MODULE)-host/-target to depend on $(my_all_targets) instead of
directly depending on the built and installed modules.

Change-Id: I3b093986db7a1bff118f1f2482275f0997a98fb6
2016-09-07 14:03:32 -07:00
Colin Cross
b43204b2ac Create more shortcut phony targets
Create shortcut phony targets for the host and device halves of
modules.

Change-Id: I1cf3a49118db830d78a1b83b2177715175949871
2016-08-30 16:16:32 -07:00
Colin Cross
6d34b61bd3 Install symlinks when using shortcut phony targets
Make symlinks an order-only dependency of the module name phony target
so that they get installed with make module or make MODULES-IN-path.

Test: mmma -j art/dalvikvm, remove symlink in $OUT and retry
Change-Id: Iae472a1c8fa1e8386cc9556cfe819bd4fca99428
2016-08-24 15:24:29 -07:00
Alexey Polyudov
755391d77e Merge "introduce AUX build class of targets"
am: 556526bf95

Change-Id: I52b4b3a561ceb9c1fbe71ce75a4ef4aa252a9665
2016-08-02 22:50:21 +00:00
Alexey Polyudov
ccdc311b33 introduce AUX build class of targets
AUX is a new class, similar to TARGET
While TARGET defines toolchain for Application Processors
AUX is defining toolchains for arbitrary utility cores (DSPs, GPUs,
MCUs, etc). This allows building of non-android sources as part
of Android tree and avoid using prebuilts if source code is avaliable

Bug: 29635686
Change-Id: Ie755ea054b16c3e86369f5fb2ba6eb0b384af77f
Signed-off-by: Alexey Polyudov <apolyudov@google.com>
2016-08-02 08:06:28 -07:00
Dan Willemsen
f8b7ae9c14 Merge \"Refactor LOCAL_INIT_RC\"
am: cc715fa5d4

Change-Id: I484480375235395fd55eb1cfbb0a50259c6d840e
2016-07-30 02:06:44 +00:00
Dan Willemsen
435360a790 Refactor LOCAL_INIT_RC
We supported de-duplicating LOCAL_INIT_RC across multiple architecture
variants in a single module definition, but that didn't work if the
module was defined with two different BUILD_PREBUILT definitions. That's
how we're exporting modules from Soong to Make.

Change-Id: Ifc93b15ef78ea3d8e78005d428a3ec57d7e414e8
2016-07-29 15:28:20 -07:00
Dan Willemsen
922ae6846b resolve merge conflicts of dd9aee1 to stage-aosp-master
Change-Id: I4278b9700c8729a06d38acc26e22ce7c340382f2
2016-07-29 14:15:14 -07:00
Dan Willemsen
3bf15e71d3 Record module type statistics
Creates a build_system_stats.txt build artifact that contains statistics
on how many BUILD_* modules are defined in a build. Also writes out
information about the Soong module types sent from the Soong build.

Merged-In: Iaf0c7062f542dc6942b5349854f3d49267cac4a5
Change-Id: Iaf0c7062f542dc6942b5349854f3d49267cac4a5
2016-07-29 19:58:35 +00:00
Colin Cross
4cca8a5573 resolve merge conflicts of 1e92cfb to stage-aosp-master
Change-Id: I1929d5c16ea0b8574372049ac7dffd30fd3e1db3
2016-07-15 14:49:45 -07:00
Colin Cross
744d33b381 Add support for LOCAL_MODULE_SYMLINKS
Specifying LOCAL_MODULE_SYMLINKS will create symlinks to the installed
module in the same directory.

Change-Id: Idecb2b75f0c9999eb000eed9a79a989244ccf6c2
2016-07-15 12:22:39 -07:00
Dan Willemsen
32b36a8819 Merge "Add NATIVE_TESTS class, move host native tests" am: e72fc63901
am: 10461b78f0

* commit '10461b78f0955d9dba8d32045d1e35ff0f9a5c8c':
  Add NATIVE_TESTS class, move host native tests

Change-Id: Ia11b54676d3b33e58c177a5a375f29233657524e
2016-06-07 00:09:39 +00:00
Dan Willemsen
e72fc63901 Merge "Add NATIVE_TESTS class, move host native tests" 2016-06-06 23:59:23 +00:00
Dan Willemsen
d99f210545 Merge "Add LOCAL_LOGTAGS_FILES that prebuilts can use" am: 476b5b1616
am: 58b7c1c744

* commit '58b7c1c744aa49fb0686848b281ae75c2485f420':
  Add LOCAL_LOGTAGS_FILES that prebuilts can use

Change-Id: I76a6077c3945463a5b52fb8a4f5146a2590de716
2016-06-01 23:53:44 +00:00
Dan Willemsen
b0a08b874c Add LOCAL_LOGTAGS_FILES that prebuilts can use
Soong modules can define logtags files that need to be combined into
/system/etc/event-log-tags, so add a new LOCAL_LOGTAGS_FILES variable
that can be used to specify *.logtags file outside of LOCAL_SRC_FILES.

Bug: 28989759
Change-Id: I53c5d396dfb7c6006806758f351eb5cdde90fe74
2016-06-01 15:31:44 -07:00
Dan Willemsen
7fe992c0cc Add NATIVE_TESTS class, move host native tests
Host native tests have been getting installed into
out/host/linux-x86/bin/..., but this pollutes the bin directory with a
lot of poorly named tests. Also, to support 32-bit and 64-bit tests, we
need to have different names with different suffixes. This causes
problems when tests expect to be named something specific (like gtest).
It's also convenient to store test data next to the test itself.

So with this change, native tests will be installed in
out/host/linux-x86/nativetest[64]/$(LOCAL_MODULE)/$(LOCAL_MODULE_STEM)
just like target tests get installed into /data/nativetest[64].

Implement this using a new NATIVE_TESTS class, which is like
EXECUTABLES, but sets up the install path differently, and configures
the rpath to load shared libraries with the proper relative path.
LOCAL_MODULE_RELATIVE_PATH can be used to control the directory name, it
will default to $(LOCAL_MODULE). This way multiple related tests can be
grouped together.

Target native tests also use NATIVE_TESTS now, but nothing should change
other than LOCAL_MODULE_RELATIVE_PATH can be used.

Change-Id: I535e42b1a6b21c5b8d6a580aa2f944d2be35e27d
2016-05-24 12:43:16 -07:00
Ying Wang
77f67cd048 Merge "Support x86+arm multilib build."
am: d314805

* commit 'd314805c29fdbee3508b99c14ca63e1a8d170c3b':
  Support x86+arm multilib build.
2016-03-25 21:51:21 +00:00
Ying Wang
87538e4f8b Support x86+arm multilib build.
Support TARGET_2ND_ARCH as the binary translation arch.
See target/board/generic_x86_arm/BoardConfig.mk and
target/product/aosp_x86_arm.mk as example for the setup.

In BoardConfig, use the TARGET_2ND_ARCH/etc. variables to set up the
binary translation arch;
Set "TARGET_TRANSLATE_2ND_ARCH := true" to tell the build system it's
not a typical 64-bit multilib configuration.
In product makefile, use "PRODUCT_PACKAGES += libfoo_<2nd_arch>" to
install the TARGET_2ND_ARCH libraries. This also pulls in any dependency
libraries.
By default we don't install any TARGET_2ND_ARCH modules, unless it's
pulled in by PRODUCT_PACKAGES.

Bug: 27526885
Change-Id: I0578e9c80da0532d2fa886a8fcdb140bbc703009
(cherry-pick from commit 277e75a488)
2016-03-25 13:29:53 -07:00
Ying Wang
9d13d6a7e9 Merge "Phony target covers all multilib variants."
am: 165c707

* commit '165c70713ac9099833df7fd6e6ba5c5620a84a9e':
  Phony target $(LOCAL_MODULE) covers all multilib variants.
2016-03-23 23:10:26 +00:00
Ying Wang
71c58092f4 Phony target $(LOCAL_MODULE) covers all multilib variants.
Bug: 27760875
Change-Id: Ie59e2c36964fa736b17fb4185563c08a8cb75b80
2016-03-23 11:02:03 -07:00
Dan Willemsen
23afb78cf9 Merge commit 'cdaf748e3abefd93a4e45393e96717fad8564c51'
Change-Id: I3c44564b08ed46f46719dbca54d4225718bb8c59
2016-03-01 15:36:08 -08:00
Dan Willemsen
479311bc7c Remove LOCAL_ACP_UNAVAILABLE
Now that copy-file-to-target doesn't use acp, nothing in the acp build
path uses acp, so we don't need to special case it to prevent loops.

Change-Id: I12810c1b064d0c03135a80077a76bc4c9cc18b24
2016-03-01 13:16:53 -08:00
Dan Willemsen
7f016150a0 Remove unused dependencies on $(ACP)
Most of these are calling to copy-file-to-target or similar, which no
longer use $(ACP).

Change-Id: I62287a80c577c34df587b74e70055c2f56050ce7
2016-03-01 13:15:35 -08:00
Dan Willemsen
9ffa38b193 Merge "Remove USE_NINJA=false" am: 3bfc095f53
am: d73633c082

* commit 'd73633c0824a63f7104bddf9a798bccc952b545c':
  Remove USE_NINJA=false
2016-02-29 22:19:29 +00:00