diff options
author | 2019-07-16 17:02:44 +0100 | |
---|---|---|
committer | 2019-09-02 10:28:27 +0000 | |
commit | ad909af6c4be163bf2d5f4ca1e0487cc619a5041 (patch) | |
tree | 737bdd7957eb6c74ebaf126acfe0ff355f7b5f0a /libartbase/base/file_utils.cc | |
parent | 6da456969b2b4294cda98e6d0bc16a4493ad9652 (diff) |
Update references to the ART APEX.
Test: Build & boot
Test: atest CtsJniTestCases CtsCompilationTestCases CtsSimpleperfTestCases CtsBionicTestCases
Bug: 135753770
Change-Id: I9635afaf7996407063a0d9ed474b95c0b0e4f890
Merged-In: I9635afaf7996407063a0d9ed474b95c0b0e4f890
Diffstat (limited to 'libartbase/base/file_utils.cc')
-rw-r--r-- | libartbase/base/file_utils.cc | 49 |
1 files changed, 24 insertions, 25 deletions
diff --git a/libartbase/base/file_utils.cc b/libartbase/base/file_utils.cc index d74cc14f5f..4f102b8e78 100644 --- a/libartbase/base/file_utils.cc +++ b/libartbase/base/file_utils.cc @@ -71,7 +71,7 @@ static constexpr const char* kAndroidRootDefaultPath = "/system"; static constexpr const char* kAndroidDataEnvVar = "ANDROID_DATA"; static constexpr const char* kAndroidDataDefaultPath = "/data"; static constexpr const char* kAndroidRuntimeRootEnvVar = "ANDROID_RUNTIME_ROOT"; -static constexpr const char* kAndroidRuntimeApexDefaultPath = "/apex/com.android.runtime"; +static constexpr const char* kAndroidArtApexDefaultPath = "/apex/com.android.art"; static constexpr const char* kAndroidConscryptRootEnvVar = "ANDROID_CONSCRYPT_ROOT"; static constexpr const char* kAndroidConscryptApexDefaultPath = "/apex/com.android.conscrypt"; @@ -80,8 +80,7 @@ static constexpr const char* kAndroidConscryptApexDefaultPath = "/apex/com.andro // located: // - on host this "root" is normally the Android Root (e.g. something like // "$ANDROID_BUILD_TOP/out/host/linux-x86/"); -// - on target this "root" is normally the Android Runtime Root -// ("/apex/com.android.runtime"). +// - on target this "root" is normally the ART Root ("/apex/com.android.art"). // Return the empty string if that directory cannot be found or if this code is // run on Windows or macOS. static std::string GetRootContainingLibartbase() { @@ -125,7 +124,7 @@ std::string GetAndroidRootSafe(std::string* error_msg) { // information to infer the location of the Android Root (on host only). // // Note that this could change in the future, if we decided to install ART - // artifacts in a different location, e.g. within a "Runtime APEX" directory. + // artifacts in a different location, e.g. within an "ART APEX" directory. if (!kIsTargetBuild) { std::string root_containing_libartbase = GetRootContainingLibartbase(); if (!root_containing_libartbase.empty()) { @@ -187,7 +186,7 @@ static const char* GetAndroidDir(const char* env_var, const char* default_dir) { static std::string GetAndroidRuntimeRootSafe(bool must_exist, /*out*/ std::string* error_msg) { #ifdef _WIN32 - UNUSED(kAndroidRuntimeRootEnvVar, kAndroidRuntimeApexDefaultPath, GetRootContainingLibartbase); + UNUSED(kAndroidRuntimeRootEnvVar, kAndroidArtApexDefaultPath, GetRootContainingLibartbase); UNUSED(must_exist); *error_msg = "GetAndroidRuntimeRootSafe unsupported for Windows."; return ""; @@ -206,20 +205,20 @@ static std::string GetAndroidRuntimeRootSafe(bool must_exist, /*out*/ std::strin // On target, libartbase is normally installed in // "$ANDROID_RUNTIME_ROOT/lib(64)" (e.g. something like - // "/apex/com.android.runtime/lib(64)". Use this information to infer the - // location of the Android Runtime Root (on target only). + // "/apex/com.android.art/lib(64)". Use this information to infer the + // location of the ART Root (on target only). if (kIsTargetBuild) { // *However*, a copy of libartbase may still be installed outside the - // Android Runtime Root on some occasions, as ART target gtests install - // their binaries and their dependencies under the Android Root, i.e. - // "/system" (see b/129534335). For that reason, we cannot reliably use - // `GetRootContainingLibartbase` to find the Android Runtime Root. - // (Note that this is not really a problem in practice, as Android Q devices - // define ANDROID_RUNTIME_ROOT in their default environment, and will - // instead use the logic above anyway.) + // ART Root on some occasions, as ART target gtests install their binaries + // and their dependencies under the Android Root, i.e. "/system" (see + // b/129534335). For that reason, we cannot reliably use + // `GetRootContainingLibartbase` to find the ART Root. (Note that this is + // not really a problem in practice, as Android Q devices define + // ANDROID_RUNTIME_ROOT in their default environment, and will instead use + // the logic above anyway.) // // TODO(b/129534335): Re-enable this logic when the only instance of - // libartbase on target is the one from the Runtime APEX. + // libartbase on target is the one from the ART APEX. if ((false)) { std::string root_containing_libartbase = GetRootContainingLibartbase(); if (!root_containing_libartbase.empty()) { @@ -229,12 +228,12 @@ static std::string GetAndroidRuntimeRootSafe(bool must_exist, /*out*/ std::strin } // Try the default path. - if (must_exist && !OS::DirectoryExists(kAndroidRuntimeApexDefaultPath)) { - *error_msg = StringPrintf("Failed to find default Android Runtime Root directory %s", - kAndroidRuntimeApexDefaultPath); + if (must_exist && !OS::DirectoryExists(kAndroidArtApexDefaultPath)) { + *error_msg = StringPrintf("Failed to find default ART Root directory %s", + kAndroidArtApexDefaultPath); return ""; } - return kAndroidRuntimeApexDefaultPath; + return kAndroidArtApexDefaultPath; #endif } @@ -254,11 +253,11 @@ std::string GetAndroidRuntimeRoot() { std::string GetAndroidRuntimeBinDir() { // Environment variable `ANDROID_RUNTIME_ROOT` is defined as - // `$ANDROID_HOST_OUT/com.android.runtime` on host. However, host ART binaries - // are still installed in `$ANDROID_HOST_OUT/bin` (i.e. outside the Android - // Runtime Root). The situation is cleaner on target, where - // `ANDROID_RUNTIME_ROOT` is `$ANDROID_ROOT/apex/com.android.runtime` and ART - // binaries are installed in `$ANDROID_ROOT/apex/com.android.runtime/bin`. + // `$ANDROID_HOST_OUT/com.android.art` on host. However, host ART binaries are + // still installed in `$ANDROID_HOST_OUT/bin` (i.e. outside the ART Root). The + // situation is cleaner on target, where `ANDROID_RUNTIME_ROOT` is + // `$ANDROID_ROOT/apex/com.android.art` and ART binaries are installed in + // `$ANDROID_ROOT/apex/com.android.art/bin`. std::string android_runtime_root = kIsTargetBuild ? GetAndroidRuntimeRoot() : GetAndroidRoot(); return android_runtime_root + "/bin"; } @@ -474,7 +473,7 @@ bool RuntimeModuleRootDistinctFromAndroidRoot() { /* must_exist= */ kIsTargetBuild, &error_msg); const char* runtime_root = GetAndroidDirSafe(kAndroidRuntimeRootEnvVar, - kAndroidRuntimeApexDefaultPath, + kAndroidArtApexDefaultPath, /* must_exist= */ kIsTargetBuild, &error_msg); return (android_root != nullptr) |