Ignore missing bootstrap class path jars after printing a warning.
Previous behavior was to print an error and halt. The warning will appear
in the log whenever the VM is started, which means you'll see it on every
"dexopt" invocation but otherwise only once during zygote init.
For internal bug 1812586.
diff --git a/vm/oo/Class.c b/vm/oo/Class.c
index 6369d9b..0d120c4 100644
--- a/vm/oo/Class.c
+++ b/vm/oo/Class.c
@@ -478,7 +478,7 @@
cc = stat(cpe->fileName, &sb);
if (cc < 0) {
- LOGW("Unable to stat classpath element '%s'\n", cpe->fileName);
+ LOGD("Unable to stat classpath element '%s'\n", cpe->fileName);
return false;
}
if (S_ISDIR(sb.st_mode)) {
@@ -510,6 +510,7 @@
return true;
}
+ LOGD("Unable to process classpath element '%s'\n", cpe->fileName);
return false;
}
@@ -517,13 +518,13 @@
* Convert a colon-separated list of directories, Zip files, and DEX files
* into an array of ClassPathEntry structs.
*
- * If we're unable to load a bootstrap class path entry, we fail. This
- * is necessary to preserve the dependencies implied by optimized DEX files
- * (e.g. if the same class appears in multiple places).
- *
* During normal startup we fail if there are no entries, because we won't
* get very far without the basic language support classes, but if we're
* optimizing a DEX file we allow it.
+ *
+ * If entries are added or removed from the bootstrap class path, the
+ * dependencies in the DEX files will break, and everything except the
+ * very first entry will need to be regenerated.
*/
static ClassPathEntry* processClassPath(const char* pathStr, bool isBootstrap)
{
@@ -583,16 +584,8 @@
cpe[idx].ptr = NULL;
if (!prepareCpe(&tmp, isBootstrap)) {
- LOGD("Failed on '%s' (boot=%d)\n", tmp.fileName, isBootstrap);
/* drop from list and continue on */
free(tmp.fileName);
-
- if (isBootstrap || gDvm.optimizing) {
- /* if boot path entry or we're optimizing, this is fatal */
- free(cpe);
- cpe = NULL;
- goto bail;
- }
} else {
/* copy over, pointers and all */
if (tmp.fileName[0] != '/')