diff options
author | 2016-04-13 15:58:19 +0000 | |
---|---|---|
committer | 2016-04-14 07:37:37 +0000 | |
commit | 83781f7b06374d1daf9cdcee087a9f1606642780 (patch) | |
tree | bb454d66762e2ab709971a620da07c575285cb3a /src/main/java/com/google/devtools/build/lib/exec | |
parent | f2521880a970945e586a7eafc410bf04c8ad304f (diff) |
Fixes bugs so that we can build bazel with bazel on Windows
src/main/java/com/google/devtools/build/lib/exec/SymlinkTreeHelper.java:
enable --windows_compatible flag on Windows to make build-runfiles.exe work.
scritps/bootstrap/compile.sh:
--windows_compatible will also be passed to a dummy build-runfiles.exe defined in complie.sh.
Which is actully a batch script, modify it to make it work.
-----
With the changes above, we are able to build bazel with bazel. But when you try to
run ./compile.sh compile /path/to/bazel again without clean up tmp directory, it will fail with
a permission deny error. The reason seems to be that you can't use build-runfile.exe to build the
same hard link twice, still trying to solve that.
--
Change-Id: I93340b1ba9fa415f6db963b106e264799e33ede3
Reviewed-on: https://bazel-review.googlesource.com/#/c/3334
MOS_MIGRATED_REVID=119751076
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/exec')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/exec/SymlinkTreeHelper.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/exec/SymlinkTreeHelper.java b/src/main/java/com/google/devtools/build/lib/exec/SymlinkTreeHelper.java index 2980c718a5..0e47c2bd81 100644 --- a/src/main/java/com/google/devtools/build/lib/exec/SymlinkTreeHelper.java +++ b/src/main/java/com/google/devtools/build/lib/exec/SymlinkTreeHelper.java @@ -34,6 +34,7 @@ import com.google.devtools.build.lib.vfs.Path; import com.google.devtools.build.lib.vfs.PathFragment; import com.google.devtools.build.lib.vfs.UnixFileSystem; import com.google.devtools.build.lib.vfs.UnixFileSystem.SymlinkStrategy; +import com.google.devtools.build.lib.vfs.WindowsFileSystem; import java.util.List; @@ -149,8 +150,9 @@ public final class SymlinkTreeHelper { } FileSystem fs = execRoot.getFileSystem(); - if (fs instanceof UnixFileSystem - && ((UnixFileSystem) fs).getSymlinkStrategy() == SymlinkStrategy.WINDOWS_COMPATIBLE) { + if ((fs instanceof WindowsFileSystem) + || (fs instanceof UnixFileSystem + && ((UnixFileSystem) fs).getSymlinkStrategy() == SymlinkStrategy.WINDOWS_COMPATIBLE)) { args.add("--windows_compatible"); } |