Commit graph

9611 commits

Author SHA1 Message Date
Dan Willemsen
b05526711e Add sh_binary[_host] for shell script that should be installed as executable
We've been putting these in cc_prebuilt_binary, but that's not really
correct. It also tries adding '.exe' to the end of windows executables,
which isn't desirable for bat files.

Test: Use sh_binary_host
Change-Id: Idd5418dceb81ac55b766c987fbb69a810aeb8a3b
2019-01-28 10:59:10 -08:00
Jiyong Park
58e364a373 Add __ANDROID_APEX__
A module can be built multiple times when it is referenced from one
or more APEXes. Sometimes, it is required for the module to behave
differently depending on the context; e.g., do A when built form
APEX M, do B when built for APEX N, and do C when built for platform.

The idea is to have a macro __ANDROID_APEX__ which is set to the
name of the apex that the module is built for. It is undefined when
the module is built for platform.

Bug: 122714993
Test: m (apex_test amended)
Change-Id: I11a89c6a0e799f4810194de7ef9ee472a71ca498
2019-01-28 20:02:27 +09:00
Logan Chien
8f74fe6e14 Fix a typo related to abidiffs
This commit fixes a typo related to abidiffs.  The generated abidiffs
should be copied to `$$DIST_DIR/abidiffs` instead of
`$$DIST_DIR/abidiff`.

(See also. https://android-review.googlesource.com/796458/)

Bug: 123491909
Test: lunch aosp_x86-userdebug && make dist
Change-Id: I89c13580344a27cac5ea0d00497f5bba3227cf61
2019-01-28 14:30:04 +08:00
Orion Hodson
1e7c3d63a9 Remove libnativehelper from global includes
Bug: 119840313
Test: m checkbuild
Change-Id: Id80e26a396c2e289dcd2596a5b799e251d9ccf1b
2019-01-27 11:11:01 +00:00
Treehugger Robot
ee04139154 Merge "Add --top_level_phony to catch more real-to-phony problems" 2019-01-26 05:08:15 +00:00
Colin Cross
15daf44967 Merge "Fix aar rules" 2019-01-26 04:55:03 +00:00
Treehugger Robot
587414a028 Merge "Switch cp(1) to toybox." 2019-01-25 22:48:27 +00:00
Treehugger Robot
1d08e2f66e Merge "Only copy native binaries on native-bridge configs" 2019-01-25 22:35:58 +00:00
Elliott Hughes
48d716c367 Switch cp(1) to toybox.
Test: treehugger
Change-Id: I908e1d6aa2aa7016432ac7ff4abc56e8163bad8a
2019-01-25 22:29:58 +00:00
Jaewoong Jung
10357c3b22 Merge "Add a prod var to override package names." 2019-01-25 22:07:48 +00:00
Colin Cross
f57c57825e Fix aar rules
aar files should build to the module out directory, not the root of
the out directory.  Also give the rules a description so they get a
better status line.

Test: m out/soong/.intermediates/frameworks/base/packages/SystemUI/SystemUI-core/android_common/SystemUI-core.aar
Change-Id: Ie8de0421427985c466d909f83c8e0146f7e0bea8
2019-01-25 13:29:12 -08:00
Colin Cross
eefe9a35b2 Add export_*_lib_headers to static and shared properties
Allow specifying export_static_lib_headers and export_shared_lib_headers
in the static or shared properties of cc_library modules.

Use a named struct for the properties to avoid having to create
a runtime struct type since none of the properties are filtered.
This avoids running into the name length limit in runtime.StructOf.

Fixes: 122882789
Test: m checkbuild
Change-Id: Ib0e9933e93981ba44668a19ed748bd12a4dd4257
2019-01-25 21:27:02 +00:00
Colin Cross
cb9880786d Optimize filterArchStruct when nothing is filtered
Runtime-created struct types have limit on the name of the type,
which is the full text of the fields in the struct.  Avoid creating
runtime struct types when filtering produces an identical struct.
Also add tests and godoc for filterArchStruct.

Test: arch_test.go
Change-Id: If7eb27ea9e72073d5252e93f2110b08889ed76b1
2019-01-25 21:26:53 +00:00
Jaewoong Jung
9d22a914bf Add a prod var to override package names.
Currently only java/app.go is affected by package name overrides. When
the var is used, the corresponding module's install APK name is changed
to the overriding name.

Bug: 122957760
Test: app_test.go + TreeHugger
Change-Id: Ie522da3d7280970d740d779cf2694560feae6180
2019-01-25 19:11:57 +00:00
Treehugger Robot
ea5c1f453c Merge "Switch hostname(1) to toybox." 2019-01-25 17:44:12 +00:00
Adrian Roos
e3fe481c5a Add last released API check to checkapi for public Android API
Test: make droid
Bug: 123222452
Change-Id: I2b0b6c9196bfb963bd6085554ff6fdcc9cb53942
2019-01-25 17:18:18 +00:00
Nicolas Geoffray
d15d614214 Merge "Make boot classpath jars in apexes uncompressed." 2019-01-25 12:10:33 +00:00
Anton Hansson
7171ffa97f Merge "Parameterize RRO test" 2019-01-25 10:14:05 +00:00
Nicolas Geoffray
5921f75b7c Make boot classpath jars in apexes uncompressed.
Save some space on /system by avoiding a copy in the .vdex files.

Test: m && /system/framework/boot-*.vdex files doesn't contain dex code.
Change-Id: I10cdcfe46a36a49a75f7640e20d065912812ab9f
2019-01-25 09:04:15 +00:00
Jiyong Park
64a44f231d Make sure that ASAN runtime lib is the first DT_NEEDED one
Introduce a new tag earlySharedDepTag which is added in front of the
ordinary sharedDep dependencies. Dependency to the ASAN runtime lib is
added with the new tag.

Bug: 120894259
Bug: 121038155
Test: m; SANITIZE_TARGET=address m
Use readelf -d to see if the runtime lib is in the first DT_NEEDED one.

Change-Id: I90de6ab95df734a99995532d826564b13fe05316
2019-01-25 14:05:51 +09:00
Treehugger Robot
de54534d2a Merge "Revert "Revert "Fix: sanitizerRuntimeMutator is not run for host""" 2019-01-25 04:54:40 +00:00
Treehugger Robot
8ed613d456 Merge changes If712ce7d,I23c62b75
* changes:
  Clean up srcjar directories after each rule
  Fix conflicting srcjar dir for current and last apicheck
2019-01-25 04:29:02 +00:00
Dan Willemsen
e4f12785db Merge "Remove armv7-a without neon support" 2019-01-25 03:52:17 +00:00
Sasha Smundak
7054764304 Convert BUILD_PREBUILT with LOCAL_MODULE_CLASS=ETC to prebuilt_etc
The conversion is a two-step process: first, when processing
BUILT_PREBUILT, convert LOCAL_SOURCE_PATH to a variable reference+fixed
subpath path in the blueprint AST. Then, set various boolean flags
depending on variable being referenced. androidmk_test.go has a test for
each handled case.

Change-Id: Iabd18d5f8645ca7077536863cd6640df5b24d24a
Fixes: 122906526
Test: treehugger
2019-01-24 18:46:31 -08:00
Colin Cross
44c29a8fe1 Clean up srcjar directories after each rule
The srcjar directories just confuse people looking for generated
files, clean them up after each rule.

Test: m checkbuild
Change-Id: If712ce7d4922619fd8420ae8f89830fe7824114d
2019-01-25 00:53:05 +00:00
Colin Cross
39c1679e69 Fix conflicting srcjar dir for current and last apicheck
Each rule needs its own srcJarDir.

Bug: 123222452
Test: m checkbuild
Change-Id: I23c62b75c7532eca9320b12235a102141d6eeefa
2019-01-25 00:52:50 +00:00
Treehugger Robot
2f4789d612 Merge "Avoid filepath.Abs" 2019-01-25 00:35:24 +00:00
Pirama Arumuga Nainar
6aa210243c Revert "Revert "Fix: sanitizerRuntimeMutator is not run for host""
Bug: http://b/123254047

This reverts commit 84757ea7ea.

Reason for revert: veridex asan failure is fixed.

Change-Id: Id03180b8d3d1dc1386fd7e4f800d64dc8578139c
2019-01-25 00:21:02 +00:00
Tor Norbye
60eed0ee25 Merge "122452571: Fix path to android.jar in prebuilts" 2019-01-25 00:00:53 +00:00
Dan Willemsen
cc62890866 Add --top_level_phony to catch more real-to-phony problems
As more phony rules move either to the packaging kati run, or soong, the
existing real-to-phony check failed to notice that they were phony
rules.

So I added --top_level_phony to Make that assumes that all leaf nodes
(source files, or nodes generated by another ninja file generator) that
do not have a '/' in them are phony targets.

The existing phony-looks-real check in Kati should prevent these from
being real generated files, and our source tree shouldn't have any
source files used at the root level.

Test: build_test on downstream branches
Change-Id: I77cff84b536c6cd6402307a9aa5a9c273e72c71f
2019-01-24 15:53:06 -08:00
Dan Willemsen
f4e0601c7e Remove armv7-a without neon support
Test: treehugger
Change-Id: I8565d84224daedb6a6dde6dfb9c0fe5f5fabb0f6
2019-01-24 15:51:26 -08:00
Colin Cross
7788c1283f Remove annotation_processors property
Now that there are no uses left of annotation_processors remove
the property.

If there are no annotation processor classes for javac for a module,
due to an empty "plugins" property or using kapt for annotation
processors, pass -proc:none to javac to ensure it does not try
to run any annotation processors found in the classpath.

Bug: 77284273
Test: plugin_test.go, kotlin_test.go
Change-Id: I3823d9fec8d3d07d2e49b1d97839f7fcbdd35647
2019-01-24 23:48:04 +00:00
Colin Cross
11ecdd6979 Translate LOCAL_ANNOTATION_PROCESSORS to java_plugin
The annotation_processors property is deprected, translate
LOCAL_ANNOTATION_PROCESSORS to plugins instead.  Also remove
LOCAL_ANNOTATION_PROCESSOR_CLASSES properties, they are
retrieved from java_plugin dependencies instead.

Bug: 77284273
Test: androidmk_test.go
Change-Id: If6f6177262d5579e03bae58d9eb54a599e3da786
2019-01-24 23:47:56 +00:00
Elliott Hughes
d5fdd3a134 Switch hostname(1) to toybox.
Test: treehugger
Change-Id: I52908a14da86ed8f162150bb48f72e141e6f060c
2019-01-24 15:18:06 -08:00
Colin Cross
7b3dcc31eb Avoid filepath.Abs
filepath.Abs is surprisingly expensive, it calls os.Getwd every
time, which involves multiple syscalls, a lock, and and allocations.
Use IsAbs and prefix matching instead.

Test: paths_test.go
Change-Id: Ia6cf34d6bef24c694702af1e7a6ff08ffd2d822b
2019-01-24 21:35:16 +00:00
Alex Light
16df4e868e Only copy native binaries on native-bridge configs
If native-bridge/ndk translation is supported for a config the build
system will know about 2 copies of binaries, one for each ABI. We only
want to actually install the 'Native' (non-translated) ABI into the
apex in these situations.

Test: lunch aosp_cf_x86_phone-userdebug
      m showcommands com.android.runtime.debug
      examine the command output to make sure only a single copy of
      dex2oat is being installed.

Change-Id: I9480e52855fd9f5564a579099309fb38f1c50367
2019-01-24 12:29:50 -08:00
Tor Norbye
ebcdfed262 122452571: Fix path to android.jar in prebuilts
The --android-jar-pattern flag passed to metalava is used to
find all the prebuilts for previous API levels such that
it can compute the exact API level for each class and member.

At some point the prebuilts must have been moved without this
code getting updated.

This fixes
Bug: 122452571: Can't build app with Q prebuilt SDK with minSdkVersion=21
Test: make sdk; inspect api-versions.xml

Change-Id: I25f6203725391dc5404cb8b6049479c9c3da1699
2019-01-24 11:09:16 -08:00
Doug Horn
c32c6b0d79 Support building for Fuchsia.
This CL adds configs for the arm64 and x64 fuchsia
device targets, sets up the necessary linker flags,
and disables some functionality that is not currently
supported on Fuchsia.

Bug: 119831161
Test: Compile walleye, internal validation against
fuchsia_arm64-eng and fuchsia_x86_64-eng.
Change-Id: I2881b99d2e3a1995e2d8c00a2d86ee101a972c94
2019-01-24 18:59:29 +00:00
Anton Hansson
0375a4f481 Parameterize RRO test
Makes it easier to add more test cases.

Bug: 123300034
Test: m nothing
Change-Id: Ice5df7afbd55c3a4f9edf60e13bf6b850a485370
2019-01-24 17:49:20 +00:00
Jaewoong Jung
590b1ae37c Minor refactoring of generateAndroidBuildActions.
The function became a gigantic machine, so I decided to split it up to
smaller, logically self-contained pieces to provide better readability.

Test: app.go + TreeHugger
Change-Id: I50e5767ed779078b2d8c60c39c3951b0b5a191d7
2019-01-24 14:56:29 +00:00
Jaewoong Jung
2ad817c65d Enable certificate overrides with product vars.
Currently it is only for android_app, though it can be easily ported to
apex.

The make-side change will be made later, along with a real application.

Bug: 122957760
Test: app_test.go
Change-Id: I41f0be84f8b9f93e9518a16160e10eaa649388cd
2019-01-24 14:55:58 +00:00
David Brazdil
9d085dea9e Merge "Disable all-assigned check in hiddenapi on master-art" 2019-01-24 09:38:13 +00:00
Nicolas Geoffray
f343872a8d Align jar file after calling merge-zips when dex is uncompressed.
Noticed this while changing a some dex build rules.

Test: m
Change-Id: I9838e81e0e98be49d34554041a5a942b64259aaa
2019-01-24 06:38:14 +00:00
Colin Cross
3a3e94c09a Fix kotlin annotation processing after java_plugin
I37c1e80eba71ae2d6a06199fb102194a51994989 broke kotlin annotation
processing with a typo in the processors flag to kapt and by
passing -processor to javac with an empty processorpath.

Bug: 77284273
Bug: 122251693
Test: kotlin_test.go
Test: m checkbuild
Change-Id: I17c45d5b3f9df089231af5d2930646ad0e6bf9be
2019-01-23 16:14:21 -08:00
Dan Albert
9f100ca0e3 Merge "Revert "Fix: sanitizerRuntimeMutator is not run for host"" 2019-01-23 23:37:37 +00:00
Dan Albert
84757ea7ea Revert "Fix: sanitizerRuntimeMutator is not run for host"
This reverts commit 1c29b0e6ec.

Reason for revert: Broke aosp_x86_64

Change-Id: I581200f1c271c3e1a39d5cdad84c782977b13054
2019-01-23 23:33:25 +00:00
David Brazdil
91b4e3e78b Disable all-assigned check in hiddenapi on master-art
Master-art configurations do not have frameworks/base and therefore do
not have hidden API flags. Pass --no-force-assign-all to `hiddenapi`
when frameworks/base does not exist to disable the corresponding
assertion. This enables us to enforce the assertion on non-master-art
builds and also get rid of logspam about missing flags on ART buildbots.

Test: art/tools/buildbot-build.sh on master-art
Bug: 123143676
Change-Id: I074d9554fb11dab3eef904016375730520107ec2
2019-01-23 22:55:41 +00:00
George Burgess IV
7294cdced0 config: swap to glibc 2.17
**Please do not revert this change without consulting with either
srhines@ or gbiv@ first. It's a large change, and if it only causes
simple/small breakages, we plan to fix those as they pop up.**

This CL swaps the host Android Linux toolchain to gcc 4.8.3 + glibc
2.17, landed in Ieeed444801160e3d288bbad7d871067e81411118.

Bug: 111358231
Test: We've done extensive testing on internal master. Please see
      Ieeed444801160e3d288bbad7d871067e81411118.
Change-Id: If991a603a3dce33b55086672c27a11992f0f3123
2019-01-23 14:02:10 -08:00
Dan Willemsen
27fd541cf3 Merge "Fix: sanitizerRuntimeMutator is not run for host" 2019-01-23 20:57:06 +00:00
Colin Cross
be9cdb8d64 Replace annotation_processors with plugins
Follow bazel's modules for annotation processors by introducing
a java_plugin module type that can contain extra metadata about
the annotation processor, the processor class and a flag to
specify if the annotation processor is compatible with the
turbine optimization.  Deprecate the annotation_processors
property, which took a list of java_library_host modules, in
favor of the plugins property, which takes a list of java_plugin
modules.  The annotation_processors property will be removed
once all uses have been replaced with plugins.

Bug: 77284273
Test: plugin_test.go
Test: m caliper
Change-Id: I37c1e80eba71ae2d6a06199fb102194a51994989
2019-01-23 20:17:51 +00:00