When packing is enabled, the profiler can no longer properly map the
symbols which results in incorrect callstacks. Packing should be
disable when profiling is turned on.
R=vmiura@chromium.org
BUG=None
TEST=trybots
Review URL: https://codereview.chromium.org/641373005
Cr-Original-Commit-Position: refs/heads/master@{#299151}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 5adad7f853b67ce4d10a1c04e3d132566d3ebc1a
This patch revises the implementation of DeviceUtils.PushChangedFiles
and changes its interface (slightly).
PushChangedFiles now:
- takes a list of (host_path, device_path) tuples, each of which are
analogous to the original parameters.
- continues to use AndroidCommands.GetFilesChanged to determine which
files need pushing
- attempts to pick the fastest method out of:
- individual file pushes
- entire directory pushes
- zip-push-unzip
BUG=400440
Review URL: https://codereview.chromium.org/646523002
Cr-Original-Commit-Position: refs/heads/master@{#299098}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: b53e3ccca7fa26a51f3980f250f5527581324316
libchromium_android_linker.so changes do not currently trigger an
APK rebuild. Hoisting a dependency fixes this.
BUG=
Review URL: https://codereview.chromium.org/636803003
Cr-Original-Commit-Position: refs/heads/master@{#298470}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 90384e880b17542882508761937a7751252322c7
Objcopy knows nothing about the dynamic tags that point to packed
relocation data. If objcopy is run after relocation packing, and if it
moves the .android.rel.dyn section, these dynamic tags become invalid
and the crazy linker cannot load the library:
E/chromium_android_linker( 9584): Open:
Could not open libchrome.2180.0.so:
Bad packed relocations ident, expected APR1 or APA1
Currently, version branding happens at the end of building libchrome.so,
and after relocation packing. Re-order so that relocation packing again
comes after all other strip and/or objcopy operations.
BUG=417510
Review URL: https://codereview.chromium.org/621263003
Cr-Original-Commit-Position: refs/heads/master@{#298236}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 4749549c06525071692f777fc6a1fa5a9ad7f877
With this change setting 'load_library_from_zip_file' to 1 will now
construct the APK with a new tool chain. The purpose of this change is
to contruct the APK in such a way that the page alignment is not broken
by the chrome signing process. To achieve this the tool is written in
Java so it shares the same underlying JarOutputStream implementation.
The key things that we depend on are that the filenames are output in
lexographical order with the META_INF files at the end of the file.
That zipalign adds 4 byte alignment to STORED files and this is done by
adding padding to the zip extra field.
BUG=390618
Review URL: https://codereview.chromium.org/595933003
Cr-Original-Commit-Position: refs/heads/master@{#297439}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: c83a88d39329e2a7d8bbc1de280d9e572d2f7c8a
When building the native libraries, insert the version string into
native libraries as a section .chromium.verson.
BUG=417510
Review URL: https://codereview.chromium.org/599093005
Cr-Original-Commit-Position: refs/heads/master@{#297065}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 29d1208bfd30add739982738a6f11f7b0dbcfcd0
We checkout the Android WebView glue layer (frameworks/webview)
into a new third_party directory (android_webview_glue)
which is checked out via gclient.
This is built against a jar containing frameworks/base
(in android_platform/webview/frameworks.jar).
We have to work around a few other issues:
- Change build/java_apk.gypi to bypass the hardcoded
'src' path.
- Move libwebviewchromium to an include so we can make both
the prefixed and un-prefixed version in the same build.
BUG=391488
R=mkosiba@chromium.org
Review URL: https://codereview.chromium.org/477903003
Cr-Original-Commit-Position: refs/heads/master@{#293921}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: aefb27936dcf9694777440b8a2752b3c12300520
This change completes the removal of package_name from
build/java_apk.gyp and removes it from all the places
which still refer to it.
'package_name' used to be how you specified the intermediate
directory when building an APK. Now we use the target name and
includers no longer need to set the intermediate directory
explicitly. However one use in java_apk for setting additional
resources files seems to have crept through the refactoring.
BUG=405963
Review URL: https://codereview.chromium.org/487223003
Cr-Original-Commit-Position: refs/heads/master@{#293498}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: a1ee8d91945a17948026ef18dce2a2121db7fbd5
First, change the NativeLibraries template to use preprocessor defines
instead of includes. This allows us to delete all the corresponding
headers.
Then, change the ordered libraries file to be a dict with both the list
of library paths and the java-style list of library names.
Update a bunch of things that used the ordered libraries file to instead
take the list of libraries directly as an argument (as a FileArg in
every case).
Add calculating the list of libraries to write_build_config and add it
to the build config (gn can use this then instead of a separate ordered
libraries file).
Add a simple copy step in gn to set up the native libraries directory
for an apk. Use this directory when creating the apk.
BUG=359249
NOTRY=true
Review URL: https://codereview.chromium.org/456493002
git-svn-id: http://src.chromium.org/svn/trunk/src/build@290963 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
- Change the android_webview_apk gyp files to include the en-US.pak
file in the apk, which was erroneously missing.
- Add the do_not_compress gyp plumbing to store and zipalign paks in
the apk (only for the android_webview_apk target).
- Stop decompressing pak files in the android webview shell apk.
- Change aw_browser_main_parts.cc to take advantage of the new AwAssets
and DataPack/ResourceBundle *FromRegion methods (mmap from the apk).
- Add temporary workaround which loads always the en-US.pak locale, in
lack of a proper refactoring of i10n_utils and ResourceBundle.
BUG=394502
Review URL: https://codereview.chromium.org/402603006
git-svn-id: http://src.chromium.org/svn/trunk/src/build@286258 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
A race can exist where two build targets build the same libchrome. It
can manifest as:
.../arm-linux-androideabi-objcopy: error: the input file '.../libchrome.2085.0.so' is empty
Move the temporary directory used to transfer stripped files between the
strip and pack actions from <(SHARED_INTERMEDIATE_DIR) to <(intermediate_dir).
Also, remove nugatory inter-action dependency, and make actions previously
consuming <(strip_stamp) consume <(pack_arm_relocations_stamp) instead.
BUG=392417
Review URL: https://codereview.chromium.org/376193003
git-svn-id: http://src.chromium.org/svn/trunk/src/build@282118 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
This CL does the 3 following things to allow the mojo shell to run:
- Updates java_apk.gypi to allow bundling additional libs.
- Bundle the network service with the mojo shell.
- Updates the shell to look for .so and .cr.so file in the local file
system for android component build.
Review URL: https://codereview.chromium.org/334783006
git-svn-id: http://src.chromium.org/svn/trunk/src/build@282015 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Broke Android compile:
FAILED: cd ../../net; python ../build/android/gyp/pack_arm_relocations.py "--enable-packing=0" "--stripped-libraries-dir=../out/Release/gen/stripped_libraries" "--packed-libraries-dir=../out/Release/net_unittests_apk/libs/armeabi-v7a" "--libraries-file=../out/Release/net_unittests_apk/native_libraries.json" "--stamp=../out/Release/net_unittests_apk/pack_arm_relocations.stamp"
Traceback (most recent call last):
File "../build/android/gyp/pack_arm_relocations.py", line 108, in <module>
sys.exit(main())
File "../build/android/gyp/pack_arm_relocations.py", line 99, in main
CopyArmLibraryUnchanged(library_path, output_path)
File "../build/android/gyp/pack_arm_relocations.py", line 58, in CopyArmLibraryUnchanged
shutil.copy(library_path, output_path)
File "/usr/lib/python2.7/shutil.py", line 117, in copy
copyfile(src, dst)
File "/usr/lib/python2.7/shutil.py", line 83, in copyfile
with open(dst, 'wb') as fdst:
IOError: [Errno 2] No such file or directory: u'../out/Release/net_unittests_apk/libs/armeabi-v7a/libnet_unittests.so'
ninja: build stopped: subcommand failed.
> Add gyp machinery to build with packed ARM relative relocations.
>
> Add gypi and python files to support packing ARM relative relocations
> during the build process.
>
> Define a use_relocation_packer gyp variable to turn ARM relocation
> packing on and off (currently set to 0).
>
> BUG=385553
>
> Review URL: https://codereview.chromium.org/358863002TBR=simonb@chromium.org
Review URL: https://codereview.chromium.org/370633002
git-svn-id: http://src.chromium.org/svn/trunk/src/build@281303 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Add gypi and python files to support packing ARM relative relocations
during the build process.
Define a use_relocation_packer gyp variable to turn ARM relocation
packing on and off (currently set to 0).
BUG=385553
Review URL: https://codereview.chromium.org/358863002
git-svn-id: http://src.chromium.org/svn/trunk/src/build@281286 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
generate_v14_compatible_resources.GenerateV14Resources was deleting and
recreating the output directory. process_resources was calling that
multiple times and reusing the same output directory (and so it would
only actually get v14 resources for the final directory).
Instead, callers of GenerateV14Resources should handle deleting/creating
the output directory for themselves--this is just
generate_v14_compatible_resources.main and process_resources (which was
already handling this itself).
BUG=383803
Review URL: https://codereview.chromium.org/362543004
git-svn-id: http://src.chromium.org/svn/trunk/src/build@280725 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
This allows us to more accurately specify the outputs of each action (we
can't specify the .class file outputs easily because determing them
essentially requires compiling the .java files).
The lint action still operates directly on the .class files, so we continue to
support specifying a directory for the .class files (but in a very simple to
remove way).
BUG=359249
Review URL: https://codereview.chromium.org/328893003
git-svn-id: http://src.chromium.org/svn/trunk/src/build@279152 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
At runtime, the classloader will look for classes in both apk's dex
files. In the standard Android build system, an instrumentation test
apk's dex file does not include the classes included in the tested apk's
dex file.
To do this, when doing obfuscation for an apk, write the list of
libraries included in the obfuscated jar and the list of proguard config
files. Then, when proguarding the test apk's code, exclude those
libraries included in the tested apk, use the configs from the tested
apk, and apply the proguard mapping (the renames from obfuscation). Also
add some extra test-specific proguard options.
Now that the test apk does not bundle its own copy of all the tested
apk's classes, some things may need to be kept in the main apk just for
tests. However, we already keep everything in org.chromium.** and
com.google.android.apps.** because of the fact that the test apk was
using its own copy of all the classes and so we couldn't depend on the
tests to actually catch us from over-optimizing with proguard.
BUG=272790
Review URL: https://codereview.chromium.org/321883002
git-svn-id: http://src.chromium.org/svn/trunk/src/build@277257 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
At runtime, the classloader will look for classes in both apk's dex
files. In the standard Android build system, an instrumentation test
apk's dex file does not include the classes included in the tested apk's
dex file.
To do this, when dexing, write a file listing the inputs to the dex
file. When dexing for an instrumentation apk, exclude those files listed
as inputs of the tested apk's dex file.
For proguarded apks, this exclusion will need to happen for proguard
inputs instead of dex inputs, so this change does not cover that case.
BUG=272790
NOTRY=true
Review URL: https://codereview.chromium.org/313273004
git-svn-id: http://src.chromium.org/svn/trunk/src/build@276788 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
This makes all temporary work be done in temporary directories.
This change is particularly helpful for 2 reasons: first, it makes it
more difficult to accidentally include stale, unwanted files during an
incremental build. Second, it is easier to trigger dependent actions
(zip file timestamps should be updated when their contents change, while
the same is not true for directories).
Makes the output of build/java_strings_grd.gypi be a zipfile containing
the resources.
BUG=359249,375431
Review URL: https://codereview.chromium.org/321463002
git-svn-id: http://src.chromium.org/svn/trunk/src/build@276226 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Reason for revert:
This is causing instrumentation-yakju-clankium-tot and clang-clankium-tot-builder (downstream) to fail with the following error message:
FAILED: cd ../../clank/native/framework; python ../../../build/android/gyp/process_resources.py --android-sdk /b/build/slave/instrumentation-yakju-clankium-tot/build/src/third_party/android_tools/sdk//platforms/android-19 --android-sdk-tools /b/build/slave/instrumentation-yakju-clankium-tot/build/src/third_party/android_tools/sdk//build-tools/19.0.0 --android-manifest ../../../clank/java/apps/deviceextras/AndroidManifest.xml --dependencies-res-dirs "" --extra-res-packages "" --extra-r-text-files "" --proguard-file ../../../out/Debug/device_extras_apk/proguard.txt --resource-dir ../../../clank/java/apps/deviceextras/res --res-v14-compatibility-dir ../../../out/Debug/device_extras_apk/res_v14_compatibility --crunch-output-dir ../../../out/Debug/device_extras_apk/res --R-dir ../../../out/Debug/device_extras_apk/gen --stamp ../../../out/Debug/device_extras_apk/codegen.stamp
Traceback (most recent call last):
File "../../../build/android/gyp/process_resources.py", line 217, in <module>
main()
File "../../../build/android/gyp/process_resources.py", line 166, in main
options.v14_verify_only)
File "/b/build/slave/instrumentation-yakju-clankium-tot/build/src/build/android/gyp/generate_v14_compatible_resources.py", line 335, in GenerateV14Resources
ErrorIfStyleResourceExistsInDir(input_dir)
File "/b/build/slave/instrumentation-yakju-clankium-tot/build/src/build/android/gyp/generate_v14_compatible_resources.py", line 107, in ErrorIfStyleResourceExistsInDir
'-v17 directory. Please refer to '
Exception: error: style file /b/build/slave/instrumentation-yakju-clankium-tot/build/src/clank/java/apps/deviceextras/res/values/styles.xml should be under /b/build/slave/instrumentation-yakju-clankium-tot/build/src/clank/java/apps/deviceextras/res/values-v17 directory. Please refer to http://crbug.com/243952 for the details.
I don't know resource loading well enough to tell if that's a legitimate issue or not; so for now reverting this to fix the build bots, and if it is a legitimate issue then ideally it could be fixed before relanding this?
Original issue's description:
> Add creation of v14 compatible resources to process_resources.py
>
> There are a lot of steps in processing resources and preparing them for
> packaging. It will be easier if these are all done by the same script.
>
> BUG=375431,359249
>
> Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=275401TBR=newt@chromium.org,cjhopman@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=375431,359249
Review URL: https://codereview.chromium.org/314363002
git-svn-id: http://src.chromium.org/svn/trunk/src/build@275436 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
This ant script is basically a simple wrapper around an aapt call (the
only thing the large AaptExecTask custom ant task adds is a bunch of
dependency checking that we don't actually want anyway). This
makes it use python instead.
BUG=359249,375324,375431
NOTRY=true
Review URL: https://codereview.chromium.org/291963002
git-svn-id: http://src.chromium.org/svn/trunk/src/build@273326 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
Reason for revert:
Suspected for android compile failure on waterfall starting
http://build.chromium.org/p/chromium/builders/Android/builds/24321
Errors are pretty obscure. Things like
BUILD FAILED
/b/build/slave/Android/build/src/build/android/ant/apk-obfuscate.xml:161: /b/build/slave/Android/build/src/out/Release/multiple_proguards_test_apk/proguard.txt (No such file or directory)
at proguard.ant.ConfigurationTask.addText(ConfigurationTask.java:315)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
FAILED: cd ../../build/android/tests/multiple_proguards; /*snip*/ build/android/ant/apk-obfuscate.xml
Traceback (most recent call last):
File "../../../../build/android/gyp/ant.py", line 34, in main
stdout = build_utils.CheckOutput(['ant'] + verbose_args)
File "/b/build/slave/Android/build/src/build/android/gyp/util/build_utils.py", line 113, in CheckOutput
raise CalledProcessError(cwd, args, stdout + stderr)
Original issue's description:
> Remove apk-codegen.xml
>
> process_resources.py already implements almost everything from
> apk-codegen.xml so just use that instead.
>
> BUG=359249,375324,375431
>
> Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=272783TBR=yfriedman@chromium.org,cjhopman@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=359249,375324,375431
Review URL: https://codereview.chromium.org/301543002
git-svn-id: http://src.chromium.org/svn/trunk/src/build@272795 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
apkbuilder only uses sourcefolder to package non-java files (see
addSourceFolder() and checkFileForPackaging() in
e162064a7b/sdkmanager/libs/sdklib/src/com/android/sdklib/build/ApkBuilder.java ),
and our java/src folders only contain .java (and OWNERS) files.
(Determined via `find . -type f -a -path '*/src/*' -a -not -name '*.java'` and
manually ignoring everything not looking like a java folder.)
No intended behavior change; Chrome.apk looks identical with and without
this change (except for timestamps).
BUG=none
NOTRY=true
Review URL: https://codereview.chromium.org/212173003
git-svn-id: http://src.chromium.org/svn/trunk/src/build@260047 4ff67af0-8c30-449e-8e8b-ad334ec8d88c