sapling/build/fbcode_builder
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
..
CMake Forced watchman daemon to always operate in non elevated mode on Windows (#878) 2020-12-21 15:17:27 -08:00
getdeps Use half of available CPUs 2020-11-30 22:31:19 -08:00
manifests Forced watchman daemon to always operate in non elevated mode on Windows (#878) 2020-12-21 15:17:27 -08:00
specs proxygen: fix shared libs build 2020-11-10 14:25:15 -08:00
.gitignore add fbcode_builder sources 2019-04-26 11:31:58 -07:00
docker_build_with_ccache.sh add fbcode_builder sources 2019-04-26 11:31:58 -07:00
docker_builder.py Fixes for travic CI build (#3) 2019-12-10 04:56:56 -08:00
docker_enable_ipv6.sh add fbcode_builder sources 2019-04-26 11:31:58 -07:00
fbcode_builder_config.py add fbcode_builder sources 2019-04-26 11:31:58 -07:00
fbcode_builder.py Fixes for travic CI build (#3) 2019-12-10 04:56:56 -08:00
getdeps.py Forced watchman daemon to always operate in non elevated mode on Windows (#878) 2020-12-21 15:17:27 -08:00
LICENSE Relicense getdeps from BSD to MIT 2019-10-10 13:20:05 -07:00
make_docker_context.py update docker os_image to ubuntu18 and gcc7 2019-05-10 16:39:16 -07:00
parse_args.py add fbcode_builder sources 2019-04-26 11:31:58 -07:00
README.docker add fbcode_builder sources 2019-04-26 11:31:58 -07:00
README.md update fbcode_builder README to document getdeps.py 2020-09-09 15:40:21 -07:00
shell_builder.py Fix shell builders (#50) 2020-06-03 14:19:29 -07:00
shell_quoting.py add fbcode_builder sources 2019-04-26 11:31:58 -07:00
travis_docker_build.sh add fbcode_builder sources 2019-04-26 11:31:58 -07:00
utils.py add fbcode_builder sources 2019-04-26 11:31:58 -07:00

Easy builds for Facebook projects

This directory contains tools designed to simplify continuous-integration (and other builds) of Facebook open source projects. In particular, this helps manage builds for cross-project dependencies.

The main entry point is the getdeps.py script. This script has several subcommands, but the most notable is the build command. This will download and build all dependencies for a project, and then build the project itself.

Deployment

This directory is copied literally into a number of different Facebook open source repositories. Any change made to code in this directory will be automatically be replicated by our open source tooling into all GitHub hosted repositories that use fbcode_builder. Typically this directory is copied into the open source repositories as build/fbcode_builder/.

Project Configuration Files

The manifests subdirectory contains configuration files for many different projects, describing how to build each project. These files also list dependencies between projects, enabling getdeps.py to build all dependencies for a project before building the project itself.

Shared CMake utilities

Since this directory is copied into many Facebook open source repositories, it is also used to help share some CMake utility files across projects. The CMake/ subdirectory contains a number of .cmake files that are shared by the CMake-based build systems across several different projects.

Older Build Scripts

This directory also still contains a handful of older build scripts that pre-date the current getdeps.py build system. Most of the other .py files in this top directory, apart from getdeps.py itself, are from this older build system. This older system is only used by a few remaining projects, and new projects should generally use the newer getdeps.py script, by adding a new configuration file in the manifests/ subdirectory.