Skip to content

Commit

Permalink
preparing to run WatchmanClientIntegrationTest on windows if watchman…
Browse files Browse the repository at this point in the history
… is available

Test Plan: CI

Reviewed By: marcinkosiba

fbshipit-source-id: d4c6631
  • Loading branch information
ilya-klyuchnikov authored and facebook-github-bot committed Apr 27, 2017
1 parent 618ad57 commit d97efed
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/com/facebook/buck/io/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ java_immutables_library(
"//src/com/facebook/buck/util:process_executor",
"//src/com/facebook/buck/util:util",
"//src/com/facebook/buck/util/concurrent:concurrent",
"//src/com/facebook/buck/util/environment:platform",
],
)

Expand Down
9 changes: 7 additions & 2 deletions src/com/facebook/buck/io/Watchman.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import com.facebook.buck.util.ListeningProcessExecutor;
import com.facebook.buck.util.ProcessExecutorParams;
import com.facebook.buck.util.RichStream;
import com.facebook.buck.util.environment.Platform;
import com.google.common.annotations.VisibleForTesting;
import com.google.common.base.Charsets;
import com.google.common.base.Function;
Expand Down Expand Up @@ -464,8 +465,12 @@ public Optional<WatchmanClient> apply(Path transportPath) {
}

private Transport createLocalWatchmanTransport(Path transportPath) throws IOException {
// TODO(beng): Support Windows named pipes here.
return UnixDomainSocket.createSocketWithPath(transportPath);
if (Platform.detect() == Platform.WINDOWS) {
// TODO(beng): Support Windows named pipes here.
throw new IOException("WatchmanTransport is not supported on windows yet");
} else {
return UnixDomainSocket.createSocketWithPath(transportPath);
}
}
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,12 @@ public FileVisitResult visitFile(Path path, BasicFileAttributes attrs)
addBuckConfigLocalOption("build", "threads", "2");
}

// We have to have .watchmanconfig on windows, otherwise we have problems with deleting stuff
// from buck-out while watchman indexes/touches files.
if (!Files.exists(getPath(".watchmanconfig"))) {
writeContentsToPath("{\"ignore_dirs\":[\"buck-out\",\".buckd\"]}", ".watchmanconfig");
}

isSetUp = true;
return this;
}
Expand Down
5 changes: 4 additions & 1 deletion windows_failures.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
!com.facebook.buck.android.AaptPackageResourcesIntegrationTest
!com.facebook.buck.cli.DaemonIntegrationTest
!com.facebook.buck.cli.ExternalTestRunnerIntegrationTest
!com.facebook.buck.cli.RunCommandIntegrationTest
!com.facebook.buck.cxx.ArchiveStepIntegrationTest#thatGeneratedArchivesAreDeterministic
Expand Down Expand Up @@ -28,10 +29,12 @@
!com.facebook.buck.cxx.HeaderMapStepTest
!com.facebook.buck.cxx.OmnibusTest
!com.facebook.buck.cxx.ToolTest
!com.facebook.buck.jvm.java.ExternalJavacIntegrationTest#whenBuckdUsesExternalJavacThenClientEnvironmentUsed
!com.facebook.buck.parser.ParserIntegrationTest#testModifyingAutodepsShouldInvalidateCorrespondingBuildRules
!com.facebook.buck.python.PrebuiltPythonLibraryIntegrationTest
!com.facebook.buck.python.PythonBinaryIntegrationTest
!com.facebook.buck.python.PythonSrcZipIntegrationTest#testDependingOnSrcZipWorks
!com.facebook.buck.python.PythonTestIntegrationTest
!com.facebook.buck.step.fs.SymCopyStepTest#testSymCopyStep
!com.facebook.buck.thrift.ThriftLibraryIntegrationTest#shouldBeAbleToConstructACxxLibraryFromThrift
!com.facebook.buck.util.ListeningProcessExecutorTest#clearsEnvWhenExplicitlySet
!com.facebook.buck.util.ListeningProcessExecutorTest#clearsEnvWhenExplicitlySet

0 comments on commit d97efed

Please sign in to comment.