Commit Graph

56 Commits

Author SHA1 Message Date
Chad Austin
5acb860689 fix windows build
Reviewed By: pkaush

Differential Revision: D19606106

fbshipit-source-id: 559c539a804e2d2c6ca095604b9dd0864da98423
2020-01-28 13:21:10 -08:00
Puneet Kaushik
b01d4a721d Implemented check file name functionality to workaround a Projected FS issue.
Summary:
There is a bug in Projected FS on Windows 1903 and 1909, which BSODs the system on SetInformation call. Projected FS seems to be dereferencing a nullptr while attempting to check if the file is in the backing store. Providing a separate callback to check if the file exists in the backing store will avoid the buggy code (suggested by Microsoft).

This will enable Eden FS on Windows 1903 and 1909.

Reviewed By: simpkins

Differential Revision: D19377522

fbshipit-source-id: ab5e9bc8e2472f3e689d71d05a560bac86211295
2020-01-13 16:15:09 -08:00
Puneet Kaushik
8899c53892 Update Windows EdenMount::getRootTree return a future
Summary: This is a followup on D18666585.

Reviewed By: chadaustin

Differential Revision: D19377523

fbshipit-source-id: f9ab4011d0978a6934de77d1837a37082603cf52
2020-01-13 16:15:09 -08:00
Puneet Kaushik
1350e4f8ce Fixing ObjectStore::create signature in Windows TestMount
Summary: We missed updating this in D18669664.

Reviewed By: simpkins

Differential Revision: D19377524

fbshipit-source-id: e23fb039047855454b4f12353bc375b1a2c8d962
2020-01-13 16:15:08 -08:00
Chad Austin
b75b10bc33 kill ObjectStore::getBlobMetadata
Summary:
The last remaining user of ObjectStore::getBlobMetadata was a debug
Thrift call. Remove it and update the Thrift call to use getBlobSize
and getBlobSha1.

Reviewed By: pkaush

Differential Revision: D18663376

fbshipit-source-id: 86baefc9004a07aac4ddf5849870431be04c75f2
2019-12-20 16:14:18 -08:00
Puneet Kaushik
4c720d12c1 hg status tests for Eden Windows
Summary: This diff contains the tests for hg status. This is not comprehensive list of tests but the tests that we have working at this time. More tests will be added as we test and fix issues.

Reviewed By: simpkins

Differential Revision: D18454851

fbshipit-source-id: 80e3ff4d24873016dc420f202fbfe53fcffc24f2
2019-12-10 14:07:26 -08:00
Puneet Kaushik
8b0feed6fd Move EdenDispatcher under PrjfsChannel
Summary: The current implementation of EdenDispatcher is projectedfs specific and was linking against its dll. This was adding the need to add Prjfs dll for running our tests. Moving it to prjfs channel should fix that.

Reviewed By: simpkins

Differential Revision: D18462171

fbshipit-source-id: ff7bfcdd14d19552d49b61ff03cdd770badfcd68
2019-12-10 14:07:26 -08:00
Puneet Kaushik
35accc34bc Add TestMount class to test EdenMount
Summary: This class provides an interface to create an EdenMount for testing and use it through the APIs. It's similar to TestMount for Eden on Posix.

Reviewed By: simpkins

Differential Revision: D18454852

fbshipit-source-id: 91d64b2c535060979ef634fe4e7779f50f169fc5
2019-12-10 14:07:25 -08:00
Puneet Kaushik
f54831e526 Teach WinStore to work with std::wstring_view to avoid unnecessary copy
Summary: WinStore interface was taking wstring for path and we were converting wchar pointers to wstring which were later converted to RelativePath. In this diff we pass the path as is and save one copy per operation.

Reviewed By: simpkins

Differential Revision: D18444773

fbshipit-source-id: fa6a3efb6a7e91cf9b0dca919e80870e1bcf0804
2019-12-10 14:07:25 -08:00
Puneet Kaushik
abfdda5447 Create TestFsChannel class
Summary: Moved the current FsChannel implementation in to PrjfsChannel and converted the FsChannel.h into an abstract class. Created a TestFsChannel class for testing.

Reviewed By: simpkins

Differential Revision: D18440401

fbshipit-source-id: 30d6742cd18b4b76b664e3af7ed1a528cf876046
2019-12-10 14:07:25 -08:00
Puneet Kaushik
e19f84aa65 Add resetParents to enable hg commit
Summary:
A successful run of hg commit ends in call to resetParents() to reset the current parent commit.

We also need resetParent to run the Status tests.

Reviewed By: genevievehelsel

Differential Revision: D18439954

fbshipit-source-id: 44f7a009e050bd5e2130d8c4fc3a85a8ec3bfad1
2019-12-10 14:07:24 -08:00
Puneet Kaushik
86f5c839d1 Add EdenMount diff to generate the ScmStatus
Summary: This implements diff() inside EdenMount which uses GenerateStatus to compute the ScmStatus.

Reviewed By: simpkins

Differential Revision: D18195574

fbshipit-source-id: 16cfbda35796d1cfd4e13e6566b7ac222163aea4
2019-12-10 14:07:24 -08:00
Puneet Kaushik
7e2de5609a Add GenerateStatus to compute the status change
Summary:
GenerateStatus will parse the CurrentState and compute the status. The algorithm here is little different than of Eden with FUSE, Eden with Prjfs will loop over the CurrentState and only compare the entries present in it. CurrentState has the list of all the entries modified and a complete status could be generated from it.

This doesn't solve all the scenarios. I have few unit tests running at the top of this stack and those cases are working. I need to test the other cases and make them work. One case that I already know doesn't work is when a user resets the parent and doesn't make any change. I will work on fixing the other cases and put up diffs for that.

Reviewed By: simpkins

Differential Revision: D18195573

fbshipit-source-id: 3650f26387f1a5f8d467fd81148c266fa1307a3c
2019-12-10 14:07:24 -08:00
Puneet Kaushik
a88d4eff1f Add template function to convert different string input types
Summary: Create a template functions to convert strings with a wide variety of input types like folly::StringPiece, std::string, folly::fbstring and std::string_view to wide char string.

Reviewed By: wez

Differential Revision: D18071832

fbshipit-source-id: 147af97dff929766db83c9477117ec82da42b03e
2019-11-18 11:31:17 -08:00
Puneet Kaushik
e9dbb85b8d Fix FileUtilsTest and enable them.
Summary: We had linking issues with the Boost while compiling with getdeps. I have moved the tests to use std::filesystem instead.

Reviewed By: wez

Differential Revision: D18195608

fbshipit-source-id: 32213a9b22105869eef78724bb3e583c3fd8e708
2019-11-18 11:31:16 -08:00
Chad Austin
987dd994b6 add a StructuredLogger instance to ServerState
Summary:
Allocate and hook up a StructuredLogger at startup if the EdenConfig
has the appropriate values set.

Reviewed By: simpkins

Differential Revision: D18071821

fbshipit-source-id: 3996b6644bbf0c16bb3b9950d57a79d4619a1656
2019-11-13 15:23:38 -08:00
Puneet Kaushik
fccc1343ba Throw EdenError when it's not implemented.
Summary: Calling a command that is not implemented will terminate the edenfs. It was ok for testing but now we have it running on Sandcastle, so will throw Eden error instead.

Reviewed By: chadaustin

Differential Revision: D18145495

fbshipit-source-id: 17e57f426d3cf80c93c2112741a027db8cbc6b8d
2019-10-30 10:50:02 -07:00
Puneet Kaushik
b1523f0862 rename tests to make testpilot happy
Summary:
Testpilot is crashing to parse the JSON with the test names. I didn't debug it any further but looked like didn't like the names and renaming them worked.

    Traceback (most recent call last):
    File "testinfra/testpilot/testpilot.py", line 616, in pre_main
    File "testinfra/testpilot/testpilot.py", line 111, in main
    File "testinfra/testpilot/testpilot.py", line 262, in main_impl
    File "testinfra/testpilot/testpilot.py", line 259, in main_impl
    File "testinfra/testpilot/integration/fbcode/finder.py", line 478, in get_tests
    KeyError: 'eden-StateDBNodeTest.fetchDirectoryEntries-getdeps-windows-none-6 - main'

Reviewed By: wez

Differential Revision: D18208976

fbshipit-source-id: 1785aa4b1c42041578350b9c2a7e928059eeb648
2019-10-30 10:50:02 -07:00
Puneet Kaushik
f41041f054 Use path class instead of manually copying the parent path.
Reviewed By: chadaustin

Differential Revision: D18145497

fbshipit-source-id: 8bb095c22d4e093cf541c573502ec6ab27d9d84f
2019-10-25 16:29:18 -07:00
Puneet Kaushik
ee9bbacc89 Add header file in CMakeLists
Summary: Having the header files in CMake, adds them in Visual Studio project and makes it easier to work in Visual Studio.

Reviewed By: chadaustin

Differential Revision: D18145496

fbshipit-source-id: f6607e0cbf2e6a8d9fc3ad9f8bed90458aec355e
2019-10-25 16:29:17 -07:00
Puneet Kaushik
bc35e81374 Integrate CurrentState with the notifications.
Summary: This diff will create an instance of CurrentState in EdenMount and integrate it with the Prjfs notifications.

Reviewed By: chadaustin

Differential Revision: D18068335

fbshipit-source-id: 5c78949c8b0ad316d2b014e808297f29092ae703
2019-10-24 16:26:55 -07:00
Puneet Kaushik
a0e5d97ab7 Add Notifications support to Eden Windows
Summary: This diff adds the notifications callbacks from Prjfs. These will be used in the later diffs in the stack.

Reviewed By: chadaustin

Differential Revision: D18068035

fbshipit-source-id: a8e679ef32ae39251e6c1e926feb9cd1b71258e0
2019-10-24 16:26:54 -07:00
Puneet Kaushik
991965ecae Update RepoConfig to store Mount id in .eden/config
Summary: This diff creates a Guid as a unique mount id. This mount id will be used to uniquely identify our repo in the Regdb.

Reviewed By: chadaustin

Differential Revision: D18055798

fbshipit-source-id: 01099d7fdf15c325498e83c8b63637dd1d85d028
2019-10-24 16:26:54 -07:00
Puneet Kaushik
3382fa538d Add CurrentState to record the FS changes
Summary: The is the top level interface which will receive all the FS changes and will store them in the RegDB for later use.

Reviewed By: chadaustin

Differential Revision: D17998282

fbshipit-source-id: 7570edcfe0f6bf9164bfa0688665fb7253a21bc6
2019-10-24 16:26:54 -07:00
Puneet Kaushik
fbd422253d Add StateDbNode to fetch and set the directory entries from the regdb
Reviewed By: chadaustin

Differential Revision: D17986746

fbshipit-source-id: 906e526d3ac8637270fe2b2eaccb45f2d535ebd4
2019-10-24 16:26:54 -07:00
Puneet Kaushik
91d12786f9 Add StateDirectoryEntry as an in memory representation of a FS cache dirEntry
Summary: StateDirectoryEntry will contain the current state of a file or folder in the prjfs cache and will be totally in memory. In the next few diffs we will bring in the code that will load and store these in the db.

Reviewed By: chadaustin

Differential Revision: D17985967

fbshipit-source-id: 260dca369a3acce10385b04fdb5ff111cfc998be
2019-10-24 16:26:53 -07:00
Puneet Kaushik
db849cfca1 Remove searchExpression DCHECK
Summary: Removing this DCHECK for the searchExpression because we can recieve requests for empty string and is a valid request.

Reviewed By: chadaustin

Differential Revision: D17985604

fbshipit-source-id: 40ffbe153a7ae44e85ed7d7ad7b2e79affb1d529
2019-10-18 12:39:09 -07:00
Puneet Kaushik
4db8a46102 Add Guid::toString() for multibyte string.
Summary: Added a multi-byte version of toString() for the guid class. Also renamed the existing toString() to toWString() which returns the widechar string for the GUID.

Reviewed By: chadaustin

Differential Revision: D17985500

fbshipit-source-id: fb3d976e39c0583122e47e3e444cf0f68e6a9544
2019-10-18 12:39:09 -07:00
Chad Austin
65c93484e2 rename tracing to telemetry
Summary: Tracing was not an accurate name for what this directory had become. So rename it to telemetry.

Reviewed By: wez

Differential Revision: D17923303

fbshipit-source-id: fca07e8447d9b9b3ea5d860809a2d377e3c4f9f2
2019-10-15 13:39:41 -07:00
Puneet Kaushik
e639e92373 Add SCM hash to FileMetadata
Summary: FileMetadata will also store the SCM hash to be used later.

Reviewed By: chadaustin

Differential Revision: D17883243

fbshipit-source-id: 6121ca76f78b05f074799c0f52b568aa7805d8ab
2019-10-14 12:20:42 -07:00
Puneet Kaushik
5e9d6ced1c Add registry key class to interface with the Windows registry
Summary: This class is to simplify working with Windows registry and would be used in the future diffs.

Reviewed By: chadaustin

Differential Revision: D17791021

fbshipit-source-id: 76de156de67be4a007a5254efe48a14bdfefb24d
2019-10-14 12:20:42 -07:00
Puneet Kaushik
52ca5798bb Add a GUID class
Reviewed By: chadaustin

Differential Revision: D17738260

fbshipit-source-id: ce0a3d5387e278d84a80747ab540bb7898c0de67
2019-10-14 12:20:41 -07:00
Chad Austin
4b47257165 remove EdenConfig accessors
Summary:
Instead of having accessors for every config setting in EdenConfig,
just expose the ConfigSettings directly.

Reviewed By: fanzeyi

Differential Revision: D17847805

fbshipit-source-id: 8c6c1010c010113cf859677449797ea916f2a2a5
2019-10-11 17:55:19 -07:00
Andres Suarez
fbdb46f5cb Tidy up license headers
Reviewed By: chadaustin

Differential Revision: D17872966

fbshipit-source-id: cd60a364a2146f0dadbeca693b1d4a5d7c97ff63
2019-10-11 05:28:23 -07:00
Puneet Kaushik
97834a146d Add requesting process name in the trace
Summary: This will help us identify the calling process for the FS request. This was helpful while testing watchman crawl in Eden repo.

Reviewed By: chadaustin

Differential Revision: D17719028

fbshipit-source-id: 0d646d7949a6e26268b71287b26d63473a9a87f8
2019-10-04 11:08:44 -07:00
Puneet Kaushik
eba935fa9a Move eden_win_util_tests from vcxproj to Cmake
Summary: Moved the code from vcproj testutils folder to test folder and enabled the Cmake build on it.

Reviewed By: wez

Differential Revision: D17738227

fbshipit-source-id: bcba41cb29b7e24782c36899c0977c5592888ff5
2019-10-04 06:40:48 -07:00
Puneet Kaushik
3af9ee1321 Converting const ptr to EdenMount to non-const reference
Summary:
Converting the const ptr in EdenDispatcher because we need to call non-const function (like update Journal). Also storing the reference in EdenDispatcher and WinStore instead of ptr.

This diff should not change the behavior of the Eden.

Reviewed By: chadaustin

Differential Revision: D17719606

fbshipit-source-id: 6c371c38045c760837130bb607163c2bc469b17a
2019-10-02 14:48:56 -07:00
Genevieve Helsel
6a036808cc use callbacks in source control tree comparisons
Summary: Use callback to save ScmStatus instead of storing status inside a `TreeDiffer` object. Involes a bit of restructuring of some code to avoid circular dependencies and library creation. Mostly renames and file moves, some funtion moves as well.

Reviewed By: simpkins

Differential Revision: D17400466

fbshipit-source-id: fcd194a4c20204dffd3d11cd4a083564dc0ea938
2019-09-23 15:22:30 -07:00
Adam Simpkins
6b3bafe54f clean up duplicate find_package(cpptoml)
Summary:
The code in `EdenConfigChecks.cmake` had two separate `find_package(cpptoml)`
calls, one using its installed CMake config file, and one using a custom
`Findcpptoml.cmake` module.

This removes the custom `Findcpptoml.cmake` code, and updates everything to
only used cpptoml's installed CMake configuration.

Reviewed By: chadaustin

Differential Revision: D17401220

fbshipit-source-id: 3789703cdfc029049db3b1bd9f5751fa2a60a8d4
2019-09-20 11:36:13 -07:00
Adam Simpkins
e7af87edad fix library dependencies on Windows
Summary:
The Windows library definitions were missing many dependencies.  They happened
to link for now, but this was fragile and it was easy to cause this to break
by making changes to the dependency structure of our other libraries.

Additionally the files in eden/fs/win/store and eden/fs/win/mount also have
circular dependencies between each other that cannot easily be resolved in one
direction or the other.  Therefore this combines the two `eden_win_mount` and
`eden_win_store` libraries into a single `eden_win` library to eliminate this
circular library dependency.

Reviewed By: wez

Differential Revision: D17309104

fbshipit-source-id: c95d0cfb8979e2b68d4947884acd13f859a4e01b
2019-09-11 13:20:43 -07:00
Puneet Kaushik
5bd4a8c788 Create .eden at the repo root and store config in it.
Summary: On Linux and Mac, we provision .eden inside every directory, which contains symlinks to other locations. On Windows this won't work as well. First, Projected FS will cache all the .eden and will bump up the number of files on the disk. Second, it would be hard to simulate symlinks from Projected FS.

Reviewed By: strager

Differential Revision: D16724354

fbshipit-source-id: a560698fae8c7f14e475f1c1fb9ecc53e60c189f
2019-08-14 19:11:33 -07:00
Puneet Kaushik
78079981f8 Redirect the log messages to the eden log file
Summary: Redirecting the stdout and stderr to the eden log file. The log categories are not working as expected on Windows and will need to be fixed. At this point this doesn't log the "eden=DBG2" on Windows. One workaround for now is to remove "FOLLY_INIT_LOGGING_CONFIG()" to get the default logs.

Reviewed By: chadaustin

Differential Revision: D16653632

fbshipit-source-id: 028cdf1d698798ff3fb0284b3f0fa2df5570eaf0
2019-08-10 11:19:24 -07:00
Puneet Kaushik
3878986e2c Run hg debugedenimporthelper with CWD as repository
Summary: hg debugedenimporthelper should either have the repo path as argument or the current working directory should be inside a repo. Setting the current working directory for the process.

Reviewed By: strager

Differential Revision: D16565042

fbshipit-source-id: d6e826bebf58fd58f5250e6c477849ca147628c8
2019-08-01 12:10:03 -07:00
Jake Crouch
6756d9b232 Pass Journal object to Windows Eden Mount
Summary: D16461081 broke the windows build of Eden by not updating the Windows mount code, this diff makes the same change as that diff in the Windows portion of the code.

Reviewed By: chadaustin

Differential Revision: D16549392

fbshipit-source-id: eee1bede08c1b27329b026746dda6863519ed10b
2019-07-29 17:21:30 -07:00
Puneet Kaushik
5d236d1342 Pass commandline to EdenServer to fix build
Summary: In a previous diff we added the support to pass the command line to EdenServer but missed from the Windows main(). Until we unify the main function we need to add it at two places.

Reviewed By: simpkins

Differential Revision: D16370228

fbshipit-source-id: 47b9842fbca709e1d3c832db3d82765f2e5f8930
2019-07-19 08:47:52 -07:00
Puneet Kaushik
5053a65758 Adding streamingeden_thrift as a dependency to fix the build
Summary: eden_win_mount, eden_win_utils and eden_win_store include journal which depend on streamingeden_thrift. Adding the dependency to fix the build order.

Reviewed By: fanzeyi

Differential Revision: D16065869

fbshipit-source-id: d3bd5887e6c675885d284671bef7e514515d5fc0
2019-07-01 11:39:55 -07:00
Puneet Kaushik
452fbb6f58 Add --edenDir and other command line arguments support to Edenfs on Windows
Summary: We need --edenDir support to run muliple instance of Edenfs, which is required to run the integration tests.

Reviewed By: simpkins

Differential Revision: D15951483

fbshipit-source-id: a516159cdeb5f046f795fc28399a2af5fe8a9f95
2019-06-25 14:16:11 -07:00
Adam Simpkins
4bc8682391 update license headers in CMake files
Summary:
Update the copyright & license headers in CMake files to reflect the
relicensing to GPLv2

Reviewed By: wez

Differential Revision: D15487079

fbshipit-source-id: 715e559464c19a0070d6e55a095b3fc7d61ad2f8
2019-06-19 17:02:46 -07:00
Adam Simpkins
aa5e6c7295 update license headers in C++ files
Summary:
Update the copyright & license headers in C++ files to reflect the
relicensing to GPLv2

Reviewed By: wez

Differential Revision: D15487078

fbshipit-source-id: 19f24c933a64ecad0d3a692d0f8d2a38b4194b1d
2019-06-19 17:02:45 -07:00
Puneet Kaushik
7913c918e2 Add eden_service_thrift as a dependency for the new CMake targets.
Summary: The new Windows CMake targets were failing to include the generated thrift headers on Sandcastle machines. Making eden_service_thrift a dependecy will make sure that the thrift generated files are created before we compile the code.

Reviewed By: simpkins

Differential Revision: D15536743

fbshipit-source-id: 4bedb8f33cddf5f7eb8f5b5ce52b2013728b38f7
2019-05-31 16:16:23 -07:00