Commit Graph

1372 Commits

Author SHA1 Message Date
Zeyi Fan
d9f1beb1a1 add mononoke:connector config and create initializeHttpMononokeBackingStore
Summary:
This diff added a configurable value "mononoke:connector" to EdenConfig, so that we can specify a particular type of connection we need when using Mononoke as backing store.

This diff also moved the logic of initializing the existing `MononokeHttpBackingStore` to `initializeHttpMononokeBackingStore`.

Reviewed By: wez, strager

Differential Revision: D14141725

fbshipit-source-id: c7208295d7b3853740d7b0e5166f8854457fcf8e
2019-03-11 14:34:08 -07:00
Chad Austin
eafd6107de add missing gflags headers
Summary:
Not sure why gflags is automatically included on Linux and not in
mode/mac, but add the includes nonetheless!

Reviewed By: strager

Differential Revision: D14389458

fbshipit-source-id: 27811ec4bb65b03e73b15bb51de1264dbfe053dc
2019-03-08 14:43:24 -08:00
Matt Glazar
49f4c37b67 Add missing copyright notices
Summary: Internal Facebook infrastructure is nagging me about some files not having a Facebook copyright notice. Add a notice to these files to make the nagging stop.

Reviewed By: simpkins

Differential Revision: D14173944

fbshipit-source-id: 7234431224fcf4f86ea56ca2f9108f47ef959d87
2019-03-07 19:32:39 -08:00
Adam Simpkins
79f873f81c automatically create mount directories when necessary
Summary:
This updates `edenfs` to automatically create the mount point directory
if it does not exist.

Previously the `eden mount` CLI command would automatically create the mount
directory in the Python logic.  This adds similar logic to the C++ code, which
handles more situations.  In particular this makes it so that `eden start`
will now automatically create missing mount point directories.

Note that the C++ code does not create the `README_EDEN.txt` symlink inside
the mount point if it is missing.  We could move that functionality into the
C++ code in the future if needed.

Reviewed By: strager

Differential Revision: D14254699

fbshipit-source-id: bad5634f57fba6e7af3b6a3830eb51ac099b435e
2019-03-07 12:36:04 -08:00
Yedidya Feldblum
e245072bf7 Add assorted missing includes
Summary: [Eden] Add assorted missing `#include`s.

Reviewed By: swolchok

Differential Revision: D14293384

fbshipit-source-id: ccd61dde41a978bd3f82eb11cbe401cd51e7e056
2019-03-07 00:13:47 -08:00
Adam Simpkins
75b199385e perform overlay initialization in a separate thread
Summary:
Update `Overlay::initialization()` to perform the bulk of the initialization
logic in the GC thread.  We re-use the GC thread simply for convenience, since
it already exists and won't have any work to do until initialization has
completed anyway.

After an unclean shutdown this allows edenfs to start and perform the overlay
scans for all of its checkouts in parallel rather than serially.

Reviewed By: wez

Differential Revision: D14154868

fbshipit-source-id: c177cb9f950a6317fd7ea06888bd5b326a55ace7
2019-03-06 20:33:42 -08:00
Adam Simpkins
42b4ffd194 add an Overlay::initialize() function
Summary:
Add an Overlay::initialize() function, and consolidate all Overlay
initializtion logic in this function.  Previously some initialization was done
by the Overlay constructor, and some was done in `EdenMount::initialize()`

Overlay::initialize() returns a folly::SemiFuture as it may perform a
non-trivial amount of disk I/O.  However, at the moment it currently performs
all I/O in the current thread before it returns.  I plan to move this work to
a separate thread in a subsequent diff.

Reviewed By: strager

Differential Revision: D13981140

fbshipit-source-id: b59eaef88012a8e74fcb770a9c93ca3f9bde32a0
2019-03-06 20:33:42 -08:00
Adam Simpkins
4dc59b856b ensure that most thrift calls cannot access initializing mounts
Summary:
This updates the `EdenServer` class so that the existing `getMount()` and
`getMountPoints()` APIs only return mounts that have finished initializing.

These APIs are primarily used by the thrift interfaces.  In most cases the
callers did not intend to operate on mounts that were still initializing, and
doing so was unsafe.  The code could potentially dereference a null pointer if
it tried to access the mount's root inode before the root inode object had
been created.

New `getMountUnsafe()` and `getAllMountPoints()` APIs have been added for call
sites that explicitly want to be able to access mounts that may still be
initializing.  Currently the `listMounts()` thrift API is the only location
that needs this.

Reviewed By: strager

Differential Revision: D13981139

fbshipit-source-id: e6168d7a15694c79ca2bcc129dda46f82382e8e9
2019-03-06 20:33:42 -08:00
Adam Simpkins
b47184adc4 add a flag to report start-up success before finishing mounts
Summary:
Add a flag to tell edenfs to report successful start-up as soon as the thrift
server is running, without waiting for all mount points to finish being
remounted.

In the future I plan to have edenfs automatically perform an fsck scan of the
overlay for checkouts that were not shut down cleanly.  This may cause the
remount to take a significant amount of extra start-up time in some cases.
(This is already true today in some cases even with the simpler scan we do to
re-compute the max inode number.)

I think we will probably want to have systemd invoke edenfs with this option,
so that we do not time out during system start up if some mount points need to
be rescanned.

Reviewed By: strager

Differential Revision: D13522040

fbshipit-source-id: 6f183770c25efee34c4805c9bad42a9cce51039e
2019-03-06 20:33:41 -08:00
Matt Glazar
ce1c8019a0 Refactor MountPromiseDelegate and FailingMountDelegate
Summary:
In the future, I want some tests to mock PrivHelper::fuseUnmount. The existing classes for mocking PrivHelper::fuseMount, MountPromiseDelegate and FailingMountDelegate, work poorly for fuseUnmount.

Combine MountPromiseDelegate and FailingMountDelegate to create MockMountDelegate, which is more flexible and allows a mocking fuseUnmount to be implemented easily.

This diff should not change behavior.

Reviewed By: simpkins

Differential Revision: D14319712

fbshipit-source-id: 6eecf121e3b44f39cd5dffbeafaf0f3aab75cb76
2019-03-06 19:20:02 -08:00
Chad Austin
28c480cb03 use cpptoml from third-party
Summary: Switch to using cpptoml from third-party on all platforms.

Reviewed By: igorsugak

Differential Revision: D14351179

fbshipit-source-id: 183bedc7d27e9c0f9216f3d0cca58ada75ac74e7
2019-03-06 15:19:23 -08:00
Matt Glazar
51857c47dd Add test for mount state after takeover
Summary: Ensure that an EdenMount is RUNNING after it takes over an EdenMount from another process.

Reviewed By: simpkins

Differential Revision: D14178500

fbshipit-source-id: 2813b024b6815dc5d31f3e3bf89cffa98ad0f1c3
2019-03-05 17:32:46 -08:00
Matt Glazar
77e312595c Make FakeFuseMountDelegate public
Summary:
I want manipulate a FakeFuseMountDelegate in a test, but FakeFuseMountDelegate is private to FakePrivHelper.cpp. Make FakeFuseMountDelegate usable outside FakePrivHelper.cpp by putting its declaration in FakePrivHelper.h.

This diff should not change behavior.

Reviewed By: simpkins

Differential Revision: D14319711

fbshipit-source-id: d7af18c316f63febe1d60f6e5aadcd4f4827cca5
2019-03-05 16:21:24 -08:00
Adam Simpkins
5abf0a6aed automatically recreate bind mount source directories when necessary
Summary:
Update `edenfs` to automatically create the bind mount source directories if
they are missing.  Previously Eden would report an error and would not be able
to mount the checkout if some of the bind mount source directories were
missing.

Reviewed By: strager

Differential Revision: D14253771

fbshipit-source-id: 87ad091ccf2c0f0f72aebb50437fd7680ddbfd1c
2019-03-04 19:57:01 -08:00
generatedunixname89002005289445
1678b9273e Update pyre version for eden
Summary: Automatic upgrade to remove `version` override and silence errors.

Reviewed By: shannonzhu

Differential Revision: D14305975

fbshipit-source-id: 7b54441dc846165fb12bfbe5339e4c917da463ec
2019-03-04 13:03:03 -08:00
Rick Ratmansky
593f2f29ca Revert D14114164: [Folly] Remove include of glog from Range.h
Differential Revision:
D14114164

Original commit changeset: e227609e9214

fbshipit-source-id: 99d0fde58e512224915d7a00893ddf15c547dfba
2019-03-01 06:51:52 -08:00
Yedidya Feldblum
851e90c055 Remove include of glog from Range.h
Summary: [Folly] Remove include of `glog` from `Range.h`.

Reviewed By: lbrandy, Orvid

Differential Revision: D14114164

fbshipit-source-id: e227609e9214ab39ff272e44519d34f3047fe025
2019-03-01 01:43:08 -08:00
Yedidya Feldblum
92a8e3f59f Stop checking EventBase::runInEventBaseThread result
Summary:
[Folly] Stop checking `EventBase::runInEventBaseThread` result, as the function will soon be changed not to return any result.

It returned `false` when failing to enqueue a task. But it cannot really fail anyway besides allocation failure, unless in the `EventBase` destructor and while draining and the `AlwaysEnqueue` variant is called.

Reviewed By: andriigrynenko

Differential Revision: D14254969

fbshipit-source-id: a6a9199cbafa18b61488a240e4318ce946953f51
2019-02-28 02:36:15 -08:00
Chad Austin
015c45872b split privhelper and privhelper_base
Summary:
We're not that far from building privhelper on mode/mac but it does
require figuring out how to depend on osxfuse from the Buck build, so
bypass that by breaking the inodes target's dependency on privhelper's
<fuse_ioctl.h> include.

Reviewed By: strager

Differential Revision: D14218709

fbshipit-source-id: edbb2a21df06d6f2a4f860ef13718ad05d445e98
2019-02-27 19:06:00 -08:00
Chad Austin
c70c52529a fix some includes on @mode/mac
Summary: Fix some missing includes that showed up in my mode/mac builds of parts of Eden.

Reviewed By: simpkins, strager

Differential Revision: D14213572

fbshipit-source-id: 54e070e89afdfb8479abdaa122ba76ca1d2d9ba9
2019-02-27 14:55:21 -08:00
Adam Simpkins
01490a26da improve error messages if the hg import helper fails to start
Summary:
Throw a slightly nicer error message if the hg import helper exits before
returning a `CMD_STARTED` response or an error response.

When switching from the `hg_import_helper.py` script to the
`hg debugedenimporthelper` subcommand we are slightly more likely to encounter
errors during startup.  For instance, if the repository path was not a valid
repository the `hg_import_helper.py` code would send an error message back
that the `HgImporter.cpp` code could parse.  However, we unfortunately can't
catch errors loading the repository the same way when using an `hg`
subcommand.  If it fails to load the repository it will simply print an error
message to stderr and then bail out before it invokes the
`debugedenimporthelper` code.

Reviewed By: chadaustin

Differential Revision: D14222266

fbshipit-source-id: cd60e5a61725d45a816b74f63b9969b29ade2160
2019-02-27 13:46:36 -08:00
Matt Glazar
4568ff90b7 Factor EdenMount::unmount function
Summary:
EdenMount calls fuseMount, but EdenServer calls fuseUnmount. I think only one of EdenMount or EdenServer should call fuseMount/fuseUnmount. Splitting the responsibility is confusing.

Move the call to fuseUnmount into EdenMount by creating a member function called unmount.

This diff should not change behavior.

Reviewed By: simpkins

Differential Revision: D14115385

fbshipit-source-id: 845c4a87cdba9f270c0eacaf01916ad91c3b7c0e
2019-02-26 22:54:12 -08:00
Adam Simpkins
61856d0919 enable blocking mount initialization via fault injection
Summary:
Update `EdenMount::initialize()` to perform a fault injection check.  This
allows test code to inject delays and errors into the mount initialization
flow.

Reviewed By: strager

Differential Revision: D14079491

fbshipit-source-id: be80135b0833c8f0300104524473cc3e949fec34
2019-02-26 18:43:22 -08:00
Orvid King
c2944f20d8 Shift from the file descriptor overload of EventHandler to the NetworkSocket overload
Summary: The file descriptor overload will be going away.

Reviewed By: yfeldblum

Differential Revision: D14070240

fbshipit-source-id: 20a0248fd9840629e31a3274032b889b6bb5f8de
2019-02-23 10:47:42 -08:00
Adam Simpkins
21c5e34e33 move hg_import_helper.py back to bin/, update edenfs to find it
Summary:
This reverts the change in D14188312 that moved `hg_import_helper.py` from
`bin/` to `libexec/eden/`, and instead updates edenfs to look for
`hg_import_helper.py` at `../../bin/hg_import_helper.py`

We cannot remove `hg_import_helper.py` from `/usr/local/bin` without breaking
existing running `edenfs` daemons as they will continue to look for
`hg_import_helper.py` in this location.

Rather than keeping a copy in both `bin/` and `libexec/eden` it seems better
to simply update edenfs so that it can correctly find `hg_import_helper.py`
even when edenfs itself has been installed in `libexec/eden/`

Reviewed By: strager

Differential Revision: D14197390

fbshipit-source-id: 2845bd79343bc29af9d3acbacecac4501cdb9032
2019-02-22 19:49:45 -08:00
Chad Austin
b8dc8a80c3 only include selinux on linux
Summary: We should only attempt to include selinux on Linux, not macOS.

Reviewed By: strager

Differential Revision: D14181109

fbshipit-source-id: be47b7bdadc3409577fa114559e905214848ebd8
2019-02-22 16:14:48 -08:00
Zeyi Fan
8535c7fe69 rename MononokeBackingStore to MononokeHttpBackingStore
Summary: Rename `MononokeBackingStore` to `MononokeHttpBackingStore`. Also fixed some pre-existing issues regarding copying & constants.

Reviewed By: wez, strager

Differential Revision: D14140968

fbshipit-source-id: 832ce449167584e1684031655514bba7d1435e01
2019-02-22 12:22:00 -08:00
Mark Thomas
9218f35f45 rename and relocate eden and edenfs
Summary:
The Eden CLI tool is really a control program for `edenfs`.  Rename it to
`edenfsctl` to free up the `eden` name for future use.

The Eden daemon shouldn't really be on the user's path, and instead belongs in
`libexec`.

For transition compatibility, `eden` is symlinked to `edenfsctl`.

Reviewed By: simpkins

Differential Revision: D13888875

fbshipit-source-id: 435cc63e92b85b1f28b8691e4846fbcb05bc450e
2019-02-21 15:00:47 -08:00
Matt Glazar
b75e6d69a2 Fix typo in log message
Summary:
Before:

E0220 22:59:26.395141 837143 EdenServiceHandler.cpp:285] Error :attempt to construct an AbsolutePath from a non-absolute string: ""

After:

E0220 22:58:22.064988 1898825 EdenServiceHandler.cpp:286] Error: attempt to construct an AbsolutePath from a non-absolute string: ""

Reviewed By: chadaustin

Differential Revision: D14077849

fbshipit-source-id: ea36151d8a87012cf6b3447883217e36a6de0992
2019-02-21 00:24:56 -08:00
Lee Howes
2ee4c1d8fd Replace futures::sleep with futures::sleepUnsafe
Summary:
futures::sleep returning a Future leads to continuations easily being run on
the Timekeeper's callback. The goal is to change the return type so that
futures::sleep returns a folly::SemiFuture.

This codemod is part of the first stage:
 * Migrate all call sites off of futures::sleep and onto futures::sleepUnsafe.

 This will be followed by:
  * Changing the return type of futures::sleep to folly::SemiFuture.
  * Migrating callers, where clearly safe such as when they follow with .via or
    .semi() from sleepUnsafe to sleep.
  * Migrating remaining callers.

Reviewed By: yfeldblum

Differential Revision: D14152623

fbshipit-source-id: bc6874e4320e4a7352ac61b20d9750458e2cbbff
2019-02-20 21:37:15 -08:00
Matt Glazar
900ca6f88d Fix EdenMount leak with racing shutdown and destroy
Summary:
If EdenMount::shutdown is in progress and EdenMount::destroy is called [1], the EdenMount object won't ever be deleted. A comment in EdenMount::destroy claims that EdenMount::shutdown will delete the EdenMount object, but the comment is wrong:

    case State::SHUTTING_DOWN:
      // Nothing else to do.  shutdown() will destroy us when it completes.
      return;

This leak is probably benign, but the leak checker can cause tests to fail spuriously. I think the leak currently can't happen for EdenServer's mounts, but in the future the leak might occur and cause problems.

Make EdenMount::shutdown delete the EdenMount if EdenMount::destroy was called. This fixes the leak.

[1] EdenMount::destroy is called by EdenMountDeleter when the last std::shared_ptr<EdenMount> is destroyed.

Reviewed By: simpkins

Differential Revision: D14015024

fbshipit-source-id: 39a0ba78bb00afb5f0363fe5c74dbec00f9d68e3
2019-02-20 14:01:04 -08:00
Matt Glazar
fe919940bc Fix race between FUSE_ERROR and SHUTDOWN EdenMount states
Summary:
If EdenMount::shutdownImpl and EdenMount::startFuse execute concurrently, the mount's `state_` might end up inconsistent. For example, for the following sequence of events, EdenMount::shutdownImpl is erroneously called twice:

1. EdenMount::initialize transitions the mount's state to INITIALIZED.
2. EdenMount::startFuse begins and transitions the mount's state to STARTING.
3. EdenMount::shutdown begins and transitions the mount's state to SHUTTING_DOWN.
4. EdenMount::shutdown finishes and transitions the mount's state to SHUT_DOWN.
5. EdenMount::startFuse finishes due to FuseChannel::initialize failing with an error and transitions the mount's state to FUSE_ERROR.
6. EdenMountDeleter calls EdenMount::destroy, which observes that the mount's state is FUSE_ERROR. EdenMount::destroy proceeds by calling EdenMount::shutdownImpl.

This specific scenario can't happen in production right now because step 3 requires allowFuseNotStarted to be true (and it's never true in production).

A similar scenario can happen with EdenMount::startFuse+EdenMount::destroy running currently, but the effects are benign. However, in a future diff (D14015024), I am changing how EdenMount::destroy works, and the SHUT_DOWN -> FUSE_ERROR transition causes problems.

When FuseChannel::initialize returns an error, transition the mount to the FUSE_ERROR state only if we are not already shutting down (instead of unconditionally). This fixes the [impossible] scenario above, and also fixes EdenMount::destroy in a future diff.

Reviewed By: simpkins

Differential Revision: D14030898

fbshipit-source-id: fe5a749b8798749734e0de91eb3b71b601ebb64b
2019-02-20 14:01:04 -08:00
Puneet Kaushik
c066cb60d6 Removing dtype from Windows
Reviewed By: wez

Differential Revision: D14141032

fbshipit-source-id: 6a8c71fe77310f83df075e4bab9e44707dec4d91
2019-02-19 15:43:20 -08:00
Wez Furlong
8847a7a061 add dtype as an optional return value from glob
Summary:
This diff adds the dtype field to the glob results;
this will help to reduce the cost of some watchman queries by avoiding a
getFileInformation call that instantiates inodes.

As part of this, I added a bunch of unit test coverage.

Reviewed By: strager

Differential Revision: D8779149

fbshipit-source-id: 3064a3e42be55ec576fed9e0f7112edef426f32d
2019-02-19 11:26:26 -08:00
Puneet Kaushik
b2ad632b62 Moving #ifdef out of macro expansion to fix the Windows build.
Reviewed By: wez

Differential Revision: D14125839

fbshipit-source-id: 455e573b4645c3009f33baccd6a14200eb0d6313
2019-02-19 10:50:48 -08:00
Adam Simpkins
5d4279567d add thrift APIs to the fault injection framework
Summary: Add some thrift APIs that allow injecting faults into Eden's FaultInjector.

Reviewed By: wez

Differential Revision: D14079490

fbshipit-source-id: a9ec16b560ddcc79d5d819dbbc120ad5da556b4e
2019-02-15 19:27:17 -08:00
Adam Simpkins
37fd4f5cfb add a fault injection framework
Summary:
Add a new class for injecting faults into Eden.  This will make it easier to
build tests that exercise specific error conditions or specifically control
the ordering of operations that might otherwise race.

To minimize the performance impact, the fault injection framework is disabled
by default and must be explicitly enabled at process startup using a command
line flag.  If this command line flag was not specified all fault injection
checks short-circuit into a no-op.  The `checkAsync()` version does still add
some extra overhead due to the addition of a new `folly::SemiFuture` into the
code path.

Reviewed By: wez

Differential Revision: D14079489

fbshipit-source-id: 3e8725d2e51e5c829199a602e90574424ea52636
2019-02-15 19:27:17 -08:00
Matt Glazar
470fb433c9 Transition to FUSE_ERROR state if mounting fails
Summary:
If PrivHelper::fuseMount fails with an error, EdenMount::getState returns STARTING. This is confusing. Make EdenMount::getState instead return FUSE_ERROR in this case.

Aside from changing the output of 'eden list' in some cases, this diff should not change behavior.

Reviewed By: chadaustin

Differential Revision: D14060982

fbshipit-source-id: ae9c2c532b1654cce36b806971053d89231058c3
2019-02-15 19:27:17 -08:00
Matt Glazar
c7df342201 Test mount state (STARTING, RUNNING, etc.)
Summary:
While moving code around in EdenMount::startFuse, EdenMount::shutdown, and EdenMount::destroy, I accidentally changed the result of EdenMount::getState in some circumstances. I noticed that we don't have any tests for EdenMount::getState, so it could have been broken even before my changes!

Write some tests for EdenMount::getState to verify the existing behavior and to prevent future regressions. Only add tests which pass with the current implementation; future diffs will fixe cases where EdenMount::getState returns the wrong value.

Reviewed By: chadaustin

Differential Revision: D14058334

fbshipit-source-id: 68b60ac92f94d336fcfb8f11e571379573bb3f42
2019-02-15 14:34:05 -08:00
Matt Glazar
ac938df3dc Simplify making TestMount with empty tree
Summary:
Some tests want to create a TestMount but don't care what files are in the mount. The following code is intuitively correct. However, TestMount's constructor takes a FakeTreeBuilder by non-const reference, so it fails to compile:

    auto testMount = TestMount{FakeTreeBuilder{}};

The following code works, but more verbose:

    auto builder = FakeTreeBuilder{};
    auto testMount = TestMount{builder};

Overload TestMount's constructor to allow the former form in addition to the latter form. This neatly shrinks some test code.

This diff should not change behavior.

Reviewed By: chadaustin

Differential Revision: D14060110

fbshipit-source-id: c6a5d4b2c5859812efff279dedbc1fe690c8f8ad
2019-02-15 13:30:44 -08:00
Matt Glazar
b0d2aac1d0 Add TestMount::startFuseAndWait
Summary:
Make it easier to write tests involving a FakeFuse-mounted EdenMount by creating the TestMount::startFuseAndWait function which initializes EdenMount.

This diff should not change behavior.

Reviewed By: chadaustin

Differential Revision: D14059808

fbshipit-source-id: ce63bbce7f2c6e710910ad530aa1b4efefe80272
2019-02-15 13:26:05 -08:00
Matt Glazar
ead13996c5 Refactor FakePrivHelper: allow custom behavior
Summary:
I want to test EdenMount::startFuse when PrivHelper::fuseMount fails. FakePrivHelper makes this inconvenient. Extend FakePrivHelper so a test can execute arbitrary code for fuseMount calls.

This diff should not change behavior.

Reviewed By: chadaustin

Differential Revision: D14058663

fbshipit-source-id: 27ff32a75adde8aff952ac50b3f1977cf0b59e93
2019-02-15 11:51:11 -08:00
Wez Furlong
ab03aa78c2 eden: hg_import_helper.py execs hg debugedenimporthelper
Summary:
Now that `hg debugedenimporthelper` has been released for
a little while, we can remove the bundled implementation of it from
the eden release.

However, we cannot remove the script itself as there are users
with long running edenfs instances that pre-date the knowledge
of `hg debugedenimporthelper`.   So, as a compatibility shim,
this diff redirects `hg_import_helper.py` and has it exec the
command in mercurial.

For extra fun, our own integration tests rely on being able
to import `hg_import_helper.py` and override portions of it,
so we cannot remove its implementation from the codebase just
yet either.

So this diff:

* Introduces `proxy_import_helper.py` which execs `hg debugedenimporthelper`
* Installs `proxy_import_helper.py` as `hg_import_helper.py` in the rpm
* Leave `hg_import_helper.py` as-is in the tree for now.

Reviewed By: simpkins

Differential Revision: D13970332

fbshipit-source-id: 717dc86a880fbbbe4a7e801a8b748abd053c7f7c
2019-02-14 22:27:00 -08:00
Wez Furlong
995f140d67 eden: resolve hg.real from $PATH on unix systems
Summary:
in D13970332 we want to allow using `hg.real` to run the
import helper that is embedded into mercurial, but we don't know
the full path, so we need to resolve it from the environment.

`folly::Subprocess` has `usePath` option, but it is not compatible
with also overriding the environment for a child process.

The easiest short term thing to do is to resolve the path ourselves
using this simple function call.

I've also added the path to `hg.real` that is used on our mac systems
to the PATH we pass down to `edenfs` when starting eden.

Longer term we want to better encapsulate how we resolve and start
the import helper, but for now this unblocks starting eden on the
mac.

Reviewed By: strager

Differential Revision: D14078612

fbshipit-source-id: bc6787bbe99cd87224b783d2fb9d3255b825b976
2019-02-14 22:27:00 -08:00
Michael Liu
b626f922ce Apply modernize-use-override (2nd iteration)
Summary:
Use C++11’s override and remove virtual where applicable.
Change are automatically generated.

Reviewed By: simpkins

Differential Revision: D14087291

fbshipit-source-id: 80e6a393c5ed8ea1656855da3832bcee10635004
2019-02-14 17:29:27 -08:00
Chad Austin
d62a6c9154 break a Thrift service dependency
Summary:
Differ.h was including an overly-broad header when all it needed was
the type definitions. This makes building the inodes target with
mode/mac easier.

Reviewed By: simpkins, strager

Differential Revision: D14036477

fbshipit-source-id: 99f3a55d0523c179f6cf2aa4210119ae6f8e51f8
2019-02-13 15:53:46 -08:00
Chad Austin
c0955f75d2 split the RocksDB local store into its own Buck target
Summary:
I don't have RocksDB building in mode/mac yet, and the inode code
only depends on the store interface, not all of the specific
implementations.

Reviewed By: simpkins, strager

Differential Revision: D14036390

fbshipit-source-id: d0b8d5c4d4f2f38dbc9bc2476c24ac99398d37b7
2019-02-13 15:53:46 -08:00
Matt Glazar
9514503c63 Factor duplicate FUSE_INIT code in tests
Summary:
Some tests set up fuse_init_in manually then call FakeFuse::sendRequest. The specific fuse_init_in setup is benign and already exists in FakeFuse::sendInitRequest. Shorten these tests by making them call FakeFuse::sendInitRequest instead.

This diff should not change behavior.

Reviewed By: chadaustin

Differential Revision: D14059700

fbshipit-source-id: 210dcfdc4ae1c74e10c50dbc3f3044c3b908da0a
2019-02-13 15:25:46 -08:00
Matt Glazar
238e5064d9 Factor duplicate init code in TestMount
Summary:
Calls to ObjectStore::create and EdenMount::create are duplicated in the various TestMount::initialize overloads. Fix the duplication by moving the two calls into their own function.

This diff should not change behavior.

Reviewed By: chadaustin

Differential Revision: D14058972

fbshipit-source-id: b3e79756793292b59f09f53c05649a637c8af07e
2019-02-13 15:20:20 -08:00
Chad Austin
9ab6370ea5 remove DirEntry::getModeUnsafe
Summary:
getInitialMode and getModeUnsafe were not inherently different, so
remove getModeUnsafe and write an accurate comment in Overlay's
serialization code about why the initial mode is saved and how we
could remove that logic in the future.

Reviewed By: strager

Differential Revision: D14007488

fbshipit-source-id: db42f45f00dcd213fabd9575360da1261931778b
2019-02-13 14:33:07 -08:00