Commit Graph

60652 Commits

Author SHA1 Message Date
svcscm
6df37edb17 Updating submodules
Summary:
GitHub commits:

7bd5a25ccd
82d65ef5e2

Reviewed By: jurajh-fb

fbshipit-source-id: 8d272563bc73ef1788cd8c1322a80094603de3ca
2020-09-21 14:02:15 -07:00
Jun Wu
ebf708e17a pyedenapi: switch to async_runtime::block_on_future
Summary:
This simplifies the code a bit, and avoids creating tokio Runtime multiple
times.

Reviewed By: kulshrax

Differential Revision: D23799642

fbshipit-source-id: 21cee6124ef6f9ab6e165891d9ee87b2feb553ac
2020-09-21 13:28:07 -07:00
Jun Wu
186151e8f9 pyedenapi: return commit data in a stream fashion
Summary:
Exercises the PyStream type from cpython-async.

`hg dbsh`:

  In [1]: s,f=api._rustclient.commitdata('fbsource', list(repo.nodes('master^^::master')))

  In [2]: s
  Out[2]: <stream at 0x7ff2db700690>

  In [3]: it=iter(s)

  In [4]: next(it)
  Out[4]: ('6\xf9\x18\xe4\x1c\x05\xfc\xb0\xd3\xb2\xe9\xec\x18E\xec\x0f\x1a:\xb7\xcd', ...)

  In [5]: next(it)
  Out[5]: ('}\x1f(\xe1o\xf1a\x9b\x81\xb9\x83}\x1b\xbbt\xd2e\xb1\xedb',...)

  In [6]: next(it)
  Out[6]: ('\xf1\xf0f\x97<\xf3\xdd\xe41w>\x92\xd1\xc0\x9ah\xdd\x87~^',...)

  In [7]: next(it)
  StopIteration:

  In [8]: f.wait()
  Out[8]: <bindings.edenapi.stats at 0x7ff2e006a3d8>

  In [9]: str(Out[8])
  Out[9]: '2.42 kB downloaded in 165 ms over 1 request (0.01 MB/s; latency: 165 ms)'

  In [10]: iter(s)
  ValueError: stream was consumed

Reviewed By: kulshrax

Differential Revision: D23799645

fbshipit-source-id: 732a5da4ccdee4646386b6080408c0d8958dd67f
2020-09-21 13:28:07 -07:00
Jun Wu
cd7f831c6c pyedenapi: return a Future of Stats for commitdata
Summary:
Exercises the PyFuture type from cpython-async.

`hg dbsh`:

    In [1]: api._rustclient.commitdata('fbsource', list(repo.nodes('master^^::master')))
    Out[1]:
    ([...], <future at 0x7f7b65d05060>)

    In [2]: f=Out[1][-1]

    In [3]: f.wait()
    Out[3]: <bindings.edenapi.stats at 0x7f7b665e8228>

    In [4]: f.wait()
    ValueError: future was awaited

    In [5]: str(Out[3])
    Out[5]: '2.42 kB downloaded in 172 ms over 1 request (0.01 MB/s; latency: 171 ms)'

Reviewed By: kulshrax

Differential Revision: D23799643

fbshipit-source-id: d4fcef7dca58bc4902bb0809adc065493bb94bd3
2020-09-21 13:28:07 -07:00
Jun Wu
7f1c05dd74 cpython-async: expose Rust Future to Python
Summary:
Add a `PyFuture<F>` type that can be used as return type in binding function.
It converts Rust Future to a Python object with an `await` method so Python
can access the value stored in the future.

Unlike `TStream`, it's currently only designed to support Rust->Python one
way conversion so it looks simpler.

Reviewed By: kulshrax

Differential Revision: D23799644

fbshipit-source-id: da4a322527ad9bb4c2dbaa1c302147b784d1ee41
2020-09-21 13:28:07 -07:00
Jun Wu
41b200c8d8 cpython-async: expose Rust Stream to Python
Summary:
The exposed type can be used as a Python iterator:

  for value in stream:
      ...

The Python type can be used as input and output parameters in binding functions:

  # Rust
  type S = TStream<anyhow::Result<X>>;
  def f1() -> PyResult<S> { ... }
  def f2(x: S) -> PyResult<S> { Ok(x.stream().map_ok(...).into()) }

  # Python
  stream1 = f1()
  stream2 = f2(stream1)

This crate is similar to `cpython-ext`: it does not define actual business
logic exposed by `bindings` module. So it's put in `lib`, not
`bindings/modules`.

Reviewed By: markbt

Differential Revision: D23799641

fbshipit-source-id: c13b0c788a6465679b562976728f0002fd872bee
2020-09-21 13:28:07 -07:00
Jun Wu
71e99bf8e7 dispatch: run ipdb in the command thread
Summary:
See the previous diff for context.  Move the error handling and ipdb logic to
the background thread so it can show proper traceback.

Reviewed By: kulshrax

Differential Revision: D23819022

fbshipit-source-id: 8ddae019ab939d8fb2c89afca2a7769094ebe26a
2020-09-21 13:15:15 -07:00
Jun Wu
c96de76ac0 util: set traceback if error happens in threaded execution
Summary:
With D23759710 (34d8dca79a), the main command was moved to a background thread, but the
error handling isn't. That can cause less useful traceback like:

  Traceback (most recent call last):
    File "dispatch.py", line 698, in _callcatch
      return scmutil.callcatch(ui, func)
    File "scmutil.py", line 147, in callcatch
      return func()
    File "util.py", line 4358, in wrapped
      raise value

Set `e.__traceback__` so `raise e` preserves the traceback information.
This only works on Python 3. On Python 2 it is possible to use
`raise exctype, excvalue, tb`. But that's invalid Python 3 code. I'm
going to fix Python 2 traceback differently.

Reviewed By: kulshrax

Differential Revision: D23819023

fbshipit-source-id: 953ac8bd6108f4c0dae193607bee3f931c2bd13e
2020-09-21 13:15:15 -07:00
Jun Wu
15fb0f4f51 util: fix mtime used in gcdir
Summary:
The parameter `mtimethreshold` should be used instead of a constant of 14 days.
This fixes an issue where sigtrace output takes a lot of space in hg rage
output.

Reviewed By: DurhamG

Differential Revision: D23819021

fbshipit-source-id: e639b01d729463a4822fa93604ce3a038fbd4a9a
2020-09-21 13:15:15 -07:00
Liubov Dmitrieva
2b0829b9f5 fix ussue with incorrent update reference request in some cases
Summary:
filter returns a filter object, so the second time we iterate, it is empty

This is only in Python3 I believe, so migration to py3 broke it.

Reviewed By: markbt

Differential Revision: D23815206

fbshipit-source-id: 1a6503b2bbfd44959307c189d17dec9b5d5ff991
2020-09-21 13:15:15 -07:00
Xavier Deguillard
e2a4bcf917 tests: enable all doctor tests on Windows
Summary:
Now that `hg whereami` properly reads the SNAPSHOT file on Windows, the doctor
tests properly detect that Mercurial and EdenFS disagree about the current
commit, thus we can enable the remaining 2 tests.

Reviewed By: genevievehelsel

Differential Revision: D23819924

fbshipit-source-id: 21be19aff913e5e485d72e8cd730e6851ecaba2e
2020-09-21 13:12:11 -07:00
svcscm
fdb84eeb03 Updating submodules
Summary:
GitHub commits:

9095e3df5a
479ba597b7
c1cbea3265
15ef80de74
e9a3375763

Reviewed By: jurajh-fb

fbshipit-source-id: b583d33b711035fb945fc99baffd4c0a32d59719
2020-09-21 13:12:11 -07:00
svcscm
ebd57c2e3b Updating submodules
Summary:
GitHub commits:

1be597790d
d769ba112b
818a84d123
d906952963
a4ca704e56
6e2709d805
4ace74a4ba
de0dc4c4aa

Reviewed By: jurajh-fb

fbshipit-source-id: 27d16fde8e6daf3b254065ea8dda4c3bba7dce6c
2020-09-21 12:27:16 -07:00
Durham Goode
63d19e1eca workers: bulk fetch data in worker thread
Summary:
During an hg update we first prefetch all the data, then write all the
data to disk. There are cases where the prefetched data is not available during
the writing phase, in which case we fall back to fetching the files one-by-one.
This has truly atrocious performance.

Let's allow the worker threads to check for missing data then do bulk fetching
of it. In the case where the cache was completely lost for some reason, this
would reduce the number of serial fetches by 100x.

Note, the background workers already spawn their own ssh connection's, so
they're already getting some level of parallelism even when they're doing 1-by-1
fetching. That's why we aren't seeing a 100x improvement in performance.

Reviewed By: xavierd

Differential Revision: D23766424

fbshipit-source-id: d88a1e55b1c21e9cea7e50fc6dbfd8a27bd97bb0
2020-09-21 11:27:12 -07:00
svcscm
7ae215cb32 Updating submodules
Summary:
GitHub commits:

9b5966588d
c6ea1d1e0f
52691703fc

Reviewed By: jurajh-fb

fbshipit-source-id: 2d58b7d23da51017c8dae33f845113c131afa3b2
2020-09-21 11:04:15 -07:00
Lukas Piatkowski
0f8e20df5b mononoke/integration tests: fix returning different output in OSS cases in tests (#60)
Summary:
Pull Request resolved: https://github.com/facebookexperimental/eden/pull/60

For the tests that output different data to stdout in OSS vs FB create helpers that remove the differences.

Reviewed By: farnz

Differential Revision: D23814134

fbshipit-source-id: c6656528021c9a90b98e3c89a9bbe8c5178c6919
2020-09-21 09:39:18 -07:00
Mark Thomas
2600860e69 scsc: implement land-stack and test stack landing via the service
Summary:
Add `scsc land-stack` to facilitate testing of stack landing via the source control service.
Use this to test that landing of stacks works.

Reviewed By: aslpavel

Differential Revision: D23813366

fbshipit-source-id: 1f7b682fa5e33a232cb1da5c702a703223658942
2020-09-21 08:39:13 -07:00
Mark Thomas
78b943019a mononoke_api: most bookmark movements errors are request errors
Summary:
Update the conversion of `BookmarkMovementError` to `MononokeError` to reflect
that most movement errors are caused by invalid requests.

Reviewed By: aslpavel

Differential Revision: D23814794

fbshipit-source-id: 48503353aaae7b3cd03e5221a8ad014eef2e9414
2020-09-21 08:39:12 -07:00
Mark Thomas
644aaa75a7 scs_server: implement repo_land_stack
Summary:
Implement the `repo_land_stack` method by working out which commits are in the
stack to be landed, and then pushrebasing them onto the target bookmark.

Reviewed By: aslpavel

Differential Revision: D23813370

fbshipit-source-id: babe34f0e9f1db055adb2e5d1debefd8ebcf6f86
2020-09-21 08:39:12 -07:00
Mark Thomas
c6a7a35c2a scs_server: add AsyncIntoResponseWith trait
Summary:
Sometimes the `AsyncIntoResponse` trait needs additional data (e.g. the set of commit
identity schemes the client is interested in) to convert the item into the response
type.

Currently we use a tuple of `(item, &additional_data)` to work around this, however
this will become less readable as we add new items with more additional data.

Split this use-case out into a new trait: `AsyncIntoResponseWith`.  This defines
an associated type which is the type of the additional data needed, and provides a
new method `into_response_with`, where a reference to the additional data can be
provided.

Note that conversions for tuple types that are logical `(name, value)` or `(id,
value)` pairs are still ok.  It is specifically the case where we have `(item,
&additional_data)` that we are converting here (i.e. the additional data merely
informs the conversion, it is not part of the resulting response value).

Reviewed By: aslpavel

Differential Revision: D23813371

fbshipit-source-id: c0dcfe826288ad53ad572ae4dd956540605998f5
2020-09-21 08:39:12 -07:00
Mark Thomas
b6a6882d10 improve error messages for mapping length errors
Summary: Make it clear which error is which, and what the number of expected and actual items are.

Reviewed By: StanislavGlebik

Differential Revision: D23813369

fbshipit-source-id: 5b94c5a67438c475235876669ec2be3fd1866700
2020-09-21 08:39:12 -07:00
svcscm
5d8357a30a Updating submodules
Summary:
GitHub commits:

28cde4beaa
0518ddfbef

Reviewed By: yns88

fbshipit-source-id: 345ab4aec397e1853e7a224acea0163123eafb0a
2020-09-21 08:35:14 -07:00
Alex Hornby
779c42d5c0 mononoke: intern ids to reduce space used
Summary: Intern ids to reduce space used in the walk state.  This is significant on large repos.

Reviewed By: farnz

Differential Revision: D23691524

fbshipit-source-id: b42f926d88083d06ffc44508db44747f9a14e0a5
2020-09-21 06:26:28 -07:00
Stanislau Hlebik
58160ae16c mononoke: add a --wait-secs parameter to catchup-head-delete subcommand
Reviewed By: ikostia

Differential Revision: D23812854

fbshipit-source-id: 6225072b3aa25c2054ffae6d0ec37d8c7ef04763
2020-09-21 06:07:57 -07:00
Stanislau Hlebik
4d46a332f6 mononoke: remove unnecessary option from into_push_redirector
Summary:
Passing option is not necessary since live_commit_sync_config is always
available.

Reviewed By: ahornby

Differential Revision: D23811021

fbshipit-source-id: ee11f88d57814d9abac8650e52febd9e431770da
2020-09-21 06:00:24 -07:00
Liubov Dmitrieva
584de33443 fix workspace name for fbclone
Summary:
Automigration gets messed up with `hg cloud rejoin` command in fbclone code because it triggered by the pull command.

As a result fbclone ends up to join a hostname workspace instead of the default for some cases.

* make sure that the migration never runs if background commit cloud operations are disabled
* also, add skip the migration in the pull command in fbclone

Once of those would be enough to fix the issue but I prefer to make both
changes.

Reviewed By: markbt

Differential Revision: D23813184

fbshipit-source-id: 3b49a3f079e889634e3c4f98b51557ca0679090b
2020-09-21 05:09:40 -07:00
Stanislau Hlebik
9fc2a01f0b mononoke: bump memcache key for blobstore
Summary:
I've re-backfilled some of blame values for configerator. But old values might
still be in memcache. To make sure that's not the case let's bump the memcache
key.

Reviewed By: krallin

Differential Revision: D23810971

fbshipit-source-id: c333a51ffb2babf7da808b276f9cfa31baaa105c
2020-09-21 01:47:01 -07:00
Durham Goode
7b4bbc2f64 revset: avoid full repo scan in children revset
Summary:
The children revset iterated over everything in the subset, which in
many cases was the entire repo. This can take hundreds of milliseconds. Let's
use the new _makerangeset to only iterate over descendants of the parentset.

Reviewed By: quark-zju

Differential Revision: D23794344

fbshipit-source-id: 9ac9bc014d56a95b5ac65534769389167b0f4508
2020-09-20 21:43:50 -07:00
svcscm
b78115f4e8 Updating submodules
Summary:
GitHub commits:

8c41fe8c2f

Reviewed By: yns88

fbshipit-source-id: cd39f0de80bd3ffdf663ffd75b400848610e80c7
2020-09-20 21:43:50 -07:00
svcscm
c36149228d Updating submodules
Summary:
GitHub commits:

53216cb405

Reviewed By: yns88

fbshipit-source-id: cc1e8a924e84aba10907e1eec6d10874519b9adf
2020-09-20 19:02:13 -07:00
svcscm
5a58a7dfef Updating submodules
Summary:
GitHub commits:

323a834d1d
8cff333f99
35a3ad2061
00d53102bc

Reviewed By: yns88

fbshipit-source-id: bce23ecb6ba1c33c43d7a375bef8f80ad1fb88f4
2020-09-19 18:57:33 -07:00
Arun Kulshreshtha
683520106e edenapi: remove python wrapper
Summary:
Now that Mercurial itself can properly handle SIGINT, there isn't a need for a Python wrapper around the Rust EdenAPI client (since the main purpose of the wrapper was to ensure proper SIGINT handling--something that could only be done in Python).

Note that while this does remove some code that prints out certificate warnings, that code was actually broken after the big refactor of the Rust bindings. (The exception types referenced no longer exist, so the code would simple result in a `NameError` if it actually tried to catch an exception from the Rust client.)

Reviewed By: singhsrb

Differential Revision: D23801363

fbshipit-source-id: 3359c181fd05dbec24d77fa1b7d9c8bd821b49a6
2020-09-19 14:23:55 -07:00
svcscm
514f349132 Updating submodules
Summary:
GitHub commits:

5a7dc15e5d
d74c59588a

Reviewed By: yns88

fbshipit-source-id: 18187888f4c3f135984f098caf94d6974edaa35a
2020-09-19 14:23:54 -07:00
svcscm
b07a8a0986 Updating submodules
Summary:
GitHub commits:

c37507e465

Reviewed By: yns88

fbshipit-source-id: a3c7188f84d466cb1fbbd916dabf5ee386891c08
2020-09-19 11:56:18 -07:00
Alex Hornby
4db4161974 mononoke: simplify walkers check that children are valid
Summary: Small change to make it more readable and reduce likelihood of allocation (although the collect might be optimized away anyway)

Reviewed By: farnz

Differential Revision: D23760762

fbshipit-source-id: 5c47352386de128b65052d63b3f3ff1081a462e3
2020-09-19 08:49:55 -07:00
svcscm
73f3a1eb57 Updating submodules
Summary:
GitHub commits:

48fb187db9
0500cb6c29
5e26697481
4747b9435e
a4d35e454b

Reviewed By: yns88

fbshipit-source-id: 4ace73c060987697ac66acceb89edc44eda88361
2020-09-19 06:32:52 -07:00
Lukasz Piatkowski
e8098beff0 mononoke/integration tests: fix issue with missing dulwich for hggit ext (#59)
Summary: Pull Request resolved: https://github.com/facebookexperimental/eden/pull/59

Reviewed By: farnz

Differential Revision: D23783095

Pulled By: lukaspiatkowski

fbshipit-source-id: cb6a72ae3d8856a92945c28e4162c1808539206a
2020-09-19 05:47:30 -07:00
svcscm
86fced8ab6 Updating submodules
Summary:
GitHub commits:

4d697b6a4d

Reviewed By: yns88

fbshipit-source-id: 8b73a4b2d53b24fd21118a93828c8f719aa7e9eb
2020-09-19 02:02:02 -07:00
Arun Kulshreshtha
3078f346f8 gotham_ext: make StreamBody take an infallible byte stream
Summary: Make `StreamBody` accept a `Stream` of `Bytes` instead of a `TryStream` of `Bytes`. This means that applications returning streaming responses will be forced to deal with errors prior to returning the response.

Reviewed By: krallin

Differential Revision: D23780216

fbshipit-source-id: dbad61947ef23bbfc4edf3d286ad0218c1859d87
2020-09-18 22:49:55 -07:00
Arun Kulshreshtha
980406cea8 lfs_server: log errors from streaming responses
Summary:
Using the `EndOnErr` combinator introduced in the previous diff, log any errors that occur during a streaming response to stderr.

Note that **the intent of this diff is to implement the most basic possible example of doing something with these errors**, with the goal of allowing us to modify `StreamBody` to only accept infallible `Stream`s.

I'd imagine that in all likelihood we'd want to do something smarter with the errors than just print them, but I figure that can be added in later diffs since it seems like doing something else (like logging the error to Scuba or adding to the RequestContext) might require additional changes that are beyond the scope of this diff.

At the very least, this seems like an improvement from before, where these errors would just get passed straight through to Hyper.

Reviewed By: krallin

Differential Revision: D23780217

fbshipit-source-id: 2f885f9fdc6af3dd28d95be1daa1d82c732453fa
2020-09-18 22:49:55 -07:00
svcscm
e4b4a28fb4 Updating submodules
Summary:
GitHub commits:

7703d0ba7b

Reviewed By: yns88

fbshipit-source-id: 21896b0e05cf64f5583c34e73e65ab1c5b7e962a
2020-09-18 22:46:21 -07:00
Arun Kulshreshtha
3435319e52 gotham_ext: add EndOnErr TryStream combinator
Summary: Add a new `EndOnErr` combinator for `TryStream`s (exposed via the `GothamTryStreamExt::end_on_err` method) which fuses the underlying `TryStream` upon hitting an error, and passes the error to the user-provided callback. This is useful for contexts like the LFS server, where mid-stream errors are considered unrecoverable and must result in termination of the response.

Reviewed By: krallin

Differential Revision: D23778490

fbshipit-source-id: 05caa52ca62d085cc63cc8feb4619188fe0fac61
2020-09-18 22:37:42 -07:00
Arun Kulshreshtha
71674d87c5 edenapi_server: log errors during streaming responses
Summary: Use the new `ForwardErr` stream combinator to log errors that occur during a streaming response. Right now, they are just printed to stderr, but in the future we should also do other things such as logging them to Scuba. This diff supersedes the approach from D22720957.

Reviewed By: krallin

Differential Revision: D23780215

fbshipit-source-id: 8d2267f1166e665a62a167a6d95bb0b1797b5767
2020-09-18 22:37:42 -07:00
Arun Kulshreshtha
7f803818ee gotham_ext: implement ContentMeta for ForwardErr
Summary: Implement `ContentMeta` for streams wrapped with the `ForwardErr` combinator, so that they may be used as input to `StreamBody`. (Presently, this won't actually work since `StreamBody` expects a `TryStream`, but this will change later in the stack.)

Reviewed By: krallin

Differential Revision: D23777842

fbshipit-source-id: 234bcdf104afbf2c9832fbe54d85744bfb470363
2020-09-18 22:37:42 -07:00
Arun Kulshreshtha
26ff321006 gotham_ext: add ForwardErr combinator for TryStreams
Summary:
This diff adds a new `ForwardErr` combinator that allows redirecting the errors from a `TryStream` into a channel, allowing them to be processed asynchronously without disrupting the stream itself. This effectively splits the `TryStream` into two `Stream`s containing the successful items and errors respectively.

To make it easy to use the combinator, I've added a new `GothamTryStreamExt` extension trait (in the vein of the old `futures_ext` crate) that allows the user to simply call `forward_err` on any `TryStream`. The trait name is a bit of a misnomer (suggestions welcome!) in that there isn't anything Gotham-specific about it, but the name `TryStreamExt` is taken and I didn't want to set up a successor to `futures_ext` just for the sake of one combinator. (Though we will likely expand the trait in the future.)

Reviewed By: krallin

Differential Revision: D23777501

fbshipit-source-id: 8628cdc2e104cd9b972afda745858f9cb9e85245
2020-09-18 22:37:42 -07:00
svcscm
b6b105b196 Updating submodules
Summary:
GitHub commits:

e49e216db7

Reviewed By: yns88

fbshipit-source-id: 202ec87e2e8b0ce7840d61514237e41b473fc873
2020-09-18 20:00:00 -07:00
Jun Wu
34d8dca79a dispatch: run command in non-main thread
Summary:
This extends the Ctrl+C special handling from edenapi to the entire Python
command so Ctrl+C should be able to exit the program even if it's running
some blocking Rust functions.

`edenapi` no longer needs to spawn threads for fetching.

Reviewed By: singhsrb

Differential Revision: D23759710

fbshipit-source-id: cbaaa8e5f93d8d74a8692117a00d9de20646d232
2020-09-18 18:47:24 -07:00
Wez Furlong
b39f678b85 edenfs: remove use of fork from StartupLogger
Summary:
on macOS we cannot safely use `fork`.

This commit replaces the use of `fork` in the startup logger subsystem.
This was a little tricky to untangle; originally (prior to any of
the `fork` removal efforts in this diff stack), the startup flow was
to spawn a set of processes via fork:

```
edenfs (setuid)
 \-----edenfs (privhelper, as root)
  \------edenfs (daemonized)
```

The forked children take advantage of being able to implicitly pass state to
the child processes from the parent.  That data flow needs to become explicit
when removing the fork which makes some things a little awkward.

With fork removed:

* `edenfs` unconditionally spawns `edenfs_privhelper` while it has
  root privs and before most of the process has been initialized.
* That same `edenfs` process will then spawn a child `edenfs`
  process which starts from scratch, but that which needs to
  run as the real server instance
* The original `edenfs` instance needs to linger for a while
  to remain connected to the controlling tty to pass back the
  startup state to the user, before terminating.

This commit deletes the check that `edenfs` is started originally
as root; previously the logic relied on the forked startup logger
continuing past the `daemonizeIfRequested` call and simply deferring
the check until after folly::init.  With these changes we can't
easily perform such a check without adding some extra gymnastics
to pass the state around; the place where that is checked is in
the spawned child of the original edenfs, which is not a privileged
process and doesn't know the original euid.  I don't believe this
to be a great loss as we tuck `edenfs` away under the libexec dir.

Reviewed By: chadaustin

Differential Revision: D23696569

fbshipit-source-id: 55b95daf022601a4699274d696af419f0a11f6f2
2020-09-18 17:22:39 -07:00
Wez Furlong
2941822299 eden: use SpawnedProcess to start privhelper
Summary:
On macOS we cannot safely use `fork` to spawn processes while other threads may initialize objc classes.

This commit replaces the use of `fork` in the privhelper startup with
`SpawnedProcess` instead.  We need to take care with this as we are generally
installed setuid root and we'd like to avoid being tricked into running an
arbitrary child process as root.

This commit defines a separate executable called `edenfs_privhelper` that
contains just the privhelper server code.

We need to be careful about locating this executable; to avoid invoking an
arbitrary process while we have root privileges we require that the privhelper
be a sibling to the edenfs executable and carry out some additional ownership
verification so that we can tell that the owner of edenfs also controls
edenfs_privhelper.

To facilitate this, I've added an `executablePath` function to PathFuncs; it
returns the path to the current executable image.

To make the integration test scenario simpler, I've added the edenfs_executable
binary definition alongside that of the edenfs binary in the buck and cmake
build systems.  This causes the binaries to be siblings in-situ in the build
tree and avoids the need to move things into place in the test harness.

Reviewed By: chadaustin

Differential Revision: D23653343

fbshipit-source-id: 3c2539a5e0e11cee88960db49c885ce0366d314e
2020-09-18 17:22:39 -07:00
svcscm
ad58fc59c5 Updating submodules
Summary:
GitHub commits:

cca821dc4a
f8e418967f
00638349eb
96c5938681
5b340a6795

Reviewed By: yns88

fbshipit-source-id: bb50b99ab6164079e4000a9b8a1cb88c10e593e6
2020-09-18 17:22:39 -07:00