Commit graph

42119 commits

Author SHA1 Message Date
Dan Willemsen
eb0a09acf3 Merge "Restrict / from module names" 2018-06-18 22:44:44 +00:00
Makoto Onuki
da97106284 Envsetup: Add way to skip installing completions
Skip installing completion if ENVSETUP_NO_COMPLETIONS is set to 1.

Test: Following command with debug log added:
$ ENVSETUP_NO_COMPLETION=adb:fastboot:bit . build/envsetup.sh -> no completion installed
$ ENVSETUP_NO_COMPLETION=adb . build/envsetup.sh -> adb completion isn't installed
$ ENVSETUP_NO_COMPLETION=a . build/envsetup.sh -> all completions installed
$ ENVSETUP_NO_COMPLETION=fastboot . build/envsetup.sh -> fastboot completion isn't installed

Change-Id: I9f907585a1d2413f55ffcb6c7c01e49d1b55a3e0
2018-06-18 15:35:40 -07: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
Treehugger Robot
7f0ac95d21 Merge "Set proper CPU variant for aosp_arm" 2018-06-15 20:19:10 +00:00
Isaac Chen
e44b0d96b9 Set proper CPU variant for aosp_arm
System image of aosp_arm products is the new GSI in Pi.
Its arch variants need to be the same as the legacy GSI built
with aosp_arm_ab so it can pass related CTS/VTS tests.

Bug: 80401108
Test: $ lunch aosp_arm-userdebug; m -j; emulator # booted OK
      $ lunch aosp_arm-userdebug; m -j cts

Change-Id: I29fffca3e02a2251913a327b54640fc622e77a8d
Merged-Id: I29fffca3e02a2251913a327b54640fc622e77a8d
(cherry picked from commit b2e58893c3)
2018-06-15 18:40:42 +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
Tom Cherry
b6b2d49e23 Merge "Always create /vendor/etc/{passwd,group}" 2018-06-15 17:04:16 +00:00
Treehugger Robot
b6a2565382 Merge "Move pid, stacks from envsetup.sh to dedicated scripts." 2018-06-15 15:43:37 +00:00
Anton Hansson
984e93a450 Merge "Move a few packages from core_minimal.mk to base.mk." 2018-06-15 09:08:33 +00:00
Anton Hansson
9d2c04e39c Merge "Add support enforcing all path requirements." 2018-06-15 09:08:10 +00:00
Colin Cross
8b4c72dc1c Merge "Dist installed-files*.json" 2018-06-15 05:01:54 +00:00
Treehugger Robot
1ce8617482 Merge "Remove com.android.location.provider.xml" 2018-06-15 03:41:18 +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
Treehugger Robot
4f22abd334 Merge "Fix stacks for Java processes." 2018-06-15 00:31:07 +00:00
Josh Gao
896a546663 Move pid, stacks from envsetup.sh to dedicated scripts.
Make it so that these can be used in other scripts by moving them from
functions defined in envsetup.sh to standalone scripts.

Test: stacks zygote64
Change-Id: Id8e5ce5b4da80e57f4226eb34edaf82b87393834
2018-06-14 16:36:56 -07:00
Josh Gao
ab1e09a6b0 Fix stacks for Java processes.
Fix stacks for the change in ANR trace location by using `debuggerd -j`
instead of manually fetching the traces file.

Also, dump zygote/zygote64 as native processes, since they don't
respond to SIGQUIT.

Test: stacks zygote
Test: stacks adbd
Test: stacks com.android.settings
Change-Id: I015458bdc2dd45624940204d42614365aacf8304
2018-06-14 15:35:53 -07: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
Tom Cherry
53940fd2ba Always create /vendor/etc/{passwd,group}
Previously we only created these if the device set
TARGET_FS_CONFIG_GEN, however there are now other targets that want to
depend on these.  Instead of having those targets conditionally depend
on them, we always create them, defaulting to blank contents (by
reading /dev/null for TARGET_FS_CONFIG_GEN).

Test: builds succeed
Change-Id: Ie95286f5a800d891022eb66cd6fefcc967000c2e
2018-06-14 13:29:32 -07:00
Treehugger Robot
6021800c45 Merge "Use implicit output for prebuilt aar manifests" 2018-06-14 19:48:37 +00:00
Anton Hansson
be371e1656 Move a few packages from core_minimal.mk to base.mk.
All the products that inherit from base.mk add these packages, so moving
them up the hierarchy eliminates some duplication.

    DownloadProvider
    idmap
    libneuralnetworks
    mdnsd
    MediaProvider

Bug: 80410283
Test: diff all product variables with multiproduct_kati
Change-Id: I133a385b3bc64261d73f616c416f7a905675c09d
Merged-In: I133a385b3bc64261d73f616c416f7a905675c09d
2018-06-14 16:39:17 +01: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
Anton Hansson
f93d674ac3 Merge "Dedupe packages in mk's that inherit core_minimal.mk" 2018-06-14 07:57:52 +00:00
Treehugger Robot
6eb060785b Merge "fs_config_generator: use vendor shell for vendor AID" 2018-06-14 03:28:32 +00:00
Sundong Ahn
8970f61d99 Remove com.android.location.provider.xml
The com.android.location.provider.xml is removed from the
PRODUCT_PACKAGES, because xml files will be generated and installed by
soong.

Bug:77577799
Test: make -j
Change-Id: Idfbc6b09ca4337795277df8b98c73f6fd5865aff
2018-06-14 11:15:20 +09:00
Treehugger Robot
ea01e649d7 Merge "mma in dirs w/o Android.(mk|bp) in ancestor dir" 2018-06-14 00:58:52 +00:00
Treehugger Robot
2371a7d60e Merge "Support shared library in recovery mode" 2018-06-13 23:14:29 +00:00
Steven Moreland
3b99ecfbab mma in dirs w/o Android.(mk|bp) in ancestor dir
Many Android.bp files are now no longer needed (since they
are all scanned and subdirs are deprecated), so there are many
places in a tree where they aren't hit.

This still suffers from one bug, given this directory structure:
 A/B/Android.bp
 A/B/C/D/Android.bp
 A/B/C/
 A/B/C/E/Android.bp

if you call 'mma' from 'A/B/C', then it will make
MODULES-IN-A-B.

However, for now, this change makes it so given the following
directory structure:
 A/B/C/D/Android.bp
 A/B/C/
 A/B/C/E/Android.bp

if you call 'mma' from 'A/B/C', then it will make
MODULES-IN-A-B-C as expected (since there are no makefiles in
parent directories). This is the expected behavior in this case
and it is common in directories where Android.bps have been
removed (since they only referenced subdirs) or outside of
git projects.

The reason why this usecase is supported is so that given this:
A/B/C/D/Android.bp
A/B/C/D/include/D/foo.h

You can, from A/B/C/D/include/D/ (for instance) do an mma, and
it will still make the modules defined in A/B/C/D/ which are
presumably related to this.

This change doesn't fix mm or other binaries. In the long term,
either we should just consider mma to make the current directory
(and not look for parent directories for the above 'feature') or
we should move more of the complexity in the build system itself
so that it can intelligently find the first parent directory
which contains a makefile in a subdirectory.

Fixes: 65407300
Test: mma from following dirs
    system/tools/hidl/test/hash_test/bad/hash/1.0 MODULES-IN-system-tools-hidl-test-hash_test
    system/tools/hidl/test/hash_test/             MODULES-IN-system-tools-hidl-test-hash_test
    system/                                       MODULES-IN-system
    hardware/ril/                                 MODULES-IN-hardware-ril

Change-Id: I072d3f382d40cd360ec3d14f8f5b060a4bde9289
2018-06-13 15:34:19 -07:00
Bo Hu
82de42067e Merge "emulator: move sepolicy to goldfish project" 2018-06-13 22:14:32 +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
bohu
4001858313 emulator: move sepolicy to goldfish project
The sepolicies are emulator specific and are installed
under vendor partition, move them to the right location.

BUG: 110030159
Change-Id: I6acc27a3b787a3fafd9373c84492537185b184c5
Merged-In: I6acc27a3b787a3fafd9373c84492537185b184c5
2018-06-13 18:37:16 +00: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
Treehugger Robot
59c5127bea Merge "Create system.prop for GSI Pi" 2018-06-13 17:48:06 +00:00
Tao Bao
50869f203a Merge "releasetools: Explicitly pass the SHA-1 of source boot image to PatchCheck." 2018-06-13 17:20:36 +00: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
Treehugger Robot
0f494a025b Merge "Restrict characters in module names" 2018-06-12 23:30:47 +00:00