Commit Graph

8 Commits

Author SHA1 Message Date
Xavier Deguillard
4346acbdce telemetry: enable SubprocessScribeLogger on Windows
Summary:
I was looking at adding telemetry for when the E-Menu fails to start in
D42272618 (eda170e8b4) but remembered that in-process telemetry wasn't enabled on Windows.
Attempting to make it compile succeeded and with a trivial tweak was even able
to get telemetry!

My understanding as to why this "just works" is probably historical: this code
uses to rely on folly::Subprocess which only runs on Linux and macOS as it
relies on fork+exec. However, the code was switched to use SpawnProcess which
also runs on Windows, and thus removing the ifdef was sufficient.

Reviewed By: chadaustin

Differential Revision: D42273007

fbshipit-source-id: 8377328599349da0687414314ea13d2a54bbce94
2023-01-03 15:33:33 -08:00
Xavier Deguillard
b7d87d807a utils: deny building an AbsolutePath from a literal
Summary:
We've had a couple of failures after landing D40818724 (f199e93924) due to some places still
building AbsolutePath from a literal. On Windows, this is almost always a bug
due to paths usually not being UNC.

To avoid this issue, we can simply forbid an AbsolutePath from being built in
the first place from a path, instead forcing the use of canonicalPath. This was
suggeted by mshroyer in the orignal diff.

Reviewed By: chadaustin

Differential Revision: D41229194

fbshipit-source-id: 3451bdcba276c87f98326b025e05f6a4eddbd1b7
2022-11-22 16:20:30 -08:00
Chad Austin
9fa292b9ed standardize namespaces on C++17 syntax
Reviewed By: genevievehelsel

Differential Revision: D36429182

fbshipit-source-id: 7d355917abf463493c37139856810de13e1090ff
2022-05-17 10:12:56 -07:00
Xavier Deguillard
a29d465ee8 fs: fix license header
Summary:
With Facebook having been renamed Meta Platforms, we need to change the license
headers.

Reviewed By: fanzeyi

Differential Revision: D33407812

fbshipit-source-id: b11bfbbf13a48873f0cea75f212cc7b07a68fb2e
2022-01-04 15:00:07 -08:00
Yedidya Feldblum
22a7fdfe34 migrate from LockedPtr::getUniqueLock
Summary: The new name is `LockedPtr::as_lock`.

Reviewed By: aary

Differential Revision: D28987868

fbshipit-source-id: 8abd6a69a1b9c884adf137f06c24fe0df9ddd089
2021-06-13 18:53:58 -07:00
Xavier Deguillard
34598d4337 remove dependency on glog
Summary:
The EdenFS codebase uses folly/logging/xlog to log, but we were still relying
on glog for the various CHECK macros. Since xlog also contains equivalent CHECK
macros, let's just rely on them instead.

This is mostly codemodded + arc lint + various fixes to get it compile.

Reviewed By: chadaustin

Differential Revision: D24871174

fbshipit-source-id: 4d2a691df235d6dbd0fbd8f7c19d5a956e86b31c
2020-11-10 16:31:15 -08:00
Wez Furlong
154d7309c9 eden: introduce SpawnedProcess
Summary:
This commit introduces a new process spawning class derived
from the ChildProcess class in the watchman codebase.

`SpawnedProcess` is similar to folly::Subprocess but is designed around the
idea that we will use a system provided spawning API to start a process, rather
than assuming the use of `fork`.

`fork` is to be avoided because it can be expensive for processes with large
address spaces and also because it interacts poorly with threads on macOS.  In
particular, we see the objC runtime terminating our process in some scenarios
where fork and threads are mixed.

There are some important differences from `folly::Subprocess` and that means
that some assumptions and uses need to be altered slightly from their prior
workings.  For example, detaching a SpawnedProcess moves the responsibility of
waiting on the child to a periodic task as there is no way to detach via
posix_spawn without also using fork.

On the plus side, this commit allows unifying spawning between posix and
windows systems, which simplifies the code!

Reviewed By: xavierd

Differential Revision: D23287763

fbshipit-source-id: b662af1d7eaaa9ed445c42f6c5765ae9af975eea
2020-09-01 13:31:32 -07:00
Chad Austin
9a5f0093f2 introduce a scribe logger that communicates with scribe_cat
Summary: Introduce a new ScribeLogger class that spawns and maintains a process. Log messages are newline-delimited and written to the process's stdin. If the process stops responding or responds too slowly, log messages are dropped.

Reviewed By: pkaush

Differential Revision: D17777215

fbshipit-source-id: c998d10c73fc103122d69ae19c5d84f58b7939d2
2019-10-22 12:42:54 -07:00