aboutsummaryrefslogtreecommitdiffhomepage
path: root/scripts/bootstrap/compile.sh
diff options
context:
space:
mode:
authorGravatar John Cater <jcater@google.com>2018-03-19 08:51:46 -0700
committerGravatar Copybara-Service <copybara-piper@google.com>2018-03-19 08:53:02 -0700
commit32c5add2088f58560131a70b670566bc5f7efa7d (patch)
tree521fe133ed9b69a17ad1adfe90caef02095691ed /scripts/bootstrap/compile.sh
parent9b8e9feaec3568ccb76787c3f0df5d80cc4a894f (diff)
Update the distfile compile scripts to create a valid embedded tools
repository. Closes #4860. Change-Id: I1689fee013d031253d5e55343be174aaa6e638c1 PiperOrigin-RevId: 189588855
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