Commit Graph

57449 Commits

Author SHA1 Message Date
Wez Furlong
15f27eae3f eden: enable globFiles on windows
Summary:
This enables globFiles for Windows, with some
minor tweaks around dtype to enable the build and make
the results consistent between watchman and eden.

Reviewed By: chadaustin

Differential Revision: D20536715

fbshipit-source-id: b1c8184dc664910e4d052a21b4cd993ddfaadf25
2020-04-24 15:57:27 -07:00
Wez Furlong
2b3f085bd8 eden: thrift enable basic journal APIs on Windows.
Summary:
This is ostensibly removing and ifndef to enable watchman
to successfully query the journal.

However, for this to work we need to teach the mountPoints list about
normalizing file names.

We avoid using realpath on posix systems because we absolutely cannot afford to
make VFS calls back to ourselves.  I don't know if the same applies on Windows.
If not then perhaps the right thing to do here is to use something like
GetFinalPathNameW to canonicalize the paths.

For now, this does the dumb thing and lowercases and converts slashes.

With this change, watchman is able to subscribe to eden and query
journal information.

However, since most queries get translated to glob requests it
still isn't useful; need to enable globFiles in a follow up diff.

Reviewed By: pkaush

Differential Revision: D20516737

fbshipit-source-id: 2053d7b565a40f6ae9cc738386e37d737772e91e
2020-04-24 15:57:26 -07:00
Puneet Kaushik
139717db04 Add DiffTest to CMake build
Summary: This diff ports DiffTest on Windows and enables them for the CMake builds.

Reviewed By: simpkins

Differential Revision: D20480869

fbshipit-source-id: 77eda5ef53e4cd19552f0da52de4ff53d9807cc3
2020-04-24 14:57:43 -07:00
Puneet Kaushik
db6ac0136e Add InodeBaseTest and TreeInodeTest to CMake build
Summary: This diff adds readdir tests for Windows and enables InodeBaseTest and TreeInodeTest for CMake build.

Reviewed By: simpkins

Differential Revision: D20480866

fbshipit-source-id: 44fb33448c2e6cdb3ecce08136bf8b9e1d5c398a
2020-04-24 14:57:43 -07:00
Puneet Kaushik
2fc667fc2a Add InodeMapTest to CMake build
Summary: This diff make the InodeMapTest work on Windows and enables this test on all the platforms for CMake build.

Reviewed By: wez

Differential Revision: D20480865

fbshipit-source-id: 8f13f88bb3655475c635c889851e39672ce5b9c7
2020-04-24 14:57:43 -07:00
Adam Simpkins
c13f0ac5f7 update the usage of pexpect to work on Windows
Summary:
Update the integration test code that uses pexpect to use the more modern
pexpect APIs.  The top-level `pexpect.spawn()` function is considered legacy
now, and is only provided for backwards compatibility on Unix platforms.

Reviewed By: wez

Differential Revision: D21214640

fbshipit-source-id: 941da5435c4f8afaf22e8053f4c344175d7b1a7f
2020-04-24 14:48:05 -07:00
Adam Simpkins
cadcd0ab39 enable building the integration helper tools in the CMake build
Summary:
Enable building fake_edenfs.cpp and TakeoverTool.cpp in the CMake build.

This includes a few changes to get `fake_edenfs.cpp` closer to building on
Windows, but at the moment it still does not fully build since the
`StartupLogger` is currently not compiled on Windows.

TakeoverTool.cpp is specific to the graceful restart tests, and doesn't make
sense to ever build on Windows.

Reviewed By: wez

Differential Revision: D21214614

fbshipit-source-id: a7a8306ea3f69579fa02bd3753a66d3095ea004a
2020-04-24 14:48:05 -07:00
Wez Furlong
894ed5f4c9 getdeps: partially educate getdeps about EdenFS on Windows
Summary:
I noticed that copytree was taking forever and realized
that it wasn't issuing a prefetch call so I started looking in here;
this commit teaches getdeps how to recognize and EdenFS repo on
Windows but skips calling prefetch on Windows.

Currently the prefetch implementation triggers some very slow
processing in mercurial that is slower to start than just
enumerating the files in the opensource build.

It turned out that my original problem was just that my credentials
had expired and we weren't surfacing that error on Windows yet.

Reviewed By: simpkins

Differential Revision: D20755905

fbshipit-source-id: 8d3695cdd1f04199d1d409895482b8c706285d5f
2020-04-24 14:44:52 -07:00
Adam Simpkins
cb5b9fefd7 tweaks to update the integration tests to allow running on Windows
Summary:
Previously none of the integration tests ran on Windows, as they checked for
the presence of `/dev/fuse` first, and would skip the test if it was not
present.

This updates the tests to allow running on Windows, and updates the
`find_executables.py` code to find the executables properly on Windows.

Reviewed By: wez

Differential Revision: D17733621

fbshipit-source-id: a8bf4e5138f9ea6c9b040814dd68fc64228961de
2020-04-24 14:14:15 -07:00
Durham Goode
344837cca4 filesystem: python bindings for new rust pending changes
Summary:
Adds initial python bindings for the rust pending changes. This is not
ready for production usage yet, but having the bindings let's me test changes
more easily until we're ready for automated tests.

Reviewed By: xavierd

Differential Revision: D20546896

fbshipit-source-id: c0ad7155e5068f45bf9c987030746e6c5f35c26a
2020-04-24 13:58:53 -07:00
Durham Goode
092d350800 filesystem: add treestate walking logic
Summary:
The second phase of pending changes is to iterate over the treestate
and figure out what files were not seen in the filesystem walk. This diff
implements that.

Reviewed By: xavierd

Differential Revision: D20546899

fbshipit-source-id: 3523fbc7e31ef0ed09c4937c72264b64e2a3db5b
2020-04-24 13:58:53 -07:00
Durham Goode
73a45b695b filesystem: add filesystem walking to PendingChanges
Summary:
The first phase of pending changes is inspecting the filesystem for
changes. This diff adds that logic.

Reviewed By: xavierd

Differential Revision: D20546909

fbshipit-source-id: 1c2c0fa7f700dbff4acfce4d5271b4472a13571f
2020-04-24 13:58:53 -07:00
Puneet Kaushik
be9628b2bc Enable hg update on Eden Windows
Summary: This diff enables running source control update and rebase operations on Eden Windows clones.

Reviewed By: wez

Differential Revision: D20480873

fbshipit-source-id: 9e7cd6acdd9aedc87ddfe126718f48509d1d7c4f
2020-04-24 12:46:19 -07:00
Puneet Kaushik
4fb5762206 Clean up prjfs cache on update
Reviewed By: wez

Differential Revision: D20480872

fbshipit-source-id: ec006be468e231de3292466bfcc0df8292341fc5
2020-04-24 12:46:19 -07:00
Puneet Kaushik
258e5ed5b2 Update the PathMap::find to do a case insensitive search on Windows
Reviewed By: simpkins

Differential Revision: D20480874

fbshipit-source-id: 65cde4dba13c49663562c96cbaa23270712c1348
2020-04-24 12:46:19 -07:00
Puneet Kaushik
33631031d7 Enable hg status on Eden Windows
Reviewed By: simpkins

Differential Revision: D20480863

fbshipit-source-id: 01289bd02d0fd1f447c18484c29324450125aeeb
2020-04-24 12:46:19 -07:00
Puneet Kaushik
2cc0d4385c Update EdenDispatcher to use Inode backed fs data on Windows
Summary:
This diff updates the EdenDispatcher to fetch/update the FS info in EdenMount which is backed by InodeTree. This helps to store the FS state in the Inode structure, which are used for source control status and update operations.

Also added a custom formatter definition for RelativePathPiece to make it easy to log relative paths.

Reviewed By: simpkins

Differential Revision: D20480861

fbshipit-source-id: b4bf1da3eeebeaee46a4a187eea9193302182068
2020-04-24 12:46:18 -07:00
Puneet Kaushik
542a7bfc46 Add APIs to remove cached files and tombstones from ProjectedFS cache
Reviewed By: simpkins

Differential Revision: D20480880

fbshipit-source-id: b185c179340d369c2479ac6fcafd0373fa01135d
2020-04-24 12:46:18 -07:00
Puneet Kaushik
16bd8c5baf Use getFileContent() on Windows
Reviewed By: simpkins

Differential Revision: D20995872

fbshipit-source-id: ab089a4a94eac4844d173397f24c1cdbb2d06205
2020-04-24 12:46:18 -07:00
Puneet Kaushik
70eab1fb4d Use hg.real to import contents
Summary: On Windows we are seeing frequent hang issues while using telemetry hg binary. Switching to using the hg.real for all the platforms.

Reviewed By: simpkins

Differential Revision: D20480875

fbshipit-source-id: 82892da7f8d46f2413442c37251243400180f9db
2020-04-24 12:46:17 -07:00
Puneet Kaushik
74bc023b18 Remove old EdenMount code
Summary: Eden Windows now shares the common EdenMount code. We can remove the unused version of EdenMount.

Reviewed By: simpkins

Differential Revision: D20993231

fbshipit-source-id: 943ee540c5f2aa30827afb73658cb0250143e4af
2020-04-24 12:46:17 -07:00
Puneet Kaushik
4f3b625825 Build the merged TestMounts on Windows
Summary: Now we are building the merged EdenMount on Windows, so we can also start using the new TestMount code.

Reviewed By: simpkins

Differential Revision: D20966556

fbshipit-source-id: a726b13250d6c29872349e1a2f562c719420f3f1
2020-04-24 12:46:17 -07:00
Jun Wu
3de6513f0e revset: make autopull commit pull seletivepull bookmarks
Summary: This ensures lagged master issue does not happen by pulling a single commit.

Reviewed By: DurhamG

Differential Revision: D20845384

fbshipit-source-id: 3ba16c07fe264fe2b6aecd494bbb832af7b390a0
2020-04-24 11:16:23 -07:00
Jun Wu
3514ac0de8 remotenames: autopullprefix -> autopullpattern
Summary:
Patterns are more powerful than prefixes. Some full revset names are
obviously not valid remote name - for example, `remote/master :: .`.
They cannot be ruled out using prefixes but can using patterns.

As we're here, add some caching for the regex compiler.

Reviewed By: DurhamG

Differential Revision: D20831015

fbshipit-source-id: af8c4eed4a3153fd71480b8972c55feed4641392
2020-04-24 11:16:22 -07:00
Jun Wu
368d59e436 revset: attempt to pull the revset expression as a single name
Summary:
For names like `a-b-c`, it can be parsed in multiple ways:

- `"a-b-c"`
- `"a-b" - "c"`
- `"a" - "b-c"`

Mercurial uses `repo.lookup` in the parser to accept names like `"a-b-c"`.
Do it for the whole revset expression too.

But do not do it for every lookup (ex. testing `"a-b"` or `"b-c"` in the above
case), because that can be exceedingly expensive.

Reviewed By: DurhamG

Differential Revision: D20831014

fbshipit-source-id: f507e04ce24c953b096ccd836c356f50f11d2006
2020-04-24 11:16:22 -07:00
Jun Wu
47f73cc5e8 revset: calculate autopull names before evaluating revset
Summary:
Add a function to figure out unknown symbols of a revset AST without executing
the revset, then try to autopull unknown symbols.

This has pros and cons comparing to the runtime (stringset) approach.

Pros:
- The fullreposet restriction is lifted.
- We can have some ideas about whether the symbols are "probably" locally
  known. If everything is locally known, then we can skip all remote lookups
  (see the next diff for details).
- We can fetch multiple symbols in batch if we want. Although it's difficult
  to do so right now due to different paths (paths.default, infinitepush,
  infinitepushbookmark, etc). Revisit once the paths are unified.

Cons:
- Functions and argument types must be statically known. Might miss
  some functions added by some extensions.

Reviewed By: DurhamG

Differential Revision: D20909535

fbshipit-source-id: a567ca0aa80aa7f2930dd75637ef3ff8cef1bdef
2020-04-24 11:16:22 -07:00
Jun Wu
e26f2eeacb tests: add a test about autopull on remote names with dashes
Summary:
Dashes are also revset operators. Add a test so we can verify if we can also
autopull those special names.

Reviewed By: DurhamG

Differential Revision: D20831016

fbshipit-source-id: 97e772053dae873ebaa529ac9eb84ea9d04f0f63
2020-04-24 11:16:22 -07:00
Jun Wu
a2d9f6604e infinitepush: disable old autopull if the new autopull is enabled
Summary:
Similar to the previous diff, let's use the new autopull logic, which
uses the tech-debt free repo.pull API.

In rare cases this can cause more pulls due to the path selection (ex. use
"infinitepush" for "remote/scratch/x" but "default" for "remote/stable/x").
With Mononoke serving repos, we might be able to remote the special paths,
and just use "default" for all cases.

If it goes well, we can then delete the old code.

Reviewed By: DurhamG

Differential Revision: D20804854

fbshipit-source-id: 75e68582a29b613c8626a119b85064e3c0ba9462
2020-04-24 11:16:21 -07:00
Jun Wu
d90be19909 remotenames: disable old autopull if the new autopull is enabled
Summary:
The new auto pull logic can replace the one in remotenames. It it goes well, we
can then remove the code in remotenames doing the auto pull.

Reviewed By: sfilipco

Differential Revision: D20804853

fbshipit-source-id: c87b6b382f4cce3b306648b305a7b6bbaec05df1
2020-04-24 11:16:21 -07:00
Jun Wu
614b349628 revset: implement auto pull for hoisted remote bookmarks
Summary:
Attempt to auto pull bookmark names without the `remote/` or `default/` prefix
if hoist is set. This would hopefully be enough to allow us to enable
selectivepull globally without breaking existing users.

Reviewed By: sfilipco

Differential Revision: D20804856

fbshipit-source-id: 72601ac5e3545523cbfd7087d1fc822ef33c2f2e
2020-04-24 11:16:21 -07:00
Jun Wu
880b33b0b7 revset: implement auto pull for commit hashes using repo.pull API
Summary: This might remove less clean logic in infinitepush.

Reviewed By: sfilipco

Differential Revision: D20804855

fbshipit-source-id: da5ed24dd912b5f86839e671a9d6b0e9356b7c86
2020-04-24 11:16:20 -07:00
Stanislau Hlebik
b28b879846 mononoke: small refactoring before introducing Cleaner for unodes
Summary:
In the next diffs I'd like to introduce cleaner for unodes. This diff just
moves a bunch of code around to make reviewing next diffs easier

Reviewed By: krallin

Differential Revision: D21226921

fbshipit-source-id: c9f9b37bf9b11f36f8fc070dfa293fd8e6025338
2020-04-24 10:52:58 -07:00
Puneet Kaushik
133e5faa7c Switch to new EdenMount
Summary:
This diff enabled building the Inodes code on the Windows platform. With this we also swtich to using the new merged version of EdenMount.
From this diff onwards Eden Windows works with Inodes.

Reviewed By: simpkins

Differential Revision: D20955997

fbshipit-source-id: 9b9d8bf56c352c98a3018e5bb389e35489ebd6fb
2020-04-24 08:33:27 -07:00
Puneet Kaushik
d2c6eaff04 Remove old version of Windows TestMounts
Summary: We have merged the Windows version of test mount to the POSIX, which now work across platform. We can remove the older version now.

Reviewed By: simpkins

Differential Revision: D20955565

fbshipit-source-id: c68eef961d27e822e6408eba06876a4034e8f3d2
2020-04-24 08:33:27 -07:00
Puneet Kaushik
19200e2e41 Remove the Windows old mount/test
Summary: These tests were designed to work with registry based implementation to store the status information. We need to remove them before we could swtich to the new Inode based merged EdenMount.

Reviewed By: simpkins

Differential Revision: D20951974

fbshipit-source-id: fa9438e157ddfb4a66ba2b1de11c1b634481d3b3
2020-04-24 08:33:26 -07:00
Puneet Kaushik
b310e9cba3 Close the inherited handle from the parent process
Summary: Close the Pipe handles that are inherited in the child and are not needed in the parent process. This will also make sure the pipe is closed when the child process ends.

Reviewed By: simpkins

Differential Revision: D20923588

fbshipit-source-id: aa58e99148d2f5c3bf666a3237266eac725be563
2020-04-24 08:33:26 -07:00
Puneet Kaushik
69aaf55c2d Update EdenMount to handle FS operations on Windows
Summary: These API will handle the file system requests for each mount.

Reviewed By: simpkins

Differential Revision: D20480868

fbshipit-source-id: 84149af4449d258149fce97bb227d45d8d3d0e3a
2020-04-24 08:33:26 -07:00
Puneet Kaushik
9a2c23cfcf Implement readdir for ProjectedFS requests
Summary: Adds a new version of readdir which populates FileMetadata. This version of readdir is used to return the result to Projected FS.

Reviewed By: wez

Differential Revision: D20480876

fbshipit-source-id: dae99753225bc3124e734e3926e777fb629b2a64
2020-04-24 08:33:25 -07:00
Alex Hornby
bd57f89319 mononoke: walker remove ResolvedNode struct
Summary: Small simplification: remove ResolvedNode struct as it is OutgoingEdge plus a NodeData

Reviewed By: krallin

Differential Revision: D21134360

fbshipit-source-id: 5fdf7ccb176263bf923b0ab60f0cadb2aa4ccd43
2020-04-24 08:04:01 -07:00
Alex Hornby
b3353518ea mononoke: walker: simplify PathTrackingRoute evolution
Summary: Remove some duplication in the walker path sampling logic by moving PathTrackingRoute evolution up to the struct itself

Reviewed By: krallin

Differential Revision: D20996285

fbshipit-source-id: 165639a3a1608c0b48dc6a7d5ae261613bc90995
2020-04-24 08:04:01 -07:00
svcscm
b3d4f59b04 Updating submodules
Summary:
GitHub commits:

7779bffbf6
6c36bc7682
9d858eef07
337cee36e7
db01e02483
5ac754ab77
f4f67f4bce
ee4f6ba497

Reviewed By: wittgenst

fbshipit-source-id: 5b3a9c25bd94aff0352e3f5e16f1275b8328715a
2020-04-24 08:04:01 -07:00
svcscm
228f99d9fb Updating submodules
Summary:
GitHub commits:

4a7d67b578
55a89231cd
23ee0e4e68
78efaa6756
660f206038
212129d8c2
876f9a3c5a
071033d784
8f18162891
834c12a054

Reviewed By: wittgenst

fbshipit-source-id: 5db2ab3f53cc263b95be89ffed3ace13c67d8f94
2020-04-24 06:20:27 -07:00
Stanislau Hlebik
31f5b6dbcb mononoke: remove unused impls
Reviewed By: krallin

Differential Revision: D21227405

fbshipit-source-id: 3579c0bb390353cabf7bd8a36d5f3a6d92a60e48
2020-04-24 05:27:10 -07:00
Lukas Piatkowski
22a9d3e1cc mononoke/configerator structs: add shipit and autocargo configs for all configerator structs
Summary: The configerator structs are used in many top level functions in Mononoke and are required in order to build all the code on github

Reviewed By: ahornby

Differential Revision: D21130546

fbshipit-source-id: 7f17d92173f5ecf7c3406ae4202359a0db8df84a
2020-04-24 04:33:53 -07:00
Alex Hornby
378559fb29 mononoke: walker: add fsnodes derivation to test blobimport
Summary:
Add --derived-data-type=fsnodes to blobimport to a couple of walker tests so we have test data present to load.

Includes a small change to library.sh to add default_setup_pre_blobimport entry point used by these tests

Reviewed By: StanislavGlebik

Differential Revision: D21202480

fbshipit-source-id: d7eb3e5736531a11da87d92d0d03a528ff2c91a7
2020-04-24 04:29:52 -07:00
Stanislau Hlebik
e10e5349e7 mononoke: remove boilerplate with auto_impl
Reviewed By: krallin

Differential Revision: D21207457

fbshipit-source-id: 32a9afe4eb4214ffa88d7ef756112e7e9033337e
2020-04-24 04:09:30 -07:00
Stanislau Hlebik
403347ee10 mononoke: add dry-run mode for backfilling fsnodes
Summary:
This diff adds a special dry-run mode of backfilling (for now only fsnodes are
supported). It does by keeping all derived data in memory (i.e. nothing is
written to blobstore) and periodically cleaning entries that can no longer
be referenced.

This mode can be useful to e.g. estimate size of derived data before actually
running the derivation.

Note that it requires --readonly-storage in order to make sure that we don't
accidentally write anything to e.g. mysql.

Reviewed By: ahornby

Differential Revision: D21088989

fbshipit-source-id: aeb299d5dd90a7da1e06a6be0b6d64b814bc7bde
2020-04-24 04:05:53 -07:00
svcscm
8f5d1296a4 Updating submodules
Summary:
GitHub commits:

b7b7390a70

Reviewed By: wittgenst

fbshipit-source-id: 7692116372f9a09b3efd077c46bfc85d2eaad80f
2020-04-24 04:05:53 -07:00
svcscm
3f5aba5dce Updating submodules
Summary:
GitHub commits:

23198e8b72
4134ddf996
fc25d15e3a
b646e5df83
e076254b26
fc4852b397
9ae029fc23
e04f3bce4f
b734bf0646
55443f2b16
bad0017d5b
91063b0c3e

Reviewed By: wittgenst

fbshipit-source-id: a20549d3cdb6d1fcf4dacbaa31ba59e778d3d462
2020-04-23 21:30:41 -07:00
Xavier Deguillard
19bfd35298 revisionstore: multiplex stores should return a path on flush
Summary:
On repack, when the Rust stores are in use, the repack code relies on
ContentStore::commit_pending to return the path of a newly created packfile, so
it won't delete it when going over the repacked ones. When LFS is enabled, both
the shared and the local stores are behind the LfsMultiplexer store that
unfortunately would always return `Ok(None)`. In this situation, the repack
code would delete all the repacked packfiles, which usually is the expected
behvior, unless only one packfile is being repacked, in which case the repack
code effectively re-creates the same packfile, and is then subsequently
deleted.

The solution is for the multiplex stores to properly return a path if one was
returned from the underlying stores.

Reviewed By: DurhamG

Differential Revision: D21211981

fbshipit-source-id: 74e4b9e5d2f5d9409ce732935552a02bdde85b93
2020-04-23 15:14:28 -07:00