Skip to content

Commit

Permalink
Add symlinks to third_party/ and tools/ to base_workspace
Browse files Browse the repository at this point in the history
While attempting to clean up the Bazel examples, I noticed that the example
tests don't actually work because they expect a third_party directory. We could
link third_party/ from the top-level bazel directory, but then we'd have
crossing symlinks (base_workspace/tools->tools and
third_party->base_workspace/third_party). Linking everything in one direction
seemed like a better option, but alternative suggestions are welcome.

--
MOS_MIGRATED_REVID=86703332
  • Loading branch information
kchodorow authored and hanwen committed Feb 19, 2015
1 parent 8af211f commit 3671ff6
Show file tree
Hide file tree
Showing 19 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/output/
/bazel-*
/fromhost/
/base_workspace/tools/jdk/jdk
/base_workspace/tools/java/ijar
/base_workspace/tools/java/JavaBuilder_deploy.jar
/base_workspace/tools/java/SingleJar_deploy.jar
/tools
/base_workspace/tools/
/tools/jdk/jdk
/tools/java/ijar
/tools/java/JavaBuilder_deploy.jar
/tools/java/SingleJar_deploy.jar
6 changes: 3 additions & 3 deletions compile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,9 @@ function log() {
fi
}

# Create a tools symlink so we can run the Bazel bootstrap.
rm -f tools && ln -s base_workspace/tools tools
# Create symlinks so we can use tools from the base_workspace.
rm -f base_workspace/tools && ln -s $(pwd)/tools base_workspace/tools
rm -f base_workspace/third_party && ln -s $(pwd)/third_party base_workspace/third_party

mkdir -p fromhost
cat << EOF > fromhost/BUILD
Expand Down Expand Up @@ -181,7 +182,6 @@ esac
test -z "$JAVA_HOME" && fail "JDK not found, please set \$JAVA_HOME."
rm -f tools/jdk/jdk && ln -s "${JAVA_HOME}" tools/jdk/jdk


JAVAC="${JAVA_HOME}/bin/javac"

[[ -x $JAVAC ]] \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ private void copySkylarkFilesIfExist() throws IOException {
scratchFile(rootDirectory.getRelative("devtools/blaze/rules/BUILD").getPathString());
scratchFile(rootDirectory.getRelative("rules/BUILD").getPathString());
copySkylarkFilesIfExist("devtools/blaze/rules/staging", "devtools/blaze/rules/staging");
copySkylarkFilesIfExist("devtools/blaze/bazel/base_workspace/tools/build_rules", "rules");
copySkylarkFilesIfExist("devtools/blaze/bazel/tools/build_rules", "rules");
}

private void copySkylarkFilesIfExist(String from, String to) throws IOException {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion base_workspace/tools/cpp/BUILD → tools/cpp/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ filegroup(
filegroup(
name = "toolchain",
srcs = [
":cc-compiler-local",
":cc-compiler-darwin",
":cc-compiler-local",
":empty",
],
)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 3671ff6

Please sign in to comment.