Commit Graph

15450 Commits

Author SHA1 Message Date
Dan Willemsen 8b9c3cc54b Mark export/unexport as deprecated
Make it so that `export`/`unexport` are deprecated during product
configuration, but obsolete during Android.mk parsing (and later in the
build, since we can't un-obsolete it).

Remove some ccache / goma exports, those don't need to be exports, since
soong_ui asks about them explicitly. They also only run doing the
initial project configuration, so we don't run anything with that
environment.

Bug: 73959648
Test: m nothing
Test: build_test on all downstream branches
Change-Id: I55a749f46775660439ae57e881a02c914e83de16
2018-06-21 10:12:23 -07:00
Dan Willemsen 94bff7ae22 Add more BUILD_BROKEN_* logic
Make the values tristate, so that we can differentiate set vs not in
scripts that parse the logs.

Also add some placeholders for warnings that I expect to turn into
errors.

Test: Set BUILD_BROKEN_PHONY_TARGETS to "foo"
Change-Id: I3f7e1e0f85dcef84d6461fc40bdd83dc5bf75ff7
2018-06-21 10:12:23 -07:00
Treehugger Robot 6d3acda913 Merge "Deprecate implicit make rules" 2018-06-21 03:31:11 +00:00
Dan Willemsen 62db0f0945 Deprecate implicit make rules
Test: mm
Test: view docs in gitiles
Change-Id: I1ced4b4218c733b5b5b771d626b20eb6fb22f0df
2018-06-20 16:52:10 -07:00
Colin Cross 375d9618f6 Merge "Merge LOCAL_STATIC_ANDROID_LIBRARIES manifests" 2018-06-20 23:24:52 +00:00
Yifan Hong 560890b29f Merge "Revert "Verify init scripts for correctness during build"" 2018-06-20 22:56:39 +00:00
Tom Cherry d15e50022f Revert "Verify init scripts for correctness during build"
This reverts commit 03303f97be.

Reason for revert: Mac build

Change-Id: Iadd76491307534fde81d3d917876c603a0658fb9
2018-06-20 22:45:14 +00:00
Tom Cherry 8075746865 Merge "Verify init scripts for correctness during build" 2018-06-20 17:06:11 +00:00
Dan Willemsen 406418d055 Fix UML build
If there aren't any boot dex files, we can't generate a boot image
profile.

Test: lunch uml-eng; m
Test: diff build-aosp_arm.ninja
Change-Id: I09cc1ef37379d9d353958c8aa75731f3d29df759
2018-06-19 23:03:34 -07:00
Jiyong Park 1cf8ee619b Export SDK library names
A java module exports SDK library names that it is using directly or
indirectly via its dependencies. Manifest fixer uses the SDK lib names
to automatically add <uses-library> tags for the apk.

The SDK library names are exported via exported-sdk-libs file in make.
From Soong, they are exported via LOCAL_EXPORT_SDK_LIBRARIES flag.

Bug: 77575606
Test: m -j

Change-Id: I4e7a9bdc5bf845af85168abf55f8063900bacc72
2018-06-20 11:50:06 +09:00
Dan Willemsen 949404a65b Merge changes I101ced40,If9a4bed2
* changes:
  Fix PHONY uses found by --warn_real_to_phony
  Fix vndk packaging to stop depending on phony targets
2018-06-19 20:35:57 +00:00
Vishwath Mohan ab0c76c869 Merge "Add Scudo support for Make" 2018-06-19 19:09:56 +00:00
Colin Cross aac18a02d9 Merge "Revert "Revert "Inject minSdkVersion from the build system""" 2018-06-19 18:14:39 +00:00
Kostya Kortchinsky 2cfa99722b Add Scudo support for Make
Scudo is a hardened usermode allocator that is part of LLVM's compiler-rt
project (home of the Sanitizers). clang allows for -fsanitize=scudo as a
possible command line option to link the shared Scudo library to a binary.

This patch add Scudo as a potential sanitize option. Scudo is not compatible
with ASan and TSan and will be disabled if either is enabled.

Test: aosp compiled with m -j
Test: local experiment with LOCAL_SANITIZE := scudo to ensure that a test
target (mediaserver) could be linked with scudo.

Change-Id: I462843b9d5512fba2c4a3ac1a0c356ca90bce4e5
2018-06-19 09:46:35 -07:00
Dan Willemsen 14e1026372 Fix PHONY uses found by --warn_real_to_phony
Switch a use of `ndk` to the timestamp file that `ndk` depends on
itself.

Mark more module-specific rules as PHONY.

Test: diff build-aosp_arm.ninja (stripping _kati_always_build_)
Test: Turn on --warn_real_to_phony for Kati, see fewer warnings
Change-Id: I101ced4067780e38d18820f5d916596429087e49
2018-06-19 09:26:58 -07:00
Dan Willemsen 649311868c Fix vndk packaging to stop depending on phony targets
These had been depending on the phony target for the library
(liblz4.vendor), not the actual built file and notice file.

Since we hadn't been saving the NOTICE file, and were only assuming the
installed notice file path. save that away for use during packaging.

Test: m vndk; diff out/target/product/generic/android-vndk-aosp_arm.zip
Test: m vndk; diff out/target/product/generic_arm64/android-vndk-aosp_arm64.zip
Change-Id: If9a4bed27030b7bd464cd3987739df94d32a0037
2018-06-19 09:26:58 -07:00
Treehugger Robot 2a07d562ac Merge "Build System: fix autogen_test_config problem" 2018-06-19 01:09:17 +00:00
Dan Willemsen eb0a09acf3 Merge "Restrict / from module names" 2018-06-18 22:44:44 +00:00
Colin Cross 2d61e47f88 Revert "Revert "Inject minSdkVersion from the build system""
This reverts commit 4cd1a75d17.

PackageParser no longer treats minSdkVersion=Q as targetSdkVersion=Q
when targetSdkVersion is set to a number.

Bug: 110167203
Bug: 110353795
Change-Id: Ib44743e4c49e59cd29a57af1bf885090e380b1b6
2018-06-18 20:18:37 +00:00
Colin Cross 71c0434af2 Merge "Revert "Inject minSdkVersion from the build system"" 2018-06-18 18:35:41 +00:00
Colin Cross 4cd1a75d17 Revert "Inject minSdkVersion from the build system"
This reverts commit fae93680fa.

Bug: 110167203
Bug: 110353795
Change-Id: I14c71aec5a54ef055fc8d2b3560754c81f3d68ba
2018-06-18 18:35:00 +00:00
Dan Willemsen ac92659e0f Restrict / from module names
Since this is a directory separator, it causes a good deal of
strangeness in the build whenever we include a module name in a path.

It becomes particularly problematic if used together with ".."

Test: build_test on downstream branches
Change-Id: I344eca0db3346cd6ffabff767c34159c85ebc051
2018-06-16 14:15:50 -07:00
Colin Cross 16f1dbc43c Merge LOCAL_STATIC_ANDROID_LIBRARIES manifests
Pass LOCAL_STATIC_ANDROID_LIBRARIES to ManifestMerger, and copy
manifests for prebuilts AARs and static android libraries to
$(intermediates.COMMON)/manifest/AndroidManifest.xml.

Bug: 78447299
Test: m java
Change-Id: I02ac29d3445fcd591101ff0ce215e60dd0997224
Merged-In: I02ac29d3445fcd591101ff0ce215e60dd0997224
Merged-In: Ib20aa4849978283f1da1ce601b28199fc0183e05
2018-06-16 07:55:41 -07:00
Colin Cross 500fccebf7 Merge "Inject minSdkVersion from the build system" 2018-06-15 22:53:52 +00:00
Colin Cross 5d80834b32 Merge "Add LOCAL_DONT_MERGE_MANIFESTS" 2018-06-15 18:23:44 +00:00
Treehugger Robot c11f2ff4d5 Merge "Move merged AndroidManifest.xml file to manifest subdirectory" 2018-06-15 18:19:12 +00:00
Anton Hansson 9d2c04e39c Merge "Add support enforcing all path requirements." 2018-06-15 09:08:10 +00:00
nelsonli cf28ff56ac Build System: fix autogen_test_config problem
If there happen to be any dependencies added to target of $(test_config),
it'll cause problem in the autogen_config. We fix it by using $< in
the autogen command.

BUG: 109736180
Test: lunch walleye_coverage-userdebug; make adbd_test
Change-Id: I22ab100c5a3f9fa058c1edd66f9e5cfdf5b7f855
2018-06-15 02:34:43 +00:00
Colin Cross 23dded0ffd Dist installed-files*.json
installed-files*.json provides hashes of each file, which will allow
a quick comparison of what has changed between builds.

Test: m checkbuild
Change-Id: I87f6c1fa89aaa83c7bcc7cbefb799e9e26d7bfa5
2018-06-14 14:51:20 -07:00
Colin Cross fae93680fa Inject minSdkVersion from the build system
Add a script that can inject a <uses-sdk minSdkVersion=""> into
AndroidManifest.xml files.  This will help with merging
LOCAL_STATIC_ANDROID_LIBRARIES, because ManifestMerger treats
a missing minSdkVersion as minSdkVersion=1 and throws errors
if libraries use a larger minSdkVersion.  It will also help
with cases where an app has a manifest that specifies an old
minSdkVersion, but the build system is compiling the app in
a way that is not compatibile with old devices, for example
using a newer dex format.

Bug: 110167203
Test: m java
Change-Id: Ia60d462e8af9e93c57d75f423207fa8d221b1347
2018-06-14 14:38:54 -07:00
Colin Cross 1d46e8abb4 Add LOCAL_DONT_MERGE_MANIFESTS
Some modules have manifests that ManifestMerger doesn't like, and
don't need manifest merging.  Skip manifest merger if
LOCAL_DONT_MERGE_MANIFESTS is set.

Bug: 78447299
Test: m checkbuild
Change-Id: If1a58253c62e0194a6acfd79930b9bb10978abe5
2018-06-14 14:38:54 -07:00
Colin Cross e1b4f302e5 Move merged AndroidManifest.xml file to manifest subdirectory
Some modules generate their own custom AndroidManifest.xml file
to $(intermediates.COMMON)/AndroidManifest.xml file.  Move the
build system's location to
$(intermediates.COMMON)/manifest/AndroidManifest.xml.

This location will also be used later for finding manifest files
from LOCAL_STATIC_ANDROID_LIBRARIES dependencies.

Bug: 78447299
Test: m checkbuild
Change-Id: I345f079bdd191451333b38d882418f2f7150b1e9
Merged-In: I345f079bdd191451333b38d882418f2f7150b1e9
(cherry picked from commit 00a6348e7dfa4fafc308ab92d8e7d06dcfcd01ba)
2018-06-14 14:38:54 -07:00
Tom Cherry 03303f97be Verify init scripts for correctness during build
Bug: 36970783
Test: builds pass without failures
Test: builds fail with failures in init files used via LOCAL_INIT_RC,
      PRODUCT_COPY_FILES, or TARGET_PREBUILT

Change-Id: Ia98793776b365733ca8f0174dc228326a6edf041
2018-06-14 14:21:06 -07:00
Treehugger Robot 6021800c45 Merge "Use implicit output for prebuilt aar manifests" 2018-06-14 19:48:37 +00:00
Anton Hansson 427d855728 Add support enforcing all path requirements.
Setting PRODUCT_ENFORCE_ARTIFACT_PATH_REQUIREMENTS to be non-empty will
verify that when an inherited product file makes an path requirement
claim, no files other than the ones it produces are allowed inside its
paths. This allows more rigorous control of what goes where, and
specifically stops accidental inclusion of modules in the wrong places
(which is very easy to do otherwise).

In order to enable iterative improvements to current offenders, support
for a whitelist is also added (via the new
PRODUCT_ARTIFACT_PATH_REQUIREMENT_WHITELIST property). Verification is
done that this variable corresponds to exactly the list of current
offenders.

Example use:
  PRODUCT_ENFORCE_ARTIFACT_PATH_REQUIREMENTS := true
  PRODUCT_ARTIFACT_PATH_REQUIREMENT_WHITELIST := system/priv-app/Dialer/Dialer.apk

Bug: 80410283
Test: In a downstream CL specifying the above.
Change-Id: I58047db08bde34da21759cfc55f398892b1c809a
2018-06-14 11:35:05 +01:00
Anton Hansson 2b0ea222c1 Merge "Add a new macro for products to make artifact path requirements." 2018-06-14 10:32:43 +00:00
Anton Hansson df832133ad Merge "Extract the product to file mapping logic to a macro." 2018-06-14 10:10:42 +00:00
Treehugger Robot 2371a7d60e Merge "Support shared library in recovery mode" 2018-06-13 23:14:29 +00:00
Colin Cross 5c1a27f30f Use implicit output for prebuilt aar manifests
Remove my_full_libs_manifest_deps by making AndroidManifest.xml an
implicit output of the prebuilt aar unzipping rule.

Bug: 78447299
Test: m checkbuild
Change-Id: I26934d16fd646d45bf57c9527dbb191112cb627b
Merged-In: I26934d16fd646d45bf57c9527dbb191112cb627b
(cherry picked from commit 2b5829e1a6)
2018-06-13 12:34:51 -07:00
Chih-hung Hsieh 504656816d Merge "Third try to enable clang lld as default linker." 2018-06-13 18:21:03 +00:00
Anton Hansson 837425b0c0 Add a new macro for products to make artifact path requirements.
When a product adds a path requirement, the build system will verify
that all its artifacts are produced inside these paths, and fail
otherwise.

The paths are all relative to PRODUCT_OUT, and the macro also supports
giving a whitelist, for known existing offenders in the hierarchy. The
build will fail if redundant whitelist entries are present.

Example invocation:
_paths := $(TARGET_COPY_OUT_SYSTEM)/
_whitelist := root/init root/init.rc
$(call require-artifacts-in-path $(_paths), $(_whitelist))

Bug: 80410283
Test: Downstream with a new product definition.
Change-Id: I235de681f65254087a42e345af69b2113b682072
2018-06-13 18:48:53 +01:00
Anton Hansson 5efe88df63 Extract the product to file mapping logic to a macro.
This way, the logic can be reused for multiple products during
the same build step. This will be used to track files output
by different subtrees in the product makefile hierarchy.

Bug: 80410283
Test: diff produt_FILES before and after
Change-Id: I6dd1cf586410b9809fdd9d75441128acb07cab08
2018-06-13 18:48:42 +01:00
Jiyong Park 53acaeab0a Support shared library in recovery mode
The dyanmic linker and the linker config script for the recovery mode
(*.recovery variants) are added to PRODUCT_PACKAGES.

Also this removes the mountpoint /system_root from the recovery image as the
recovery image is self-contained and the real system image is mounted at
/mnt/system which is created automatically at runtime.

Bug: 63673171
Test: `adb reboot recovery; adb devices` shows the device ID
Test: Select 'mount /system' in the recovery mode, then `adb shell`.
$ lsof -p `pidof adbd` shows that libm.so, libc.so, etc. are loaded from
the /lib directory.

Change-Id: Ice6c75b0b81bb9be696aaff3e095d87f19278995
2018-06-14 02:03:57 +09:00
Yi Kong cfbe8cf3bb Merge "Fix CLANG_EXTERNAL_CFLAGS logic" 2018-06-13 02:10:12 +00:00
Yi Kong 0047dbed14 Fix CLANG_EXTERNAL_CFLAGS logic
Should be neq instead of eq.

Test: build-full.ninja is now correct
Change-Id: I26c0aa84d9b54a8b19f19124978ac1d49bae7448
2018-06-12 15:49:12 -07:00
Dan Willemsen bbe6a022a3 Restrict characters in module names
See the Changes.md documentation for more information.

Test: build_test on downstream branches
Change-Id: I1524b1dbfd44a7feac3b9a212f37986f870bd837
2018-06-12 13:48:49 -07:00
Chih-Hung Hsieh 4ad173788e Third try to enable clang lld as default linker.
Note of existing configurations:
  * When lld is used, llvm-strip and llvm-objcopy are also used.
  * darwin host modules do not use lld.
  * lld can be disabled locally with use_clang_lld:false in Android.bp
    or LOCAL_USE_CLANG_LLD:=false in Android.mk.

Bug: 73768157
Test: make checkbuild, boot and run bionic and system/core native tests
Change-Id: I3067ff8021dd6e1598f2447b80aea66a3f7e1677
2018-06-12 10:50:10 -07:00
Treehugger Robot 9c8120aa48 Merge "Disable verity on -eng builds" 2018-06-11 21:43:34 +00:00
Anton Hansson 3c0f857e65 Merge "Rename the poorly named ALL_PRODUCTS variable." 2018-06-08 14:12:35 +00:00
Treehugger Robot 87d8dc4d4e Merge "Use llvm-{objcopy,strip} when clang lld is used." 2018-06-08 00:42:03 +00:00