Commit Graph

3445 Commits

Author SHA1 Message Date
Michael Cuevas
26ae74fb1d add thrift endpoint for querying file attributes in bulk
Summary:
update thrift interface to include a function that returns attributes for a given list of files.

to support this, we add several structures that define the functions parameters and return type.

- FileAttributes: a "bitmask" enum. Each attribute is a power of 2 to enable bitwise ORing attributes together to decide which attributes to fetch from files.
- FileAttributeData: struct to hold the attributes of an individual file
- FileAttributeDataOrError: union that is either a FileAttributeData or EdenError thrown when accessing the file attributes
- GetAttributesFromFilesParameters: self explanatory.
- GetAttributesFromFilesResult: self explanatory. Map of file -> FileAttributeDataOrError
- getAttributesFromFile(): actual function that will be implemented in EdenServiceHandler.cpp

Reviewed By: chadaustin

Differential Revision: D32155168

fbshipit-source-id: 6dd768f3bcee1e32a2362df231feebfb1297dbf6
2021-11-17 11:31:25 -08:00
Jim Meyering
1e894f4361 eden/fs/service/EdenServiceHandler.cpp: adapt to C++20
Summary:
Cast EDEN_MICRO to something fmt::format can handle: char* (from std::basic_string<char8_t>); but that means this is no longer a literal, so cannot concat. Move to its own fmt argument.

This avoids the following errors:

  eden/fs/service/EdenServiceHandler.cpp:227:60: error: invalid operands to binary expression ('basic_ostream<char>' and 'std::basic_string<char8_t>')

Differential Revision: D32486517

fbshipit-source-id: c799bdd73be1b46cc938b2076ebc78d0bdb3dded
2021-11-17 00:04:35 -08:00
Jim Meyering
71ebf27844 eden/fs/utils/test/Utf8Test.cpp: fix platform010-exposed build errors
Summary:
We should all be migrating to platform010, for the improved performance of its
generated code and for its improved diagnostics/portability.

reinterpret_cast another u8"..." literal to const char*

This avoids the following errors:
```
stderr: In file included from eden/fs/utils/test/Utf8Test.cpp:9:
In file included from folly/portability/GTest.h:32:
third-party-buck/platform010/build/googletest/include/gtest/gtest.h:1545:11: error: invalid operands to binary expression ('char8_t const[4]' and 'const std::basic_string<char>')
  if (lhs == rhs) {
      ~~~ ^  ~~~
third-party-buck/platform010/build/googletest/include/gtest/gtest.h:1572:12: note: in instantiation of function template specialization 'testing::internal::CmpHelperEQ<char8_t [4], std::basic_string<char>>' requested here
    return CmpHelperEQ(lhs_expression, rhs_expression, lhs, rhs);
           ^
eden/fs/utils/test/Utf8Test.cpp:43:3: note: in instantiation of function template specialization 'testing::internal::EqHelper::Compare<char8_t [4], std::basic_string<char>, nullptr>' requested here
  EXPECT_EQ(u8"\uFFFD", ensureValidUtf8("\xff"));
```

Differential Revision: D32484896

fbshipit-source-id: b271292eb121e0e183bec56ab51fc6acb791b052
2021-11-16 21:10:13 -08:00
Xavier Deguillard
6d2b462933 inodes: add TreeInode::removeRecursively
Summary:
On Windows, directory removal notifications can be received out of order, and
sometimes duplicated. The next diff will rework the way EdenFS handle
notifications on Windows by looking at the on-disk state and applying it to the
inode hierarchy. In some cases, an entire directory hierarchy will need to be
removed which the added function will make it easier to do.

Reviewed By: chadaustin

Differential Revision: D32329806

fbshipit-source-id: ad9af389c993420184c0e59dd3d25188adddb77a
2021-11-16 16:33:24 -08:00
Pyre Bot Jr
0f0334f97a suppress errors in fbcode/eden - batch 1
Differential Revision: D32470212

fbshipit-source-id: 9170c56d6a6bab051bf35337ef8df57a5a73371f
2021-11-16 12:54:39 -08:00
Andrii Grynenko
1d19898163 Remove MicroLock::init()
Summary: Have constructor do init() instead. I can't think of any valid reason to have this API other than confusing everyone who decides to use it.

Reviewed By: praihan

Differential Revision: D32302228

fbshipit-source-id: 136e0d2919291acd60be953337309cd006bd674b
2021-11-15 14:20:38 -08:00
Andrey Chursin
3051184ce0 do not recompute metadata if using aux data from hg
Summary: Sha1 computation show up in many profilers, we can skip this step entirely if we are using metadata from hg.

Reviewed By: xavierd

Differential Revision: D32396312

fbshipit-source-id: 928f8458a91bba4d18da6730d3fc244eb5499489
2021-11-15 13:56:47 -08:00
Andrey Chursin
74115cda20 read aux data from hg cache
Summary:
This diff allows eden to fetch blob metadata from hg cache.
Combined with previous diffs in stack, it allows to entirely skip scs metadata import, saving whole additional network round trip for operations like ls -lr or parsing buck files.

This diff adds hg:use-aux-metadata config that controls this behaviour.

When config is set, we instruct hg backing store to fetch file aux metadata along with get tree request.
Later when blob metadata is requested we are checking hg cache to get the metadata.

For trees that were imported prior to this config we fallback to reading scs metadata cache.

In terms of performance effect, this diff reduces traffic on laptops during listing/stating files significantly, because x2p client sends significant amount of extra data.

It does not improve end to end speed significantly though, because scs queries run in parallel with tree request.

Before
```
ls -lR fbsource.eden/fbcode/admarket  0.97s user 8.02s system 3% cpu 4:47.42 total
Traffic usage: 77Mb 25Mb down, 52Mb up
```
After
```
ls -lR fbsource.eden/fbcode/admarket  0.98s user 8.19s system 3% cpu 4:33.65 total
Traffic usage: 40 Mb, 22Mb down, 18Mb up
```

On laptops with worse network this likely to improve speed too, because some networks have much lower uplink latency

Additionally, this allows to efficiently use metadata on windows (where previously entire blob needed to be downloaded in order to calculate blob size)

Reviewed By: xavierd

Differential Revision: D32371710

fbshipit-source-id: 8ac962ea0136bc3bc4e30d0bf31692e65c35c43f
2021-11-15 13:56:46 -08:00
Xavier Deguillard
438d4a1a4c immediatefuture: add makeImmediateFuture that takes an exception_wrapper
Summary:
When unwrapping Try it is convenient to be able to build an ImmediateFuture
directly from the .exception() call.

Reviewed By: chadaustin

Differential Revision: D32333774

fbshipit-source-id: 0066ca7eddc4a57010f60974c234b57691b73d77
2021-11-15 13:52:59 -08:00
Xavier Deguillard
dda17f055f immediatefuture: fully qualify collectAll calls
Summary:
For some reason, in some cases the compiler wants to use the folly::collectAll
function instead of the ImmediateFuture one. Adding the namespace solves this
issue.

Reviewed By: chadaustin

Differential Revision: D32329807

fbshipit-source-id: 22ee9b20cf33e5718c9bb0270dd93f3f857b0967
2021-11-15 13:52:59 -08:00
CodemodService Bot
2acfb2a272 ThriftSetter_eden
Reviewed By: chadaustin

Differential Revision: D32312265

fbshipit-source-id: e365f14d5951b1d57dbd255fdfe0413c43eafdff
2021-11-15 12:13:07 -08:00
Jan Mazur
946bf1398b don't return eden-related error from low-level unix socket wrapper
Summary:
Previously it raised

``` raise TTransportException(
                    type=TTransportException.NOT_OPEN, message="eden not running"
                )
```

even if it wasn't thrift and it wasn't eden.

Now it will raise OSError (as regular sockets do), and translate it to TTransportException if it's used as a thrift socket

Reviewed By: DurhamG

Differential Revision: D32171878

fbshipit-source-id: 290368acf8def5aec812abc88c23a946e7a0f1f4
2021-11-15 04:14:37 -08:00
Grace Ku
8dda4cf806 cli_rs: Re-use humantime util
Reviewed By: fanzeyi

Differential Revision: D32331357

fbshipit-source-id: 9495e56cb9e7e094e30067bb53ea51b21e7943ef
2021-11-12 09:23:27 -08:00
Grace Ku
a56cbf6221 cli_rs: Move humantime to its own file
Summary:
So that I can re-use it in the next diff.

I considered putting this in a util/ subfolder but when doing the `use` imports, this caused issues since there was another crate called util and would require renaming all those use statements.

Reviewed By: fanzeyi

Differential Revision: D32331290

fbshipit-source-id: 78f9bf94bcf6426f1f0f23761061161e3e392832
2021-11-12 09:23:27 -08:00
Grace Ku
d180f92b11 cli_rs: Remove unnecessary unreachable
Summary: As fanzeyi pointed out, the Rust compiler can correctly infer that this code is unreachable (since compiler warnings pop up) and we don't need to explicitly write unreachable.

Reviewed By: fanzeyi

Differential Revision: D32295516

fbshipit-source-id: d8562fab7a4d012db5fe91c4947558531e512144
2021-11-12 09:23:27 -08:00
Grace Ku
b7bf1f4044 cli_rs: Do some formatting on the cmd to make it easier to read
Summary:
Mimicking logic in: https://www.internalfb.com/code/fbsource/[f073cb3ef9b9]/fbcode/eden/fs/cli/util.py?lines=650-665

This strips nulls, and applies shlex safe quoting.

Reviewed By: fanzeyi

Differential Revision: D32294990

fbshipit-source-id: b77396dae444092aa0ea9c04fc3c9e42324e789c
2021-11-12 09:23:27 -08:00
Grace Ku
63b2979a41 cli_rs: format time
Summary: Mimicking logic here: https://www.internalfb.com/code/fbsource/[7cbce9bdee83]/fbcode/eden/fs/cli/top.py?lines=107-122 to show human-readable time.

Reviewed By: fanzeyi

Differential Revision: D32289942

fbshipit-source-id: 87a7d5c7fe1d740e5625c72a73156ef942b85ab6
2021-11-12 09:23:27 -08:00
Grace Ku
b7194c4b36 cli_rs: Remove crossterm refreshing
Summary:
This is because the save / restore cursor position sometimes behaves differently depending on the command that I run minitop with (e.g., it sometimes will re-print the first row repeatedly if the saved cursor position was somehow wrong).

I also explored calculating how much to truncate by getting the screen size, but this was simpler.

We can add this back in if we switch to an "alternate screen".

Reviewed By: fanzeyi

Differential Revision: D32289941

fbshipit-source-id: 3edda78ab2aa82958f6a40efd03e302520f84f4b
2021-11-12 09:23:27 -08:00
Grace Ku
c58d82afd5 cli_rs: Sort by time
Reviewed By: fanzeyi

Differential Revision: D32289943

fbshipit-source-id: 8f00afb555cf971fef9a45fd7075a077467e701b
2021-11-12 09:23:27 -08:00
Jeremy Fitzhardinge
3d32723b51 third-party/rust: update to cargo 0.57
Summary: allow-large-files

Reviewed By: dtolnay

Differential Revision: D32340068

fbshipit-source-id: bb1e954eaae26d02d75ea8dbd7fa390bf5739098
2021-11-11 11:58:54 -08:00
Thomas Orozco
de525e8fe4 edenfsctl: take a lock around mutating config.json
Summary:
There is a race in here. We read the config, then mutate it, then put the new
config in place. However, if something else comes and mutates the config
between the time where we read it and write it again, we'll clobber its
changes.

Concretely, if you're running lots of `eden clone` or `eden rm` concurrently,
then the current mechanism will sometimes "forget" some directories or add back
directories you removed, which will e.g. break `eden list` (and cause those
commands to sometimes fail as well).

This diff fixes that by wrapping the critical section with a file lock.

Reviewed By: chadaustin, xavierd

Differential Revision: D32251727

fbshipit-source-id: 9eee57c7a824286bb4f0e7911e5ccd9d769c6daa
2021-11-11 00:50:32 -08:00
Andrey Chursin
168d328f5b fix proxy hash null batch [proxy hash removal 9/n]
Summary:
There was confusion in previous diff with some proxy hash interface taking optional<> and some taking nullable pointer, resulting in cretion of optional with null pointer inside.

To avoid this confusion I am just going to use optional<> everywhere.

Reviewed By: chadaustin

Differential Revision: D32324008

fbshipit-source-id: 2f0df1f50d032dd0c8823a1671a69ff74435eb3b
2021-11-10 21:37:56 -08:00
Xavier Deguillard
7dd8eb32b7 service: send the takeover mount after fuse is initialized
Summary:
On takeover, the new EdenFS sends the current mount point over to the
privhelper, and due to being a suid root process, the privhelper needs to
double check that the given mount point is valid before accepting it. In order
to do this, a `stat` is ran on the mount point.

Unfortunately, this `stat` call may need to perform a lookup and getattr FUSE
calls, but since EdenFS hasn't yet initialized FUSE, it may hang, leading to
EdenFS not being able to restart.

To fix this, we can simply start FUSE prior to advertising the mount point to
the privhelper, this way the lookup and getattr FUSE calls can be answered.

Reviewed By: kmancini

Differential Revision: D32322661

fbshipit-source-id: 4ea1e44ce362e04ed7eebaff1f2a8f381f8bff60
2021-11-10 18:35:13 -08:00
Grace Ku
9cf7a85a6e cli_rs: Do not hide cursor
Summary:
Do not hide cursor because when you stop the process, it leaves the cursor as disabled.

Even when this was disabled, you could still type anyway. Better to use alternate methods to disable this.

Reviewed By: fanzeyi

Differential Revision: D32254638

fbshipit-source-id: ce76b8943aea5f15eb35a263afc1b67593c2ba12
2021-11-10 16:23:14 -08:00
Grace Ku
d4ba2840c5 cli_rs: Formatting output as table
Reviewed By: fanzeyi

Differential Revision: D32172668

fbshipit-source-id: 8f6c8028b0213e1f604ad0f0ca1c23078af4dce1
2021-11-10 16:23:14 -08:00
Grace Ku
6c0b8dfaee cli_rs: handle pids with different cmds
Summary:
I noticed that I'm hitting this assertion. Likely because the running process changes what commands it's running. Let's remove this assertion.

This is the same as the python `eden top`'s behavior where they just continue to aggregate and never update the `cmd`.

Reviewed By: fanzeyi

Differential Revision: D32173253

fbshipit-source-id: 72bc4710e585fa800d7d96c04fa9a88f13a8557d
2021-11-10 16:23:14 -08:00
Xavier Deguillard
d752501d4e prjfs: detach callbacks futures when not ready
Summary:
The QueuedImmediateExecutor can have surprising effect, let's instead move the
futures to the global CPU executor, but only if the ImmediateFuture isn't
ready, ie: when there is still some computation to be performed. The use of
folly::detachOnGlobalCPUExecutor also makes it obvious that the intent is to
run the future elsewhere in the background.

Reviewed By: chadaustin

Differential Revision: D32155651

fbshipit-source-id: 8ae5be48230ff44c58a5697d3824825eeb8235dc
2021-11-10 14:56:09 -08:00
Xavier Deguillard
3e0610c963 prjfs: do not bail on read-only callbacks
Summary:
In order to compute the sha1 of materialized files in the working copy, EdenFS
on Windows will open and read the file out of the working copy directly. In the
case where EdenFS is wrong about the state of the file, this can lead to a
ProjectedFS callback to be triggered which may need to take the same lock that
the sha1 computation holds. This obviously results in a deadlock and to protect
against this, EdenFS would bail early when detecting recursive callbacks.

With read-only callbacks having been switched to only take into account the
underlying Mercurial data, and not the inode state, these callbacks will never
attempt to take any inode locks. This also means that the deadlock described
above can no longer happen: the ObjectStore layer will never attempt to read
anything from the working copy, thus recursive callbacks are impossible. These
checks are thus unecessary.

In theory, these checks could stay in place as a safety measure, but EdenFS
will soon need to list directory entry and call PrjGetOnDiskFileState in
response to file/directory creation/removal to handle the case where these can
happen out of order.

Reviewed By: genevievehelsel

Differential Revision: D32149411

fbshipit-source-id: 73b228bb8c73416b38f7f2042c25964e1aef3c4e
2021-11-10 14:56:09 -08:00
Xavier Deguillard
03731ee50d utils: add a collectAllSafe for vectors
Summary:
We already had a collectAllSafe for argument packs, let's have a similar
function when the argument is a vector.

Reviewed By: chadaustin

Differential Revision: D32323573

fbshipit-source-id: 2cfa3da565a7d9bb88746e3cc6b10d1d8890c05e
2021-11-10 13:39:49 -08:00
Zeyi (Rice) Fan
3fa17f83ed windows: skip a some more integration tests on Windows
Reviewed By: xavierd

Differential Revision: D32297242

fbshipit-source-id: 57c9362e79f0d02e4e97fab98ae4091754e707ca
2021-11-10 13:23:26 -08:00
Xavier Deguillard
0a820ed7d0 config: remove overlay.enable_tree_overlay
Summary:
This config has been enabled for many months now, let's simply assume it is set
to true on Windows.

Reviewed By: genevievehelsel

Differential Revision: D32192585

fbshipit-source-id: 76829a031f859594a5139dd09a6479cabeda2089
2021-11-10 10:03:52 -08:00
Andrey Chursin
fd1743308f introduce new format for tree serialization [proxy hash removal 8/n]
Summary:
This diff introduces new format for serializing trees in local store.

Unlike currently used git serialization format, new format supports variable length object ids.

Long term this will be replaced with using mercurial as a source of truth, but for now we need this to roll out proxy hash replacement.

Reviewed By: chadaustin

Differential Revision: D31998935

fbshipit-source-id: 9aacfbea631e75c0ea1421094a0b1ae255adb04a
2021-11-10 09:40:45 -08:00
Zeyi (Rice) Fan
5caf4d2ade cli_rs: deep merge TOML tables
Summary: If toml values are maps, we were overriding the previous values without merging them. This makes `eden-config` to incorrectly discard values that should have been kept.

Reviewed By: genevievehelsel

Differential Revision: D32288269

fbshipit-source-id: e9c9f6a1aed3b0de719a046e56344cab763a3e7e
2021-11-09 20:53:28 -08:00
Zeyi (Rice) Fan
2cea2bc61f stack-config: enable tests
Summary: I wasn't sure why I didn't make them a test when I wrote them. Let's make them a test and continuously run them to make sure `stack-config`'s implementation is correct.

Differential Revision: D32288267

fbshipit-source-id: 988f65993de0947ce408a6809b32b3ece5e9b3a3
2021-11-09 20:53:28 -08:00
Chad Austin
98cd3d6329 rage: include the system mount table
Summary: When debugging, it's nice to know what the kernel thinks the mount table is.

Reviewed By: xavierd

Differential Revision: D32288215

fbshipit-source-id: d4c15b16689f20846a45f682c4089e2fa8250661
2021-11-09 15:45:44 -08:00
Xavier Deguillard
c407619ac1 inodes: use Trees instead of Inodes for Prjfs callbacks
Summary:
In ProjectedFS terminology, the "backing store" refers to the state of files
and directories in the source control backend. For the longest time, EdenFS
assumed that the Inodes hierarchy was the "backing store", but this lead to
subtle bugs. For instance, renaming a non-hydrated placeholder would render the
file unreadable due to the read callback from ProjecedFS callback using the old
file name, not the new one
(https://github.com/microsoft/ProjFS-Managed-API/issues/68). It also meant that
files just created would always get a tombstone written on disk when being
removed as ProjectedFS queries EdenFS when removing a file via the access
callback. Returning true from this callback means that this file is present in
the backing store and thus ProjectedFS needs to create a tombstone on disk.

In order to fix these issues, EdenFS needs not to query the Inodes hierarchy,
but the Tree hierarchy. The latter matches with the expected behavior from
ProjectedFS.

For modification callbacks, these are by design acting on the Inode hierarchy
and thus are unchanged.

Reviewed By: chadaustin

Differential Revision: D32022639

fbshipit-source-id: bef18a0709a7eff9ef0a48a90126d1339be0023e
2021-11-09 13:29:48 -08:00
Genevieve Helsel
9c8cee7077 add corp2prod/macos support to predictive prefetch profiles
Reviewed By: fanzeyi

Differential Revision: D30807432

fbshipit-source-id: e44d66a3cabc26467805ccb231472dd74a1c3b42
2021-11-09 09:45:09 -08:00
Robert Grosse
1e9b73cde4 Update tracing-subscriber crate to 0.3.1
Summary:
Update tracing-subscriber crate to 0.3.1. Also add some features that David Barsky suggested.

Also update tracing-appender since 0.1.x is incompatible.

Reviewed By: zsol

Differential Revision: D32175169

fbshipit-source-id: ad714db1c1c67b508be1c97d3dc960dd7d809cc6
2021-11-09 09:34:19 -08:00
Jim Meyering
fc23fbd7ee eden/fs/utils/test/ImmediateFutureTest.cpp: fix platform010-exposed build errors
Summary:
We should all be migrating to platform010, for the improved performance of its
generated code and for its improved diagnostics/portability.

add an explicit constructor, now required for C++20, see https://en.cppreference.com/w/cpp/language/default_constructor

This avoids the following errors:

  eden/fs/utils/test/ImmediateFutureTest.cpp:335:17: error: no matching constructor for initialization of 'Uncopyable'

# Context:
The cost of delaying a platform upgrade is now estimated at about $3M/week.
For the preceding one, it was measured at [**$1M/week**](https://fburl.com/jfmpsqmy).

Differential Revision: D32250064

fbshipit-source-id: 8c6990489cafb09629c03e56bdbae92395d6f85f
2021-11-08 10:38:37 -08:00
Andrey Chursin
08f337f7ab embed proxy hashes into object id [proxy hash removal 7/n]
Summary:
This diff introduces config store:embed-proxy-hashes.

When this config is set, we store HgId directly into ObjectId, instead of using proxy hash object.
This allows to bypass proxy hash rocks db storage when reading files.

**Compatibility notes**

This diff is compatible with previous versions unless store:embed-proxy-hashes config is set.

Once config is set, new ObjectId format is used and serialized into inodes. Once this is done previous versions of eden fs won't be able to read overlay inodes created by this version.

This means we need to be careful with setting this config - once set we won't be able to roll back eden fs version easily, it will basically require re-creating eden checkout.

Inodes created prior to this config being set will remain written in old format, only when new inode is written is when new format is used.

**Git tree format issue**

We use git tree serialization format in the LocalStore to serialize trees.
This format assumes 20-byte hashes and is not compatible with variable length ObjectId.

In this diff we bypass this issue by not storing trees into local store. This seem ok in terms of correctness, because tree information can always be fetched from mercurial.

However, this seem to impose performance penalty on some work loads (see below).

We can solve this by either introducing new format that supports var length object id(short term), or by getting rid of tree cache and efficiently getting the data directly from mercurial(long term).

**Performance numbers**

Hot file access time is reduced by 50%:
```
$ fsprobe.sh run cat.targets

Before:
lat: 0.2331 ms, qps: 4, dur: 28.697384178s, 123092 files, 217882490 bytes, 1641 errors, rate 7.59 Mb/s

After:
lat: 0.1611 ms, qps: 6, dur: 19.835917353s, 123092 files, 217882490 bytes, 1641 errors, rate 10.98 Mb/s
```

However, we do not see improvement with arc focus, most likely due to bypassing tree serialization, so we will need to figure out that issue.

We can still merge this diff and see if enabling this feature on other workloads like sandcastle is benefitical.

Reviewed By: chadaustin

Differential Revision: D31777929

fbshipit-source-id: fc4b678477d0737c9f242968f0be99ed04f4f58a
2021-11-05 17:05:43 -07:00
Grace Ku
8731631b3a cli_rs: style output
Summary:
Hide the cursor and disable the line wrap

Some issues I've still noticed:
- If you resize the window to be smaller it messes things up (you can resize the terminal to be larger and it works fine)
- Sometimes it will decide to continuously print instead of overwriting the old text. Not sure why exactly this happens. It happens more often when I run `buck run` rather than the underlying binary.
- You can still type even though the cursor is disabled

I suspect to address this, I need to rely on the `event` module in the `crossterm` crate.

Reviewed By: fanzeyi

Differential Revision: D32114319

fbshipit-source-id: 037dc1b7e4fbba6e624b00210b4cb07b8d0644c9
2021-11-05 16:22:51 -07:00
Grace Ku
a324477274 cli_rs: Loop fetching access counts
Summary: Loop fetching access counts and update rendering.

Reviewed By: fanzeyi

Differential Revision: D32109917

fbshipit-source-id: 83eae25bc7938497f2f99cb966e0fd7ce907f017
2021-11-05 16:22:51 -07:00
Grace Ku
62315132a1 cli_rs: Initial code for minitop
Summary:
This diff gets access counts and prints them out in a simple table laid out with tabs.

Still a lot to do, but wanted to get this code out there to get feedback earlier. Some things I need to do:
- format last access time
- sort by last access time
- laying out in a nicer table (I plan on using comfy-table: https://fburl.com/code/k353fp6i)
- updating every `refresh_rate` seconds (I plan on using cross-term: https://fburl.com/code/ahuoqy7t)

Reviewed By: fanzeyi

Differential Revision: D32000885

fbshipit-source-id: 6fc60d13e9519ed45ad6e18628013f9b3ac88bc7
2021-11-05 16:22:51 -07:00
Xavier Deguillard
6ac28eeffb cli: fix typo when destroying mount
Summary: See title

Reviewed By: chadaustin

Differential Revision: D32219226

fbshipit-source-id: 8daa9b02d32a27c85a77bcfe447cfa3cb465d456
2021-11-05 15:40:45 -07:00
Xavier Deguillard
87ef50135e prjfs: make readdir more asynchronous
Summary:
The makeImmediateFuture is merely a glorified try/catch, and thus the entirety
of the readdir callback would run immediately, and would block on every size
sequentially. This is inefficient and may cause files to be fetched one at a time.

By reworking the inner logic, we can collect all the sizes beforehand prior to
servicing the callback, allowing for sizes to be fetched concurrently, and for
completing the callback asynchronously.

Reviewed By: chadaustin

Differential Revision: D31782916

fbshipit-source-id: d6315347492e969ffa79037dc2a4f275f4b95a8d
2021-11-05 12:55:58 -07:00
Xavier Deguillard
6dd3693628 cli: fix killing buck on Windows
Summary:
Since the CWD wasn't specified when gathering the Buck version, the buck
version returned by `buck --version-fast` could be different from the one in
use in the subdirectory where `buck kill` would be called. This would lead to
Buck failing to stop itself, which would interrupt `eden stop`.

Reviewed By: kmancini

Differential Revision: D32193032

fbshipit-source-id: cbe4983df785b4439645037f9d42084cf745a423
2021-11-05 12:47:16 -07:00
Xavier Deguillard
98fb42163d cli: remove BUCKVERSION workaround on macOS
Summary:
The original bug has been fixed for over a year now, let's remove the
workaround.

Reviewed By: kmancini

Differential Revision: D32193033

fbshipit-source-id: 29de7a52e47f8fe070b45b785756b4c93e42151c
2021-11-05 12:47:16 -07:00
Grace Ku
9a12c6786a cli_rs: Add refresh_rate option for minitop subcommand
Summary: The same as the option that is available in `eden top`.

Reviewed By: fanzeyi

Differential Revision: D31863321

fbshipit-source-id: 3571cc4866fc43e5f43dc5f390cf737b33a7c0b4
2021-11-04 11:29:14 -07:00
Chad Austin
225a341914 C++20 fixes
Summary:
C++20 changed the rules around char8_t. Cast to char* as
necessary. Also, fix references to some removed std::allocator
associated types.

Reviewed By: fanzeyi, meyering

Differential Revision: D32155762

fbshipit-source-id: dc72e5bc58e8c08612ea1a1eb2568861701287c6
2021-11-03 17:55:42 -07:00
Barys Skarabahaty
dc8ca37577 Rename CTIME in result enum
Summary: It is conflicts with CTIME from libc when sys/ioctl.h is imported

Reviewed By: johnny90

Differential Revision: D32017643

fbshipit-source-id: 0346674a7a215524ccaf7cce0e5dfafb5ea9f288
2021-11-03 17:39:36 -07:00