diff options
author | 2019-09-20 15:53:40 +0100 | |
---|---|---|
committer | 2019-09-24 17:40:00 +0000 | |
commit | e58624f221b967553d7b71f14d8677ceaa000553 (patch) | |
tree | 00d6caa5ca66562d9c8e448abc77c0c6018fca0c | |
parent | 48349ad38887f65da76df268f8e548d508d8c6a1 (diff) |
Various renames following the name change from "Runtime APEX" to "ART APEX".
In particular ANDROID_RUNTIME_ROOT is now ANDROID_ART_ROOT.
Test: Build & boot
Test: art/tools/run-gtests.sh in chroot
Test: art/test/testrunner/testrunner.py --target --64 in chroot
Test: art/tools/run-libcore-tests.sh --mode=device --variant=X64 in chroot
Test: art/tools/run-jdwp-tests.sh --mode=device --variant=X64 in chroot
Test: m test-art-host-gtest
Test: art/test/testrunner/testrunner.py --host --64
Test: art/tools/run-jdwp-tests.sh --mode=host
Bug: 135753770
Change-Id: Ia74da964e54cf396d66e9e12ea56da4e9483662a
34 files changed, 173 insertions, 176 deletions
diff --git a/Android.mk b/Android.mk index 64d72c1d9c..65a57419c5 100644 --- a/Android.mk +++ b/Android.mk @@ -607,10 +607,9 @@ standalone-apex-files: libc.bootstrap libdl.bootstrap libm.bootstrap linker $(DE # Also include: # - a copy of the ICU prebuilt .dat file in /system/etc/icu on target # (see module `icu-data-art-test-i18n`); and -# so that it can be found even if the ART APEX is not available, -# by setting the environment variable `ART_TEST_ANDROID_RUNTIME_ROOT` -# to "/system" on device. This is a temporary change needed -# until Golem fully supports the ART APEX. +# so that it can be found even if the ART APEX is not available, by setting the +# environment variable `ART_TEST_ANDROID_ART_ROOT` to "/system" on device. This +# is a temporary change needed until Golem fully supports the ART APEX. # # TODO(b/129332183): Remove this when Golem has full support for the # ART APEX. diff --git a/build/Android.gtest.mk b/build/Android.gtest.mk index 736b7f3af5..36c240e009 100644 --- a/build/Android.gtest.mk +++ b/build/Android.gtest.mk @@ -468,9 +468,9 @@ ifneq ($(ART_TEST_ANDROID_I18N_ROOT),) ART_GTEST_TARGET_ANDROID_I18N_ROOT := $(ART_TEST_ANDROID_I18N_ROOT) endif -ART_GTEST_TARGET_ANDROID_RUNTIME_ROOT := '/apex/com.android.art' -ifneq ($(ART_TEST_ANDROID_RUNTIME_ROOT),) - ART_GTEST_TARGET_ANDROID_RUNTIME_ROOT := $(ART_TEST_ANDROID_RUNTIME_ROOT) +ART_GTEST_TARGET_ANDROID_ART_ROOT := '/apex/com.android.art' +ifneq ($(ART_TEST_ANDROID_ART_ROOT),) + ART_GTEST_TARGET_ANDROID_ART_ROOT := $(ART_TEST_ANDROID_ART_ROOT) endif ART_GTEST_TARGET_ANDROID_TZDATA_ROOT := '/apex/com.android.tzdata' @@ -528,7 +528,7 @@ $$(gtest_rule): test-art-target-sync ($(ADB) shell "$$(PRIVATE_MAYBE_CHROOT_COMMAND) env $(GCOV_ENV) LD_LIBRARY_PATH=$(4) \ ANDROID_ROOT=$(ART_GTEST_TARGET_ANDROID_ROOT) \ ANDROID_I18N_ROOT=$(ART_GTEST_TARGET_ANDROID_I18N_ROOT) \ - ANDROID_RUNTIME_ROOT=$(ART_GTEST_TARGET_ANDROID_RUNTIME_ROOT) \ + ANDROID_ART_ROOT=$(ART_GTEST_TARGET_ANDROID_ART_ROOT) \ ANDROID_TZDATA_ROOT=$(ART_GTEST_TARGET_ANDROID_TZDATA_ROOT) \ $$(PRIVATE_TARGET_EXE) \ && touch $$(PRIVATE_GTEST_WITNESS)" \ @@ -781,7 +781,7 @@ ART_TEST_TARGET_GTEST$(2ND_ART_PHONY_TEST_TARGET_SUFFIX)_RULES := ART_TEST_TARGET_GTEST_RULES := ART_GTEST_TARGET_ANDROID_ROOT := ART_GTEST_TARGET_ANDROID_I18N_ROOT := -ART_GTEST_TARGET_ANDROID_RUNTIME_ROOT := +ART_GTEST_TARGET_ANDROID_ART_ROOT := ART_GTEST_TARGET_ANDROID_TZDATA_ROOT := ART_GTEST_class_linker_test_DEX_DEPS := ART_GTEST_class_table_test_DEX_DEPS := diff --git a/build/apex/art_apex_test.py b/build/apex/art_apex_test.py index 6d29fc9769..ee372f4856 100755 --- a/build/apex/art_apex_test.py +++ b/build/apex/art_apex_test.py @@ -29,10 +29,10 @@ logging.basicConfig(format='%(message)s') # Architectures supported by APEX packages. archs = ["arm", "arm64", "x86", "x86_64"] -# Directory containing ART tests within a Runtime APEX (if the package includes +# Directory containing ART tests within an ART APEX (if the package includes # any). ART test executables are installed in `bin/art/<arch>`. Segregating # tests by architecture is useful on devices supporting more than one -# architecture, as it permits testing all of them using a single Runtime APEX +# architecture, as it permits testing all of them using a single ART APEX # package. art_test_dir = 'bin/art' @@ -1223,7 +1223,7 @@ def art_apex_test_default(test_parser): if __name__ == "__main__": - parser = argparse.ArgumentParser(description='Check integrity of a Runtime APEX.') + parser = argparse.ArgumentParser(description='Check integrity of an ART APEX.') parser.add_argument('apex', help='APEX file input') diff --git a/build/apex/runtests.sh b/build/apex/runtests.sh index c51e930225..c3dc70980f 100755 --- a/build/apex/runtests.sh +++ b/build/apex/runtests.sh @@ -15,7 +15,7 @@ # limitations under the License. # -# Run Android Runtime APEX tests. +# Run ART APEX tests. SCRIPT_DIR=$(dirname $0) @@ -64,7 +64,7 @@ print_file_sizes_p=false function usage { cat <<EOF Usage: $0 [OPTION] -Build (optional) and run tests on Android Runtime APEX package (on host). +Build (optional) and run tests on ART APEX package (on host). -B, --skip-build skip the build step -l, --list-files list the contents of the ext4 image (\`find\`-like style) @@ -193,6 +193,6 @@ for apex_module in ${apex_modules[@]}; do echo done -[[ "$exit_status" = 0 ]] && say "All Android Runtime APEX tests passed" +[[ "$exit_status" = 0 ]] && say "All ART APEX tests passed" exit $exit_status diff --git a/dexdump/dexdump_test.cc b/dexdump/dexdump_test.cc index 4ddb208a92..91ab1871de 100644 --- a/dexdump/dexdump_test.cc +++ b/dexdump/dexdump_test.cc @@ -39,7 +39,7 @@ class DexDumpTest : public CommonRuntimeTest { // Runs test with given arguments. bool Exec(const std::vector<std::string>& args, std::string* error_msg) { - std::string file_path = GetAndroidRuntimeBinDir() + "/dexdump"; + std::string file_path = GetArtBinDir() + "/dexdump"; EXPECT_TRUE(OS::FileExists(file_path.c_str())) << file_path << " should be a valid file path"; std::vector<std::string> exec_argv = { file_path }; exec_argv.insert(exec_argv.end(), args.begin(), args.end()); diff --git a/dexlayout/dexdiag_test.cc b/dexlayout/dexdiag_test.cc index 0791e9a563..23fd66ffad 100644 --- a/dexlayout/dexdiag_test.cc +++ b/dexlayout/dexdiag_test.cc @@ -39,7 +39,7 @@ class DexDiagTest : public CommonArtTest { // Path to the dexdiag(d?)[32|64] binary. std::string GetDexDiagFilePath() { - std::string path = GetAndroidRuntimeBinDir() + '/' + kDexDiagBinaryName; + std::string path = GetArtBinDir() + '/' + kDexDiagBinaryName; std::string path32 = path + "32"; // If we have both a 32-bit and a 64-bit build, the 32-bit file will have a 32 suffix. if (OS::FileExists(path32.c_str()) && !Is64BitInstructionSet(kRuntimeISA)) { diff --git a/dexlayout/dexlayout_test.cc b/dexlayout/dexlayout_test.cc index 5ee63b5feb..391a54834b 100644 --- a/dexlayout/dexlayout_test.cc +++ b/dexlayout/dexlayout_test.cc @@ -253,14 +253,14 @@ static void WriteFileBase64(const char* base64, const char* location) { class DexLayoutTest : public CommonArtTest { protected: std::string GetDexLayoutPath() { - return GetAndroidRuntimeBinDir() + "/dexlayoutd"; + return GetArtBinDir() + "/dexlayoutd"; } // Runs FullPlainOutput test. bool FullPlainOutputExec(std::string* error_msg) { ScratchFile dexdump_output; const std::string& dexdump_filename = dexdump_output.GetFilename(); - std::string dexdump = GetAndroidRuntimeBinDir() + "/dexdump"; + std::string dexdump = GetArtBinDir() + "/dexdump"; EXPECT_TRUE(OS::FileExists(dexdump.c_str())) << dexdump << " should be a valid file path"; ScratchFile dexlayout_output; diff --git a/dexlist/dexlist_test.cc b/dexlist/dexlist_test.cc index 32bc735487..fa17a2f834 100644 --- a/dexlist/dexlist_test.cc +++ b/dexlist/dexlist_test.cc @@ -41,7 +41,7 @@ class DexListTest : public CommonRuntimeTest { // Runs test with given arguments. bool Exec(const std::vector<std::string>& args, std::string* error_msg) { - std::string file_path = GetAndroidRuntimeBinDir() + "/dexlist"; + std::string file_path = GetArtBinDir() + "/dexlist"; EXPECT_TRUE(OS::FileExists(file_path.c_str())) << file_path << " should be a valid file path"; std::vector<std::string> exec_argv = { file_path }; exec_argv.insert(exec_argv.end(), args.begin(), args.end()); diff --git a/dexoptanalyzer/dexoptanalyzer_test.cc b/dexoptanalyzer/dexoptanalyzer_test.cc index 9f8dbd7b0e..65b50358d8 100644 --- a/dexoptanalyzer/dexoptanalyzer_test.cc +++ b/dexoptanalyzer/dexoptanalyzer_test.cc @@ -25,7 +25,7 @@ namespace art { class DexoptAnalyzerTest : public DexoptTest { protected: std::string GetDexoptAnalyzerCmd() { - std::string file_path = GetAndroidRuntimeBinDir() + "/dexoptanalyzer"; + std::string file_path = GetArtBinDir() + "/dexoptanalyzer"; if (kIsDebugBuild) { file_path += 'd'; } diff --git a/imgdiag/imgdiag_test.cc b/imgdiag/imgdiag_test.cc index 426f9efd34..6c83f9aaf1 100644 --- a/imgdiag/imgdiag_test.cc +++ b/imgdiag/imgdiag_test.cc @@ -61,7 +61,7 @@ class ImgDiagTest : public CommonRuntimeTest { // Path to the imgdiag(d?)[32|64] binary. std::string GetImgDiagFilePath() { - std::string path = GetAndroidRuntimeBinDir() + '/' + kImgDiagBinaryName; + std::string path = GetArtBinDir() + '/' + kImgDiagBinaryName; if (kIsDebugBuild) { path += 'd'; } diff --git a/libartbase/base/common_art_test.cc b/libartbase/base/common_art_test.cc index e05c14352e..7101ca479b 100644 --- a/libartbase/base/common_art_test.cc +++ b/libartbase/base/common_art_test.cc @@ -184,15 +184,15 @@ void CommonArtTestImpl::SetUpAndroidRootEnvVars() { setenv("ANDROID_I18N_ROOT", android_i18n_root.c_str(), 1); } - // Environment variable ANDROID_RUNTIME_ROOT is set on the device, but not + // Environment variable ANDROID_ART_ROOT is set on the device, but not // necessarily on the host. It needs to be set so that various libraries // like libcore / icu4j / icu4c can find their data files. - const char* android_runtime_root_from_env = getenv("ANDROID_RUNTIME_ROOT"); - if (android_runtime_root_from_env == nullptr) { - // Use ${ANDROID_HOST_OUT}/com.android.art for ANDROID_RUNTIME_ROOT. - std::string android_runtime_root = android_host_out_from_env; - android_runtime_root += "/com.android.art"; - setenv("ANDROID_RUNTIME_ROOT", android_runtime_root.c_str(), 1); + const char* android_art_root_from_env = getenv("ANDROID_ART_ROOT"); + if (android_art_root_from_env == nullptr) { + // Use ${ANDROID_HOST_OUT}/com.android.art for ANDROID_ART_ROOT. + std::string android_art_root = android_host_out_from_env; + android_art_root += "/com.android.art"; + setenv("ANDROID_ART_ROOT", android_art_root.c_str(), 1); } // Environment variable ANDROID_TZDATA_ROOT is set on the device, but not diff --git a/libartbase/base/common_art_test.h b/libartbase/base/common_art_test.h index 32f1ef55a9..ef1c1aef46 100644 --- a/libartbase/base/common_art_test.h +++ b/libartbase/base/common_art_test.h @@ -81,7 +81,7 @@ class CommonArtTestImpl { virtual ~CommonArtTestImpl() = default; // Set up ANDROID_BUILD_TOP, ANDROID_HOST_OUT, ANDROID_ROOT, ANDROID_I18N_ROOT, - // ANDROID_RUNTIME_ROOT, and ANDROID_TZDATA_ROOT environment variables using sensible defaults + // ANDROID_ART_ROOT, and ANDROID_TZDATA_ROOT environment variables using sensible defaults // if not already set. static void SetUpAndroidRootEnvVars(); diff --git a/libartbase/base/file_utils.cc b/libartbase/base/file_utils.cc index 4f102b8e78..5e164ec6f5 100644 --- a/libartbase/base/file_utils.cc +++ b/libartbase/base/file_utils.cc @@ -70,7 +70,7 @@ static constexpr const char* kAndroidRootEnvVar = "ANDROID_ROOT"; 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* kAndroidArtRootEnvVar = "ANDROID_ART_ROOT"; 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"; @@ -184,27 +184,27 @@ static const char* GetAndroidDir(const char* env_var, const char* default_dir) { } } -static std::string GetAndroidRuntimeRootSafe(bool must_exist, /*out*/ std::string* error_msg) { +static std::string GetArtRootSafe(bool must_exist, /*out*/ std::string* error_msg) { #ifdef _WIN32 - UNUSED(kAndroidRuntimeRootEnvVar, kAndroidArtApexDefaultPath, GetRootContainingLibartbase); + UNUSED(kAndroidArtRootEnvVar, kAndroidArtApexDefaultPath, GetRootContainingLibartbase); UNUSED(must_exist); - *error_msg = "GetAndroidRuntimeRootSafe unsupported for Windows."; + *error_msg = "GetArtRootSafe unsupported for Windows."; return ""; #else - // Prefer ANDROID_RUNTIME_ROOT if it's set. - const char* android_runtime_root_from_env = getenv(kAndroidRuntimeRootEnvVar); - if (android_runtime_root_from_env != nullptr) { - if (must_exist && !OS::DirectoryExists(android_runtime_root_from_env)) { + // Prefer ANDROID_ART_ROOT if it's set. + const char* android_art_root_from_env = getenv(kAndroidArtRootEnvVar); + if (android_art_root_from_env != nullptr) { + if (must_exist && !OS::DirectoryExists(android_art_root_from_env)) { *error_msg = StringPrintf("Failed to find %s directory %s", - kAndroidRuntimeRootEnvVar, - android_runtime_root_from_env); + kAndroidArtRootEnvVar, + android_art_root_from_env); return ""; } - return android_runtime_root_from_env; + return android_art_root_from_env; } // On target, libartbase is normally installed in - // "$ANDROID_RUNTIME_ROOT/lib(64)" (e.g. something like + // "$ANDROID_ART_ROOT/lib(64)" (e.g. something like // "/apex/com.android.art/lib(64)". Use this information to infer the // location of the ART Root (on target only). if (kIsTargetBuild) { @@ -214,7 +214,7 @@ static std::string GetAndroidRuntimeRootSafe(bool must_exist, /*out*/ std::strin // 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 + // ANDROID_ART_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 @@ -229,7 +229,7 @@ static std::string GetAndroidRuntimeRootSafe(bool must_exist, /*out*/ std::strin // Try the default path. if (must_exist && !OS::DirectoryExists(kAndroidArtApexDefaultPath)) { - *error_msg = StringPrintf("Failed to find default ART Root directory %s", + *error_msg = StringPrintf("Failed to find default ART root directory %s", kAndroidArtApexDefaultPath); return ""; } @@ -237,13 +237,13 @@ static std::string GetAndroidRuntimeRootSafe(bool must_exist, /*out*/ std::strin #endif } -std::string GetAndroidRuntimeRootSafe(std::string* error_msg) { - return GetAndroidRuntimeRootSafe(/* must_exist= */ true, error_msg); +std::string GetArtRootSafe(std::string* error_msg) { + return GetArtRootSafe(/* must_exist= */ true, error_msg); } -std::string GetAndroidRuntimeRoot() { +std::string GetArtRoot() { std::string error_msg; - std::string ret = GetAndroidRuntimeRootSafe(&error_msg); + std::string ret = GetArtRootSafe(&error_msg); if (ret.empty()) { LOG(FATAL) << error_msg; UNREACHABLE(); @@ -251,15 +251,15 @@ std::string GetAndroidRuntimeRoot() { return ret; } -std::string GetAndroidRuntimeBinDir() { - // Environment variable `ANDROID_RUNTIME_ROOT` is defined as +std::string GetArtBinDir() { + // Environment variable `ANDROID_ART_ROOT` is defined as // `$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 + // situation is cleaner on target, where `ANDROID_ART_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"; + std::string android_art_root = kIsTargetBuild ? GetArtRoot() : GetAndroidRoot(); + return android_art_root + "/bin"; } std::string GetAndroidDataSafe(std::string* error_msg) { @@ -380,10 +380,9 @@ std::string ReplaceFileExtension(const std::string& filename, const std::string& } } -bool LocationIsOnRuntimeModule(const char* full_path) { +bool LocationIsOnArtModule(const char* full_path) { std::string unused_error_msg; - std::string module_path = - GetAndroidRuntimeRootSafe(/* must_exist= */ kIsTargetBuild, &unused_error_msg); + std::string module_path = GetArtRootSafe(/* must_exist= */ kIsTargetBuild, &unused_error_msg); if (module_path.empty()) { return false; } @@ -466,19 +465,19 @@ bool LocationIsOnSystem(const char* path) { #endif } -bool RuntimeModuleRootDistinctFromAndroidRoot() { +bool ArtModuleRootDistinctFromAndroidRoot() { std::string error_msg; const char* android_root = GetAndroidDirSafe(kAndroidRootEnvVar, kAndroidRootDefaultPath, /* must_exist= */ kIsTargetBuild, &error_msg); - const char* runtime_root = GetAndroidDirSafe(kAndroidRuntimeRootEnvVar, - kAndroidArtApexDefaultPath, - /* must_exist= */ kIsTargetBuild, - &error_msg); + const char* art_root = GetAndroidDirSafe(kAndroidArtRootEnvVar, + kAndroidArtApexDefaultPath, + /* must_exist= */ kIsTargetBuild, + &error_msg); return (android_root != nullptr) - && (runtime_root != nullptr) - && (std::string_view(android_root) != std::string_view(runtime_root)); + && (art_root != nullptr) + && (std::string_view(android_root) != std::string_view(art_root)); } int DupCloexec(int fd) { diff --git a/libartbase/base/file_utils.h b/libartbase/base/file_utils.h index 776dc3df83..6a57fbd9d8 100644 --- a/libartbase/base/file_utils.h +++ b/libartbase/base/file_utils.h @@ -39,21 +39,19 @@ std::string GetAndroidRoot(); // Find $ANDROID_ROOT, /system, or return an empty string. 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.art". On host, this is usually a subdirectory of the -// Android Root, e.g. -// "$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. +// These methods return the ART Root, which is the location of the (activated) +// ART APEX module. On target, this is normally "/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.art". The location of the +// ART root can be overridden using the ANDROID_ART_ROOT environment variable. // -// Find $ANDROID_RUNTIME_ROOT, /apex/com.android.art, or abort. -std::string GetAndroidRuntimeRoot(); -// Find $ANDROID_RUNTIME_ROOT, /apex/com.android.art, or return an empty string. -std::string GetAndroidRuntimeRootSafe(/*out*/ std::string* error_msg); +// Find $ANDROID_ART_ROOT, /apex/com.android.art, or abort. +std::string GetArtRoot(); +// Find $ANDROID_ART_ROOT, /apex/com.android.art, or return an empty string. +std::string GetArtRootSafe(/*out*/ std::string* error_msg); -// Return the path to the directory containing the Android Runtime binaries. -std::string GetAndroidRuntimeBinDir(); +// Return the path to the directory containing the ART binaries. +std::string GetArtBinDir(); // Find $ANDROID_DATA, /data, or abort. std::string GetAndroidData(); @@ -97,7 +95,7 @@ std::string GetVdexFilename(const std::string& oat_filename); std::string ReplaceFileExtension(const std::string& filename, const std::string& new_extension); // Return whether the location is on /apex/com.android.art -bool LocationIsOnRuntimeModule(const char* location); +bool LocationIsOnArtModule(const char* location); // Return whether the location is on /apex/com.android.conscrypt bool LocationIsOnConscryptModule(const char* location); @@ -111,9 +109,9 @@ bool LocationIsOnSystemFramework(const char* location); // Return whether the location is on /apex/. bool LocationIsOnApex(const char* location); -// Compare the runtime module root against android root. Returns true if they are +// Compare the ART module root against android root. Returns true if they are // both known and distinct. This is meant to be a proxy for 'running with apex'. -bool RuntimeModuleRootDistinctFromAndroidRoot(); +bool ArtModuleRootDistinctFromAndroidRoot(); // dup(2), except setting the O_CLOEXEC flag atomically, when possible. int DupCloexec(int fd); diff --git a/libartbase/base/file_utils_test.cc b/libartbase/base/file_utils_test.cc index b26395b9c2..85c110465f 100644 --- a/libartbase/base/file_utils_test.cc +++ b/libartbase/base/file_utils_test.cc @@ -100,51 +100,50 @@ TEST_F(FileUtilsTest, GetAndroidRootSafe) { ASSERT_EQ(0, setenv("ANDROID_ROOT", android_root_env.c_str(), /* overwrite */ 1)); } -TEST_F(FileUtilsTest, GetAndroidRuntimeRootSafe) { +TEST_F(FileUtilsTest, GetArtRootSafe) { std::string error_msg; - std::string android_runtime_root; - std::string android_runtime_root_env; + std::string android_art_root; + std::string android_art_root_env; // TODO(b/130295968): Re-enable this part when the directory exists on host if (kIsTargetBuild) { // We don't expect null returns for most cases, so don't check and let std::string crash. - // CommonArtTest sets ANDROID_RUNTIME_ROOT, so expect this to be the same. - android_runtime_root = GetAndroidRuntimeRootSafe(&error_msg); - android_runtime_root_env = getenv("ANDROID_RUNTIME_ROOT"); - EXPECT_EQ(android_runtime_root, android_runtime_root_env) << error_msg; + // CommonArtTest sets ANDROID_ART_ROOT, so expect this to be the same. + android_art_root = GetArtRootSafe(&error_msg); + android_art_root_env = getenv("ANDROID_ART_ROOT"); + EXPECT_EQ(android_art_root, android_art_root_env) << error_msg; - // Set ANDROID_RUNTIME_ROOT to something else (but the directory must exist). So use dirname. - UniqueCPtr<char> root_dup(strdup(android_runtime_root_env.c_str())); + // Set ANDROID_ART_ROOT to something else (but the directory must exist). So use dirname. + UniqueCPtr<char> root_dup(strdup(android_art_root_env.c_str())); char* dir = dirname(root_dup.get()); - ASSERT_EQ(0, setenv("ANDROID_RUNTIME_ROOT", dir, /* overwrite */ 1)); - std::string android_runtime_root2 = GetAndroidRuntimeRootSafe(&error_msg); - EXPECT_STREQ(dir, android_runtime_root2.c_str()) << error_msg; + ASSERT_EQ(0, setenv("ANDROID_ART_ROOT", dir, /* overwrite */ 1)); + std::string android_art_root2 = GetArtRootSafe(&error_msg); + EXPECT_STREQ(dir, android_art_root2.c_str()) << error_msg; } - // Set a bogus value for ANDROID_RUNTIME_ROOT. This should be an error. - ASSERT_EQ(0, setenv("ANDROID_RUNTIME_ROOT", "/this/is/obviously/bogus", /* overwrite */ 1)); - EXPECT_EQ(GetAndroidRuntimeRootSafe(&error_msg), ""); + // Set a bogus value for ANDROID_ART_ROOT. This should be an error. + ASSERT_EQ(0, setenv("ANDROID_ART_ROOT", "/this/is/obviously/bogus", /* overwrite */ 1)); + EXPECT_EQ(GetArtRootSafe(&error_msg), ""); - // Inferring the Android Runtime Root from the location of libartbase only works on target. + // Inferring the ART root from the location of libartbase only works on target. if (kIsTargetBuild) { // Disabled for now, as we cannot reliably use `GetRootContainingLibartbase` - // to find the Android Runtime Root on target yet (see comment in - // `GetAndroidRuntimeRootSafe`). + // to find the ART root on target yet (see comment in `GetArtRootSafe`). // // TODO(b/129534335): Re-enable this part of the test on target when the - // only instance of libartbase is the one from the Runtime APEX. + // only instance of libartbase is the one from the ART APEX. if ((false)) { - // Unset ANDROID_RUNTIME_ROOT and see that it still returns something (as + // Unset ANDROID_ART_ROOT and see that it still returns something (as // libartbase code is running). - ASSERT_EQ(0, unsetenv("ANDROID_RUNTIME_ROOT")); - std::string android_runtime_root3 = GetAndroidRuntimeRootSafe(&error_msg); + ASSERT_EQ(0, unsetenv("ANDROID_ART_ROOT")); + std::string android_art_root3 = GetArtRootSafe(&error_msg); // This should be the same as the other root (modulo realpath), otherwise // the test setup is broken. On non-bionic. On bionic we can be running - // with a different libartbase that lives outside of ANDROID_RUNTIME_ROOT. - UniqueCPtr<char> real_root3(realpath(android_runtime_root3.c_str(), nullptr)); + // with a different libartbase that lives outside of ANDROID_ART_ROOT. + UniqueCPtr<char> real_root3(realpath(android_art_root3.c_str(), nullptr)); #if !defined(__BIONIC__ ) || defined(__ANDROID__) - UniqueCPtr<char> real_root(realpath(android_runtime_root.c_str(), nullptr)); + UniqueCPtr<char> real_root(realpath(android_art_root.c_str(), nullptr)); EXPECT_STREQ(real_root.get(), real_root3.get()) << error_msg; #else EXPECT_STRNE(real_root3.get(), "") << error_msg; @@ -152,8 +151,8 @@ TEST_F(FileUtilsTest, GetAndroidRuntimeRootSafe) { } } - // Reset ANDROID_RUNTIME_ROOT, as other things may depend on it. - ASSERT_EQ(0, setenv("ANDROID_RUNTIME_ROOT", android_runtime_root_env.c_str(), /* overwrite */ 1)); + // Reset ANDROID_ART_ROOT, as other things may depend on it. + ASSERT_EQ(0, setenv("ANDROID_ART_ROOT", android_art_root_env.c_str(), /* overwrite */ 1)); } TEST_F(FileUtilsTest, ReplaceFileExtension) { diff --git a/oatdump/oatdump_test.h b/oatdump/oatdump_test.h index 7c5149dcda..00672b8ab0 100644 --- a/oatdump/oatdump_test.h +++ b/oatdump/oatdump_test.h @@ -72,7 +72,7 @@ class OatDumpTest : public CommonRuntimeTest { // Returns path to the oatdump/dex2oat/dexdump binary. std::string GetExecutableFilePath(const char* name, bool is_debug, bool is_static) { - std::string path = GetAndroidRuntimeBinDir() + '/' + name; + std::string path = GetArtBinDir() + '/' + name; if (is_debug) { path += 'd'; } diff --git a/profman/profile_assistant_test.cc b/profman/profile_assistant_test.cc index c16b26cfde..cc2772a55c 100644 --- a/profman/profile_assistant_test.cc +++ b/profman/profile_assistant_test.cc @@ -198,7 +198,7 @@ class ProfileAssistantTest : public CommonRuntimeTest { } std::string GetProfmanCmd() { - std::string file_path = GetAndroidRuntimeBinDir() + "/profman"; + std::string file_path = GetArtBinDir() + "/profman"; if (kIsDebugBuild) { file_path += "d"; } diff --git a/runtime/hidden_api.cc b/runtime/hidden_api.cc index 388ed33dfa..98774bdf2d 100644 --- a/runtime/hidden_api.cc +++ b/runtime/hidden_api.cc @@ -76,10 +76,10 @@ static inline std::ostream& operator<<(std::ostream& os, const AccessContext& va static Domain DetermineDomainFromLocation(const std::string& dex_location, ObjPtr<mirror::ClassLoader> class_loader) { // If running with APEX, check `path` against known APEX locations. - // These checks will be skipped on target buildbots where ANDROID_RUNTIME_ROOT + // These checks will be skipped on target buildbots where ANDROID_ART_ROOT // is set to "/system". - if (RuntimeModuleRootDistinctFromAndroidRoot()) { - if (LocationIsOnRuntimeModule(dex_location.c_str()) || + if (ArtModuleRootDistinctFromAndroidRoot()) { + if (LocationIsOnArtModule(dex_location.c_str()) || LocationIsOnConscryptModule(dex_location.c_str())) { return Domain::kCorePlatform; } diff --git a/runtime/jit/jit.cc b/runtime/jit/jit.cc index c9b458fb49..08883fcdea 100644 --- a/runtime/jit/jit.cc +++ b/runtime/jit/jit.cc @@ -941,8 +941,8 @@ uint32_t Jit::CompileMethodsFromProfile( ClassLinker* class_linker = Runtime::Current()->GetClassLinker(); uint32_t added_to_queue = 0u; for (const DexFile* dex_file : dex_files) { - if (LocationIsOnRuntimeModule(dex_file->GetLocation().c_str())) { - // The runtime module jars are already preopted. + if (LocationIsOnArtModule(dex_file->GetLocation().c_str())) { + // The ART module jars are already preopted. continue; } // To speed up class lookups, generate a type lookup table for diff --git a/runtime/runtime.cc b/runtime/runtime.cc index c5d87fcca3..499dbf0a0f 100644 --- a/runtime/runtime.cc +++ b/runtime/runtime.cc @@ -799,7 +799,7 @@ std::string Runtime::GetCompilerExecutable() const { if (!compiler_executable_.empty()) { return compiler_executable_; } - std::string compiler_executable = GetAndroidRuntimeBinDir() + "/dex2oat"; + std::string compiler_executable = GetArtBinDir() + "/dex2oat"; if (kIsDebugBuild) { compiler_executable += 'd'; } diff --git a/test/900-hello-plugin/run b/test/900-hello-plugin/run index 633b544921..a19a38cd95 100755 --- a/test/900-hello-plugin/run +++ b/test/900-hello-plugin/run @@ -35,9 +35,8 @@ if [[ "$@" != *"--host"* ]]; then test_native_lib_path=$("$ANDROID_BUILD_TOP/art/test/utils/get-device-test-native-lib-path" \ "$bitness_flag") - # The linker configuration used for dalvikvm(64) in the Runtime APEX - # requires us to pass the full path to the agent to the runtime when - # running on device. + # The linker configuration used for dalvikvm(64) in the ART APEX requires us + # to pass the full path to the agent to the runtime when running on device. plugin=${test_native_lib_path}/${plugin} fi diff --git a/test/909-attach-agent/run b/test/909-attach-agent/run index 017a1400e3..add558e963 100755 --- a/test/909-attach-agent/run +++ b/test/909-attach-agent/run @@ -45,9 +45,8 @@ if [[ "$@" != *"--host"* ]]; then test_native_lib_path=$("$ANDROID_BUILD_TOP/art/test/utils/get-device-test-native-lib-path" \ "$bitness_flag") - # The linker configuration used for dalvikvm(64) in the Runtime APEX - # requires us to pass the full path to the agent to the runtime when - # running on device. + # The linker configuration used for dalvikvm(64) in the ART APEX requires us + # to pass the full path to the agent to the runtime when running on device. agent=${test_native_lib_path}/${agent} # The above agent path is an absolute one; append the root directory to the diff --git a/test/README.chroot.md b/test/README.chroot.md index a694a9a2f1..f24eba3e20 100644 --- a/test/README.chroot.md +++ b/test/README.chroot.md @@ -38,6 +38,7 @@ Note that using this chroot-based approach requires root access to the device ```bash unset ART_TEST_ANDROID_ROOT unset CUSTOM_TARGET_LINKER + unset ART_TEST_ANDROID_ART_ROOT unset ART_TEST_ANDROID_RUNTIME_ROOT unset ART_TEST_ANDROID_I18N_ROOT unset ART_TEST_ANDROID_TZDATA_ROOT diff --git a/test/etc/run-test-jar b/test/etc/run-test-jar index 32cf1a0a54..591c8a6814 100755 --- a/test/etc/run-test-jar +++ b/test/etc/run-test-jar @@ -14,8 +14,8 @@ msg() { } ANDROID_ROOT="/system" +ANDROID_ART_ROOT="/apex/com.android.art" ANDROID_I18N_ROOT="/apex/com.android.i18n" -ANDROID_RUNTIME_ROOT="/apex/com.android.art" ANDROID_TZDATA_ROOT="/apex/com.android.tzdata" ARCHITECTURES_32="(arm|x86|mips|none)" ARCHITECTURES_64="(arm64|x86_64|mips64|none)" @@ -230,8 +230,8 @@ while true; do elif [ "x$1" = "x--host" ]; then HOST="y" ANDROID_ROOT="${ANDROID_HOST_OUT}" + ANDROID_ART_ROOT="${ANDROID_HOST_OUT}/com.android.art" ANDROID_I18N_ROOT="${ANDROID_HOST_OUT}/com.android.i18n" - ANDROID_RUNTIME_ROOT="${ANDROID_HOST_OUT}/com.android.art" ANDROID_TZDATA_ROOT="${ANDROID_HOST_OUT}/com.android.tzdata" shift elif [ "x$1" = "x--bionic" ]; then @@ -304,8 +304,8 @@ while true; do TIME_OUT="n" HOST="y" ANDROID_ROOT="${ANDROID_HOST_OUT}" + ANDROID_ART_ROOT="${ANDROID_HOST_OUT}/com.android.art" ANDROID_I18N_ROOT="${ANDROID_HOST_OUT}/com.android.i18n" - ANDROID_RUNTIME_ROOT="${ANDROID_HOST_OUT}/com.android.art" ANDROID_TZDATA_ROOT="${ANDROID_HOST_OUT}/com.android.tzdata" shift elif [ "x$1" = "x--gdb" ]; then @@ -371,9 +371,9 @@ while true; do shift ANDROID_I18N_ROOT="$1" shift - elif [ "x$1" = "x--android-runtime-root" ]; then + elif [ "x$1" = "x--android-art-root" ]; then shift - ANDROID_RUNTIME_ROOT="$1" + ANDROID_ART_ROOT="$1" shift elif [ "x$1" = "x--android-tzdata-root" ]; then shift @@ -592,7 +592,7 @@ if [ "$IS_JVMTI_TEST" = "y" ]; then if [[ "$HOST" = "y" ]]; then FLAGS="${FLAGS} -agentpath:${agent}=${TEST_NAME},art" else - # The linker configuration used for dalvikvm(64) in the Runtime APEX + # The linker configuration used for dalvikvm(64) in the ART APEX # requires us to pass the full path to the agent to the runtime when # running on device. FLAGS="${FLAGS} -agentpath:/data/${TEST_DIRECTORY}/art/${ISA}/${agent}=${TEST_NAME},art" @@ -630,7 +630,7 @@ if [[ "$JVMTI_STRESS" = "y" ]]; then if [[ "$HOST" = "y" ]]; then FLAGS="${FLAGS} -agentpath:${agent}=${agent_args}" else - # The linker configuration used for dalvikvm(64) in the Runtime APEX + # The linker configuration used for dalvikvm(64) in the ART APEX # requires us to pass the full path to the agent to the runtime when # running on device. FLAGS="${FLAGS} -agentpath:/data/${TEST_DIRECTORY}/art/${ISA}/${agent}=${agent_args}" @@ -806,15 +806,14 @@ if [ "$HOST" = "y" ]; then # directory under the "Android Root" (usually `out/host/linux-x86`). # # TODO(b/130295968): Adjust this if/when ART host artifacts are installed - # under the Android Runtime Root (usually - # `out/host/linux-x86/com.android.art`). - ANDROID_RUNTIME_BIN_DIR=$ANDROID_ROOT/bin + # under the ART root (usually `out/host/linux-x86/com.android.art`). + ANDROID_ART_BIN_DIR=$ANDROID_ROOT/bin else - # On target, run binaries (`dex2oat(d)`, `dalvikvm`, `profman`) from the - # Runtime APEX's `bin` directory. This means the linker will observe the - # Runtime APEX linker configuration file - # (`/apex/com.android.art/etc/ld.config.txt`) for these binaries. - ANDROID_RUNTIME_BIN_DIR=$ANDROID_RUNTIME_ROOT/bin + # On target, run binaries (`dex2oat(d)`, `dalvikvm`, `profman`) from the ART + # APEX's `bin` directory. This means the linker will observe the ART APEX + # linker configuration file (`/apex/com.android.art/etc/ld.config.txt`) for + # these binaries. + ANDROID_ART_BIN_DIR=$ANDROID_ART_ROOT/bin fi profman_cmdline="true" @@ -852,10 +851,10 @@ if [ "$USE_ZIPAPEX" = "y" ]; then fi setupapex_cmdline="unzip -o -u ${zip_options} ${ZIPAPEX_LOC} apex_payload.zip -d ${DEX_LOCATION}" installapex_cmdline="unzip -o -u ${zip_options} ${DEX_LOCATION}/apex_payload.zip -d ${DEX_LOCATION}/zipapex" - ANDROID_RUNTIME_BIN_DIR=$DEX_LOCATION/zipapex/bin + ANDROID_ART_BIN_DIR=$DEX_LOCATION/zipapex/bin elif [ "$USE_EXTRACTED_ZIPAPEX" = "y" ]; then # Just symlink the zipapex binaries - ANDROID_RUNTIME_BIN_DIR=$DEX_LOCATION/zipapex/bin + ANDROID_ART_BIN_DIR=$DEX_LOCATION/zipapex/bin # Force since some tests manually run this file twice. ln_options="" if [ "$DEV_MODE" = "y" ]; then @@ -867,7 +866,7 @@ fi # PROFILE takes precedence over RANDOM_PROFILE, since PROFILE tests require a # specific profile to run properly. if [ "$PROFILE" = "y" ] || [ "$RANDOM_PROFILE" = "y" ]; then - profman_cmdline="$ANDROID_RUNTIME_BIN_DIR/profman \ + profman_cmdline="$ANDROID_ART_BIN_DIR/profman \ --apk=$DEX_LOCATION/$TEST_NAME.jar \ --dex-location=$DEX_LOCATION/$TEST_NAME.jar" if [ -f $DEX_LOCATION/$TEST_NAME-ex.jar ]; then @@ -897,7 +896,7 @@ if [ "$PREBUILD" = "y" ]; then if [[ "$TEST_IS_NDEBUG" = "y" ]]; then dex2oat_binary=${DEX2OAT_NDEBUG_BINARY} fi - dex2oat_cmdline="$INVOKE_WITH $ANDROID_RUNTIME_BIN_DIR/$dex2oat_binary \ + dex2oat_cmdline="$INVOKE_WITH $ANDROID_ART_BIN_DIR/$dex2oat_binary \ $COMPILE_FLAGS \ --boot-image=${BOOT_IMAGE} \ --dex-file=$DEX_LOCATION/$TEST_NAME.jar \ @@ -958,7 +957,7 @@ fi # We set DumpNativeStackOnSigQuit to false to avoid stressing libunwind. # b/27185632 # b/24664297 -dalvikvm_cmdline="$INVOKE_WITH $GDB $ANDROID_RUNTIME_BIN_DIR/$DALVIKVM \ +dalvikvm_cmdline="$INVOKE_WITH $GDB $ANDROID_ART_BIN_DIR/$DALVIKVM \ $GDB_ARGS \ $FLAGS \ $DEX_VERIFY \ @@ -1062,7 +1061,7 @@ if [ "$HOST" = "n" ]; then fi # Prepend directories to the path on device. - PREPEND_TARGET_PATH=$ANDROID_RUNTIME_BIN_DIR + PREPEND_TARGET_PATH=$ANDROID_ART_BIN_DIR if [ "$ANDROID_ROOT" != "/system" ]; then PREPEND_TARGET_PATH="$PREPEND_TARGET_PATH:$ANDROID_ROOT/bin" fi @@ -1119,7 +1118,7 @@ if [ "$HOST" = "n" ]; then export DEX_LOCATION=$DEX_LOCATION && \ export ANDROID_ROOT=$ANDROID_ROOT && \ export ANDROID_I18N_ROOT=$ANDROID_I18N_ROOT && \ - export ANDROID_RUNTIME_ROOT=$ANDROID_RUNTIME_ROOT && \ + export ANDROID_ART_ROOT=$ANDROID_ART_ROOT && \ export ANDROID_TZDATA_ROOT=$ANDROID_TZDATA_ROOT && \ export ANDROID_LOG_TAGS=$ANDROID_LOG_TAGS && \ rm -rf ${DEX_LOCATION}/dalvik-cache/ && \ @@ -1166,7 +1165,7 @@ else export ANDROID_DATA="$DEX_LOCATION" export ANDROID_ROOT="${ANDROID_ROOT}" export ANDROID_I18N_ROOT="${ANDROID_I18N_ROOT}" - export ANDROID_RUNTIME_ROOT="${ANDROID_RUNTIME_ROOT}" + export ANDROID_ART_ROOT="${ANDROID_ART_ROOT}" export ANDROID_TZDATA_ROOT="${ANDROID_TZDATA_ROOT}" if [ "$USE_ZIPAPEX" = "y" ] || [ "$USE_EXRACTED_ZIPAPEX" = "y" ]; then # Put the zipapex files in front of the ld-library-path @@ -1176,7 +1175,7 @@ else export LD_LIBRARY_PATH="${ANDROID_ROOT}/${LIBRARY_DIRECTORY}:${ANDROID_ROOT}/${TEST_DIRECTORY}" export DYLD_LIBRARY_PATH="${ANDROID_ROOT}/${LIBRARY_DIRECTORY}:${ANDROID_ROOT}/${TEST_DIRECTORY}" fi - export PATH="$PATH:$ANDROID_RUNTIME_BIN_DIR" + export PATH="$PATH:$ANDROID_ART_BIN_DIR" # Temporarily disable address space layout randomization (ASLR). # This is needed on the host so that the linker loads core.oat at the necessary address. @@ -1213,7 +1212,7 @@ else fi if [ "$DEV_MODE" = "y" ]; then - for var in ANDROID_PRINTF_LOG ANDROID_DATA ANDROID_ROOT ANDROID_I18N_ROOT ANDROID_TZDATA_ROOT ANDROID_RUNTIME_ROOT LD_LIBRARY_PATH DYLD_LIBRARY_PATH PATH LD_USE_LOAD_BIAS; do + for var in ANDROID_PRINTF_LOG ANDROID_DATA ANDROID_ROOT ANDROID_I18N_ROOT ANDROID_TZDATA_ROOT ANDROID_ART_ROOT LD_LIBRARY_PATH DYLD_LIBRARY_PATH PATH LD_USE_LOAD_BIAS; do echo EXPORT $var=${!var} done echo "$(declare -f linkdirs)" diff --git a/test/run-test b/test/run-test index 218c989c3f..2214d6cf35 100755 --- a/test/run-test +++ b/test/run-test @@ -399,14 +399,14 @@ while true; do android_root="$1" run_args+=(--android-root "$1") shift - elif [ "x$1" = "x--android-runtime-root" ]; then + elif [ "x$1" = "x--android-art-root" ]; then shift if [ "x$1" = "x" ]; then - echo "$0 missing argument to --android-runtime-root" 1>&2 + echo "$0 missing argument to --android-art-root" 1>&2 usage="yes" break fi - run_args+=(--android-runtime-root "$1") + run_args+=(--android-art-root "$1") shift elif [ "x$1" = "x--android-tzdata-root" ]; then shift @@ -813,8 +813,8 @@ if [ "$usage" = "yes" ]; then echo " --android-i18n-root [path]" echo " The path on target for the i18n module root." echo " (/apex/com.android.i18n by default)." - echo " --android-runtime-root [path]" - echo " The path on target for the Android Runtime root." + echo " --android-art-root [path]" + echo " The path on target for the ART module root." echo " (/apex/com.android.art by default)." echo " --android-tzdata-root [path]" echo " The path on target for the Android Time Zone Data root." diff --git a/test/testrunner/env.py b/test/testrunner/env.py index 56d372d155..6c9447df74 100644 --- a/test/testrunner/env.py +++ b/test/testrunner/env.py @@ -90,8 +90,8 @@ HOST_2ND_ARCH_PREFIX_DEX2OAT_HOST_INSTRUCTION_SET_FEATURES = _env.get( ART_TEST_CHROOT = _env.get('ART_TEST_CHROOT') ART_TEST_ANDROID_ROOT = _env.get('ART_TEST_ANDROID_ROOT') +ART_TEST_ANDROID_ART_ROOT = _env.get('ART_TEST_ANDROID_ART_ROOT') ART_TEST_ANDROID_I18N_ROOT = _env.get('ART_TEST_ANDROID_I18N_ROOT') -ART_TEST_ANDROID_RUNTIME_ROOT = _env.get('ART_TEST_ANDROID_RUNTIME_ROOT') ART_TEST_ANDROID_TZDATA_ROOT = _env.get('ART_TEST_ANDROID_TZDATA_ROOT') ART_TEST_WITH_STRACE = _getEnvBoolean('ART_TEST_DEBUG_GC', False) diff --git a/test/testrunner/testrunner.py b/test/testrunner/testrunner.py index 509852cacb..1fddfe8469 100755 --- a/test/testrunner/testrunner.py +++ b/test/testrunner/testrunner.py @@ -399,8 +399,9 @@ def run_tests(tests): elif target == 'jvm': options_test += ' --jvm' - # Honor ART_TEST_CHROOT, ART_TEST_ANDROID_ROOT, ART_TEST_ANDROID_RUNTIME_ROOT, - # ART_TEST_ANDROID_I18N_ROOT, and ART_TEST_ANDROID_TZDATA_ROOT but only for target tests. + # Honor ART_TEST_CHROOT, ART_TEST_ANDROID_ROOT, ART_TEST_ANDROID_ART_ROOT, + # ART_TEST_ANDROID_I18N_ROOT, and ART_TEST_ANDROID_TZDATA_ROOT but only + # for target tests. if target == 'target': if env.ART_TEST_CHROOT: options_test += ' --chroot ' + env.ART_TEST_CHROOT @@ -408,8 +409,8 @@ def run_tests(tests): options_test += ' --android-root ' + env.ART_TEST_ANDROID_ROOT if env.ART_TEST_ANDROID_I18N_ROOT: options_test += ' --android-i18n-root ' + env.ART_TEST_ANDROID_I18N_ROOT - if env.ART_TEST_ANDROID_RUNTIME_ROOT: - options_test += ' --android-runtime-root ' + env.ART_TEST_ANDROID_RUNTIME_ROOT + if env.ART_TEST_ANDROID_ART_ROOT: + options_test += ' --android-art-root ' + env.ART_TEST_ANDROID_ART_ROOT if env.ART_TEST_ANDROID_TZDATA_ROOT: options_test += ' --android-tzdata-root ' + env.ART_TEST_ANDROID_TZDATA_ROOT @@ -200,7 +200,7 @@ function run_dex2oat() { verbose_run ANDROID_DATA=$ANDROID_DATA \ ANDROID_ROOT=$ANDROID_ROOT \ ANDROID_I18N_ROOT=$ANDROID_I18N_ROOT \ - ANDROID_RUNTIME_ROOT=$ANDROID_RUNTIME_ROOT \ + ANDROID_ART_ROOT=$ANDROID_ART_ROOT \ ANDROID_TZDATA_ROOT=$ANDROID_TZDATA_ROOT \ LD_LIBRARY_PATH=$LD_LIBRARY_PATH \ PATH=$ANDROID_ROOT/bin:$PATH \ @@ -276,8 +276,8 @@ function run_art() { # Run dalvikvm. verbose_run ANDROID_DATA="$ANDROID_DATA" \ ANDROID_ROOT="$ANDROID_ROOT" \ - ANDROID_I18N_ROOT=$ANDROID_I18N_ROOT \ - ANDROID_RUNTIME_ROOT="$ANDROID_RUNTIME_ROOT" \ + ANDROID_I18N_ROOT="$ANDROID_I18N_ROOT" \ + ANDROID_ART_ROOT="$ANDROID_ART_ROOT" \ ANDROID_TZDATA_ROOT="$ANDROID_TZDATA_ROOT" \ LD_LIBRARY_PATH="$LD_LIBRARY_PATH" \ PATH="$ANDROID_ROOT/bin:$PATH" \ @@ -426,24 +426,24 @@ if [ -z "$ANDROID_I18N_ROOT" ]; then fi fi -# If ANDROID_RUNTIME_ROOT is not set, try to detect whether we are running on +# If ANDROID_ART_ROOT is not set, try to detect whether we are running on # target or host and set that environment variable to the usual default value. -if [ -z "$ANDROID_RUNTIME_ROOT" ]; then +if [ -z "$ANDROID_ART_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 + # default value `ANDROID_ART_ROOT` is not the same on host and target: + # - on host, `ANDROID_ART_ROOT` is expected to be # "$ANDROID_ROOT/com.android.art"; - # - on target, `ANDROID_RUNTIME_ROOT` is expected to be + # - on target, `ANDROID_ART_ROOT` is expected to be # "/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.art" + ANDROID_ART_ROOT="/apex/com.android.art" else # Host case. - ANDROID_RUNTIME_ROOT="$ANDROID_ROOT/com.android.art" + ANDROID_ART_ROOT="$ANDROID_ROOT/com.android.art" fi fi diff --git a/tools/buildbot-build.sh b/tools/buildbot-build.sh index cf5461e6cd..2410164764 100755 --- a/tools/buildbot-build.sh +++ b/tools/buildbot-build.sh @@ -85,8 +85,8 @@ elif [[ $mode == "target" ]]; then make_command+=" com.android.runtime" # Build the Testing ART APEX (which is a superset of the Release and Debug ART APEXes). make_command+=" com.android.art.testing" - # Build the system linker configuration, which is needed to use the - # Runtime APEX's linker configuration. + # Build the system linker configuration, which is needed to use the ART APEX's + # linker configuration. make_command+=" ld.config.txt " # Build the bootstrap Bionic artifacts links (linker, libc, libdl, libm). # These targets create these symlinks: diff --git a/tools/common/common.py b/tools/common/common.py index 93b014ab10..fc9d879aa9 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.art' + android_art_root = android_root + '/com.android.art' android_tzdata_root = android_root + '/com.android.tzdata' library_path = android_root + '/' + lib path = android_root + '/bin' @@ -308,7 +308,7 @@ class HostTestEnv(ITestEnv): self._shell_env['ANDROID_DATA'] = self._env_path self._shell_env['ANDROID_ROOT'] = android_root self._shell_env['ANDROID_I18N_ROOT'] = android_i18n_root - self._shell_env['ANDROID_RUNTIME_ROOT'] = android_runtime_root + self._shell_env['ANDROID_ART_ROOT'] = android_art_root self._shell_env['ANDROID_TZDATA_ROOT'] = android_tzdata_root self._shell_env['LD_LIBRARY_PATH'] = library_path self._shell_env['DYLD_LIBRARY_PATH'] = library_path diff --git a/tools/dexanalyze/dexanalyze_test.cc b/tools/dexanalyze/dexanalyze_test.cc index 3bfbc79b84..9e6ed6df67 100644 --- a/tools/dexanalyze/dexanalyze_test.cc +++ b/tools/dexanalyze/dexanalyze_test.cc @@ -22,7 +22,7 @@ namespace art { class DexAnalyzeTest : public CommonRuntimeTest { public: std::string GetDexAnalyzePath() { - return GetAndroidRuntimeBinDir() + "/dexanalyze"; + return GetArtBinDir() + "/dexanalyze"; } void DexAnalyzeExec(const std::vector<std::string>& args, bool expect_success) { diff --git a/tools/hiddenapi/hiddenapi_test.cc b/tools/hiddenapi/hiddenapi_test.cc index 337fae4850..41eb4db9cc 100644 --- a/tools/hiddenapi/hiddenapi_test.cc +++ b/tools/hiddenapi/hiddenapi_test.cc @@ -31,7 +31,7 @@ namespace art { class HiddenApiTest : public CommonRuntimeTest { protected: std::string GetHiddenApiCmd() { - std::string file_path = GetAndroidRuntimeBinDir() + "/hiddenapi"; + std::string file_path = GetArtBinDir() + "/hiddenapi"; if (kIsDebugBuild) { file_path += 'd'; } diff --git a/tools/host_bcp.sh b/tools/host_bcp.sh index 1dea295ba4..0a78fb4373 100755 --- a/tools/host_bcp.sh +++ b/tools/host_bcp.sh @@ -59,13 +59,13 @@ for m in `ls -1 -d ${ANDROID_PRODUCT_OUT}{,/system}${ART_APEX}*${MANIFEST} 2>/de if [[ $USE_FIRST_DIR == true ]]; then break fi - echo "Multiple Runtime apex dirs: ${ART_APEX_SELECTED}, ${d}." + echo "Multiple ART APEX dirs: ${ART_APEX_SELECTED}, ${d}." exit 1 fi ART_APEX_SELECTED=${d} done if [[ "x${ART_APEX_SELECTED}" == "x" ]]; then - echo "No Runtime apex dir." + echo "No ART APEX dir." exit 1 fi diff --git a/tools/run-gtests.sh b/tools/run-gtests.sh index 8241c836fe..5a4ab3a777 100755 --- a/tools/run-gtests.sh +++ b/tools/run-gtests.sh @@ -32,7 +32,7 @@ fi adb="${ADB:-adb}" android_i18n_root=/apex/com.android.i18n -android_runtime_root=/apex/com.android.art +android_art_root=/apex/com.android.art android_tzdata_root=/apex/com.android.tzdata if [[ $1 = -j* ]]; then @@ -45,7 +45,7 @@ if [ $# -gt 0 ]; then else # Search for executables under the `bin/art` directory of the ART APEX. tests=$("$adb" shell chroot "$ART_TEST_CHROOT" \ - find "$android_runtime_root/bin/art" -type f -perm /ugo+x | sort) + find "$android_art_root/bin/art" -type f -perm /ugo+x | sort) fi failing_tests=() @@ -53,7 +53,10 @@ failing_tests=() for t in $tests; do echo "$t" "$adb" shell chroot "$ART_TEST_CHROOT" \ - env ANDROID_I18N_ROOT="$android_i18n_root" ANDROID_RUNTIME_ROOT="$android_runtime_root" ANDROID_TZDATA_ROOT="$android_tzdata_root" $t \ + env ANDROID_ART_ROOT="$android_art_root" \ + ANDROID_I18N_ROOT="$android_i18n_root" \ + ANDROID_TZDATA_ROOT="$android_tzdata_root" \ + $t \ || failing_tests+=("$t") done |