Commit Graph

507 Commits

Author SHA1 Message Date
John Elliott
a1928c77da Move UserInfo from eden to edencommon
Summary:
To support better telemetry and logging in watchman we want to use Eden's components. Lets migrate and detangle the needed pieces.

This change moves UserInfo from eden to edencommon.

Reviewed By: kmancini

Differential Revision: D56326986

fbshipit-source-id: 80ff63a33b3f692be8c9a94d38c41409bc1b49f5
2024-04-23 20:41:06 -07:00
Genevieve (Genna) Helsel
575c86e400 fix TARGETS files for autodeps
Summary: The fix is being worked on, but to reduce confusion, its probably worth just changing our TARGETS files since its a no-op change

Reviewed By: jdelliot

Differential Revision: D56495193

fbshipit-source-id: 10370b333cfd8ef316f9f257009ba4200869e21e
2024-04-23 17:17:20 -07:00
Yedidya Feldblum
9cd884d10b migrate from folly::in_place (assorted)
Summary: Under c++17, `folly::in_place` is just an alias for `std::in_place`. Migrate existing uses.

Reviewed By: Gownta

Differential Revision: D55085146

fbshipit-source-id: bf3b08da10de0e4c7f698513d545fb6159cea131
2024-03-25 12:17:34 -07:00
John Elliott
a7a2f5833e Move SysctlUtil from eden to edencommon
Summary:
To support better telemetry and logging in watchman we want to use Eden's components. Lets migrate and detangle the needed pieces.

This change moves SysctlUtil from eden to edencommon.

Reviewed By: genevievehelsel

Differential Revision: D54471684

fbshipit-source-id: df6d0716dfe371d8c7fc1fe80079649b85b50e6b
2024-03-04 12:22:09 -08:00
John Elliott
6916477707 Move RefPtr from eden to edencommon
Summary:
To support better telemetry and logging in watchman we want to use Eden's components. Lets migrate and detangle the needed pieces.

This change moves RefPtr from eden to edencommon.

Reviewed By: genevievehelsel

Differential Revision: D54471553

fbshipit-source-id: 407978616391b72649f72ca1f626df6700814dc3
2024-03-04 12:22:09 -08:00
John Elliott
f149770cf1 Move EnumValue from eden to edencommon
Summary:
To support better telemetry and logging in watchman we want to use Eden's components. Lets migrate and detangle the needed pieces.

This change moves EnumValue from eden to edencommon.

Reviewed By: genevievehelsel

Differential Revision: D54471130

fbshipit-source-id: 9f0828f4864f43fa4b400d0738333d07c09b93c4
2024-03-04 12:22:09 -08:00
John Elliott
e90196bcb0 Move SpawnedProcess from eden to edencommon
Summary:
To support better telemetry and logging in watchman we want to use Eden's components. Lets migrate and detangle the needed pieces.

This change moves SpawnedProcess from eden to edencommon.

Reviewed By: genevievehelsel

Differential Revision: D54471128

fbshipit-source-id: 5c8caa7d6388ba9a3753cb483ba8d11adc5eb87c
2024-03-04 12:22:09 -08:00
John Elliott
b68b201435 Move utils:io from eden to edencommon
Summary:
To support better telemetry and logging in watchman we want to use Eden's components. Lets migrate and detangle the needed pieces.

This change moves utils:io from eden to edencommon.

Reviewed By: genevievehelsel

Differential Revision: D54443719

fbshipit-source-id: 1c88d60126cab0d878c295b1d3ffbf9d8e6f1718
2024-03-04 12:22:09 -08:00
John Elliott
71a4ffb7e6 Move utils:utils from eden to edencommon (part 2)
Summary:
To support better telemetry and logging in watchman we want to use Eden's components. Lets migrate and detangle the needed pieces.

This change moves utils:utils from eden to edencommon.

NOTE: This is a large diff, so breaking the tests into separate subsequent diff.

Reviewed By: genevievehelsel

Differential Revision: D54442946

fbshipit-source-id: 99ef0e0cf60693bc809929f6735cf4bc2a1d84ba
2024-03-04 12:22:09 -08:00
John Elliott
36ae764747 Move utils:utils from eden to edencommon (part 1)
Summary:
To support better telemetry and logging in watchman we want to use Eden's components. Lets migrate and detangle the needed pieces.

This change moves utils:utils from eden to edencommon.

NOTE: This is a large diff, so breaking the tests into separate subsequent diff.

Reviewed By: genevievehelsel

Differential Revision: D54442939

fbshipit-source-id: 1cfbfa10d2dc4bbf7379d700978198b8b6788c71
2024-03-04 12:22:09 -08:00
John Elliott
108b57fc36 Move FileUtils and PathFuncs from eden to edencommon
Summary:
To support better telemetry and logging in watchman we want to use Eden's components. Lets migrate and detangle the needed pieces.

This change moves FileUtils and PathFuncs from eden to edencommon.

NOTE: FileUtils and PathFuncs are mutally dependent so they were migrated togehter. Most of the files touched, however, was due to PathFuncs.

Reviewed By: genevievehelsel

Differential Revision: D54393041

fbshipit-source-id: 6dc404b1b1066704584da512220475e9ee486247
2024-03-01 18:09:03 -08:00
John Elliott
0dbbe9f6f6 Move Try from eden to edencommon
Summary:
To support better telemetry and logging in watchman we want to use Eden's components. Lets migrate and detangle the needed pieces.

This change moves Try from eden to edencommon.

Reviewed By: genevievehelsel

Differential Revision: D54379294

fbshipit-source-id: 9fdc8c896a6a09f959a25d0bee82a623650ced32
2024-03-01 15:23:56 -08:00
John Elliott
0d09b33ee9 Move Match from eden to edencommon
Summary:
To support better telemetry and logging in watchman we want to use Eden's components. Lets migrate and detangle the needed pieces.

This change moves Match from eden to edencommon.

Reviewed By: genevievehelsel

Differential Revision: D54378643

fbshipit-source-id: f291126d2455cc2fdddffa4914be0c9d3f44f634
2024-03-01 15:23:56 -08:00
John Elliott
59221fc39f Move TempFile from eden to edencommon
Summary:
To support better telemetry and logging in watchman we want to use Eden's components. Lets migrate and detangle the needed pieces.

This change moves TempFile from eden to edencommon.

Reviewed By: genevievehelsel

Differential Revision: D54372850

fbshipit-source-id: 681f00c2b8b2c353b802c680fe62382d86ee7c8d
2024-03-01 15:23:56 -08:00
John Elliott
bb37cf9419 Move SystemError from eden to edencommon
Summary:
To support better telemetry and logging in watchman we want to use Eden's components. Lets migrate and detangle the needed pieces.

This change moves SystemError from eden to edencommon.

Reviewed By: MichaelCuevas

Differential Revision: D54343729

fbshipit-source-id: 7861e3effc9d242fbeda34333078c14c4d021a80
2024-02-29 21:00:21 -08:00
John Elliott
daad993aaa Move Utf8 from eden to edencommon
Summary:
To support better telemetry and logging in watchman we want to use Eden's components. Lets migrate and detangle the needed pieces.

This change moves Utf8 from eden to edencommon.

Reviewed By: fanzeyi

Differential Revision: D54341648

fbshipit-source-id: b1461a7f92963100914733d69de6eb574af3e1f9
2024-02-29 21:00:21 -08:00
John Elliott
48927b980c Move String from eden to edencommon
Summary:
To support better telemetry and logging in watchman we want to use Eden's components. Lets migrate and detangle the needed pieces.

This change moves String from eden to edencommon.

Reviewed By: fanzeyi

Differential Revision: D54341192

fbshipit-source-id: 8f0763313e5585efeb336038f41c646d84986ec3
2024-02-29 21:00:21 -08:00
John Elliott
06758c87fb Move Memory from eden to edencommon
Summary:
To support better telemetry and logging in watchman we want to use Eden's components. Lets migrate and detangle the needed pieces.

This change moves Memory from eden to edencommon.

Reviewed By: fanzeyi

Differential Revision: D54340336

fbshipit-source-id: cd209be7f39452123ffc41312cf370a48e4923bc
2024-02-29 16:32:49 -08:00
John Elliott
dcb1388959 Move CaseSenstivity from eden to edencommon
Summary:
To support better telemetry and logging in watchman we want to use Eden's components. Lets migrate and detangle the needed pieces.

This change moves CaseSensitvity from eden to edencommon.

Reviewed By: fanzeyi

Differential Revision: D54339283

fbshipit-source-id: f96a421f4390578e5d2281b307532c62e22935d3
2024-02-29 16:32:49 -08:00
John Elliott
82002e0095 Move ImmediateFuture from eden to edencommon
Summary:
To support better telemetry and logging in watchman we want to use Eden's components. Lets migrate and detangle the needed pieces.

This change moves ImmediateFuture from eden to edencommon.

Reviewed By: fanzeyi

Differential Revision: D54337631

fbshipit-source-id: 2e09a9e244ef8b8b662959c1b14db3e103f559d0
2024-02-29 15:43:22 -08:00
Yedidya Feldblum
b4311c75be migrate from FOLLY_MAYBE_UNUSED to [[maybe_unused]]
Reviewed By: ot, Orvid, xinchenguo

Differential Revision: D54089810

fbshipit-source-id: c88eb520404590c9759e0e29966d1399c26a2244
2024-02-28 13:28:26 -08:00
Richard Barnes
0a06f101a5 Fix deprecated use of 0/NULL in common/time/TimeZoneWithoutScuba.cpp + 3
Summary:
`nullptr` is typesafe. `0` and `NULL` are not. In the future, only `nullptr` will be allowed.

This diff helps us embrace the future _now_ in service of enabling `-Wzero-as-null-pointer-constant`.

Reviewed By: meyering

Differential Revision: D54163067

fbshipit-source-id: 3473ba42193c8dd3cd61b8f170d20c7279f88521
2024-02-25 22:18:39 -08:00
Genevieve (Genna) Helsel
7b9f34f60f add RefPtrBenchmark.cpp to TARGETS
Reviewed By: jdelliot

Differential Revision: D54130725

fbshipit-source-id: 31802f03471ad960a5e0942997c75da2ebaa4363
2024-02-23 16:39:52 -08:00
John Elliott
c07bebc856 Move Throw.h from eden to edencommon
Summary:
To support better telemetry and logging in watchman we want to use Eden's components. Lets migrate and detangle the needed pieces.

This change moves Throw.h and it's related tests from eden to edencommon.

Reviewed By: genevievehelsel

Differential Revision: D54046153

fbshipit-source-id: 669d702c13e70536d9c0b58ff8ff17f826237851
2024-02-23 15:46:42 -08:00
Genevieve (Genna) Helsel
c0a0212e1e add DirType.cpp to TARGETS
Reviewed By: MichaelCuevas

Differential Revision: D54128124

fbshipit-source-id: 2748732d85ac1f946a269ee827172544d1a6968e
2024-02-23 13:47:22 -08:00
generatedunixname89002005287564
efeb8cd887 eden (5003156845066480047)
Reviewed By: genevievehelsel

Differential Revision: D53914310

fbshipit-source-id: f56669c44d28f7e327b7918ed52647dcd2b0cfbf
2024-02-23 11:30:48 -08:00
Richard Barnes
b30fce38b2 Fix shadowed variable in eden/fs/utils/test/ImmediateFutureTest.cpp
Summary:
Our upcoming compiler upgrade will require us not to have shadowed variables. Such variables have a _high_ bug rate and reduce readability, so we would like to avoid them even if the compiler was not forcing us to do so.

This codemod attempts to fix an instance of a shadowed variable. Please review with care: if it's failed the result will be a silent bug.

**What's a shadowed variable?**

Shadowed variables are variables in an inner scope with the same name as another variable in an outer scope. Having the same name for both variables might be semantically correct, but it can make the code confusing to read! It can also hide subtle bugs.

This diff fixes such an issue by renaming the variable.

 - If you approve of this diff, please use the "Accept & Ship" button :-)

Reviewed By: palmje

Differential Revision: D53478924

fbshipit-source-id: 619cd5814bdc1804edb6366e381f26bfe75bb56d
2024-02-06 16:38:43 -08:00
Yedidya Feldblum
e6cecdfce5 migrate from FOLLY_FALLTHROUGH to [[fallthrough]] (assorted)
Summary:
X-link: https://github.com/facebookincubator/velox/pull/8558

The attribute `[[fallthrough]]` is standard C++17. We no longer need to wrap it.

Reviewed By: Orvid

Differential Revision: D53034074

fbshipit-source-id: 19b1e8314e70f3e08882e76b93f7ded4df7ab9f2
2024-01-29 08:06:49 -08:00
John Elliott
6782821902 Removing remaining hgimporter support and references
Summary: Removing the `eden stats hgimport` command; references to hgimporter in documentation; etc.

Reviewed By: kmancini

Differential Revision: D51963976

fbshipit-source-id: 19f998ea0f7ca7f132a6714232f03fdee2cf08c2
2024-01-17 13:24:03 -08:00
Michael Cuevas
23b29bcd75 move FilterId parsing logic into util function
Summary: We can now share parsing logic in the CheckoutConfig layer when we're parsing the last RootID from the SNAPSHOT file.

Reviewed By: kmancini

Differential Revision: D52185706

fbshipit-source-id: f9aa8a9d4b7d349917b80da38b6eb5ec368ba227
2023-12-19 22:20:08 -08:00
Xavier Deguillard
28541ce2ba tests: remove last remnant of QueuedImmediateExecutor
Summary:
Most of it was replaced with a ManualExecutor. Some care had to be taken around
the use of StoredObject as triggering an error on them when no future was
obtained from it leads to the error not being triggered when the future is then
retrieved from it.

The only place where QueuedImmediateExecutor is still present is in the
ImmediateFutureTest to demonstrate the lack of safety with it.

Reviewed By: genevievehelsel

Differential Revision: D51302393

fbshipit-source-id: fb66a9426e0ae7672799bd997898e8b525ff112c
2023-11-30 13:41:03 -08:00
Xavier Deguillard
3432b06297 service: fix a misuse of ImmediateFuture::ensure
Summary:
The return value of the passed in lambda is dropped in the `ensure` method,
thus the future returned by `completeInvalidations` would never be waited on,
potentially leading to weird bugs.

This is only used in a debug CLI command so this shouldn't have any effect, but
let's add a static_assert check in the ImmediateFuture code to make sure it
isn't misused elsewhere or in the future.

Reviewed By: genevievehelsel

Differential Revision: D51254287

fbshipit-source-id: 9fcfabbf2318aef739ca44daf1543dc0b83f82e3
2023-11-28 12:57:11 -08:00
Mark Shroyer
67bcbff287 Add collatePathMap function
Summary: Adds a function to collate two different path maps by entry name.

Reviewed By: genevievehelsel

Differential Revision: D50989168

fbshipit-source-id: dc6d94970cbb45230e334269d415b8ea226a3878
2023-11-06 17:55:16 -08:00
Christopher Ponce de Leon
0972cf92cb Revert D51029740: Namespace doesn't need to be followed by semicolon
Differential Revision:
D51029740

Original commit changeset: 177e3f6e6b0a

Original Phabricator Diff: D51029740

fbshipit-source-id: c71ff386342902f2cfa6552d6a834ea3f2475e32
2023-11-06 08:37:37 -08:00
Richard Barnes
21f86621c2 Namespace doesn't need to be followed by semicolon
Summary:
Auto-generated with
```
fbgs "}; // namespace" -l | sort | uniq | sed 's/fbsource.//' | xargs -n 50 sed -i 's_}; // namespace_} // namespace_'
```

Reviewed By: dmm-fb

Differential Revision: D51029740

fbshipit-source-id: 177e3f6e6b0ab7e986b1147952cd5e2f59d4b1fc
2023-11-06 08:02:11 -08:00
John Elliott
438a3f43ba Enable warnings for shadow definitions for clang/gcc
Summary:
Eden builds allow for shadow declarations to hide members, parameters, etc.

This can lead to subtle bugs and frustrations. Lets fix that. This first update enables shadow warngings for most problematic types of shadows. With errors on by default, this will block local and CI builds.

Reviewed By: xavierd

Differential Revision: D50434604

fbshipit-source-id: 976bd2e86c620f1f0e62e19867c81840fee645c9
2023-10-27 16:29:22 -07:00
generatedunixname89002005287564
6c809740ae eden (2379049371826165760)
Reviewed By: xavierd

Differential Revision: D50550199

fbshipit-source-id: 27fc2c66194e44624e6b7381cedfec4c1d5d9615
2023-10-24 00:22:18 -07:00
Saul Gutierrez
0ba6615c18 symlinks: make symlinks appear as modified with fake symlinks
Summary: Before all the EdenFS symlink changes on Windows, replacing a "fake" symlink with an actual symlink would make that file show up as modified. This diff reverts that behavior.

Reviewed By: kmancini

Differential Revision: D49755711

fbshipit-source-id: 03ea79e9af59264a2c1303240494a862d140f86f
2023-10-12 18:20:15 -07:00
Facebook GitHub Bot
df8fba6e6d Re-sync with internal repository
The internal and external repositories are out of sync. This Pull Request attempts to brings them back in sync by patching the GitHub repository. Please carefully review this patch. You must disable ShipIt for your project in order to merge this pull request. DO NOT IMPORT this pull request. Instead, merge it directly on GitHub using the MERGE BUTTON. Re-enable ShipIt after merging.
2023-10-11 22:09:00 -07:00
Xinyi Wang
0e86e4ccf0 create GlobTree class that doesn't depend on inode
Summary:
See why on previous diff

Now with this diff GlobTree is independent of inode

Reviewed By: kmancini

Differential Revision: D49933175

fbshipit-source-id: 1551a2b7e054df5df88ac37fbf0bf45f91e34548
2023-10-10 10:06:24 -07:00
Alex Hornby
0a17a93819 edenfs fix redundant move warnings in ImmediateFuture-inl.h (#696)
Summary:
edenfs fix redundant move warnings in ImmediateFuture-inl.h

GCC complained about these redundant moves, spamming the logs.

Pull Request resolved: https://github.com/facebook/sapling/pull/696

Test Plan:
Build locally with ./build/fbcode_builder/getdeps.py --allow-system-packages build --src-dir=. eden

before, warnings:
```
/home/runner/work/sapling/sapling/eden/fs/utils/ImmediateFuture-inl.h:356:25: warning: redundant move in return statement [-Wredundant-move]
  356 |     return std::move(res);
      |                         ^
/home/runner/work/sapling/sapling/eden/fs/utils/ImmediateFuture-inl.h:356:25: note: remove ‘std::move’ call
/home/runner/work/sapling/sapling/eden/fs/utils/ImmediateFuture-inl.h: In instantiation of ‘facebook::eden::ImmediateFuture<std::vector<folly::Try<T> > > facebook::eden::collectAll(std::vector<facebook::eden::ImmediateFuture<T> >) [with T = {anonymous}::ImmediateFuture_collectUncopyable_Test::TestBody()::Uncopyable]’:
/home/runner/work/sapling/sapling/eden/fs/utils/test/ImmediateFutureTest.cpp:350:39:   required from here
/home/runner/work/sapling/sapling/eden/fs/utils/ImmediateFuture-inl.h:356:25: warning: redundant move in return statement [-Wredundant-move]
/home/runner/work/sapling/sapling/eden/fs/utils/ImmediateFuture-inl.h:356:25: note: remove ‘std::move’ call
/home/runner/work/sapling/sapling/eden/fs/utils/ImmediateFuture-inl.h: In instantiation of ‘facebook::eden::ImmediateFuture<typename facebook::eden::detail::continuation_result<typename std::enable_if<is_invocable_v<Func, folly::Try<T> >, void>::type, Func, folly::Try<T> >::type> facebook::eden::ImmediateFuture<T>::thenTry(Func&&) && [with Func = facebook::eden::ImmediateFuture<T>::ensure(Func&&) && [with Func = {anonymous}::ImmediateFuture_ensureBasic_Test::TestBody()::<lambda()>&; T = int]::<lambda(folly::Try<int>)>; T = int; typename facebook::eden::detail::continuation_result<typename std::enable_if<is_invocable_v<Func, folly::Try<T> >, void>::type, Func, folly::Try<T> >::type = int]’:
/home/runner/work/sapling/sapling/eden/fs/utils/ImmediateFuture-inl.h:196:8:   required from ‘facebook::eden::ImmediateFuture<T> facebook::eden::ImmediateFuture<T>::ensure(Func&&) && [with Func = {anonymous}::ImmediateFuture_ensureBasic_Test::TestBody()::<lambda()>&; T = int]’
/home/runner/work/sapling/sapling/eden/fs/utils/test/ImmediateFutureTest.cpp:52:41:   required from here
/home/runner/work/sapling/sapling/eden/fs/utils/ImmediateFuture-inl.h:240:31: warning: redundant move in return statement [-Wredundant-move]
  240 |       return std::move(semiFut);
```

after,  they are gone!

 ---
Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/facebook/sapling/pull/696).
* https://github.com/facebook/sapling/issues/693
* __->__ https://github.com/facebook/sapling/issues/696
* https://github.com/facebook/sapling/issues/692
* https://github.com/facebook/sapling/issues/691
* https://github.com/facebook/sapling/issues/682
* https://github.com/facebook/sapling/issues/689
* https://github.com/facebook/sapling/issues/697
* https://github.com/facebook/sapling/issues/706
* https://github.com/facebook/sapling/issues/730

Reviewed By: xavierd

Differential Revision: D49874503

Pulled By: genevievehelsel

fbshipit-source-id: 959af45431444b65446eb3f21d1aaf8b4dc5bf30
2023-10-06 21:20:06 -07:00
Mark Shroyer
cc3f9e1d21 Add a synchronous fault check returning a Try
Summary:
This adds a synchronous FaultInjector::check method so we can handle errors in
synchronous code without throwing and catching.

In the process, I rework the checkImpl functions:
- Now the check logic is deduplicated into checkAsync
- checkTry just blocks on checkAsync on a single thread
- check just unwraps any exception from checkTry

Reviewed By: chadaustin

Differential Revision: D49108908

fbshipit-source-id: 1c2a614d0dde5cae0c341f55f90128f710b5ef6d
2023-09-11 13:43:20 -07:00
Mark Shroyer
554546bdb3 Simplify FaultInjector::check and checkAsync
Summary:
We have multiple FaultInjector::check* templates with different parameters,
which will lead to an unweildy number of implementations when we add one that
returns a Try.  This cleans things up by overloading constructKey to forward
std::string_view directly to the implementations, so we can then remove the
versions that accept keyValue as a string_view.

Reviewed By: chadaustin

Differential Revision: D49114096

fbshipit-source-id: 1b25ea365537e285c65053468a48e837b983d5ab
2023-09-11 13:43:20 -07:00
John Elliott
8701d96f9a Refactor ProcessNameCache to include ProcessSimpleName and ppid.
Summary:
When doing a hack-a-month task I punted on cleaning up some new code to retrieve a simple, human-readable process name - https://www.internalfb.com/diff/D47276991?dst_version_fbid=795860982081651&transaction_fbid=584703497175444.

This change moves the fetching of a simple process name into the process name cache. My first cut at this kept ProcessName and ProcessSimpleName entirely separated in the cache, but the async processing fetched the two together. This felt pretty klunky, so this cut now bundles up ProcessName and ProcessSimpleName along with the pid and ppid (parent pid) into a new struct, ProcessInfo and changes to cache that instead.

In some areas this is more ergonomic and otthers it slightly less ergonomic. The fact we obtain both names and parent pid is overkill in some cases, but what is needed for others. Given that these are used for logging and diagnostics this seemed OK to me.

Note: ProcessSimpleName is only implemented (validly) for macOS today. Adding other platofms should not be difficult, but there is no use case at this time.

Reviewed By: kmancini

Differential Revision: D48923253

fbshipit-source-id: abcbc604e7a319bf1c249cf94948e4ff4b2504c9
2023-09-06 22:12:38 -07:00
John Elliott
3052018e9f Move ProcessSimpleName support to ProcessInfo.*
Summary: In preparation for merging ProcessSimpleName and ProcessName functionality into ProcessNameCache moving some helper functions to ProcessInfo.

Reviewed By: genevievehelsel

Differential Revision: D48923254

fbshipit-source-id: 9223d45c3b36924750292a302f091fac924ed4cf
2023-09-06 22:12:38 -07:00
John Elliott
5664b37971 Rename ProcessName* to ProcessInfo*
Summary: In preparation for merging ProcessSimpleName and ProcessName functionality into ProcessNameCache renaming now The new cache will cache ProcessInfo object which will include both names, and the parent pid.

Reviewed By: genevievehelsel

Differential Revision: D48855222

fbshipit-source-id: 4cb10df7b6cc32efc0d655771d01d58e7ba57dd5
2023-09-06 22:12:38 -07:00
John Elliott
cb65bd30a8 Fixes to getdeps OSS builds on CentOS Stream 9
Summary:
CentOS Stream 9 comes with a much newer version of gcc (11.4.1) than either earlier devservers (8.5) and sandcastle (8.4).

This set of changes enables builds to succeed on newer devservers. One set of errors was realted to ImmediateFuture where `makeNotReadyImmediateFuture` failed with an "class template argument deduction failed" error. Looking at the errors it looked like using parens instead of curly braces might be the solution. However, this did not change the outcome. Another error in the output was that the `SemiFutureReadiness` enum was private. Moving this to public fixed this error.

Next up was an issue where size_t was undefined in RingBuffer.h. Easy add of <stddef.h> resolved this issue.

Reviewed By: xavierd

Differential Revision: D48250671

fbshipit-source-id: 646e0d5865593a16ba29131c2443b87f2bb4820e
2023-08-11 12:21:08 -07:00
John Elliott
01afcad092 Filter out duplicates when reporting NFS crawling
Summary:
When the NFS crawl detection logic runs, it walks over the list of processes that have open files in any of the Eden mounts. If a given process hierarcy has mulitple non-exluded process with open files they are reported multiple times. This change keeps track of which pids have been seen in the reporting and only reports them one time. It also detects process hierarchies that are proper subsets of and only retains the longest hiearchy for reporting.

NFS crawl detection is still pretty basic - simple detecting that certain metrics have crossed a threshold and reporting which processes have open files in Eden mounts. Future improvements could use this trigger to initiate sampling of open files over a short interval to better refine which processes are actually opening multiple files and not just holding a static list. This improvement could be made in the future if this simple mechansim is too noisy.

Reviewed By: mshroyer

Differential Revision: D48095393

fbshipit-source-id: c85f5dd7d8a7d184cd41d4b0604795874e123641
2023-08-09 17:17:58 -07:00
Saul Gutierrez
62c802bfdc symlinks: handle symlinks with absolute paths
Summary:
This allows hg on EdenFS to be able to create symlinks with absolute paths on Windows as well as check out commits with absolute path symlinks.

There are a few caveats here:
- Symlinks with absolute paths will only be usable on the same type of OS (Windows vs. POSIX) they were created.
- Checking out commits with absolute paths created on POSIX (i.e., starting with `/`) aren't usable on Windows
- Symlinks with absolute paths created on Windows will keep the same drive letter across different checkouts.
  - E.g., if the root of the EdenFS checkout is somewhere at `C:\` and there is a symlink pointing to somewhere like `D:\foo\bar.txt`, and then that same commit is checked out in a different Windows machine with that same repo mounted at `E:\`, that symlink will still point to `D:\foo\bar.txt`

If there seems to be some UNC wonkiness in this commit, it is because UNC usage on symlinks is quite inconsistent on Windows:
- Things that use UNC for absolute path symlinks:
  - Windows' `mklink` command (creates symlinks with UNC paths)
  - Python's `os.symlink` (same as above)
  - Hg commits
  - EdenFS (when stored as Inodes; some functions like `realpath`)
- Things that don't use UNC for absolute path symlinks:
  - `PrjWritePlaceholderInfo2`
  - `PrjFillDirEntryBuffer2`
  - `std::filesystem::read_symlink`

Reviewed By: xavierd

Differential Revision: D47227590

fbshipit-source-id: b92c8462ad3f13c2724b76ee61f8c095695027cd
2023-08-01 13:59:20 -07:00
Xavier Deguillard
f5184b0365 utils: remove SSLContext
Summary: This appears to be unused, no need to keep it around.

Reviewed By: kmancini

Differential Revision: D47959163

fbshipit-source-id: a07d2d7e09d376ee81cb9db33eb7710e90daf5da
2023-08-01 11:06:06 -07:00