Commit graph

1173 commits

Author SHA1 Message Date
Colin Cross
bdaada855f Fix zipped resources
Fix mismatch between output directory of zipsync and input
directory of aapt2.

Bug: 79481102
Test: m checkbuild
Change-Id: If012c943af0c04cc3f0dd5c4266126412ae0a759
Merged-In: If012c943af0c04cc3f0dd5c4266126412ae0a759
(cherry picked from commit 164a33f194)
2018-05-16 09:00:01 -07:00
Colin Cross
43641b5e1f Regenerate R.java files from LOCAL_STATIC_ANDROID_LIBRARIES
If a static android library lib1 has LOCAL_STATIC_ANDROID_LIBRARIES
lib2, then the R.class files for packages in lib2 will be merged
into the jar for lib1.  If an app has lib1 in its
LOCAL_STATIC_ANDROID_LIBRARIES it will get the R.class files from
lib2 through lib1, instead of regenerating the R.java files with
numbering that matches the resource table of the app.

This was worked around for support libraries by keeping a
fix_dependencies.mk that added transitive static support libraries
to the direct static dependencies of apps.  Instead, propagate
the packages that aapt2 generated R.java files for up as
--extra-packages arguments to the next aapt2 invocation, which
will force aapt2 to regenerate the R.java files for those packages.

Bug: 78300023
Test: m checkbuild
Change-Id: I7375e13241b4c4f2933032409fb7935abe133bfc
Merged-In: I7375e13241b4c4f2933032409fb7935abe133bfc
(cherry picked from commit 43c247e181)
2018-05-02 15:31:03 -07:00
Dan Willemsen
4cfebe0ac4 Delay eval to save memory use in create-suite-dependencies
Instead of passing the entire contents of
$(COMPATIBILITY.$(suite).FILES) to eval, which may keep that string
around, delay the evaluation of that, and the new files until inside the
eval.

This saves ~2.8GB: 7.4GB -> 4.6GB of ckati max resident memory for a
relatively small internal build. It also saves ~10% of the makefile
loading time (81 -> 73 seconds).

Bug: 77879502
Test: build-aosp_arm.ninja is identical
Change-Id: If45a4796f1bbf6d67dff388ea877a6115a4e06f4
Merged-In: If45a4796f1bbf6d67dff388ea877a6115a4e06f4
(cherry picked from commit a4155e8512)
2018-04-10 22:16:49 -07:00
Ryan Prichard
d809d369cb Fix mini_debug_info stripping when no symbols should be kept.
If there are no symbols to keep (i.e. all function symbols are also in
the dynsym table), then the $@.keep_symbols file has size 0.
When objcopy parses a --keep-symbols file, it has a special case for
0-sized files where it silently fails (exits with status 1, no error
message). On the other hand, objcopy is happy with a file containing no
symbols, as long as there is some whitespace or a comment. Avoid the
special case by appending a newline to keep_symbols.

Bug: b/62815515
Bug: b/77242617
Test: manual
Change-Id: I348593164fe78ece5c85db3d28c7daccce3a52fb
(cherry picked from commit a45f5833c0)
2018-04-04 15:56:20 -07:00
Colin Cross
a5b6b5021c Silence more duplicate path warnings
Silence warnings when merging header jars that were missed by
Ifb67dbf7734b5f53941d110f578c4fe642e36005.

Bug: 69316739
Test: m checkbuild
Change-Id: I5cfea62e46d99f9b315a589d8915bf62307220aa
Merged-In: I5cfea62e46d99f9b315a589d8915bf62307220aa
(cherry picked from commit f6799e859a)
2018-03-22 15:06:49 -07:00
Colin Cross
ccf8992ac2 Use a srcjar for aapt and aapt2 output
Dumping files in the *_intermediates/src causes incremental build
problems, because we don't know when to delete them if they are
no longer generated.  Switch to outputting a srcjar instead, and
pass it in to the turbine and javac compiles.

Bug: 73885582
Test: m checkbuild
Change-Id: Ibef28507522339d930c09426d0c98372eb864cb6
Merged-In: Ibef28507522339d930c09426d0c98372eb864cb6
(cherry picked from commit 2d1cddd567)
2018-03-20 15:47:45 -07:00
Colin Cross
ec7be103d0 Use srcjar and resource zip as output of renderscript rules
Replace RenderScript.stamp with a srcjar, with a resource zip as
an implicit output.  This makes the renderscript rules self contained,
which will make it easier to move them before aapt.

Bug: 73885582
Test: m checkbuild
Change-Id: I12d33e52019aebac6ea33271939228e4690a4173
Merged-In: I12d33e52019aebac6ea33271939228e4690a4173
(cherry picked from commit e00e2fae52)
2018-03-20 15:47:45 -07:00
Colin Cross
a73ea16f95 Replace extract_srcjars.sh with zipsync
Use zipsync instead of extract_srcjars.sh.

Also fixes an issue where unzipping a resource zip would
ignore anything that wasn't a *.java file.

Bug: 73885582
Test: m checkbuild
Change-Id: I1c25f65afa196614879071c8655866febebac185
Merged-In: I1c25f65afa196614879071c8655866febebac185
(cherry picked from commit 3f99cd5933)
2018-03-20 15:47:45 -07:00
Colin Cross
ce99f05025 Allow compiles with only srcjars
Some javac and turbine compiles have no source files but sources
from srcjars.  Continue with compilation if the java source list
is empty but the srcjar source list is not.

Bug: 73885582
Test: m checkbuild
Change-Id: Ica412de2dd1b1bfc12c01c3eafca884220d42771
Merged-In: Ica412de2dd1b1bfc12c01c3eafca884220d42771
(cherry picked from commit 0c0adb993c)
2018-03-20 15:47:45 -07:00
Colin Cross
0a717ccd3f Allow aapt2 rules to take zipped resource files
Allow aapt2 rules to take zipped resource files similar to the
way the javac rules take srcjars.  For now, unzip the files using
extract_srcjars.sh, and then use aapt2 compile --dir.  Eventually
it could be done with aapt2 compile --zip.

Bug: 73885582
Bug: 74574557
Test: m checkbuild
Change-Id: I97ea3ff305e7a9ef2a908b4cf0bca903af62c6b1
Merged-In: I97ea3ff305e7a9ef2a908b4cf0bca903af62c6b1
(cherry picked from commit bc0c494d3a)
2018-03-20 15:47:45 -07:00
Colin Cross
f13eb55448 Add LOCAL_SRCJARS support
Allow java modules to take jars containing .java files as an input.
For turbine, pass them directly to turbine.  For javac, extract them
to a directory and pass a list of the files to javac.

Bug: 73885582
Test: m checkbuild
Change-Id: Ib4351a5b4b165a55e5fb02ee2680466db368983a
Merged-In: Ib4351a5b4b165a55e5fb02ee2680466db368983a
(cherry picked from commit 11e2d55c0f)
2018-03-20 15:47:45 -07:00
Colin Cross
35e31b65bd Remove sharding support from make
Sharding is not used in make any more, the large java modules
(libcore and framework) have moved to Soong.  Keeping sharding
support complicates java compiling, so remove it.

Bug: 73885582
Test: m checkbuild
Change-Id: I2932f9e96bfc8f2ebf82095b16d6c0b3c51613f0
Merged-In: I2932f9e96bfc8f2ebf82095b16d6c0b3c51613f0
(cherry picked from commit 5ef6e79c21)
2018-03-20 15:47:45 -07:00
Dan Willemsen
f65052640e Merge "Use xmllint built from source" am: 063e6b2939 am: 41d79327cd
am: 993655b8bf

Change-Id: I182feaff6e3db997407affd5520f57b421b8e433
2018-02-27 04:43:13 +00:00
Dan Willemsen
4c36d45a2c Use xmllint built from source
Instead of relying on whatever version of xmllint is on the host system,
build and use the version in external/libxml2.

Test: diff build_aosp-marlin.ninja, expected changes.
Test: m $(xmllint targets in build_aosp-marlin.ninja)
Test: introduce xml error, build fails
Change-Id: I39579f06db3777e3b5c8dda7c7541c25a35887b2
2018-02-27 02:34:08 +00:00
Colin Cross
de2d9195ff Merge "Move to-upper and to-lower to definitions.mk" am: 74413198b7 am: 7209b4066b
am: 3c508d0b3d

Change-Id: I73f796d5a53f57210f5fad53ca47bbe8af1e59f2
2018-02-09 18:51:06 +00:00
Treehugger Robot
74413198b7 Merge "Move to-upper and to-lower to definitions.mk" 2018-02-09 18:20:23 +00:00
Victor Hsieh
06f66af4e3 Merge "Don't use the same temp directory to uncompress dex" am: 9963b1af06 am: 4adb37dc4e
am: 7850bb0060

Change-Id: I3c2cea2b79615189e909a82fa003dc2fd91419af
2018-02-09 07:44:19 +00:00
Colin Cross
18fae7a32e Move to-upper and to-lower to definitions.mk
So they can be used by art/test/Android.run-test.mk.

Also remove the line wrapping, which was inserting extra characters
at the beginning of the result, and add a sanity check.

Bug: 26275726
Test: no change to out/build-hikey960-test-art.ninja
Change-Id: I35b54c258a1dc76bb1a8a758ec4a08915a2b226d
2018-02-08 16:03:17 -08:00
Victor Hsieh
7aecf33efd Don't use the same temp directory to uncompress dex
This was ok for apk because they are in different parent directory.

Test: marlin built
Bug: 63920015
Bug: 30972906
Change-Id: I5ed00824fda9e7e0a99c825402753c21a06ba6c5
2018-02-08 13:24:56 -08:00
David Brazdil
8c4d521d0d Merge "Revert "Revert "Apply hiddenapi build tool on boot jars""" am: edd4716ff9 am: bc05d3f846
am: 3264b568f3

Change-Id: I21ce7dc6f2d50a96722a197f52e48f13899ede7d
2018-02-01 23:27:09 +00:00
David Brazdil
b8fa6dd104 Revert "Revert "Apply hiddenapi build tool on boot jars""
This reverts commit 4a2926a44e.

Reason for revert: The original CL caused two issues:
1) Increased app startup because `profman` failed to verify boot
jars and created an empty profile for the boot image. All methods
in the framework therefore ran interpreted/JITed. New flag
"--skip-apk-verification" has been added to `profman` to fix
the issue in CL Iad614e47feada293218c11cff985a8012ca49a0f.
2) Caused a crash in Mockito CTS tests because jvmti did not
remove hiddenapi access flags from boot jars before using them.
This has been fixed with CL Ibc9a96a6b541c06844f276db009ac29514f7a3bb.

Bug: 64382372
Bug: 72550707
Test: make test-art-host
Change-Id: Ie8c58714455662f042f56b2977b01b75c5ec7d2f
2018-01-30 18:25:46 +00:00
Dan Willemsen
bd2f15cd58 Merge "Clean up some kati warnings" am: 157fbf771b am: 6432cf64b6
am: 6597699c8d

Change-Id: If7fe1940d10ff759c4606c314f98030fad83b232
2018-01-30 07:53:15 +00:00
Dan Willemsen
893bebc44b Clean up some kati warnings
Kati has a `--warn` option that adds some extra Kati-specific warnings
-- like using undefined make functions, undefined user functions, likely
bad variable lookups, etc. Some of these are bugs, others are fine doing
nothing. This fixes up all of them in the core build system.

It also complains about $(eval) usage in a recipe not being recommended.
Those aren't handled as part of this change.

Bug: 72661763
Test: build-aosp_arm.ninja is identical before and after
Change-Id: I8e00af142a7745236d3ad4efc9e91ec3ce71a511
2018-01-29 16:23:37 -08:00
Tobias Thierer
ebbbb5b1a2 Merge "javac 9 -target 1.9: Move bootclasspath jars onto classpath." am: e1b94da7c8 am: 6f1cb62ed4
am: 57e6177293

Change-Id: I588c93bfaa3f39405118452d4aa401f84f28c3e4
2018-01-29 11:01:12 +00:00
Tobias Thierer
e1b94da7c8 Merge "javac 9 -target 1.9: Move bootclasspath jars onto classpath." 2018-01-29 10:51:24 +00:00
Alex Light
e66c468790 Merge "Revert "Apply hiddenapi build tool on boot jars"" am: 9f1e629503 am: 67bf2d712a
am: 393453d761

Change-Id: I4e69247e2add400d6dad997cca04b1969384bb4f
2018-01-26 19:54:13 +00:00
Alex Light
4a2926a44e Revert "Apply hiddenapi build tool on boot jars"
This reverts commit b7f00ed2af.

Bug: 72550707
Bug: 64382372
Test: atest CtsInlineMockingTestCases

Reason for revert: Causing invalid dex files to be passed to jvmti
                   agents. This causes CtsInlineMockingTestCases and
                   other tests to fail.

Change-Id: I50129e94791b9e2bef919fe398b4250ae461195b
2018-01-26 18:16:52 +00:00
Tobias Thierer
0276db1ec7 javac 9 -target 1.9: Move bootclasspath jars onto classpath.
When building with OpenJDK 9's javac with -source 1.9 -target 1.9,
a runtime image (with system modules) is used via the --system
command line flag, instead of --bootclasspath.
The runtime image only contains the default libraries (libcore)
but is missing other libraries that might be on the bootclasspath
for a particular build target.

This CL fixes compilation for this case by adding the missing
jars onto the classpath instead.

This already used to work but was broken by CL [1]. I attempted
to conditionally revert some of that CL's changes to java_common.mk
for the case of language level 1.9, but couldn't get it to work.
Therefore this CL follows a different approach.

[1] http://r.android.com/519552

Bug: 38177569
Test: Treehugger
Test: Ran "EXPERIMENTAL_USE_OPENJDK9=true make checkbuild docs"
      and spot-checked some javac invocations to confirm that the
      system modules libs were not included in the bootclasspath,
      but other libs were.

Change-Id: I48fd11aac9b310bfa58dee0f9cfb3ef33f10bca8
2018-01-26 02:48:48 +00:00
David Brazdil
5f97aef277 Merge "Apply hiddenapi build tool on boot jars" am: 221848b181 am: b1831cf27e
am: 74f173806b

Change-Id: I60a5482f2a04429e3dcbf47ed82441cb3c702cdc
2018-01-26 00:16:38 +00:00
David Brazdil
b7f00ed2af Apply hiddenapi build tool on boot jars
Restrictions on usage of private APIs require encoding new information
into the dex files of the boot class path. ART now contains a new build
tool called `hiddenapi` which takes three lists of class member
signatures (blacklist, light and dark greylist), finds the class members
in their respective dex files and modifies their access flags in place.

This patch invokes the `hiddenapi` tool on all JARs in
PRODUCT_BOOT_JARS. For Java libraries built with Makefiles the tool is
invoked after the dexer directly on DEX files. For Soong-built
libraries, the build system has to unzip the JAR produced by Soong,
apply `hiddenapi` and rezip again. This is due to the fact that the
PRODUCT_BOOT_JARS variable is not available to Soong.

Bug: 64382372
Test: m
Change-Id: I6ce897d204459c8b6f46ed49e0909ff76c08a9ed
2018-01-25 09:22:08 +00:00
Nicolas Geoffray
c218a41c20 Merge "Tighter control of stripping in dex_preopt_odex_install." am: ec1fdc8813 am: ef29a15ac4
am: aa9a2e4af9

Change-Id: I622998242a20d8f4f8ee9fb2e0856180db44efe0
2018-01-22 13:49:33 +00:00
Nicolas Geoffray
ec1fdc8813 Merge "Tighter control of stripping in dex_preopt_odex_install." 2018-01-22 13:37:56 +00:00
Tobias Thierer
1d160f630c Merge "Experimental feature: LOCAL_PATCH_MODULE option in .mk files." am: 4bb18a8a2e am: 38d784f152
am: 33130f97e3

Change-Id: Idb30848c98b01a4fec8c6afdaac56899fb0f8d5f
2018-01-22 11:48:35 +00:00
Paul Duffin
f492ebdbd1 Revert "Filter JUnit and android.test classes from applications using proguard"
This reverts commit f22aca1e47.

Switching to use -systemjars instead of -libraryjars means that it is no longer
necessary to filter out the junit and android.test classes from jars to which
Proguard is being applied.

Bug: 30188076
Bug: 69156675
Test: make checkbuild
Change-Id: I36e14d28e01517927b458d69ade8ccb2c79a3340
2018-01-19 08:16:34 +00:00
Nicolas Geoffray
3972a47e9f Tighter control of stripping in dex_preopt_odex_install.
- Move logic to uncompress dexs in an APK in dex_preopt_odex_install.mk
  and definitions.mk.
- Explicitly mark nostripping cases where dexpreopt will not embed the dex
  file in the APK.

bug: 63920015
Test: m
Test: verify priv-apps dexs are uncompressed and unstripped
Test: Verify a non priv-app APK with uncompressed dex doesn't get stripped.

Change-Id: I624a03e3d965cebc0cae43fd6f7a6260178e6b8a
2018-01-18 22:42:46 +00:00
Tobias Thierer
f795dcb767 Experimental feature: LOCAL_PATCH_MODULE option in .mk files.
Specifying this option causes the make target's sources
and classpath dependencies to be patched into the specified
module via --patch-module (if the build toolchain implements
the module system, ie. when targeting 1.9). This allows tests
to compile that have classes in packages under test.

Currently, only java.base is on the module path (everything
else is on the classpath), and only when using -target 1.9
(ie. EXPERIMENTAL_USE_OPENJDK9=true).

Bug: 71699916
Test: Treehugger
Test: Checked that I was able to compile some ojluni & icu
      test sources that had classes in (libcore) packages
      under test.

Change-Id: I044fb9d904754ed281f574ab3dd52235cf0d7fec
2018-01-11 01:13:13 +00:00
Colin Cross
aca57b6c89 Remove --no-locals -> --release translation
--no-locals is never used any more, remove the translation.

Bug: 70886092
Test: m checkbuild
Change-Id: I5b0a512601b417c5a10001feed1fd9b8de8cb983
2017-12-21 13:00:51 -08:00
Alan Leung
c8ef37dfd8 Prep D8 default instead of CompatDX in build/core
Also use zip2zip to extract classes into another jar
to avoid hitting parameter limit in the shell invocations.

Bug: 69329508
Test: m checkbuild tests

Change-Id: Ic047aa699519b6b3fd100cb5395de945f96e4d0b
2017-12-18 23:54:33 -08:00
Treehugger Robot
973301af79 Merge "Replace build/tools with build/make/tools" 2017-12-13 02:34:42 +00:00
Alan Leung
aff156bd49 Avoid feeding D8 with dex files.
Some test targets include dex files as resource to be loaded
at runtime. This is an issue since full D8 also take dex files
as input.

This CL extracts only the class files and feed that to D8 instead
of the whole jar.

Test: USE_D8_DESUGAR=true m checkbuild tests
Bug: 69329508

Change-Id: I52d80ec01933573f18eb497472a80b6a649c9dae
2017-12-12 15:51:25 -08:00
Alan Leung
eaafb3cd37 Add USE_D8_DESUGAR option in build/core
Add an option to use D8's desugar instead of the standalone version.

USE_D8_DESUGAR=true m would trigger DCHECK in dex2oat unless
https://android-review.googlesource.com/c/platform/art/+/562595 is
patched in as well.

Bug: 69329508
Test: m && USE_D8_DESUGAR=false m

Change-Id: I601dada44c361e45bbc0e2227ae1544a7d9efa90
2017-12-11 14:03:09 -08:00
Colin Cross
fdea893833 Replace build/tools with build/make/tools
Test: m checkbuild
Change-Id: I8db6c27a6d2372f142d10568fe92d6f2e9a59252
2017-12-06 16:12:40 -08:00
Xin Li
5f03da0404 Merge "DO NOT MERGE: Merge Oreo MR1 into master" 2017-12-06 23:18:30 +00:00
Treehugger Robot
0765d53239 Merge "Add build script to generate TF test XML file with filters" 2017-12-06 22:51:43 +00:00
Sundong Ahn
f3e8302088 Add LOCAL_SDK_VERSION := system_$(VER)
am: 5a44d1f069

Change-Id: Ief08f78484b654502d356c07d61063a16aad0572
2017-12-01 04:26:10 +00:00
Sundong Ahn
5a44d1f069 Add LOCAL_SDK_VERSION := system_$(VER)
The system_$(VER) can be set in LOCAL_SDK_VERSION, and the apk will use
android_system.jar at build time.
If LOCAL_SDK_VERSION is not defined and this module is installed in
vendor.img, LOCAL_SDK_VERSION is set to system_current.

Bug: 67724799
Test: 1. build && run on taimen
2. LOCAL_SDK_VERSION:=system_27 in ims.apk && build ims.apk && check
the vsdk_v27_intermediates.

Merged-In: I5b11c78b8fcd4a2f2a5e3b141527cd34dbe80018
Change-Id: I5b11c78b8fcd4a2f2a5e3b141527cd34dbe80018
(cherry picked from commit ef212cbe8d)
2017-12-01 00:39:07 +00:00
Colin Cross
2338f237a3 Merge "Tighten restrictions on LOCAL_JACK_COVERAGE_(INCLUDE|EXCLUDE)_FILTER"
am: 711bfabd50

Change-Id: If9f4d81504c26e3d752d4f10f161f9229fb68a8d
2017-11-22 22:37:23 +00:00
Colin Cross
711bfabd50 Merge "Tighten restrictions on LOCAL_JACK_COVERAGE_(INCLUDE|EXCLUDE)_FILTER" 2017-11-22 22:30:18 +00:00
Colin Cross
3c8d30ce60 Tighten restrictions on LOCAL_JACK_COVERAGE_(INCLUDE|EXCLUDE)_FILTER
Jack supported '?' and '*' wildcards anywhere in a filter. Tighten
the restrictions to only support '*' at the end of a filter, and
to disallow '?'.  This will allow jacoco support to be built on
top of the existing zip2zip tools.

Add checks that all filters meet the new requirements, and run
the checks outside the LOCAL_EMMA_INSTRUMENT==true check so that
mistakes can be caught without having to run a build with
coverage enabled.

Bug: 69629238
Test: m EMMA_INSTRUMENT=true EMMA_INSTRUMENT_STATIC=true
Test: m in internal master
Test: https://android-build.googleplex.com/builds/view-workplan?viewType=Table&workplanId=L67200000122054710&nodeType=Trybot
Change-Id: Ib78bd3c8685fbc6bdcdb517df874186efd1cff33
2017-11-22 01:49:47 +00:00
Tomasz Wasilczyk
c792d08bd2 Merge "Silence yet more superfluous build messages."
am: 01e1fe60b8

Change-Id: I5dc1676389d4b6fb062265fac86a9d77b37c5c7b
2017-11-22 01:25:29 +00:00