diff options
author | 2019-07-16 17:02:44 +0100 | |
---|---|---|
committer | 2019-09-02 10:28:27 +0000 | |
commit | ad909af6c4be163bf2d5f4ca1e0487cc619a5041 (patch) | |
tree | 737bdd7957eb6c74ebaf126acfe0ff355f7b5f0a | |
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
-rw-r--r-- | build/apex/ld.config.txt | 8 | ||||
-rwxr-xr-x | build/apex/runtests.sh | 8 | ||||
-rw-r--r-- | dex2oat/dex2oat.cc | 2 | ||||
-rw-r--r-- | libartbase/base/file_utils.cc | 49 | ||||
-rw-r--r-- | libartbase/base/file_utils.h | 10 | ||||
-rw-r--r-- | libartbase/base/logging.h | 2 | ||||
-rw-r--r-- | tools/art | 8 | ||||
-rwxr-xr-x | tools/common/common.py | 2 | ||||
-rwxr-xr-x | tools/host_bcp.sh | 22 |
9 files changed, 55 insertions, 56 deletions
diff --git a/build/apex/ld.config.txt b/build/apex/ld.config.txt index c94437ef7a..faad7cb293 100644 --- a/build/apex/ld.config.txt +++ b/build/apex/ld.config.txt @@ -1,6 +1,6 @@ # Copyright (C) 2018 The Android Open Source Project # -# Bionic loader config file for the Runtime APEX. +# Bionic loader config file for the ART APEX. # # There are no versioned APEX paths here - this APEX module does not support # having several versions mounted. @@ -31,12 +31,12 @@ namespace.runtime.isolated = true namespace.runtime.visible = true # Keep in sync with the "runtime" namespace in system/core/rootdir/etc/ld.config*.txt. -namespace.runtime.search.paths = /apex/com.android.runtime/${LIB} -namespace.runtime.asan.search.paths = /apex/com.android.runtime/${LIB} +namespace.runtime.search.paths = /apex/com.android.art/${LIB} +namespace.runtime.asan.search.paths = /apex/com.android.art/${LIB} # JVMTI libraries used in ART testing are located under /data; dalvikvm # has to be able to dlopen them. # TODO(b/129534335): Move this to the linker configuration of the Test -# Runtime APEX when it is available. +# ART APEX when it is available. namespace.runtime.permitted.paths = /data # odex files are in /system/framework. dalvikvm has to be able to dlopen the # files for CTS. diff --git a/build/apex/runtests.sh b/build/apex/runtests.sh index df53572e97..004e7052eb 100755 --- a/build/apex/runtests.sh +++ b/build/apex/runtests.sh @@ -127,10 +127,10 @@ function fail_check { # Test all modules apex_modules=( - "com.android.runtime.release" - "com.android.runtime.debug" - "com.android.runtime.testing" - "com.android.runtime.host" + "com.android.art.release" + "com.android.art.debug" + "com.android.art.testing" + "com.android.art.host" ) # Build the APEX packages (optional). diff --git a/dex2oat/dex2oat.cc b/dex2oat/dex2oat.cc index 958194709f..91d6513fc8 100644 --- a/dex2oat/dex2oat.cc +++ b/dex2oat/dex2oat.cc @@ -187,7 +187,7 @@ static std::string StrippedCommandLine() { // Construct the final output. if (command.size() <= 1U) { - // It seems only "/apex/com.android.runtime/bin/dex2oat" is left, or not + // It seems only "/apex/com.android.art/bin/dex2oat" is left, or not // even that. Use a pretty line. return "Starting dex2oat."; } 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) diff --git a/libartbase/base/file_utils.h b/libartbase/base/file_utils.h index 7e1923a60f..776dc3df83 100644 --- a/libartbase/base/file_utils.h +++ b/libartbase/base/file_utils.h @@ -41,15 +41,15 @@ std::string GetAndroidRootSafe(/*out*/ std::string* error_msg); // These methods return the Android Runtime Root, which is the location of the // (activated) Android Runtime APEX module. On target, this is normally -// "/apex/com.android.runtime". On host, this is usually a subdirectory of the +// "/apex/com.android.art". On host, this is usually a subdirectory of the // Android Root, e.g. -// "$ANDROID_BUILD_TOP/out/host/linux-x86/com.android.runtime". The location of +// "$ANDROID_BUILD_TOP/out/host/linux-x86/com.android.art". The location of // the Android Runtime Root can be overriden using the ANDROID_RUNTIME_ROOT // environment variable. // -// Find $ANDROID_RUNTIME_ROOT, /apex/com.android.runtime, or abort. +// Find $ANDROID_RUNTIME_ROOT, /apex/com.android.art, or abort. std::string GetAndroidRuntimeRoot(); -// Find $ANDROID_RUNTIME_ROOT, /apex/com.android.runtime, or return an empty string. +// Find $ANDROID_RUNTIME_ROOT, /apex/com.android.art, or return an empty string. std::string GetAndroidRuntimeRootSafe(/*out*/ std::string* error_msg); // Return the path to the directory containing the Android Runtime binaries. @@ -96,7 +96,7 @@ std::string GetVdexFilename(const std::string& oat_filename); // ReplaceFileExtension("foo", "abc") == "foo.abc" std::string ReplaceFileExtension(const std::string& filename, const std::string& new_extension); -// Return whether the location is on /apex/com.android.runtime +// Return whether the location is on /apex/com.android.art bool LocationIsOnRuntimeModule(const char* location); // Return whether the location is on /apex/com.android.conscrypt diff --git a/libartbase/base/logging.h b/libartbase/base/logging.h index 68ad9fcfa3..9d83e51058 100644 --- a/libartbase/base/logging.h +++ b/libartbase/base/logging.h @@ -75,7 +75,7 @@ extern void InitLogging(char* argv[], AbortFunction& default_aborter); // performed. extern const char* GetCmdLine(); -// The command used to start the ART runtime, such as "/apex/com.android.runtime/bin/dalvikvm". If +// The command used to start the ART runtime, such as "/apex/com.android.art/bin/dalvikvm". If // InitLogging hasn't been performed then just returns "art". extern const char* ProgramInvocationName(); @@ -432,18 +432,18 @@ if [ -z "$ANDROID_RUNTIME_ROOT" ]; then # This script is used on host and target (device). However, the (expected) # default value `ANDROID_RUNTIME_ROOT` is not the same on host and target: # - on host, `ANDROID_RUNTIME_ROOT` is expected to be - # "$ANDROID_ROOT/com.android.runtime"; + # "$ANDROID_ROOT/com.android.art"; # - on target, `ANDROID_RUNTIME_ROOT` is expected to be - # "/apex/com.android.runtime". + # "/apex/com.android.art". # # We use the presence/absence of the `$ANDROID_ROOT/../apex` directory to # determine whether we are on target or host (this is brittle, but simple). if [ -d "$ANDROID_ROOT/../apex" ]; then # Target case. - ANDROID_RUNTIME_ROOT="/apex/com.android.runtime" + ANDROID_RUNTIME_ROOT="/apex/com.android.art" else # Host case. - ANDROID_RUNTIME_ROOT="$ANDROID_ROOT/com.android.runtime" + ANDROID_RUNTIME_ROOT="$ANDROID_ROOT/com.android.art" fi fi diff --git a/tools/common/common.py b/tools/common/common.py index c80ebf513f..93b014ab10 100755 --- a/tools/common/common.py +++ b/tools/common/common.py @@ -300,7 +300,7 @@ class HostTestEnv(ITestEnv): lib = 'lib64' if x64 else 'lib' android_root = GetEnvVariableOrError('ANDROID_HOST_OUT') android_i18n_root = android_root + '/com.android.i18n' - android_runtime_root = android_root + '/com.android.runtime' + android_runtime_root = android_root + '/com.android.art' android_tzdata_root = android_root + '/com.android.tzdata' library_path = android_root + '/' + lib path = android_root + '/bin' diff --git a/tools/host_bcp.sh b/tools/host_bcp.sh index bb12a02d1b..1dea295ba4 100755 --- a/tools/host_bcp.sh +++ b/tools/host_bcp.sh @@ -22,7 +22,7 @@ Extracts boot class path locations from <image> and outputs the appropriate --runtime-arg -Xbootclasspath:... --runtime-arg -Xbootclasspath-locations:... arguments for many ART host tools based on the \$ANDROID_PRODUCT_OUT variable -and existing \$ANDROID_PRODUCT_OUT/apex/com.android.runtime* paths. +and existing \$ANDROID_PRODUCT_OUT/apex/com.android.art* paths. If --use-first-dir is specified, the script will use the first apex dir instead of resulting in an error. EOF @@ -51,20 +51,20 @@ if [[ "x${BCPL}" == "x" ]]; then fi MANIFEST=/apex_manifest.json -RUNTIME_APEX=/apex/com.android.runtime -RUNTIME_APEX_SELECTED= -for m in `ls -1 -d ${ANDROID_PRODUCT_OUT}{,/system}${RUNTIME_APEX}*${MANIFEST} 2>/dev/null`; do +ART_APEX=/apex/com.android.art +ART_APEX_SELECTED= +for m in `ls -1 -d ${ANDROID_PRODUCT_OUT}{,/system}${ART_APEX}*${MANIFEST} 2>/dev/null`; do d=${m:0:-${#MANIFEST}} - if [[ "x${RUNTIME_APEX_SELECTED}" != "x" ]]; then + if [[ "x${ART_APEX_SELECTED}" != "x" ]]; then if [[ $USE_FIRST_DIR == true ]]; then break fi - echo "Multiple Runtime apex dirs: ${RUNTIME_APEX_SELECTED}, ${d}." + echo "Multiple Runtime apex dirs: ${ART_APEX_SELECTED}, ${d}." exit 1 fi - RUNTIME_APEX_SELECTED=${d} + ART_APEX_SELECTED=${d} done -if [[ "x${RUNTIME_APEX_SELECTED}" == "x" ]]; then +if [[ "x${ART_APEX_SELECTED}" == "x" ]]; then echo "No Runtime apex dir." exit 1 fi @@ -75,9 +75,9 @@ IFS=: for COMPONENT in ${BCPL}; do HEAD=${ANDROID_PRODUCT_OUT} TAIL=${COMPONENT} - if [[ ${COMPONENT:0:${#RUNTIME_APEX}} = ${RUNTIME_APEX} ]]; then - HEAD=${RUNTIME_APEX_SELECTED} - TAIL=${COMPONENT:${#RUNTIME_APEX}} + if [[ ${COMPONENT:0:${#ART_APEX}} = ${ART_APEX} ]]; then + HEAD=${ART_APEX_SELECTED} + TAIL=${COMPONENT:${#ART_APEX}} fi if [[ ! -e $HEAD$TAIL ]]; then echo "File does not exist: $HEAD$TAIL" |