Commit Graph

56546 Commits

Author SHA1 Message Date
Zeyi (Rice) Fan
ae0e37455e use vendored Rust crates
Summary: Actually use vendored Rust crates when building with CMake. The `--offline` option make sure cargo do not go to the Internet for missing crates.

Reviewed By: simpkins

Differential Revision: D20542672

fbshipit-source-id: ab4af40150c6af8b531a75f503a4fa848b3914da
2020-03-23 17:24:35 -07:00
Steven Troxler
d90435ced9 Deprecate rust-crypto in eden/scm/lib/revisionstore
Summary:
Replace `rust-crypto` with `hex`, `sha-1`, `sha2`.
 - `crypto::sha1::Sha1` with `sha1::Sha1`
 - `crypto::sha2::Sha2` with `sha2::Sha2`
 - `crypto::digest::Digest` with `sha1::Digest` and `sha2::Digest`
 - `.result_str()` with `hex::encode` and `.result()`

Reviewed By: jsgf

Differential Revision: D20588313

fbshipit-source-id: 75c4342e8b6285f0f960f864c21457a1a0808f64
2020-03-23 16:38:07 -07:00
svcscm
69e00cd724 Updating submodules
Summary:
GitHub commits:

26399c4f4c
ab04797720

Reviewed By: wittgenst

fbshipit-source-id: 3d8ab21f84089c6f5885dcb80591050e12e857e8
2020-03-23 16:38:07 -07:00
svcscm
b118654980 Updating submodules
Summary:
GitHub commits:

0d3859605c
9813c524eb
84693531d4
9d60154152
a3b162690d
785f6d144b
617f479266
ae21ec84d1
619b7bc34e
49b77ad4c3
2108f1b791

Reviewed By: wittgenst

fbshipit-source-id: 09d4b01401ab8b9c65aeacce85d5b1fbc4f5d84d
2020-03-23 14:48:07 -07:00
Xavier Deguillard
730327c29e eden: commit the Rust ContentStore when unable to find a blob
Summary:
The markforrefresh only exist in the legacy Python contentstore, commiting the
current store will have the same effect for the Rust store.

Reviewed By: DurhamG

Differential Revision: D20562032

fbshipit-source-id: de12cfd65d992395c9b9894d1f05cf50d86b0191
2020-03-23 14:33:42 -07:00
Xavier Deguillard
674e9c7900 fsinfo: return an enum instead of a String
Summary:
In a strongly typed langage, using strings should be avoided whenever possible
as they do not provide the safety guarantees that types provide.

I took the liberty of removing all the filesystems that are not relevant for
Mercurial for simplification reasons. If needs arise, we can always add a new
FsType to the enum.

Reviewed By: DurhamG

Differential Revision: D20517138

fbshipit-source-id: 0a38b53c6a87f05f4b2d664038e10c4293de96ae
2020-03-23 14:29:10 -07:00
Jun Wu
beb3d8c692 fsmonitor: make race detector aware of the matcher
Summary:
This makes it so `hg status A` won't complain about race conditions about file
`B`. As we're here, the detector logic was also moved to the filesystem layer.

Reviewed By: DurhamG

Differential Revision: D20568151

fbshipit-source-id: 713e3775a14674fd170df391977d42d9dee0f718
2020-03-23 14:22:02 -07:00
svcscm
e069e5ed91 Updating submodules
Summary:
GitHub commits:

1c4cada9a6
8b577fe1da
c242b9c696
55fc4b3274
2ac99f48ec
3b6fd7d993
d33fabb7c4
5c6346c420
9af062b94e
c45985c40a
e76e824422
f324000119

Reviewed By: wittgenst

fbshipit-source-id: 6475a12fa12414a5ab795b337fa710f5be33ec1e
2020-03-23 12:55:47 -07:00
Adam Simpkins
d7a2142064 exclude eden/scm build artifacts from the getdeps path map
Summary:
If you have built the `eden/scm` subdirectory with `make local` in your
repository it will have left a bunch of build output artifacts in the source
tree.  Update the getdeps shipit path map for eden to explicitly exclude many
of these build artifacts.

In particular:
- Exclude `eden/scm/build/` since this directory can contains a lot of files.
- Exclude all `*.pyc` files since there may be a reasonable number of these.
- Exclude several Cargo-related files since these will cause problems when
  trying to build Rust code.

Reviewed By: chadaustin

Differential Revision: D20570720

fbshipit-source-id: a60dec4854ae470fdb58e9651fd8a3b910c76004
2020-03-23 11:29:09 -07:00
Steven Troxler
b6de099da8 Deprecate rust-crypto in zstore
Summary:
Replace `rust-crypto` with `sha-1`:
 - `crypto::digest::Digest` with `sha1::Digest`
 - `crypto::Sha1` with `sha1::Sha1`

The interface changes slightly - no need to pass a mutable byte array when
getting the result.

Reviewed By: jsgf

Differential Revision: D20587638

fbshipit-source-id: c6c737f3f8eba94b98c728e198eb4fac12c5c80b
2020-03-23 11:29:09 -07:00
Steven Troxler
71279b3916 Deprecate rust-crypto in manifest-tree
Summary:
Replace `rust-crypto` with `sha-1`:
 - `crypto::digest::Digest` with `sha1::Digest`
 - `crypto::sha1::Sha1` with `sha1::Sha1`

Reviewed By: jsgf

Differential Revision: D20587716

fbshipit-source-id: de801c20bffd356eb5b2205a63ec0218b3aca6c0
2020-03-23 11:15:58 -07:00
Steven Troxler
154c458285 Deprecate rust-crypto in eden/scm/lib/types
Summary:
Swap out `rust-crypto` for `sha-1`
 - `crypto::sha1::Sha1` is replaced by `sha1::Sha1`
 - `crypto::digest::Digest` is replaced by `digest::Digest`

Reviewed By: jsgf

Differential Revision: D20587685

fbshipit-source-id: 971fdaa8ce5b3e9e60db219131f6c36dcbc213d9
2020-03-23 11:15:57 -07:00
Steven Troxler
3534ca3bb8 Deprecate rust-crypto in edenfs-client
Summary:
Switched out the `sha` package for the `rust-crypto` package. The
apis aren't an exact match, so I had to insert a clone in place of
a modification to a mutable reference.

Reviewed By: jsgf

Differential Revision: D20585336

fbshipit-source-id: 22245157aea1115ae6f225b17b0346f0696653f7
2020-03-23 11:04:36 -07:00
Aida Getoeva
66f007f083 scs: separate scs-diff test
Summary: Move integration tests for `scsc diff` to the `test-scs-diff.t`.

Reviewed By: krallin

Differential Revision: D20557896

fbshipit-source-id: 201b6b5046babfef56db87c0cce70ab8cb6ae62c
2020-03-23 08:36:51 -07:00
Aida Getoeva
4819a08901 scs: separate log test
Summary:
`test-scs.t` is very big and takes too much time to run.
I'm moving integration tests for `scsc log` to the `test-scs-log.t` file.

Reviewed By: krallin

Differential Revision: D20537505

fbshipit-source-id: 8f4a06ad4b48f34eb131d095ec21bd2d08cfe9d9
2020-03-23 08:36:50 -07:00
Alex Hornby
24770ff84c mononoke: walker: add start_step to WalkVisitor
Summary: Add WalkVisitor::start_step entry point, so we have opportunity to take action before Nodes are loaded.

Reviewed By: krallin

Differential Revision: D20534842

fbshipit-source-id: 93c3e0974c99ee68b7c2e930f4b8fdea87b44bc3
2020-03-23 06:25:40 -07:00
svcscm
f2020e79c0 Updating submodules
Summary:
GitHub commits:

e2f47dc2e1

Reviewed By: wittgenst

fbshipit-source-id: df563aab980016c4a9cd72990b3018d5081af2f6
2020-03-23 05:38:42 -07:00
Alex Hornby
b3285fd963 mononoke: add sampling key to LoggingContainer
Summary:
Add sampling key to LoggingContainer so that we have a way to sample low level blobstore actions for a given high level blobrepo action with the

This is will be used to track the blobs loaded when walking a repo and associate them with paths.

Walker will assign a new sampling_key to each step, and the SamplingHandler attached to SamplingBlobstore will use it correlate the get() with the Node or Path we want to track accesses for. E.g. to build a corpus of blobs per path for compression analysis

Reviewed By: mitrandir77

Differential Revision: D20534844

fbshipit-source-id: 22662b66a57ad4fef044a1108648f4ad8f2dae78
2020-03-23 05:10:17 -07:00
Alex Hornby
72483f6fd8 mononoke: add a sampling blobstore
Summary:
Add a sampling blobstore for use by the walker.

Combined with the SamplingKey in next in stack it allows samplinglow level blobstore operations from hight level actions on things like BlobRepo.

Reviewed By: mitrandir77

Differential Revision: D20534843

fbshipit-source-id: 8c7378572a4f78534f66b09adfccf08b3aaa103d
2020-03-23 05:10:16 -07:00
Alex Hornby
da43e107f1 mononoke: walker: use derive_more to remove some boilerplate
Summary: use derive_more to remove some boilerplate for trivial Add/Div/Mul/Sum implementations.

Reviewed By: StanislavGlebik

Differential Revision: D20560288

fbshipit-source-id: ddab11134b133d8f29a2384e4858a35e9774e5cc
2020-03-23 03:07:19 -07:00
Stanislau Hlebik
d2412fbcfe mononoke: move StoreLoadable and add LodableError
Summary:
This is a small refactoring that does two things:
1) Move StoreLoadable into the Blobstore crate. This might be a bit
controversial since StoreLoadable doesn't have anything to do with blobstore.
But I put it there for a few reasons:
* In the next diffs I want to use StoreLoadable in mononoke_types. However I
can't create dependency from `mononoke_types` crate to `manifest` crate because
`manifest` depends on `mononoke_types`
* `manifest` crate doesn't look like a good place for this struct either
* I didn't find a better place for it - don't want to put it in crates like
`common`, and it creating a separate crate just for this trait looks like an
overkill.

2) Changes error type to LoadableError to match Loadable trait. This add one
FIXME for git tree which doesn't differentiate between these errors.

Reviewed By: krallin

Differential Revision: D20561442

fbshipit-source-id: a0dca0ff8daa5d7fa166f4527c2f7cc7f541a4c0
2020-03-23 00:43:44 -07:00
svcscm
42464ce4cb Updating submodules
Summary:
GitHub commits:

7c252a8f15
186d782f02
7bc1fe8379

Reviewed By: wittgenst

fbshipit-source-id: 0d82d7ebd452ad5953f90448daaba5aefc039484
2020-03-21 23:05:25 -07:00
svcscm
de25e38eb1 Updating submodules
Summary:
GitHub commits:

cf712dc9a8
cd84566130
56e0468711

Reviewed By: wittgenst

fbshipit-source-id: 2d0e40297c1804993c660c8c229574d5b732055a
2020-03-20 22:34:47 -07:00
Xavier Deguillard
767134797c pyerror: stringify Rust errors with "{:?}"
Summary:
According to the anyhow documentation[0], the behavior of `.to_string()` is to
only stringify the top-level errors, hiding all the context of the error.
Instead, the debug format allows all the context to be displayed, and, if
available the backtrace.

This should significantly help debug Rust errors when context is available,
which we should strive to have everywhere!

[0]: https://docs.rs/anyhow/1.0.27/anyhow/struct.Error.html#display-representations

Reviewed By: sfilipco

Differential Revision: D20575944

fbshipit-source-id: 2968d7fb755edec7f7e5151138e8049ded181c1b
2020-03-20 20:22:14 -07:00
svcscm
64bec39f5c Updating submodules
Summary:
GitHub commits:

cd8de9ff9f
b335c45643
cc1d36f0cd
05177629a2
20e91cc072
3ee0b7d56f

Reviewed By: wittgenst

fbshipit-source-id: eea82084992bb504e378163594ad6b06822e51a7
2020-03-20 20:22:14 -07:00
svcscm
550cb0fc80 Updating submodules
Summary:
GitHub commits:

cb8ac18a5b
940c095e23
e811afb890
4fc216649d
e859d78c6d
1e67f8003c
dadacb3e05

Reviewed By: wittgenst

fbshipit-source-id: 7a188cc3ffb7a3f31558107c42b2aaa1cebaf01a
2020-03-20 16:59:24 -07:00
Arun Kulshreshtha
d179270444 edenapi: remove unused log fields
Summary:
Originally, we wanted to log EdenAPI batch sizes to Scuba in order to A/B test the effect of batch size on fetching speed. It turns out that the original arbitrary choice of 1000 works pretty well, so there isn't really a need to log this to Scuba anymore.

In addition to removing these fields, this diff moves the "http_enabled" column to be logged from the config by the wrapper instead of being manually logged by hg.

Reviewed By: quark-zju

Differential Revision: D20568104

fbshipit-source-id: 1e113489d005e93e6283f7e4a439b1c78b6f0fb9
2020-03-20 16:53:43 -07:00
generatedunixname89002005287564
090b4cdc17 eden/cli/debug_posix.py
Reviewed By: simpkins

Differential Revision: D20415405

fbshipit-source-id: d0a9a281beb929a7c58d5d584a35b80dc318d376
2020-03-20 16:34:34 -07:00
Adam Simpkins
f89bfe7670 fix a type-checking error
Summary:
Fix code in `memcommit/serialization.py` that was assigning a `str` to a
`bytes` variable.

Reviewed By: singhsrb

Differential Revision: D20564418

fbshipit-source-id: 578ebe9d2b8823353d5a4727f6ea888678ca881f
2020-03-20 15:32:51 -07:00
Wez Furlong
0be26944f7 eden: fix some unreferenced variable warnings on Windows
Summary: the exception object is unused in each of these catch blocks.

Reviewed By: chadaustin

Differential Revision: D20562251

fbshipit-source-id: 12502429e47f5603b73cfc88b10dda0db5daeb93
2020-03-20 14:00:33 -07:00
Wez Furlong
0a6aa21d77 eden: fix multiply defined symbols issue with ImportPriority
Summary:
This is a rough pass that resolves a linker issue on MSVC by
switching to inline static member functions.

Reviewed By: chadaustin

Differential Revision: D20529163

fbshipit-source-id: 578ed440758c685091d3e039e261638e027db17a
2020-03-20 10:56:08 -07:00
Wez Furlong
9972789892 eden: make bitfield usage in DirEntry.h more portable
Summary:
the type of `mode_t` that we were using for this on Windows
recently changed in the folly portability layer, resulting in a padding/alignment
problem that breaks our assumption at the size of this struct.

I don't believe that we were using bitfields correctly here; in my experience
all of the members must have the same type in order to get packed in the
struct correctly, because the standard doesn't define much in the way
of bitfield behavior beyond the syntax.

This commit uses an unsigned integer type for all of the bitfields
and takes a stab at using a cast when returning the actual mode
member for macOS.  This may not be right; I'm just throwing up this
diff first in order to be able to get it on a mac machine.

Reviewed By: simpkins

Differential Revision: D20529006

fbshipit-source-id: e9362bf263fab03d51cc8aa97f94f00806650618
2020-03-20 10:56:07 -07:00
Adam Simpkins
46767d9723 add type annotations for a few more edenscmnative modules
Summary:
There isn't really much to annotate here, but this lets us eliminate a couple
`pyre-fixme` comments about not being able to find these modules during type
checkign.

Reviewed By: singhsrb

Differential Revision: D20550267

fbshipit-source-id: 271f8406890787c0613294a9047365fdebcdeda1
2020-03-20 10:41:32 -07:00
Adam Simpkins
66f7b2e813 remove some duplicate .pyx files
Summary:
These were copied into the `edenscmnative` directory in D15798642, but never
removed from their original location.

Reviewed By: singhsrb

Differential Revision: D20550268

fbshipit-source-id: dadce279f1717a66ece86376bd51179b8669cc8a
2020-03-20 10:41:31 -07:00
svcscm
1a7ac863ac Updating submodules
Summary:
GitHub commits:

966f3fab23
e838f6323a

Reviewed By: wittgenst

fbshipit-source-id: c77aacda7db26dad5b6591ade774614c5a4c961b
2020-03-20 09:44:53 -07:00
Lukas Piatkowski
c3e8dfd31a rust-shed: add hostname crate to the shed
Reviewed By: StanislavGlebik

Differential Revision: D20468997

fbshipit-source-id: 25240c38812f848c9b152e648a491fdfc645ee56
2020-03-20 08:56:12 -07:00
Lukas Piatkowski
12f639159e cargo_from_buck: get rid of signatures in generated Cargo.toml files
Summary: The signatures were used by the linter to warn if the files require regenerating, since the linter now regenerates the files regardless of the signature it is no longer needed to sign the files.

Reviewed By: krallin

Differential Revision: D20467745

fbshipit-source-id: aff2643f80939d5693e7a30abf07484c9060796f
2020-03-20 08:56:11 -07:00
Mark Thomas
12e94a142a newdoc: Add mutation and visibility documentation
Summary: Add Mercurial Developer Guide documentation for Mutation and Visibility.

Reviewed By: quark-zju

Differential Revision: D20534279

fbshipit-source-id: 3f06de79b5efe3903f4d1baf76fa2030ee58e7f4
2020-03-20 04:09:32 -07:00
Kostia Balytskyi
21f70ac6d1 mononoke: do not log JSON field extra_contents to scuba, log columns instead
Reviewed By: farnz

Differential Revision: D20500084

fbshipit-source-id: 296747780298fe81e4cca4cdb8af05548ba80169
2020-03-20 02:48:03 -07:00
svcscm
aab18f1a6f Updating submodules
Summary:
GitHub commits:

4a3af6ba64
d1bd44bd09
201f98fdaa
f2e15611b5
b8340d2e1c
a52a6bd7a4
33b52209d7
dcc6c04da9

Reviewed By: wittgenst

fbshipit-source-id: f7202c64d1c0b8ab724bc25eeaa6aa086954af67
2020-03-20 02:48:03 -07:00
svcscm
61ff1954cb Updating submodules
Summary:
GitHub commits:

8294c5e7d4
9325cacc44
704e6ae332
e7b465ec55
7b15dda248
c25ae7df32
0e1e875a72
fc11f4c748
711e303ee7

Reviewed By: wittgenst

fbshipit-source-id: 27a15914b1b92e82581636a1d0a4917f1dd23bed
2020-03-19 21:18:36 -07:00
Shrikrishna Khare
50538d7a41 Script to build OpenNSA kernel modules
Summary:
OpenNSA has prebuilt SDK but kernel modules have to be built from sources. Add
a utility script to build and extend packaging script.

In future, we can consider folding this build into fbcode_builder itself.

Differential Revision: D20549883

fbshipit-source-id: f9475b7e0223e9f357117d7d7d27df8904fa1d73
2020-03-19 20:23:24 -07:00
Adam Simpkins
2e0aaa3ee0 fix signal delivery when using edenfsctl start --foreground
Summary:
This fixes handling of Ctrl-C when using `edenfsctl start --foreground` or
`edenfsctl start --gdb`.

The changes in D19861810 to make `exec_daemon()` fork and exec instead of
simply calling exec accidentally broke this.  While it attempted to forward
SIGINT to the child process, in practice this would normally fail in
development environments.  In development environments EdenFS is normally
started using `sudo`, and the CLI does not have permissions to send signals to
this child process since it is running with elevated privileges.  As a result
on Ctrl-C the foreground `edenfsctl` process would die since it did not handle
the error attempting to forward the signal, and the actual EdenFS process
would continue running.

The main goal of D19861810 was to allow telemetry logging of success or
failure on restart.  This changes the `edenfsctl restart` code to use the
existing `start_daemon()` function, and reverts the old behavior of
`exec_daemon()` to use `execve()` to replace the current process.

Reviewed By: genevievehelsel

Differential Revision: D20355252

fbshipit-source-id: 5e61f70e8b411ee023eee6fe06e0cd641f732631
2020-03-19 20:10:06 -07:00
Adam Simpkins
91f4fbc5b7 improve behavior of stopping EdenFS in the integration tests
Summary:
Fix `EdenFS.shutdown()` to call `edenfsctl stop` with a timeout of 0 seconds,
telling it not to wait for EdenFS to exit.  This code then performs its own
wait with a timeout.

Previously the code called `edenfsctl stop` asking it to wait for EdenFS to
exit with a 30 second timeout.  However, since the integration test could be
the immediate parent process of EdenFS the `edenfs` process may not actually
go away until the test called `wait()` on this process, which wouldn't happen
until `edenfsctl stop` returned.  This only caused problems for cases where
the test could run `edenfs` directly without needing to run it through `sudo`:
when run through `sudo` the edenfs process would get cleaned up since `sudo`
was the immediate parent and it would wait on the process.

Reviewed By: genevievehelsel

Differential Revision: D20434081

fbshipit-source-id: 513fd2ebb5fc24a54c546a76e94827c81a4ab754
2020-03-19 20:10:06 -07:00
Steven Troxler
41378d4f37 Deprecate rust-crypto in eden/monanoke/derived_data
Summary:
The rust-crypto library appears to be unmaintained, switching
 - `crypto::digest::Digest` to `digest::Digest`
 - `crypto::sha1::Sha1` to `sha1::Sha1`
 - `crypto::sha2::Sha256` to `sha2::Sha256`

Reviewed By: jsgf

Differential Revision: D20456962

fbshipit-source-id: 2e3406dedba05245265d96b480c35ba2421aa3fd
2020-03-19 19:00:06 -07:00
svcscm
378d03858f Updating submodules
Summary:
GitHub commits:

9b74a85c6a
ecf3417784
eca93a4502
a795f497ea
efd1abfa80
d5f8bc5505
34b8d7c8ab
6230082450
233dca40b4
5dd79a370a

Reviewed By: wittgenst

fbshipit-source-id: b7eea2087093403480b489f2f4ac5007cf0413de
2020-03-19 18:26:39 -07:00
Koray Polat
c993337227 Update fmt from 5.3.0 to 6.1.1
Summary: Updated fmt version to be on par with buck build. It was causing inconsistencies.

Reviewed By: vitaut

Differential Revision: D20528011

fbshipit-source-id: d9e04ed2c28b839eaeff24120162c4db4732fa55
2020-03-19 17:54:15 -07:00
Steven Troxler
13fa9a5f1f Deprecate rust-crypto in eden/mononoke/filestore
Summary:
The rust-crypto library appears to be unmaintained, switching
 - `crypto::digest::Digest` to `digest::Digest`
 - `crypto::sha1::Sha1` to `sha1::Sha1`
 - `crypto::sha2::Sha256` to `sha2::Sha256`

Reviewed By: jsgf

Differential Revision: D20456840

fbshipit-source-id: 90cc031ec5402b60b6eb06a301a3733bd92bbc69
2020-03-19 17:25:44 -07:00
Xavier Deguillard
bb68ce52ff remotefilelog: provide fast path for cmp, size and isbinary
Summary: For LFS blobs, these can be obtained very easily by querying the ContentStore.

Reviewed By: DurhamG

Differential Revision: D20504235

fbshipit-source-id: 937ef20184d6524b1355565f9ab81e40b56d7ab0
2020-03-19 16:36:41 -07:00
Steven Troxler
8e99cdbd34 Asyncify the loop in statistics_collector
Summary:
This diff asyncifies the `loop_fn` call in `run_statistics`.

I was unable to find an existing example of asyncifying an infinite
loop - my solution requires allowing the `Ok` around my `loop`
to be unreachable via the `#[allow(unreachable_code)]` annotation. There may be
a better solution.

We also swap out the `tokio-timer` dependency, which uses old-style
futures, for current-version `tokio` so we can use the new-style future
`tokio::time::delay_for`.

Reviewed By: farnz

Differential Revision: D20527530

fbshipit-source-id: 90d30ec9465402d06d3b4b30c1bbd5e340ac94b6
2020-03-19 15:39:18 -07:00