aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar Laszlo Csomor <laszlocsomor@google.com>2016-09-02 11:53:16 +0000
committerGravatar Kristina Chodorow <kchodorow@google.com>2016-09-06 15:37:14 +0000
commit4a249b6962d32ed4cfd4165dfdae4a555b00bb69 (patch)
tree3ee3274df9f544dd75970fc26cd2989eeb98367d /src
parent80f21af764a4d2dc72d72a7152650eb620e46881 (diff)
Windows, JNI: use native isJunction method.
Fixes https://github.com/bazelbuild/bazel/issues/1680 -- MOS_MIGRATED_REVID=132051176
Diffstat (limited to 'src')
-rw-r--r--src/main/java/com/google/devtools/build/lib/BUILD1
-rw-r--r--src/main/java/com/google/devtools/build/lib/vfs/WindowsFileSystem.java11
-rw-r--r--src/main/native/BUILD2
3 files changed, 6 insertions, 8 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/BUILD b/src/main/java/com/google/devtools/build/lib/BUILD
index b474265937..d15c3f2aec 100644
--- a/src/main/java/com/google/devtools/build/lib/BUILD
+++ b/src/main/java/com/google/devtools/build/lib/BUILD
@@ -135,6 +135,7 @@ java_library(
":os_util",
":preconditions",
":unix",
+ ":windows",
"//third_party:guava",
"//third_party:jsr305",
],
diff --git a/src/main/java/com/google/devtools/build/lib/vfs/WindowsFileSystem.java b/src/main/java/com/google/devtools/build/lib/vfs/WindowsFileSystem.java
index b74b279573..020ef69cd4 100644
--- a/src/main/java/com/google/devtools/build/lib/vfs/WindowsFileSystem.java
+++ b/src/main/java/com/google/devtools/build/lib/vfs/WindowsFileSystem.java
@@ -14,7 +14,7 @@
package com.google.devtools.build.lib.vfs;
import com.google.devtools.build.lib.concurrent.ThreadSafety.ThreadSafe;
-
+import com.google.devtools.build.lib.windows.WindowsFileOperations;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
@@ -88,7 +88,7 @@ public class WindowsFileSystem extends JavaIoFileSystem {
@Override
protected boolean fileIsSymbolicLink(File file) {
try {
- if (file.isDirectory() && isJunction(file.toPath())) {
+ if (file.isDirectory() && WindowsFileOperations.isJunction(file.getPath())) {
return true;
}
} catch (IOException e) {
@@ -164,7 +164,7 @@ public class WindowsFileSystem extends JavaIoFileSystem {
protected boolean isDirectory(Path path, boolean followSymlinks) {
if (!followSymlinks) {
try {
- if (isJunction(getIoFile(path).toPath())) {
+ if (WindowsFileOperations.isJunction(getIoFile(path).getPath())) {
return false;
}
} catch (IOException e) {
@@ -173,9 +173,4 @@ public class WindowsFileSystem extends JavaIoFileSystem {
}
return super.isDirectory(path, followSymlinks);
}
-
- private static boolean isJunction(java.nio.file.Path p) throws IOException {
- // Jury-rigged
- return p.compareTo(p.toRealPath()) != 0;
- }
}
diff --git a/src/main/native/BUILD b/src/main/native/BUILD
index eed0d7edc6..2ae8927bce 100644
--- a/src/main/native/BUILD
+++ b/src/main/native/BUILD
@@ -65,6 +65,8 @@ cc_binary(
genrule(
name = "windows_jni",
+ # Keep this `glob` in sync with scripts/bootstrap/compile.sh:build_jni
+ # function's msys*|mingw* case.
srcs = glob([
"windows_*.cc",
"windows_*.h",