Commit graph

903 commits

Author SHA1 Message Date
Dimitry Ivanov
7636b362e1 Merge "Apply native_bridge suffix to all cc_modules" 2019-05-24 08:28:55 +00:00
Treehugger Robot
d14e5c6ed4 Merge "Add some more visibility test cases." 2019-05-23 16:31:49 +00:00
dimitry
4320449c97 Apply native_bridge suffix to all cc_modules
This fixes the problem with cc_object not having this suffix and
as a result overriding non-bridged variants for modules using mk files.

Bug: http://b/77159578
Test: build 4arch product
Change-Id: Ie958f997c6f54f93d8b2987ca5ba605004e1eb70
2019-05-23 13:31:10 +02:00
dimitry
628db6faa4 Native bridge modules are not translated second archs
Ignore native_bridge targets when detecting whether second
architecture is translated or not.

The concept of second translated architectures is almost deprected
and will be removed once all affected products are switched to
native_bridge support from the build system.

Bug: http://b/77159578
Test: make 4arch target
Change-Id: Ife93ccc60f5c1a4020f66b2cf862b709889d9d6b
2019-05-22 15:21:15 +00:00
Martin Stjernholm
8edeb6372e Add some more visibility test cases.
Bug: 112158820
Test: Soong self test
Change-Id: Ia359c35c0c124bac2693926ce8f05dd20435f05d
2019-05-21 20:36:00 +01:00
Colin Cross
0d99f7cd84 Don't create a second host arch for tests on darwin
Only x86_64 darwin is supported, not x86.  Don't create an x86
host arch when running tests on darwin.

Test: all soong tests
Change-Id: Ic12763298345e32a1340f8fbef338d2ab4d62b2e
2019-05-17 08:43:36 -07:00
Jaewoong Jung
105920a792 Merge "Fix override_android_app dependency issues." 2019-05-16 15:07:13 +00:00
Treehugger Robot
e40da8cff6 Merge "Soong: Add support on installing fonts in /fonts system image." 2019-05-15 23:53:28 +00:00
Treehugger Robot
651f40bbe1 Merge "Generate VNDK snapshot with Soong except configs" 2019-05-15 22:13:35 +00:00
Patrice Arruda
61583eb72a Soong: Add support on installing fonts in /fonts system image.
A new module named prebuilt_font allows a set of fonts to be
installed in the /fonts system image.

Bug: b/123403785
Test: Wrote and ran unit test cases.
Change-Id: Icd468abe3d70a528b28a8d8f216407484e9966a7
2019-05-15 12:35:29 -07:00
Jaewoong Jung
b639a6adb2 Fix override_android_app dependency issues.
This change fixes an issue where an android_test could not depened on an
override_android_app or an android_app overridden by one by moving all
override processing to post-deps and forwarding incoming dependencies on
override_android_apps to base android_app modules

Fixes: 132447700
Test: app_test.go
Change-Id: I4ac593be661f541f5ea9823ef97373bee4b186f9
2019-05-15 12:11:18 -07:00
Inseob Kim
1f086e2f0d Generate VNDK snapshot with Soong except configs
This is the first commit to generate VNDK snapshot with Soong: .so
files, some txt files, and notice files are captured with Soong. As
ld.config.txt is currently in Android.mk and will be deprecated soon,
configs files (and zipping all of artifacts) are still handled with
Makefile.

Bug: 131564934
Test: 1) DIST_DIR=out/dist development/vndk/snapshot/build.sh
Test: 2) try installing vndk snapshot with:
     development/vndk/snapshot/update.py

Change-Id: I8629e1e25bfc461fd495565bb4872c9af176cf92
2019-05-15 10:26:54 +09:00
Colin Cross
66bdb695ae Prevent hangs in OncePer when the callback panics
If the callback passed to Once panics it was leaving the waiter
in place that would never be completed.  Move writing the value
and signalling the waiter to defer.

Test: TestOncePerPanic
Change-Id: Icc4d3b779a79914fcd881d61d38dffcc2f591c39
2019-05-14 18:40:13 +00:00
Pete Gillin
42e862c56d Merge "Rename EXPERIMENTAL_USE_OPENJDK9 to EXPERIMENTAL_JAVA_LANGUAGE_LEVEL_9." 2019-05-10 11:50:08 +00:00
dimitry
03dc3f63f6 Enable native bridge support by default for certain ndk modules
The ndk_library, ndk_prebuilt_object and ndk_prebuilt_static_stl
modules are natural targets to have native bridge support enabled,
since they build user facing object which have to be supported for
translated architectures.

Bug: http://b/77159578
Test: make
Change-Id: Ic556f4c1c41e5b3dc92f9c290b4482dee8faed33
2019-05-09 16:37:16 +02:00
Pete Gillin
0c2143e1ee Rename EXPERIMENTAL_USE_OPENJDK9 to EXPERIMENTAL_JAVA_LANGUAGE_LEVEL_9.
The current EXPERIMENTAL_USE_OPENJDK9 environment variable is a legacy
from when the 8 -> 9 toolchain upgrade was happening. That migration
is done and the variable only affects the language level, so it should
have a name that reflects that. (The current situation would be
especially confusing if we started a 9 -> 11 toolchain upgrade,
presumably controlled by a variable like EXPERIMENTAL_USE_OPENJDK11,
since the two settings look incompatible but are actually orthogonal.)

The current variable historically allowed a value or "1.8" which meant
"use the OpenJDK 9 toolchain but target language level 8". That value
no longer has any meaning and the new variable doesn't allow it.

Bug: 131678633
Test: `make` with `EXPERIMENTAL_JAVA_LANGUAGE_LEVEL_9=true`
Test: `javap -v $OUT_DIR/soong/.intermediates/libcore/core-oj/android_common/javac/classes/java/util/List.class | grep 'major version'` shows 53
Test: Audit all mentions of the old string here and downstream
Change-Id: Idad808c7f07913baba1a777627322d5452dabcef
2019-05-09 15:36:29 +01:00
Jaewoong Jung
a5e5abc449 Implement DPI variants in android_app_import.
Bug: 128610294
Test: app_test.go
Change-Id: Ie3e558bfdb40de6b0b9df95d3b373d08a4084d7b
2019-05-07 17:55:23 -07:00
dimitry
1f33e40972 Add native_bridge target to Android.bp
This allows us to build guest libraries for the native bridge for
arm/arm64 architectures.

Bug: http://b/77159578
Test: make
Change-Id: I35520ca456105ddadd456c78a4eb1e6de39147c5
2019-05-03 15:33:28 +02:00
Colin Cross
0ef0816727 Support robolectric_test
robolectric_test will compile a suite of tests that run in
robolectric.  For now it also generates a Run* rule, later
that will be removed in favor of atest.

Bug: 123248659
Test: m RunSettingsLibRoboTests
Change-Id: I12407d0b0d639e31c1969077ba787e8985e6a506
2019-05-01 16:41:44 -07:00
Paul Duffin
ff5a177879 Remove unnecessary core library neverallow rules
The rules that restricted access to core library targets are no longer
required as they have been replaced with visibility rules. The
visibility rules are safer because they check all dependencies whereas
the neverallow rules that have been removed only checked dependencies
in the libs property and so missed dependencies in static_libs and
java_libs properties.

(cherry picked from 8e8c01c382)

Bug: 112158820
Test: m core-tests
Change-Id: I3b50b705b7cd6fcdc55d26cd71b9149b3abd2b88
Merged-In: Ibfef74db0769992266ebadf445836d2a183df3f7
2019-05-01 09:39:32 +01:00
Treehugger Robot
1341942d86 Merge "Prebuilt APEXes are recoreded in apexkeys.txt" 2019-04-30 03:14:01 +00:00
Logan Chien
23803f9365 Merge "Support opt-in ABI checks" 2019-04-29 17:40:06 +00:00
Jiyong Park
4d27704da0 Prebuilt APEXes are recoreded in apexkeys.txt
apexkeys.txt now correctly lists prebuilt APEXes with keys specified as
PRESIGNED.

This change also fixes a bug that non-installable APEXes are listed in
the file.

Bug: 131130235
Test: m out/soong/apexkeys.txt and check that
com.android.apex.cts.shim.apex is listed there with PRESIGNED keys.

Merged-In: Ib6d391a82864714743a1cc59cd655bea917b5073
Change-Id: Ib6d391a82864714743a1cc59cd655bea917b5073
(cherry picked from commit a41f12a6fa)
2019-04-29 09:21:23 +09:00
Logan Chien
41eabe63e8 Support opt-in ABI checks
This commit allows a module to opt in for ABI checks even when it is
not an LLNDK/VNDK module.

Bug: 131421213
Test: Add `header_abi_checker { enabled: true, }` to some module
Change-Id: Ie09d262e651cbb44d7d0eba652f55dc1e1e52962
2019-04-27 01:55:50 +08:00
Paul Duffin
2e61fa6e14 Add visibility support
Implementation uploaded for review. Includes unit tests but does not
yet handle prebuilts, that will come in a future change once some
more general issues with prebuilts and namespaces is resolved.

See README.md#Visibility for details of what this does and how to use
it.

Bug: 112158820
Test: add visibility rules for core library modules, make core-tests
Change-Id: I8ec980554398ad6f2d42043ce518f811a35da679
2019-04-26 12:37:37 +01:00
Treehugger Robot
18805e483f Merge "Build contexts files with Soong" 2019-04-25 07:46:19 +00:00
Jaewoong Jung
159a585251 Merge "New AndroidMk authoring system based on entry map." 2019-04-23 14:43:52 +00:00
Treehugger Robot
588c1ee5f8 Merge "Fix tests with cc_binary_host on mac" 2019-04-23 04:12:26 +00:00
Inseob Kim
0866b003b2 Build contexts files with Soong
This is to migrate sepolicy Makefiles into Soong. For the first part,
file_contexts, hwservice_contexts, property_contexts, and
service_contexts are migrated. Build-time tests for contexts files are
still in Makefile; they will also be done with Soong after porting the
module sepolicy.

The motivation of migrating is based on generating property_contexts
dynamically: if we were to amend contexts files at build time in the
future, it would be nicer to manage them in Soong. To do that, building
contexts files with Soong can be very helpful.

Bug: 127949646
Bug: 129377144
Test: 1) Build blueline-userdebug, flash, and boot.
Test: 2) Build blueline-userdebug with TARGET_FLATTEN_APEX=true, flash,
and boot.
Test: 3) Build aosp_arm-userdebug.

Change-Id: I49206e656564206d6f7265206361666665696e65
2019-04-23 10:10:56 +09:00
Colin Cross
9c6241f768 Fix tests with cc_binary_host on mac
cc_binary_host on mac uses ctx.Config().HostSystemTool(), which needs
PATH in the test environment.  Copy it from the original environment.

Fixes: 129763458
Test: proto_test.go
Change-Id: I41c1acdceee7c35036148256adafb471871034df
2019-04-22 15:55:56 -07:00
Jaewoong Jung
9aa3ab1f3f New AndroidMk authoring system based on entry map.
The new system collects all Android.mk variable assignments using a map
and writes them to io.Writer. Compared to the previous system, which
directly writes all entries to buffers, this new system is more robust
and test-friendly.

Test: Built without prebuilt_etc.go change and diffed the mk output.
Test: prebuilt_etc_test.go
Change-Id: Idd28443d129ff70053295015e69328a8fa3eca47
2019-04-22 15:32:44 -07:00
Colin Cross
e928452f30 Merge "Allow codename.fingerprint format for targetSdkVersion" 2019-04-22 16:48:35 +00:00
Jiyong Park
d4671111ef Ensure that PathsForModuleSrc works with prebuilts
prebuilt_test is amended to ensure
f2976304f7 is not broken.

PathsForModuleSrc is called to check if the file is from correct module
(either from source or prebuilt module)

Bug: 130627486
Test: m

Change-Id: Ic5f467fbc2837727df92102530687e967cd5529f
2019-04-19 17:57:33 +09:00
Jiyong Park
f2976304f7 Fix: PathsForModuleSrc does not work for a replaced dependency
PathsForModuleSrc does not work if a source module is replaced with a
prebuilt module. This is because the function uses GetDirectDepWithTag
with the name of the original source module. Since the dependency is
replaced and the prebuilt module has the name "prebuilt_<name>", the
search always fails.

Fixing this by re-implementing GetDirectDep* functions inside Soong
using VisitDirectDep.

Bug: 130627486
Test: m
Change-Id: I68d52668283c429d5e93c7f2c81f6a8db1f24893
2019-04-19 13:48:33 +09:00
Colin Cross
109328714f Allow codename.fingerprint format for targetSdkVersion
Use codename.fingerprint format for targetSdkVersion if it is unset
in the manifest and UNBUNDLED_BUILD_TARGET_SDK_WITH_API_FINGERPRINT=true.

Test: manual
Bug: 130541924
Change-Id: I4e3b1274cc32038b00b292dc6d67559eb320e9e4
2019-04-18 16:05:37 -07:00
Dan Willemsen
54879d193e TARGET_FS_CONFIG_GEN is a list, not a single path
Bug: 130787336
Test: m oemaids_header_gen oemaids_headers passwd group
Test: Set TARGET_FS_CONFIG_GEN to a list of paths
Change-Id: Ic1f7d38239f3f805ca0723c24005d3e18a811870
2019-04-18 17:16:41 +00:00
Treehugger Robot
59d4a31063 Merge "Use LoadHook to create modules in java_sdk_library" 2019-04-17 08:28:36 +00:00
Colin Cross
44d5d22db6 Merge "Allow guava to use java_host_for_device" 2019-04-16 23:14:12 +00:00
Colin Cross
f8b860a0fb Use LoadHook to create modules in java_sdk_library
Creating new modules in a mutator is dangerous, as other mutators
that need to see the new modules may already have run, in this case
the prebuilts mutator.  Move SdkLibraryMutator to a LoadHook instead.
Also moves registering the LoadHook mutator to testing.go so it is
registered for all tests.

Test: m checkbuild
Change-Id: I08bd76a0e6205d2ca27861058067a1562c339eed
2019-04-16 21:46:28 +00:00
Colin Cross
97add50354 Allow guava to use java_host_for_device
Guava can't compile against a device bootclasspath, it uses methods
that only exist in the host bootclasspath, and then avoids calling
them at runtime.

Bug: 130306229
Test: m checkbuild
Change-Id: I012030cb701c01ea9ff554c1b6156d0242365a4c
Merged-In: I012030cb701c01ea9ff554c1b6156d0242365a4c
Exempt-From-Owner-Approval: cherry pick
(cherry picked from commit b5191a573d)
2019-04-15 21:44:51 -07:00
Dan Willemsen
4e0aa23dd3 Convert yacc to a single RuleBuilder rule
So that <module>/gen/yacc/... is (re)created by a single rule, previous
files are removed, and location.hh is in the build graph when it is
produced.

Test: treehugger
Change-Id: I2f6e47ea07f315e10ae1cb8ad50697e7123d0285
2019-04-15 14:52:05 -07:00
Dan Willemsen
633c502295 Support RuleBuilder.Sbox to wrap commands in sbox
This essentially allows you to declare that everything in a directory
will be created by the rule, and we'll ensure that your command actually
writes out all of the claimed outputs, and remove any other files that
previously existed in that directory.

Test: built-in tests
Change-Id: I990dce2b3a0d89ebd2736ac1a0cadfb5864c6e73
2019-04-15 14:52:05 -07:00
Dan Willemsen
71c7460713 Expose TargetFSConfigGen to DeviceConfig from Make
Bug: 118089258
Test: m oemaids_header_gen oemaids_headers
Change-Id: I2675822ae01af9bbec70f0c0413c047f36b5e024
2019-04-10 20:24:16 -07:00
Dan Willemsen
412160e1c9 Stop using build/target -> build/make/target symlink
Instead, fully specify build/make/target/... everywhere

Test: treehugger
Change-Id: I07ba0e9b0604919a271afd5133070616e1f404fc
2019-04-09 21:36:26 -07:00
Dan Willemsen
b6d171bb73 Update default soong config
BuildNumberFromFile is required to be non-empty for version injection to
work.

The various platform version values are needed for various Java builds.

Test: treehugger
Change-Id: Ifa5844794ea9e9baf0ec725dec107975cd759354
2019-04-09 09:44:31 -07:00
Colin Cross
ba71a3fb11 Fix missing genrule srcs and tools with ALLOW_MISSING_DEPENDENCIES=true
Set the location label for missing srcs and tools to avoid
nonsensical errors when parsing the command.

Test: genrule_test.go
Test: paths_test.go
Test: unbundled branch with missing framework-res module needed by robolectric genrule
Change-Id: I9c1f1cd82a80f048c0e903b8e93910b1ae34b0b1
2019-04-07 19:40:02 +00:00
Sasha Smundak
b6d230515e Implement host_required and target_required properties.
They are counterparts of LOCAL_HOST_REQUIRED_MODULES and
LOCAL_TARGET_REQUIRED_MODULES respectively.

Fixes: 128693436
Test: treehugger, convert cts/hostsidetests/devicepolicy/Android.bp
Change-Id: Id66ffca6edffe18993ac51e8930f1d0e78178249
2019-04-04 11:24:01 -07:00
Colin Cross
092c9da922 Export more config variables
Export some more config variables that will be used to generate
robolectric's build.prop file.

Bug: 122331577
Test: m checkbuild
Change-Id: I39f3436ed5d5c4e730dd3e1f86c840cf6358ec87
2019-04-04 03:59:41 +00:00
Colin Cross
cc0ce80ed5 Fix package path of android/soong/android pctx
android/soong/common was renamed to android/soong/android long
ago, but the pctx package path was still "android/soong/common".
This required all users of rules defined in android/soong/android
to import "android/soong/android" and then
pctx.Import("android/soong/common").

Test: m checkbuild
Change-Id: I20d096522760538f7cfc2bec3d4bfeba99b275d4
2019-04-04 03:59:34 +00:00
Christopher Ferris
134f8f6f00 Make libc_scudo always go first.
In addition, add Shared_libs to malloc_not_svelte.

Bug: 123689570

Test: Verified that libc_scudo is first wherever it is added.
Change-Id: Ibdc5dbd019a382630a727c270f846aa4446f8d99
Merged-In: Ibdc5dbd019a382630a727c270f846aa4446f8d99
2019-04-03 14:54:12 -07:00