sapling/build/fbcode_builder/CMake
Arthur Kushka 60affd571a Forced watchman daemon to always operate in non elevated mode on Windows (#878)
Summary:
Recently I found that its impossible to access elevated Watchman daemon from non-elevated process on Windows.

```
events.js:174
      throw er; // Unhandled 'error' event
      ^
Error: connect EPERM \\.\pipe\watchman
    at PipeConnectWrap.afterConnect [as oncomplete] (net.js:1106:14)
Emitted 'error' event at:
    at Socket.<anonymous> (C:\open\ovrsource\unity\socialvr\_js\node_modules\fb-watchman\index.js:118:12)
    at Socket.emit (events.js:198:13)
    at emitErrorNT (internal/streams/destroy.js:91:8)
    at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
    at process._tickCallback (internal/process/next_tick.js:63:19)
```

To fix this, it was suggested by wez to use [his library](https://github.com/wez/EleDo) to force Watchman daemon always start in normal mode on Windows. In this stack of commits I did integrated his library into project and used it to force daemon restart in normal mode when spawned from elevated terminal.

To make it happen, I checked-in library sources and created proxy project which depends on the initial library and contains header bindings and cmake configuration. I did copy pasted Rust cmake macroses from another facebook project - eden, and also created analogue of autogen.sh but for Windows - autogen.cmd.

Pull Request resolved: https://github.com/facebook/watchman/pull/878

Test Plan:
Launch elevated terminal
Start watchman.exe produced from sources
Observe daemon starting and answering
In process monitor, observe watchman.exe process running under user group

Reviewed By: fanzeyi

Differential Revision: D25595879

Pulled By: arhelmus

fbshipit-source-id: 15eb29adcf5bd4a5708b6533a1b2bacbf13f431c
2020-12-21 15:17:27 -08:00
..
fb_py_test_main.py Fix bug in optimizing module loader for coverage collection 2020-04-02 02:42:33 -07:00
fb_py_win_main.c return returncode correctly 2020-08-31 16:26:46 -07:00
FBBuildOptions.cmake fbcode_builder: add a license header to FBBuildOptions.cmake 2019-09-16 15:41:57 -07:00
FBCMakeParseArgs.cmake fbcode_builder: CMake functions for building standalone python programs 2019-08-19 11:08:34 -07:00
FBCompilerSettings.cmake getdeps: silence inherits via dominance warnings 2020-05-08 21:46:06 -07:00
FBCompilerSettingsMSVC.cmake getdeps: silence inherits via dominance warnings 2020-05-08 21:46:06 -07:00
FBCompilerSettingsUnix.cmake getdeps: silence inherits via dominance warnings 2020-05-08 21:46:06 -07:00
FBPythonBinary.cmake getdeps: add an install_fb_python_executable() function to the CMake utilities 2019-12-03 21:42:27 -08:00
FBPythonTestAddTests.cmake getdeps: add an add_fb_python_unittest() function 2019-09-30 10:46:18 -07:00
FBThriftCppLibrary.cmake add shared library support to add_fbthrift_cpp_library 2020-11-12 10:57:28 -08:00
FBThriftLibrary.cmake fbcode_builder: add a FBThriftLibrary.cmake file 2019-08-29 22:05:44 -07:00
FBThriftPyLibrary.cmake fix the thrift CMake rules to add dependencies on the thrift compiler 2019-09-16 21:10:01 -07:00
FindGflags.cmake update FindGflags.cmake to work on CentOS 8.x (#1409) 2020-09-09 12:44:54 -07:00
FindGlog.cmake FindGlog: Add support for 'glogd' Debug library (#1479) 2020-10-24 01:18:21 -07:00
FindGMock.cmake add fbcode_builder sources 2019-04-26 11:31:58 -07:00
FindLibEvent.cmake add fbcode_builder sources 2019-04-26 11:31:58 -07:00
FindLibUnwind.cmake only use symbolizer if libunwind is found 2020-08-17 17:08:55 -07:00
FindPCRE.cmake add fbcode_builder sources 2019-04-26 11:31:58 -07:00
FindRe2.cmake add re2 as cmake dependency 2020-09-02 22:54:23 -07:00
FindSodium.cmake Fix discovery of libsodium 2020-11-04 16:16:49 -08:00
make_fbpy_archive.py update make_fbpy_archive.py to replace the output on Windows 2019-09-18 20:05:01 -07:00
RustStaticLibrary.cmake Forced watchman daemon to always operate in non elevated mode on Windows (#878) 2020-12-21 15:17:27 -08:00