aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts/bootstrap/compile.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/bootstrap/compile.sh')
-rwxr-xr-xscripts/bootstrap/compile.sh16
1 files changed, 15 insertions, 1 deletions
diff --git a/scripts/bootstrap/compile.sh b/scripts/bootstrap/compile.sh
index f991e32a22..2ae26f44bd 100755
--- a/scripts/bootstrap/compile.sh
+++ b/scripts/bootstrap/compile.sh
@@ -207,10 +207,24 @@ if [ -z "${BAZEL_SKIP_JAVA_COMPILATION}" ]; then
cp src/main/java/$i ${OUTPUT_DIR}/classes/$i
done
+ # Create the bazel_tools repository.
+ BAZEL_TOOLS_REPO=${OUTPUT_DIR}/embedded_tools
+ mkdir -p ${BAZEL_TOOLS_REPO}
+ cat <<EOF >${BAZEL_TOOLS_REPO}/WORKSPACE
+workspace(name = 'bazel_tools')
+EOF
+ link_dir ${PWD}/src ${BAZEL_TOOLS_REPO}/src
+ link_dir ${PWD}/third_party ${BAZEL_TOOLS_REPO}/third_party
+ link_dir ${PWD}/tools ${BAZEL_TOOLS_REPO}/tools
+
+ # Set up @bazel_tools//platforms properly
+ mkdir -p ${BAZEL_TOOLS_REPO}/platforms
+ cp tools/platforms/platforms.BUILD ${BAZEL_TOOLS_REPO}/platforms/BUILD
+
# Overwrite tools.WORKSPACE, this is only for the bootstrap binary
chmod u+w "${OUTPUT_DIR}/classes/com/google/devtools/build/lib/bazel/rules/tools.WORKSPACE"
cat <<EOF >${OUTPUT_DIR}/classes/com/google/devtools/build/lib/bazel/rules/tools.WORKSPACE
-local_repository(name = 'bazel_tools', path = __workspace_dir__)
+local_repository(name = 'bazel_tools', path = '${BAZEL_TOOLS_REPO}')
bind(name = "cc_toolchain", actual = "@bazel_tools//tools/cpp:default-toolchain")
EOF