Commit Graph

295 Commits

Author SHA1 Message Date
Xavier Deguillard
09f97fa27a store: diff should respect the mount case sensitivity
Summary:
During a diff operation, files that have a case change should not reported as
changed for case insensitive mount. This is a follow up to D29150552 (37ccaa9231) where the
TreeInode code was taught to ignore case changes for case insensitive mounts.

Reviewed By: kmancini

Differential Revision: D29952464

fbshipit-source-id: e5fa8eccc1c1984a680838fd8589a0278989d9d0
2021-07-29 11:29:42 -07:00
Zhengchao Liu
8f58e523cd synchronize getClient in scs metadata importer
Reviewed By: kmancini

Differential Revision: D29794557

fbshipit-source-id: e8e09c9aea994fad649af5119f3d8e42e12f5417
2021-07-29 09:56:24 -07:00
Xavier Deguillard
628ba1b62d utils: fix race in SpawnedProcess::threadedCommunicate
Summary:
TSAN complains that pipes_ is read and written in different threads without
proper synchronization. To avoid this, we can simply close the FileDescriptor
without removing it from the pipes map as this achieve the same result: it
notifies the reader that the endpoint is closed.

Differential Revision: D29924043

fbshipit-source-id: be92630799bb5c78089dbe85f9c2f02f937300bc
2021-07-27 07:32:42 -07:00
Zhengchao Liu
321cb87688 cli support for ActivityRecorder
Summary:
This adds debug commands for ActivityRecorder:
```
eden debug start_recording --output-dir <DIR>
  * stdout: the id of the profile
eden debug stop_recording --unique <ID>
  * stdout: the output file path
```
Users can record multiple profiles concurrently. Each profile is identified by the timestamp when it started.

Reviewed By: genevievehelsel

Differential Revision: D29666359

fbshipit-source-id: 487ca67de77378a8141bc4ac46b9abd1375ffd23
2021-07-23 12:32:25 -07:00
Zhengchao Liu
067abe2d55 collect memory and disk fetch counts
Summary: This adds counters for memory and disk counts in addition to import count so that we can understand cache hit rates during local investigation or output this in ActivityRecorder.

Reviewed By: genevievehelsel

Differential Revision: D29805637

fbshipit-source-id: 34261f91c33d6bd4bcb4b85b17d2e68360410896
2021-07-21 21:37:20 -07:00
Prabhash Rathore
889ceef7b9 Remove direct uses of gmock.h
Summary: Remove direct uses of gmock.h

Reviewed By: chadaustin

Differential Revision: D29532548

fbshipit-source-id: c4262eb2bba7461c4f4b6dc9114dae4bcb4c5f82
2021-07-07 13:32:31 -07:00
Genevieve Helsel
9b4909d022 create util EdenTaskQueue from NfsTaskQueue
Summary: NfsTaskQueue can be made more generic to be shared across the codebase, so this makes it its own target in `eden/fs/utils` w/ the name EdenTaskQueue.

Reviewed By: xavierd

Differential Revision: D29244762

fbshipit-source-id: 78348f2ff8fa66bc801aefe7d6b3905e0da278e8
2021-06-29 09:45:46 -07:00
Zhengchao Liu
1f9541251f utils: add ImmediateFuture::ensure
Summary:
We are adding tracing to nfs. To record the elapsed time of a call, we need to invoke a callback when future is ready (has value or exception). For fuse, this is done with `Future::ensure`. Nfs is using `ImmediateFuture`, so I am adding `ImmediateFuture::ensure` accordingly.

https://www.internalfb.com/intern/diffusion/FBS/browsefile/master/fbcode/eden/fs/fuse/FuseChannel.cpp?commit=64091acc4e2905bfb58b4795e705fa6b554c487c&lines=1733-1735

Reviewed By: chadaustin

Differential Revision: D29278838

fbshipit-source-id: 176d6361a0ef1dd4a89db470acbb36b4868e04ef
2021-06-23 14:23:40 -07:00
Xavier Deguillard
cc5951d322 service: key mount map with an AbsolutePath
Summary:
Using a PathMap to hold the list of mounts gives us case sensitivity for free
without needing to have #ifdef _WIN32, we can also avoid copying the paths just
to normalize them.

Reviewed By: fanzeyi

Differential Revision: D28969795

fbshipit-source-id: 859cdc3881e36db120913099ce3f451940fa48a4
2021-06-09 21:34:27 -07:00
Yipu Miao
f2bb80c128 Not use gtest for UserInfo.h on Windows
Summary: There are some unused warning on Windows, should be an easy fix.

Reviewed By: fanzeyi

Differential Revision: D28663227

fbshipit-source-id: cee18ec28283c0aef18151465a3c13e9be604d7d
2021-05-25 23:55:08 -07:00
Yipu Miao
405c6996cd Fix warning on FileDescriptor.cpp
Summary: FileDescriptor.cp throws some warning on comparison of signed long and unsigned long.  So fix these warning and follow how ```folly/portability/SysUio.cpp:doVecOperation``` did

Reviewed By: fanzeyi

Differential Revision: D28608581

fbshipit-source-id: 3b6e35e9764548ce470634f16a1f6eec5118d7ed
2021-05-25 19:45:22 -07:00
Xavier Deguillard
5a84f7ac85 utils: add an makeImmediateFutureWith function
Summary: This will be used to replace calls to folly::makeFutureWith.

Reviewed By: chadaustin

Differential Revision: D28515786

fbshipit-source-id: 2c2c542392e8e57b8f865173d6878cb9d00ba376
2021-05-25 09:45:47 -07:00
Xavier Deguillard
de7a364e78 utils: really skip path sanity checking when asked
Summary:
When the caller asks to not perform sanity checking, this should be honored as
the caller can for instance tell that a path is guaranteed to be valid and
shouldn't be checked.

When running the newly added glob benchmark, EdenFS was spending 7.5% of the
time validating a path that was constructed via the operator+.

Reviewed By: fanzeyi

Differential Revision: D28612665

fbshipit-source-id: 282155d0415ab6458bd9307c89a24e9e090bf09d
2021-05-21 19:26:46 -07:00
Xavier Deguillard
de6ca0c970 utils: handle void lambda in ImmediateFuture
Summary:
Lambda returning no values would cause the compiler to try to instantiate an
ImmediateFuture<void>, which doesn't compile. We could try special casing the
void type, but it's easier if we simply consider these lambda to return unit.

Reviewed By: genevievehelsel

Differential Revision: D28372253

fbshipit-source-id: 1368ae5dc5e2d4d6a5c3e31bc87ed7d230027c3a
2021-05-17 14:07:29 -07:00
Xavier Deguillard
3863a8972a utils: add a timeout to ImmediateFuture::{get,getTry}
Summary:
This is to mimic the folly::Future API which allows the `get` and `getTry` to
throw if the Future isn't ready. One difference is that the ImmediateFuture API
has a default argument of a max duration instead of having a separate method.
Since chrono durations are expressed as intmax_t (64-bits on systems supported
by EdenFS) a max duration is virtually infinite.

Reviewed By: chadaustin

Differential Revision: D28424053

fbshipit-source-id: 319493174f31367184dbe0aa811a97145b0310cf
2021-05-17 14:07:28 -07:00
Xavier Deguillard
288a56327b utils: EDEN_BUG_FUTURE returns a Try<T>
Summary:
This allows the macro to be used for both folly::Future, but also with
ImmediateFuture, reducing the cost of migrating to the latter.

Reviewed By: chadaustin

Differential Revision: D28302478

fbshipit-source-id: d8470428ecaa6aaccf2aa884437ca97d4b45806f
2021-05-13 16:51:34 -07:00
Xavier Deguillard
189934f9ac utils: allow mutable lambda to be passed to ImmediateFuture::thenValue
Summary:
Since lambda are default capturing by const, Func was also captured that way,
which made it impossible to call if Func was actually a mutable lambda.

Reviewed By: chadaustin

Differential Revision: D28297423

fbshipit-source-id: b9c6bdcf024c2e219ec0f8f5be2379e51df24db0
2021-05-13 16:51:34 -07:00
Xavier Deguillard
5ee950f5e0 utils: also call func when an ImmediateFuture holds an exception
Summary:
This code initially was for thenValue, but when I converted it for thenTry I
forgot to also remove the hasException case. We were never calling the callback
on a Try that had an exception.

Reviewed By: chadaustin

Differential Revision: D28302477

fbshipit-source-id: 755fb2c8928627fbe1883f3863cafc360e34a038
2021-05-13 16:51:34 -07:00
Xavier Deguillard
7d48df9938 utils: coerce a SemiFuture<ImmediateFuture<T>> to a SemiFuture<T>
Summary:
When the passed in callback returns an ImmediateFuture, the code had a small
typing bug where we would try to return an ImmediateFuture<ImmediateFuture<T>>
while the function signature expected an ImmediateFuture<T>. This is due to the
SemiFuture code not coalescing a SemiFuture<ImmediatureFuture<T>> into a
SemiFuture<T>.

Reviewed By: chadaustin

Differential Revision: D28293942

fbshipit-source-id: 1bc8f58d387766f29e573499fb37402ff9b49c83
2021-05-13 16:51:34 -07:00
Katie Mancini
85942cfaad use portable version of gtest
Summary:
gtest includes some windows headers that will have conflicts with the
folly portability versions. This caused some issues in my in-memory tree
cache diffs (D27050310 (8a1a529fcc)).

We should probably generally be using the folly portable gtests so we can
avoid such issues in the future.

see here for more details: bd600cd4e8/folly/portability/GTest.h (L19)

I ran this with codemod yes to all

- convert all the includes with quotes:
`codemod -d eden/fs --extensions cpp,h '\#include\ "gtest/gtest\.h"' '#include <folly/portability/GTest.h>'`

- convert all the includes with brackets
`codemod -d eden/fs --extensions cpp,h '\#include\ <gtest/gtest\.h>' '#include <folly/portability/GTest.h>'`

- convert the test template
`codemod -d eden/facebook --extensions template '\#include\ <gtest/gtest\.h>' '#include <folly/portability/GTest.h>'`

then used `arc lint` to clean up all the targets files

Reviewed By: genevievehelsel, xavierd

Differential Revision: D28035146

fbshipit-source-id: c3b88df5d4e7cdf4d1e51d9689987ce039f47fde
2021-05-12 15:58:27 -07:00
Xavier Deguillard
f2e7099799 nfs: allow mountd and nfsd to bind to a unix socket on macOS
Summary:
Due to NFS being designed as a network filesystem, it default to binding on a
TCP socket. For EdenFS, since we're not expecting to mount an actual remote
filesystem, we bind these sockets to localhost. Unfortunately, TCP sockets have
some inherent overhead due to being designed to be reliable over a non-reliable
medium.

On macOS, Apple provides a way to mount an NFS server that is listening on a
unix domain socket. Thanks for unix socket being reliable, the TCP overhead
goes away leading to some higher throughput and lower latency for the NFS
server. For EdenFS, timing `rg foobar` over a directory containing 27k files gives:

NFS over TCP:
rg foobar > /dev/null  0.80s user 5.44s system 567% cpu 1.100 total

NFS over UDS:
rg foobar > /dev/null  0.77s user 5.27s system 679% cpu 0.888 total

osxfuse:
rg foobar > /dev/null  0.87s user 5.59s system 662% cpu 0.975 total

The main drawback of going through a unix socket is that D27717945 (bcf6aa465c) appears to
no longer be effective due to
8f02f2a044/bsd/nfs/nfs_vfsops.c (L3739)

Reviewed By: kmancini

Differential Revision: D28261422

fbshipit-source-id: 25dc1dc78cdb50d6c6550a86ef01ea2c894c110f
2021-05-12 13:06:57 -07:00
Xavier Deguillard
935791590a utils: add a semi() method to ImmediateFuture
Summary:
While ImmediateFuture are expected to be used on values that are mostly
immediate, there are cases where it won't be. In these cases we need a way to
wait for the computation/IO to complete. In order to achieve this, we need to
transform an ImmediateFuture onto a SemiFuture.

Reviewed By: fanzeyi

Differential Revision: D28293941

fbshipit-source-id: 227c0acf1e22e4f23a948ca03f2c92ccc160c862
2021-05-11 08:05:11 -07:00
Xavier Deguillard
be1aeaf5be utils: add default constructor to ImmediateFuture
Summary:
When a T can be default constructed, make an ImmediateFuture default
constructible.

Reviewed By: fanzeyi

Differential Revision: D28292874

fbshipit-source-id: 4c239cc9c3f448652b2bcdc103ea1a81ace46402
2021-05-11 08:05:11 -07:00
Xavier Deguillard
f331a0c3f9 utils: add noexcept qualifier to ImmediateFuture
Summary: This should help the compiler generate even better code.

Reviewed By: chadaustin

Differential Revision: D28153979

fbshipit-source-id: b1d84c92af4fa760c92624c53d7f57330d7706fa
2021-05-11 08:05:11 -07:00
Xavier Deguillard
b7ab05edc5 utils: add an ImmediateFuture type
Summary:
In very hot code path, EdenFS is spending a very large amount of time creating
and destroying folly::Future objects. This is due to the required memory
allocation, as well as the handful of atomics that are happening at creation
time, and these are showing up in EdenFS profiles.

In the steady state, EdenFS actually doesn't need futures, as it often times is
able to service requests from its in-memory caches, in which case we should
ideally just return the value itself and not wrap it in a folly::Future. The
added ImmediateFuture is a step in this direction, as it can hold either an
immediate value, or a folly::SemiFuture, and allow the same API to be used
transparently between these 2.

Reviewed By: genevievehelsel

Differential Revision: D28006802

fbshipit-source-id: 89eaa32e7fa82c44844c4b23c4cb30dbeea46ca8
2021-05-06 10:54:03 -07:00
Zeyi (Rice) Fan
e94d69dcd5 utils: define symlink type for Windows
Summary:
This diff defines symlink type in `DirType`.

Even though it is not directly used in the FSCK diff. This will allow us to support symlink in EdenFS Windows in the future.

Reviewed By: genevievehelsel

Differential Revision: D28016305

fbshipit-source-id: 67c1aa22e39198f9c91845129695f27b8303a5f1
2021-04-29 13:17:54 -07:00
Zeyi (Rice) Fan
a87cfb9aa3 utils: expand AbsolutePathBase to provide some filesystem related methods via Boost
Summary:
These methods will be used in my later Windows fsck diff as it will need to scan disk state to find changes.

It is a bit unfortunate that we'll need to stick with boost for now. However this should be a fairly easy migration to `std::filesystem` once that is available.

Reviewed By: kmancini

Differential Revision: D27872828

fbshipit-source-id: f6b27a171026aeaaea3db9f17b8f43cfa25004e4
2021-04-23 15:22:09 -07:00
Zeyi (Rice) Fan
287a9ff724 utils: add stack trace for Windows
Summary:
Copy from Watchman.

This allows us to show stack trace when EdenFS terminates on Windows.

Reviewed By: chadaustin

Differential Revision: D27896966

fbshipit-source-id: f3238a37a1176f879d5e6bc051ec97031c9a7096
2021-04-23 13:20:46 -07:00
Genevieve Helsel
f6e1705b7e use getGlobalIOExecutor instead of getIOExecutor
Summary:
We started getting the message
```stderr: eden/fs/utils/SpawnedProcess.cpp:798:21: error: 'getIOExecutor' is deprecated: getIOExecutor is deprecated. To use the global mutable executor use getUnsafeMutableGlobalIOExecutor. For a better solution use getGlobalIOExecutor. [-Werror,-Wdeprecated-declarations]
```
I don't see why we would need a mutable executor here so I chose `getGlobalIOExecutor` over `getUnsafeMutableGlobalIOExecutor`.

Reviewed By: kmancini

Differential Revision: D27912276

fbshipit-source-id: 95b1053f72c2b4eb2746e3c40c0cf76b69d90d6e
2021-04-21 22:13:53 -07:00
Zeyi (Rice) Fan
a3d912f2cd utils: introduce CaseSensitivity
Summary: `CaseSensitivity::Sensitive` is better than a mere `true` out of nowhere.

Reviewed By: kmancini

Differential Revision: D27867180

fbshipit-source-id: 39d21d3cc3b70c78c6984c3ddbd65b53520770be
2021-04-20 13:08:27 -07:00
Zeyi (Rice) Fan
5407ab67bd make msvc happy
Summary: Apparently MSVC isn't able to accept `std::array<char, N>::end()` as `const char*`. This fixes that.

Reviewed By: xavierd

Differential Revision: D27744719

fbshipit-source-id: 61c30f987612db4274c210aea67163505a8878bf
2021-04-13 14:34:41 -07:00
Yedidya Feldblum
d5de1b81dd migrate from uint64ToBufferUnsafe
Summary: Migrate the codebase away from the ad-hoc `folly::uint64ToBufferUnsafe` and to `folly::to_ascii_decimal` which is intended for these cases.

Reviewed By: WillerZ

Differential Revision: D27281875

fbshipit-source-id: 0c98749e4aed9c873853eed2221cf54a89279ff4
2021-04-09 21:34:38 -07:00
Anna Kukliansky
b8be7b6b29 fix compilation error of missing type
Summary:
example failure:https://www.internalfb.com/intern/buck/build/89566c50-0f40-4940-bee8-c58e4597db69/

{F508857478}

Reviewed By: mzlee

Differential Revision: D27037961

fbshipit-source-id: dd77219870f368586567b4acf2247cde2855042e
2021-03-15 22:31:25 -07:00
Chad Austin
7a3ac07f7f move EdenError to utils/
Summary:
I want to use EdenError from some code outside of service/, so move
EdenError into utils.

Reviewed By: genevievehelsel

Differential Revision: D25447438

fbshipit-source-id: 2d1ddfa379238369679e84708518a9ba106f76b9
2021-02-23 19:58:03 -08:00
Xavier Deguillard
8853701e91 path: forbid building non-utf8 paths
Summary:
The world has moved on utf-8 as the default encoding for files and data, but
EdenFS still accepts non utf-8 filenames to be written to it. In fact, most of
the time when a non utf-8 file is written to the working copy, and even though
EdenFS handles it properly, Mercurial ends up freaking out and crash. In all of
these cases, non-utf8 files were not intentional, and thus refusing to create
them wouldn't be a loss of functionality.

Note that this diff makes the asumption that Mercurial's manifest only accept
utf8 path, and thus we only have to protect against files being created in the
working copy that aren't utf8.

The unfortunate part of this diff is that it makes importing trees a bit more
expensive as testing that a path is utf8 valid is not free.

Reviewed By: chadaustin

Differential Revision: D25442975

fbshipit-source-id: 89341a004272736a61639751da43c2e9c673d5b3
2021-02-23 11:35:12 -08:00
Shai Szulanski
dba656e44d Rename Try::throwIfFailed -> throwUnlessValue
Summary: Update name to match usage of Try as tri-state, since this method also throws if the Try is empty

Reviewed By: yfeldblum

Differential Revision: D25737810

fbshipit-source-id: a4166153362f07353d212216fbaf7105867eef2a
2021-01-11 13:05:17 -08:00
Andres Suarez
21c95391ca Apply clang-format update fixes
Reviewed By: igorsugak

Differential Revision: D25861960

fbshipit-source-id: e3c39c080429058a58cdc66d45350e5d1420f98c
2021-01-10 10:06:29 -08:00
Xavier Deguillard
978cd4549c hg: ignore invalid filename when importing manifest
Summary:
Mercurial support files with `\` in their name, which can't be represented on
Windows due to `\` being the path separator. Currently, EdenFS will throw
errors at the user when such file are encountered, let's simply warn, and
continue.

Reviewed By: chadaustin

Differential Revision: D25430523

fbshipit-source-id: 4167b4cd81380226aead8e4f4850a7738087fd95
2021-01-05 14:08:14 -08:00
Xavier Deguillard
a3115dacd8 utils: add a constexpr utf8 checker
Summary:
In a future diff, paths will be validated to make sure they are valid utf8. The
path sanity checker needs to be constexpr to construct global paths, but the
utf8 functions aren't, so let's write one that is.

Reviewed By: chadaustin

Differential Revision: D25562681

fbshipit-source-id: e48ec835c2cc9dc01090918cc7ee8f61b6c05a20
2020-12-16 01:03:32 -08:00
Xavier Deguillard
34edb7b618 win: re-use guid for the lifetime of the checkout
Summary:
On Windows, the GUID of the mount point identifies the virtualization instance,
that GUID is then propagated automatically to the created placeholders when
these are created as a response to a getPlaceholderInfo callback.

When the placeholders are created by EdenFS when invalidating directories we
have to pass GUID. The documentation isn't clear about whether that GUID needs
to be identical to the mount point GUID, but for a very long time these have
been mismatching due to the mount point GUID being generated at startup time
and not re-used.

One of the most common issue that users have reported is that sometimes
operations on the repository start failing with the error "The provider that
supports file system virtualization is temporarily unavailable". Looking at the
output of `fsutil reparsepoint query` for all the directories from the file
that triggers the error to the root of the repositories, shows that one of the
folder and its descendant don't share the same GUID, removing it solves the
issue.

It's not clear to me why this issue doesn't always reproduce when restarting
EdenFS, but a simple step that we can take to solve this is to always re-use
the GUID, and that hopefully will lead to the GUID always being the same and
the error to go away.

Reviewed By: fanzeyi

Differential Revision: D25513122

fbshipit-source-id: 0058dedbd7fd8ccae1c9527612ac220bc6775c69
2020-12-15 08:07:49 -08:00
Xavier Deguillard
88dcfa7bb3 utils: add an RcuPtr class
Summary:
RCU is a synchronization mechanism that allows for very fast reads, at the
expense of slower writes. This is achieved by having the reader sometimes
reading a stale pointer when concurrent to a write, at which point the writer
will delay reclaiming the old data to a later moment where it is known that no
reader can hold a pointer to the old data.

Doing that allows for the read operations to be significantly faster than using
a Synchronized lock. Folly's documentation claims a read lock/unlock of RCU
runs in ~4ns, while the same for Synchronized is ~26ns.

Due to the writers cost, RCU is perfectly suited for places where reads needs
to be as fast as possible, and writes are very infrequent. One typical example
is when caching an application's configuration, we can expect reading the
configuration values more frequently than it is being reloaded, and in the case
where the configuration mismatch, a stale configuration can be tolerated by the
application.

In EdenFS, we can use RCU on Windows to make sure that unmounting a repository
will wait on all the pending callbacks.

Reviewed By: kmancini

Differential Revision: D25351536

fbshipit-source-id: 050ca0337e67ae195f4f16062dddb60f584af692
2020-12-11 14:10:58 -08:00
Xavier Deguillard
754d132783 Back out "prjfs: handle concurrent file/directory removal"
Summary: Something is wrong with this which causes Unity to freak out.

Reviewed By: fanzeyi

Differential Revision: D25453230

fbshipit-source-id: 89f61fd97817403fa65071ddac022a226b775e53
2020-12-10 07:42:38 -08:00
Xavier Deguillard
2bfdf6f481 prjfs: handle concurrent file/directory removal
Summary:
A while back, we saw that concurrent directory creation would lead to EdenFS
being confused and failing to record some of the created directories. This then
caused EdenFS to no longer being in sync with what was on disk. To handle this
case, we've had to manually creating these directories recursively.

What I didn't realize at the time was that these concurrent notifications could
also happen on removal this time, and if a directory removal notification wins
the race against the removal of its last children, that directory wouldn't be
removed and EdenFS would once again be confused about the state of the
repository.

Fixing this is a bit trickier than directory creation as it's more racier.
Consider a directory that is being removed, and then immediately recreated with
a file in it in a different process. The naive approach of simply force
removing all of the children of a directory when handling the removal
notification would clash with the file creation. We could argue that nobody
should be doing this, but there would be an unhandled race, and thus a bug
where data would potentially be lost[0].

We can however fix this bug slightly differently. For file/directory removal,
we can actually hook onto the pre-callback, ie: one that happens before the
file/directory is no longer visible on disk. This inherently eliminate the race
altogether as the callback will be guaranteed to run when none of its children
are present, and if a race happens with a file creation in it, we can simply
fail the removal properly.

The only tricky bit is for the renaming logic, as renaming a file is logically
a removal followed by a creation. For that reason, I've moved part of the
renaming bits to the pre-callback too.

In theory, this change may negatively affect workloads that do concurrent
directory removal as the duration during which a file/directory is visible
ondisk now includes the EdenFS callback while it didn't before. Such workflows
should be fairly rare and/or redirected to avoid EdenFS altogether if
performance matters.

[0]: This left-over file that EdenFS wouldn't be aware of would also later
cause the checkout code to fail due to invalidation failures triggered when
trying to invalidate that directory. This would be fairly hard to debug.

Reviewed By: fanzeyi

Differential Revision: D25112381

fbshipit-source-id: 9300499ce872ad93d0a687f0e61b7e2a9caf9556
2020-12-04 14:25:44 -08:00
generatedunixname89002005325676
c22e5de544 Daily arc lint --take CLANGFORMAT
Reviewed By: zertosh

Differential Revision: D25049451

fbshipit-source-id: 6b9d1b95dca0f2454e94918bb78e545e084e5d14
2020-11-18 04:32:26 -08:00
Chad Austin
20d032231c improve PathComponent parse failure error messaging
Summary:
Be more specific about which PathComponent string failed to validate
in order to help diagnose downstream issues like glob syntax errors.

Reviewed By: genevievehelsel

Differential Revision: D24966004

fbshipit-source-id: cd3bc0aeaeb389caa13c86b91149d48c5afdb306
2020-11-17 12:53:39 -08:00
Xavier Deguillard
4038c01e9f utils: remove //eden/fs/utils/test:linux_test
Summary:
The skip_on_mode_mac argument to cpp_unittest doesn't exist on Windows, and to
be consistent with the rest of the code, we can simply ifdef the code that
either doesn't compile, or doesn't run.

Note: For some reason the accessIncrementsAccessCount test fails when running
on Windows, but only if running after accessAddsProcessToProcessNameCache...

Reviewed By: chadaustin

Differential Revision: D24496450

fbshipit-source-id: fe18fe1d791a27fbe4bd03bd3e8c811feeb23f5f
2020-11-16 08:29:04 -08:00
Xavier Deguillard
27f08fc126 utils: remove ServiceAddress
Summary: This is unused, except in tests, so let's just remove it.

Reviewed By: chadaustin

Differential Revision: D24930011

fbshipit-source-id: cb132962e1dff9d12ce12e7eb75bd34a026c58b7
2020-11-13 15:19:38 -08:00
Xavier Deguillard
d2f78cafdf pathfuncs: silence warning
Summary:
The components iterator return pieces of the original path, using a reference
makes little sense and the compiler complains.

Reviewed By: genevievehelsel

Differential Revision: D24873851

fbshipit-source-id: 40d414dcb4a0539167ab4760dfc0095af8245b3a
2020-11-11 20:00:39 -08:00
Xavier Deguillard
adcc8f07ea utils: add a quoting test for SpawnedProcess
Summary:
While doing notifications, I struggled a bit to get them working and thought
the special quoting on Windows didn't work as expected. It turns out the error
was cmd related and using a modern shell (PowerShell) fixed it.

Having a test for the quoting is a good idea nonetheless, so let's have one.

Reviewed By: genevievehelsel

Differential Revision: D24864357

fbshipit-source-id: 6b1ac50f3b7b1ef469378d5de21f56c24c0945f9
2020-11-11 09:37:56 -08: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