Remove _embedded_binaries path segment beneath install_base.
RELNOTES: None.
PiperOrigin-RevId: 279160551
diff --git a/scripts/bootstrap/compile.sh b/scripts/bootstrap/compile.sh
index e022500..6e6be1c 100755
--- a/scripts/bootstrap/compile.sh
+++ b/scripts/bootstrap/compile.sh
@@ -310,21 +310,21 @@
log "Creating Bazel install base..."
ARCHIVE_DIR=${OUTPUT_DIR}/archive
-mkdir -p ${ARCHIVE_DIR}/_embedded_binaries
+mkdir -p ${ARCHIVE_DIR}
# Prepare @platforms local repository
-link_dir ${PWD}/platforms ${ARCHIVE_DIR}/_embedded_binaries/platforms
+link_dir ${PWD}/platforms ${ARCHIVE_DIR}/platforms
# Dummy build-runfiles (we can't compile C++ yet, so we can't have the real one)
if [ "${PLATFORM}" = "windows" ]; then
# We don't rely on runfiles trees on Windows
- cat <<'EOF' >${ARCHIVE_DIR}/_embedded_binaries/build-runfiles${EXE_EXT}
+ cat <<'EOF' >${ARCHIVE_DIR}/build-runfiles${EXE_EXT}
#!/bin/sh
mkdir -p $2
cp $1 $2/MANIFEST
EOF
else
- cat <<'EOF' >${ARCHIVE_DIR}/_embedded_binaries/build-runfiles${EXE_EXT}
+ cat <<'EOF' >${ARCHIVE_DIR}/build-runfiles${EXE_EXT}
#!/bin/sh
# This is bash implementation of build-runfiles: reads space-separated paths
# from each line in the file in $1, then creates a symlink under $2 for the
@@ -356,7 +356,7 @@
EOF
fi
-chmod 0755 ${ARCHIVE_DIR}/_embedded_binaries/build-runfiles${EXE_EXT}
+chmod 0755 ${ARCHIVE_DIR}/build-runfiles${EXE_EXT}
function build_jni() {
local -r output_dir=$1
@@ -390,17 +390,17 @@
fi
}
-build_jni "${ARCHIVE_DIR}/_embedded_binaries"
+build_jni "${ARCHIVE_DIR}"
-cp src/main/tools/jdk.BUILD ${ARCHIVE_DIR}/_embedded_binaries/jdk.BUILD
+cp src/main/tools/jdk.BUILD ${ARCHIVE_DIR}/jdk.BUILD
cp $OUTPUT_DIR/libblaze.jar ${ARCHIVE_DIR}
# TODO(b/28965185): Remove when xcode-locator is no longer required in embedded_binaries.
log "Compiling xcode-locator..."
if [[ $PLATFORM == "darwin" ]]; then
- run /usr/bin/xcrun --sdk macosx clang -mmacosx-version-min=10.9 -fobjc-arc -framework CoreServices -framework Foundation -o ${ARCHIVE_DIR}/_embedded_binaries/xcode-locator tools/osx/xcode_locator.m
+ run /usr/bin/xcrun --sdk macosx clang -mmacosx-version-min=10.9 -fobjc-arc -framework CoreServices -framework Foundation -o ${ARCHIVE_DIR}/xcode-locator tools/osx/xcode_locator.m
else
- cp tools/osx/xcode_locator_stub.sh ${ARCHIVE_DIR}/_embedded_binaries/xcode-locator
+ cp tools/osx/xcode_locator_stub.sh ${ARCHIVE_DIR}/xcode-locator
fi
function get_cwd() {
diff --git a/src/main/cpp/blaze.cc b/src/main/cpp/blaze.cc
index 76fd737..b8adee9 100644
--- a/src/main/cpp/blaze.cc
+++ b/src/main/cpp/blaze.cc
@@ -337,12 +337,6 @@
return result;
}
-// Returns the installed embedded binaries directory, under the shared
-// install_base location.
-string GetEmbeddedBinariesRoot(const string &install_base) {
- return blaze_util::JoinPath(install_base, "_embedded_binaries");
-}
-
// Returns the JVM command argument array.
static vector<string> GetServerExeArgs(const blaze_util::Path &jvm_path,
const string &server_jar_path,
@@ -392,7 +386,7 @@
std::stringstream java_library_path;
java_library_path << "-Djava.library.path=";
blaze_util::Path real_install_dir =
- blaze_util::Path(GetEmbeddedBinariesRoot(startup_options.install_base));
+ blaze_util::Path(startup_options.install_base);
for (const auto &it : archive_contents) {
if (IsSharedLibrary(it)) {
@@ -884,9 +878,8 @@
const int server_pid = ExecuteDaemon(
server_exe, server_exe_args, PrepareEnvironmentForJvm(),
server->ProcessInfo().jvm_log_file_,
- server->ProcessInfo().jvm_log_file_append_,
- GetEmbeddedBinariesRoot(startup_options.install_base), server_dir,
- startup_options, &server_startup);
+ server->ProcessInfo().jvm_log_file_append_, startup_options.install_base,
+ server_dir, startup_options, &server_startup);
ConnectOrDie(
option_processor, startup_options, server_pid, server_startup, server);
@@ -894,7 +887,7 @@
delete server_startup;
}
-static void MoveFiles(const string &embedded_binaries) {
+static void BlessFiles(const string &embedded_binaries) {
blaze_util::Path embedded_binaries_(embedded_binaries);
// Set the timestamps of the extracted files to the future and make sure (or
@@ -946,7 +939,6 @@
blaze_util::SyncFile(embedded_binaries_);
}
-
// Installs Blaze by extracting the embedded data files, iff necessary.
// The MD5-named install_base directory on disk is trusted; we assume
// no-one has modified the extracted files beneath this directory once
@@ -964,13 +956,9 @@
// Work in a temp dir to avoid races.
string tmp_install = startup_options.install_base + ".tmp." +
blaze::GetProcessIdAsString();
- string tmp_binaries = GetEmbeddedBinariesRoot(tmp_install);
- ExtractArchiveOrDie(
- self_path,
- startup_options.product_name,
- expected_install_md5,
- tmp_binaries);
- MoveFiles(tmp_binaries);
+ ExtractArchiveOrDie(self_path, startup_options.product_name,
+ expected_install_md5, tmp_install);
+ BlessFiles(tmp_install);
uint64_t et = GetMillisecondsMonotonic();
const DurationMillis extract_data_duration(et - st);
@@ -1014,8 +1002,7 @@
std::unique_ptr<blaze_util::IFileMtime> mtime(
blaze_util::CreateFileMtime());
blaze_util::Path real_install_dir =
- blaze_util::Path(startup_options.install_base)
- .GetRelative("_embedded_binaries");
+ blaze_util::Path(startup_options.install_base);
for (const auto &it : archive_contents) {
blaze_util::Path path = real_install_dir.GetRelative(it);
if (!mtime->IsUntampered(path)) {
diff --git a/src/main/cpp/startup_options.cc b/src/main/cpp/startup_options.cc
index 9428c75..bf93cdd 100644
--- a/src/main/cpp/startup_options.cc
+++ b/src/main/cpp/startup_options.cc
@@ -440,8 +440,8 @@
}
blaze_util::Path StartupOptions::GetEmbeddedJavabase() const {
- blaze_util::Path bundled_jre_path = blaze_util::Path(blaze_util::JoinPath(
- install_base, "_embedded_binaries/embedded_tools/jdk"));
+ blaze_util::Path bundled_jre_path = blaze_util::Path(
+ blaze_util::JoinPath(install_base, "embedded_tools/jdk"));
if (blaze_util::CanExecuteFile(
bundled_jre_path.GetRelative(GetJavaBinaryUnderJavabase()))) {
return bundled_jre_path;
diff --git a/src/main/java/com/google/devtools/build/lib/BUILD b/src/main/java/com/google/devtools/build/lib/BUILD
index 124cabf..aed9942 100644
--- a/src/main/java/com/google/devtools/build/lib/BUILD
+++ b/src/main/java/com/google/devtools/build/lib/BUILD
@@ -1504,7 +1504,6 @@
cmd = (
"cat $(location //site:command-line-reference-prefix.html) > $@ && " +
"TMP=`mktemp -d /tmp/tmp.XXXXXXXXXX` && " +
- "mkdir $${TMP}/_embedded_binaries/ && " +
"$(location :bazel/BazelServer) " +
"--jvm_flag=-Dio.bazel.EnableJni=0 --batch " +
"--install_base=$${TMP} --output_base=$${TMP}/output/ --output_user_root=$${TMP} " +
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/ServerDirectories.java b/src/main/java/com/google/devtools/build/lib/analysis/ServerDirectories.java
index 9ff40c2..5a8bb70 100644
--- a/src/main/java/com/google/devtools/build/lib/analysis/ServerDirectories.java
+++ b/src/main/java/com/google/devtools/build/lib/analysis/ServerDirectories.java
@@ -103,7 +103,7 @@
@VisibleForTesting
public static Path getEmbeddedBinariesRoot(Path installBase) {
- return installBase.getChild("_embedded_binaries");
+ return installBase;
}
/**
diff --git a/src/test/shell/bazel/bazel_with_jdk_test.sh b/src/test/shell/bazel/bazel_with_jdk_test.sh
index 006a09b..6db1ff4 100755
--- a/src/test/shell/bazel/bazel_with_jdk_test.sh
+++ b/src/test/shell/bazel/bazel_with_jdk_test.sh
@@ -103,7 +103,7 @@
install_base="$(bazel --batch info install_base)"
# Case-insensitive match, because Windows paths are case-insensitive.
- grep -sqi -- "^java-home: ${install_base}/_embedded_binaries/embedded_tools/jdk" $TEST_log || \
+ grep -sqi -- "^java-home: ${install_base}/embedded_tools/jdk" $TEST_log || \
fail "bazel's java-home is not inside the install base"
}
diff --git a/src/test/shell/integration/bazel_java_test.sh b/src/test/shell/integration/bazel_java_test.sh
index b2a3ade..bf8021a 100755
--- a/src/test/shell/integration/bazel_java_test.sh
+++ b/src/test/shell/integration/bazel_java_test.sh
@@ -41,7 +41,7 @@
# Check that we're using the embedded JDK by default as server_javabase.
bazel --batch info >& $TEST_log
- expect_log "java-home: .*/_embedded_binaries/embedded_tools/jdk"
+ expect_log "java-home: .*/embedded_tools/jdk"
}
function test_host_javabase() {