Skip to content

Commit

Permalink
Move SystemError from eden to edencommon
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jdelliot authored and facebook-github-bot committed Mar 1, 2024
1 parent daad993 commit bb37cf9
Show file tree
Hide file tree
Showing 30 changed files with 37 additions and 265 deletions.
2 changes: 1 addition & 1 deletion eden/fs/config/CheckoutConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
#include <folly/json/json.h>
#include <optional>

#include "eden/common/utils/SystemError.h"
#include "eden/common/utils/Throw.h"
#include "eden/fs/utils/FileUtils.h"
#include "eden/fs/utils/FilterUtils.h"
#include "eden/fs/utils/PathMap.h"
#include "eden/fs/utils/SystemError.h"

using folly::ByteRange;
using folly::IOBuf;
Expand Down
2 changes: 1 addition & 1 deletion eden/fs/config/TARGETS
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ cpp_library(
srcs = glob(["*.cpp"]),
headers = glob(["*.h"]),
deps = [
"//eden/common/utils:system_error",
"//eden/fs/utils:enum",
"//eden/fs/utils:file_utils",
"//eden/fs/utils:filter_utils",
"//eden/fs/utils:system_error",
"//eden/fs/utils:user_info",
"//folly:map_util",
"//folly:range",
Expand Down
3 changes: 2 additions & 1 deletion eden/fs/fuse/FuseChannel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
#include <chrono>
#include <csignal>
#include <type_traits>

#include "eden/common/utils/Synchronized.h"
#include "eden/common/utils/SystemError.h"
#include "eden/fs/fuse/FuseDirList.h"
#include "eden/fs/fuse/FuseDispatcher.h"
#include "eden/fs/fuse/FuseRequestContext.h"
Expand All @@ -25,7 +27,6 @@
#include "eden/fs/utils/Bug.h"
#include "eden/fs/utils/IDGen.h"
#include "eden/fs/utils/StaticAssert.h"
#include "eden/fs/utils/SystemError.h"
#include "eden/fs/utils/Thread.h"

using namespace folly;
Expand Down
2 changes: 1 addition & 1 deletion eden/fs/fuse/FuseRequestContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@

#include <folly/logging/xlog.h>

#include "eden/common/utils/SystemError.h"
#include "eden/fs/notifications/Notifier.h"
#include "eden/fs/telemetry/RequestMetricsScope.h"
#include "eden/fs/utils/SystemError.h"

using namespace folly;

Expand Down
2 changes: 1 addition & 1 deletion eden/fs/fuse/TARGETS
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ cpp_library(
deps = [
"fbsource//third-party/fmt:fmt",
"//eden/common/utils:synchronized",
"//eden/common/utils:system_error",
"//eden/fs/notifications:notifier",
"//eden/fs/privhelper:interface",
"//eden/fs/telemetry:fs_event_logger",
"//eden/fs/utils:static_assert",
"//eden/fs/utils:system_error",
"//eden/fs/utils:thread",
"//folly:exception",
"//folly/executors:global_executor",
Expand Down
3 changes: 2 additions & 1 deletion eden/fs/inodes/FuseDispatcherImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

#include "eden/fs/inodes/FuseDispatcherImpl.h"
#include <folly/logging/xlog.h>

#include "eden/common/utils/SystemError.h"
#include "eden/fs/fuse/FuseDirList.h"
#include "eden/fs/inodes/EdenMount.h"
#include "eden/fs/inodes/FileInode.h"
Expand All @@ -19,7 +21,6 @@
#include "eden/fs/store/ObjectFetchContext.h"
#include "eden/fs/telemetry/EdenStats.h"
#include "eden/fs/utils/Clock.h"
#include "eden/fs/utils/SystemError.h"

using namespace folly;
using std::string;
Expand Down
2 changes: 1 addition & 1 deletion eden/fs/inodes/InodeMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <folly/chrono/Conv.h>
#include <folly/logging/xlog.h>

#include "eden/common/utils/SystemError.h"
#include "eden/fs/config/EdenConfig.h"
#include "eden/fs/config/ReloadableConfig.h"
#include "eden/fs/inodes/FileInode.h"
Expand All @@ -23,7 +24,6 @@
#include "eden/fs/telemetry/EdenStats.h"
#include "eden/fs/utils/Bug.h"
#include "eden/fs/utils/NotImplemented.h"
#include "eden/fs/utils/SystemError.h"
#include "eden/fs/utils/TimeUtil.h"

using folly::Future;
Expand Down
3 changes: 2 additions & 1 deletion eden/fs/inodes/PrjfsDispatcherImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
#include <folly/logging/xlog.h>
#include <folly/stop_watch.h>
#include <optional>

#include "eden/common/utils/SystemError.h"
#include "eden/fs/config/CheckoutConfig.h"
#include "eden/fs/inodes/EdenMount.h"
#include "eden/fs/inodes/FileInode.h"
Expand All @@ -26,7 +28,6 @@
#include "eden/fs/utils/FaultInjector.h"
#include "eden/fs/utils/FileUtils.h"
#include "eden/fs/utils/PathFuncs.h"
#include "eden/fs/utils/SystemError.h"
#include "eden/fs/utils/UnboundedQueueExecutor.h"

namespace facebook::eden {
Expand Down
2 changes: 1 addition & 1 deletion eden/fs/inodes/RequestContext.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@

#include <folly/logging/xlog.h>

#include "eden/common/utils/SystemError.h"
#include "eden/fs/telemetry/RequestMetricsScope.h"
#include "eden/fs/utils/SystemError.h"

using namespace std::chrono;

Expand Down
4 changes: 2 additions & 2 deletions eden/fs/inodes/TARGETS
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ cpp_library(
srcs = ["RequestContext.cpp"],
headers = ["RequestContext.h"],
deps = [
"//eden/fs/utils:system_error",
"//eden/common/utils:system_error",
"//folly/logging:logging",
],
exported_deps = [
Expand Down Expand Up @@ -151,6 +151,7 @@ cpp_library(
"fbsource//third-party/fmt:fmt",
":file_content_store",
"//eden/common/utils:synchronized",
"//eden/common/utils:system_error",
"//eden/fs/digest:blake3_hash",
"//eden/fs/inodes/memcatalog:meminodecatalog",
"//eden/fs/inodes/sqlitecatalog:bufferedsqliteinodecatalog",
Expand Down Expand Up @@ -179,7 +180,6 @@ cpp_library(
"//eden/fs/utils:match",
"//eden/fs/utils:nfs_socket",
"//eden/fs/utils:process",
"//eden/fs/utils:system_error",
"//folly:exception",
"//folly:fbstring",
"//folly:file_util",
Expand Down
2 changes: 1 addition & 1 deletion eden/fs/inodes/TreeInode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "eden/common/utils/CaseSensitivity.h"
#include "eden/common/utils/ImmediateFuture.h"
#include "eden/common/utils/Synchronized.h"
#include "eden/common/utils/SystemError.h"
#include "eden/fs/config/CheckoutConfig.h"
#include "eden/fs/fuse/FuseChannel.h"
#include "eden/fs/fuse/FuseDirList.h"
Expand Down Expand Up @@ -56,7 +57,6 @@
#include "eden/fs/utils/FaultInjector.h"
#include "eden/fs/utils/NotImplemented.h"
#include "eden/fs/utils/PathFuncs.h"
#include "eden/fs/utils/SystemError.h"
#include "eden/fs/utils/TimeUtil.h"
#include "eden/fs/utils/UnboundedQueueExecutor.h"
#include "eden/fs/utils/XAttr.h"
Expand Down
2 changes: 1 addition & 1 deletion eden/fs/model/git/GitIgnoreFileParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
#include <folly/FileUtil.h>
#include <folly/logging/xlog.h>

#include "eden/common/utils/SystemError.h"
#include "eden/fs/model/git/GitIgnoreFileParser.h"
#include "eden/fs/utils/SystemError.h"

namespace facebook::eden {

Expand Down
2 changes: 1 addition & 1 deletion eden/fs/model/git/TARGETS
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ cpp_library(
"TopLevelIgnores.h",
],
deps = [
"//eden/fs/utils:system_error",
"//eden/common/utils:system_error",
"//folly:file",
"//folly:file_util",
"//folly/logging:logging",
Expand Down
2 changes: 1 addition & 1 deletion eden/fs/nfs/Nfsd3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <folly/futures/Future.h>
#include <folly/portability/Stdlib.h>

#include "eden/common/utils/SystemError.h"
#include "eden/common/utils/Throw.h"
#include "eden/fs/nfs/NfsRequestContext.h"
#include "eden/fs/nfs/NfsUtils.h"
Expand All @@ -27,7 +28,6 @@
#include "eden/fs/utils/Clock.h"
#include "eden/fs/utils/IDGen.h"
#include "eden/fs/utils/StaticAssert.h"
#include "eden/fs/utils/SystemError.h"

#ifdef __linux__
#include <sys/sysmacros.h>
Expand Down
2 changes: 1 addition & 1 deletion eden/fs/nfs/TARGETS
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ cpp_library(
deps = [
":nfs_utils",
":nfsd_rpc",
"//eden/common/utils:system_error",
"//eden/common/utils:throw",
"//eden/fs/privhelper:interface",
"//eden/fs/store:context",
Expand All @@ -54,7 +55,6 @@ cpp_library(
"//eden/fs/telemetry:structured_logger",
"//eden/fs/utils:clock",
"//eden/fs/utils:static_assert",
"//eden/fs/utils:system_error",
"//eden/fs/utils:utils",
"//folly:utility",
"//folly/executors:serial_executor",
Expand Down
3 changes: 2 additions & 1 deletion eden/fs/notifications/CommandNotifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@
#include "eden/fs/notifications/CommandNotifier.h"

#include <folly/futures/Future.h>

#include "eden/common/utils/SystemError.h"
#include "eden/fs/config/EdenConfig.h"
#include "eden/fs/utils/SpawnedProcess.h"
#include "eden/fs/utils/SystemError.h"

namespace facebook::eden {

Expand Down
3 changes: 2 additions & 1 deletion eden/fs/notifications/Notifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@
#include "eden/fs/notifications/Notifier.h"

#include <folly/futures/Future.h>

#include "eden/common/utils/SystemError.h"
#include "eden/fs/config/EdenConfig.h"
#include "eden/fs/utils/SystemError.h"

namespace facebook::eden {

Expand Down
6 changes: 3 additions & 3 deletions eden/fs/notifications/TARGETS
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ cpp_library(
srcs = ["Notifier.cpp"],
headers = ["Notifier.h"],
deps = [
"//eden/fs/utils:system_error",
"//eden/common/utils:system_error",
"//folly/futures:core",
],
exported_deps = [
Expand Down Expand Up @@ -66,9 +66,9 @@ cpp_library(
"fbsource//third-party/fmt:fmt",
":constants",
"//eden/common/utils:stringconv",
"//eden/common/utils:system_error",
"//eden/fs/config:config",
"//eden/fs/utils:process",
"//eden/fs/utils:system_error",
"//folly/futures:core",
"//folly/portability:windows",
],
Expand All @@ -84,9 +84,9 @@ cpp_library(
srcs = ["CommandNotifier.cpp"],
headers = ["CommandNotifier.h"],
deps = [
"//eden/common/utils:system_error",
"//eden/fs/config:config",
"//eden/fs/utils:process",
"//eden/fs/utils:system_error",
"//folly/futures:core",
],
exported_deps = [
Expand Down
2 changes: 1 addition & 1 deletion eden/fs/notifications/WindowsNotifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
#include <folly/portability/Windows.h>

#include "eden/common/utils/StringConv.h"
#include "eden/common/utils/SystemError.h"
#include "eden/fs/config/EdenConfig.h"
#include "eden/fs/utils/SpawnedProcess.h"
#include "eden/fs/utils/SystemError.h"

namespace facebook::eden {
namespace {
Expand Down
2 changes: 1 addition & 1 deletion eden/fs/privhelper/PrivHelperConn.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
#include <folly/portability/Unistd.h>
#include <sys/types.h>

#include "eden/common/utils/SystemError.h"
#include "eden/common/utils/Throw.h"
#include "eden/fs/utils/Bug.h"
#include "eden/fs/utils/SystemError.h"

using folly::ByteRange;
using folly::checkUnixError;
Expand Down
2 changes: 1 addition & 1 deletion eden/fs/privhelper/TARGETS
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ cpp_library(
srcs = ["PrivHelperConn.cpp"],
headers = ["PrivHelperConn.h"],
deps = [
"//eden/common/utils:system_error",
"//eden/common/utils:throw",
"//eden/fs/utils:system_error",
"//eden/fs/utils:utils",
"//folly:demangle",
"//folly:exception",
Expand Down
3 changes: 2 additions & 1 deletion eden/fs/privhelper/test/PrivHelperTestServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
#include <folly/FileUtil.h>
#include <folly/Range.h>
#include <system_error>
#include "eden/fs/utils/SystemError.h"

#include "eden/common/utils/SystemError.h"

using folly::File;
using folly::StringPiece;
Expand Down
2 changes: 1 addition & 1 deletion eden/fs/privhelper/test/TARGETS
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ cpp_unittest(
"ovr_config//os:macos",
],
deps = [
"//eden/common/utils:system_error",
"//eden/fs/privhelper:conn",
"//eden/fs/privhelper:interface",
"//eden/fs/privhelper:privhelper",
"//eden/fs/privhelper:server",
"//eden/fs/testharness:temp_file",
"//eden/fs/utils:system_error",
"//eden/fs/utils:user_info",
"//folly:conv",
"//folly:exception",
Expand Down
2 changes: 1 addition & 1 deletion eden/fs/testharness/TARGETS
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ cpp_library(
srcs = ["TempFile.cpp"],
headers = ["TempFile.h"],
deps = [
"//eden/fs/utils:system_error",
"//eden/common/utils:system_error",
"//folly/portability:unistd",
],
exported_deps = [
Expand Down
2 changes: 1 addition & 1 deletion eden/fs/testharness/TempFile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include <folly/portability/Unistd.h>

#include "eden/fs/utils/SystemError.h"
#include "eden/common/utils/SystemError.h"

using folly::StringPiece;
using folly::test::TemporaryDirectory;
Expand Down
3 changes: 2 additions & 1 deletion eden/fs/utils/EdenError.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
*/

#include "eden/fs/utils/EdenError.h"

#include "eden/common/utils/SystemError.h"
#include "eden/common/utils/WinError.h"
#include "eden/fs/utils/SystemError.h"

namespace facebook::eden {

Expand Down
Loading

0 comments on commit bb37cf9

Please sign in to comment.