Commit Graph

34 Commits

Author SHA1 Message Date
Andres Suarez
edd73c3cb8 Update tokio to 1.15
Reviewed By: Imxset21

Differential Revision: D33759920

fbshipit-source-id: 7fd02dc93a7c1c564454a1fece3ff4b12dba3d3e
2022-01-25 02:05:10 -08:00
Matt Hammerly
dacc5fbd89 update Rust to 1.57.0
Summary: Config changes + source fixes to upgrade Rust to 1.57.0

Reviewed By: dtolnay

Differential Revision: D32852266

fbshipit-source-id: b7fc82e3cd82ec8611b68778d9c996e417a65725
2021-12-14 10:34:01 -08:00
Andres Suarez
e47c848333 Update itertools to 0.10.3
Summary:
Simple update from 0.10.1 to 0.10.3:
https://github.com/rust-itertools/itertools/blob/v0.10.3/CHANGELOG.md

Reviewed By: Imxset21

Differential Revision: D32949101

fbshipit-source-id: cfaef29e67d0a26dcabc4995d295ded577e61e4b
2021-12-08 08:55:53 -08:00
Jason White
aabc333e0f third-party/rust: Re-run autocargo after tracing update
Reviewed By: jsgf

Differential Revision: D32823732

fbshipit-source-id: 2fdbb36d7d973bc1765a2259be3823957c9a0e62
2021-12-03 13:06:53 -08:00
David Tolnay
9dea6e43a8 third-party/rust: Update anyhow from 1.0.48 to 1.0.51
Reviewed By: aaronabramov

Differential Revision: D32699872

fbshipit-source-id: 4ae6ae6916e0318c2b05c904c1436151de9c5a23
2021-11-29 14:14:17 -08:00
David Tolnay
56dbf182e3 third-party/rust: Update anyhow from 1.0.47 to 1.0.48
Summary:
For invocations of `ensure!` where the argument is one of the comparison operators `==` `<=` `<` `!=` `>=` `>` and the lhs and rhs of the operator both have a `Debug` impl, we now render both sides as part of the error message.

### Example:

```
ensure!(flags.len() <= 40);
```

```
ensure!(kind == Kind::File);
```

Before:

```
Condition failed: `flags.len() <= 40`
Condition failed: `kind == Kind::File`
```

After:

```
Condition failed: `flags.len() <= 40` (99 vs 40)
Condition failed: `kind == Kind::File` (Symlink vs File)
```

Reviewed By: zertosh

Differential Revision: D32598267

fbshipit-source-id: 70fdab6d8f0e3ceceb98e651eab0a73795cadaeb
2021-11-22 13:19:04 -08:00
David Tolnay
8b29b9f7bb third-party/rust: Update anyhow from 1.0.44 to 1.0.47
Summary:
This release helps catch places that the `anyhow!` or `bail!` macros are invoked with a missing fmt argument, such as:

```
-     anyhow!("unsupported redirect operation {:?}")
+     anyhow!("unsupported redirect operation {:?}", op)
```

All instances of this in fbcode were fixed in D32266567 (2f440eac7e).

Reviewed By: wqfish

Differential Revision: D32564287

fbshipit-source-id: e9cf5a1376e6c83343de3f3c6ba2925d88334a30
2021-11-19 15:57:13 -08:00
Victor Gao
578401a16b import Move core crates
Summary:
This is an attempt to import `move-vm-runtime` and some other core crates of the Move programming language into fbsource.

The imported Move crates contains a few patches and are different from the official release in the following ways:
1. `diem-workspace-hack` regenerated in disabled mode
2. `diem-types` does not enable the default features for its dependency `diem-crypto`
3. `bytecode-interpreter` does not enable the default features for its dependency `bytecode-interpreter-crypto`

All of these patches are needed to help avoid enabling conflicting features at the same time.

#buildmore

Reviewed By: shazqadeer

Differential Revision: D29804394

fbshipit-source-id: 4fe3ba153437062a8744ffdf8cfe528bab817a91
2021-11-16 12:15:30 -08:00
Victor Gao
e625e8d934 update Diem crates to release 1.5
Summary:
This updates the existing Diem & Move crates to the latest release (1.5).

A patch was needed to make feature unification work.
- `diem-crypto` has two exclusive features "fiat" and "u64", with ["fiat"] being the default feature set
- `diem-types` depends on `diem-crypto`, but it doesn't disable the default features, so "fiat" is enabled as a result
- jellyfish-merkle uses both `diem-types` and `diem-crypto` with feature "u64" enabled. This is problematic since "u64" and "fiat" cannot coexist.
- The patch simply disables the default features from `diem-crypto` in the `Cargo.toml` of `diem-types`

The following libraries have been bumped to satisfy version selection:
1. hex: 0.4 => 0.4.3
2. proptest: 0.1 => 1.0
3. proptest-derive: 0.2 => 0.3
4. serde_json: 1.0.60 => 1.0.64

#buildmore

Reviewed By: jsgf

Differential Revision: D31842317

fbshipit-source-id: c4d75b167e32f5f004dc8ed578750d7b2c6fe0ff
2021-11-03 01:46:13 -07:00
David Tolnay
0abb174f26 Remove imports of prelude items
Summary:
The 2021 edition has some new traits in the prelude, which means they no longer require an explicit import in every module that wants to use them.

Details: https://doc.rust-lang.org/edition-guide/rust-2021/prelude.html

Reviewed By: metajack

Differential Revision: D31823254

fbshipit-source-id: 7532a198347b032f0cf9277c916d54db268581ba
2021-10-21 20:06:41 -07:00
David Tolnay
2ea696cb5a Regenerate Cargo.tomls to 2021 edition
Summary: Generated by `sed -i 's/edition = "2018"/edition = "2021"/' common/rust/cargo_from_buck/project_configs/*.toml` and `cargo autocargo` following the autocargo code change in D31830985 and its corresponding MSDK rebuild in D31832311.

Reviewed By: zertosh

Differential Revision: D31832698

fbshipit-source-id: db79024cad311467d5b7c13b7abedc6464f09366
2021-10-21 12:40:28 -07:00
Zoltán Nagy
9eb3692ea7 Add html2text and dependencies
Reviewed By: jsgf

Differential Revision: D31793293

fbshipit-source-id: 1159ef6bd0663f38cdce505c9d6f352e60d661e7
2021-10-21 08:15:13 -07:00
Grace Ku
a149365a3f Remove unused file
Summary: See title

Reviewed By: fanzeyi

Differential Revision: D31804926

fbshipit-source-id: 258f3049327746caebfe86af639f3f91835274e4
2021-10-20 15:02:51 -07:00
Davide Cavalca
5ad11146fc Bump some dependencies for below
Summary: Bump in preparation for a new release

Reviewed By: brianc118

Differential Revision: D31657479

fbshipit-source-id: eeb2a08c54f6db75b6e515ca0966637f31b906a8
2021-10-14 17:36:29 -07:00
Andrei Ilyashenko
639d7b35f0 Bump 'structopt' to from 0.3.21 to 0.3.23
Summary: Bumping structopt version

Reviewed By: MarcoMontaltoMonella

Differential Revision: D31432560

fbshipit-source-id: cd58f374e3039e21ee9b36825b6f4a4915cb94b5
2021-10-09 09:34:57 -07:00
Yan Soares Couto
30d4c8fc2d Make RNG in 'arbitrary' calls more correct
Summary:
Using modulo on arbitrary integers to get random numbers [isn't correct](https://www.internalfb.com/diff/D31305392 (da13975a4f)?dst_version_fbid=311037904117090&transaction_fbid=550270779610744), as the distribution between numbers isn't fair (unless the size is a power of two).

This was raised on D31305392 (da13975a4f), but we decided to land that quickly to unblock builds before doing these changes.

I'm applying the changes suggested on D31305392 (da13975a4f). This is what this diff does:
- For all cases where we generate small numbers (up to 5), replace with call to `Gen::choose`, so `u32::arbitrary(g) % 3` becomes `g.choose(&[0, 1, 2]).unwrap()`.
- For generating numbers in range 0..=1, I instead replaced with generating a boolean, which gets rid of the `unreachable!` calls.
- I removed the code to generate numbers in range 0..=0.
- For generating larger numbers, I used `u64::arbitrary` instead, which should make things "less wrong".

Some things I assumed, but am happy to change before landing, just let me know:
- Theoretically we don't *need* to change the code for `% 2` and `% 4`, as the math checks out there. I changed it for consistency there, but am happy to change it back.
- Using boolean also wasn't suggested initially, I'm happy to change back.

Reviewed By: krallin

Differential Revision: D31379381

fbshipit-source-id: a0bac26ebabd32a6c65f717512de998ef5dc37c8
2021-10-06 09:39:23 -07:00
Jonathan Keljo
542e84d8fc Enable unbounded_depth feature for serde_json
Summary: I'm parsing some deeply-nested JSON, and it's running into the limit. This feature enables a potential footgun, but even with the feature enabled you have to add code to reach for said footgun.

Reviewed By: jsgf

Differential Revision: D31284743

fbshipit-source-id: 00ea5d7d7db8bdeb878d48fe390831f39e007409
2021-09-30 14:56:43 -07:00
Victor Gao
ae87b82eaf update rand and quickcheck
Summary:
This updates the following crates to their latest versions:
- `rand`: 0.7 => 0.8
- `quickcheck`: 0.9 => 1.0

Both crates introduced some breaking changes, so affected clients had to be fixed accordingly. Most changes are rather mechanical and shouldn't change the existing logic. In addition, a few buggy property tests were uncovered, presumably due to `quicktest` becoming smarter with its choice of inputs in the newer version, and the fixes are included in this diff.

Reviewed By: yancouto

Differential Revision: D31115820

fbshipit-source-id: 60a61dfac3236fd93cd4f03b86506654d81d330f
2021-09-29 13:59:49 -07:00
Gus Wynn
c797db63a1 vendor tokio-console and console-subscriber
Summary:
this relies on local changes to make it so cargo metadata ACTUALLY finds this
binary: https://github.com/tokio-rs/console/pull/146 is where I try to upstream
it

Reviewed By: jsgf

Differential Revision: D30944630

fbshipit-source-id: 5d34a32a042f83eff7e7ae7445e23badf10fffe3
2021-09-17 16:23:43 -07:00
Jeremy Fitzhardinge
113060beb1 third-party/rust: bump all the tracing packages
Summary:
This includes recent changes:
- `skip_all` in #[instrument] https://github.com/tokio-rs/tracing/pull/1548
- NoSubscriber no-op Subscriber https://github.com/tokio-rs/tracing/pull/1549
- Box/Arc Layer (https://github.com/tokio-rs/tracing/pull/1536 +
  https://github.com/tokio-rs/tracing/pull/1547)
- log filtering fixes https://github.com/tokio-rs/tracing/pull/1543

Local: force `log` and `log-always` features off. This removes the
`enable-trace-logging` flag from smartplatform/reconciler.

Reviewed By: guswynn

Differential Revision: D30906032

fbshipit-source-id: fdc3e4e29a39e9e181d9f4ff017e6b3e16acdcd8
2021-09-15 16:52:25 -07:00
Jeremy Fitzhardinge
fd03bff2e2 third-party/rust: bump tracing versions in preparation for patching
Summary:
Bump all the versions on crates.io to highest to make migration to github
versions in next diff work.

Reviewed By: dtolnay

Differential Revision: D30829928

fbshipit-source-id: 09567c26f275b3b1806bf8fd05417e91f04ba2ef
2021-09-09 22:38:25 -07:00
David Tolnay
5e9b8cd4b2 third-party/rust: Update thiserror from 1.0.23 to 1.0.29
Summary:
Release notes:

- https://github.com/dtolnay/thiserror/releases/tag/1.0.24
- https://github.com/dtolnay/thiserror/releases/tag/1.0.25
- https://github.com/dtolnay/thiserror/releases/tag/1.0.26
- https://github.com/dtolnay/thiserror/releases/tag/1.0.27
- https://github.com/dtolnay/thiserror/releases/tag/1.0.28
- https://github.com/dtolnay/thiserror/releases/tag/1.0.29

The pertinent feature is 1.0.29 adding support for inferred trait bounds on error types that contain generic type parameters. I remember someone asking for this in fbcode but I forget what project it was for.

```
use thiserror::Error;

#[derive(Error, Debug)]
pub enum MyError<E, F, G> {
    #[error("thing {0} ({0:?})")]
    Variant(E),
    #[error("some error")]
    Delegate(#[source] SomeError<F>),
    #[error("err 0o{val:o}")]
    Octal { val: G },
}
```

```
// generated

impl<E, F, G> std::error::Error for MyError<E, F, G>
where
    SomeError<F>: std::error::Error + 'static,  //'
    Self: std::fmt::Debug + std::fmt::Display;

impl<E, F, G> std::fmt::Display for MyError<E, F, G>
where
    E: std::fmt::Debug + std::fmt::Display,
    G: std::fmt::Octal;
```

Reviewed By: zertosh

Differential Revision: D30758449

fbshipit-source-id: b3afe08fe8c8affa26693df9cbb63e04632ea1d3
2021-09-08 20:49:35 -07:00
Gus Wynn
87a09132dc tokio -> 1.10
Reviewed By: dtolnay

Differential Revision: D30647831

fbshipit-source-id: 7094873ec5cfbf80cd7c3564fdd011268053b0d3
2021-08-30 15:55:16 -07:00
CodemodService Bot
0a375b8e5d Daily common/rust/cargo_from_buck/bin/autocargo
Reviewed By: StanislavGlebik

Differential Revision: D30535840

fbshipit-source-id: a941161547246c1e9aac0735a1994f20389ce1ae
2021-08-25 03:07:04 -07:00
Alex Barouski
1c21efc176 Updating url to 2.2.2
Summary:
Part of Rust-analyzer update.

Updated the affected sources (migrage from Url#into_string to Into#into

Reviewed By: jsgf

Differential Revision: D30344564

fbshipit-source-id: fc3ccbe25d7b3d9369a01dfb6b7f8e6a200a7083
2021-08-23 15:59:20 -07:00
Egor Tkachenko
51367815cd Moving thrift targets
Summary:
I was adding thrift fiddle support to my derivation service like this https://www.internalfb.com/intern/wiki/Rust-at-facebook/Thrift/Writing_a_Rust_Thrift_Server/#thrift-fiddle and run into errors with generated thrift code P439166788. After searching a little bit I came across the post in Thrift Users group with this comment https://fb.workplace.com/groups/thriftusers/posts/497757970933620/?comment_id=498850394157711
So in this diff I'm moving all `thrift_library` targets into the directory together with .thrift file itself.

Reviewed By: ahornby

Differential Revision: D30300919

fbshipit-source-id: bb2d7e2a98d6ba783e6249963b3a1dfcd6d62669
2021-08-17 06:49:44 -07:00
David Tolnay
aa8152f1dd Make thrift-generated dyn async traits future compatible
Summary:
The use of dyn traits of the Thrift-generated server traits was emitting future compatibility warnings with recent versions of rustc, due to a fixed soundness hole in the trait object system:

```
error: the trait `x_account_aggregator_if::server::XAccountAggregator` cannot be made into an object
     |
     = this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
```

This diff pulls in https://github.com/dtolnay/async-trait/releases/tag/0.1.51 which results in the Thrift-generated server traits no longer hitting the problematic pattern.

Reviewed By: zertosh

Differential Revision: D29979939

fbshipit-source-id: 3e6e976181bfcf35ed453ae681baeb76a634ddda
2021-07-29 16:25:33 -07:00
Thomas Orozco
8c83bd9a1c third-party/rust: update Tokio to 1.7.1
Summary: There is a regression in 1.7.0 (which we're on at the moment) so we might as well update.

Reviewed By: zertosh, farnz

Differential Revision: D29358047

fbshipit-source-id: 226393d79c165455d27f7a09b14b40c6a30d96d3
2021-06-25 06:17:41 -07:00
Andres Suarez
fc37fea20c Update itertools 0.8.2 to 0.10.1
Reviewed By: dtolnay

Differential Revision: D29286012

fbshipit-source-id: 6923c0b750692e6932e85fd539b076b172ff43b7
2021-06-22 04:09:00 -07:00
Davide Cavalca
b82c5672fc Update several rust crate versions
Summary: Update versions for several of the crates we depend on.

Reviewed By: danobi

Differential Revision: D29165283

fbshipit-source-id: baaa9fa106b7dad000f93d2eefa95867ac46e5a1
2021-06-17 16:38:19 -07:00
Jeremy Fitzhardinge
c652f9a11f third-party/rust: update time to 0.2
Summary:
Time 0.2 is current, and 0.1 is long obsolete. Unfortunately there's a
large 0.1 -> 0.2 API change, so I preserved 0.1 and updated the targets of its
users. Also unfortunate that `chrono` has `oldtime` as a default feature, which
makes it use `time-0.1`'s `Duration` type. Excluding it from the features
doesn't help because every other user is specifying it by default.

Reviewed By: dtolnay

Differential Revision: D28854148

fbshipit-source-id: 0c41ac6b998dfbdcddc85a22178aadb05e2b2f2b
2021-06-03 13:52:54 -07:00
Thomas Orozco
846a983d67 thrift/lib/rust: update to Bytes 1.x
Summary:
Like it says in the title. The API between Bytes 1.x has changed a little bit,
but the concepts are basically the same, so we just need to change the
callsites that were calling `bytes()` and have them ask for `chunk()` instead.

This diff attempts to be as small as it can (and it's already quite big). I
didn't attempt to update *everything*: I only updated whatever was needed to
keep `common/rust/tools/scripts/check_all.sh` passing.

However, there are a few changes that fall out of this. I'll outline them here:

## `BufExt`

One little caveat is the `copy_to_bytes` we had on `BufExt`. This was
introduced into Bytes 1.x (under that name), but we can't use it here directly.

The reason we can't is because the instance we have is a `Cursor<Bytes>`, which
receives an implementation of `copy_from_bytes` via:

```
impl<T: AsRef<[u8]>> Buf for std::io::Cursor<T>
```

This means that implementation isn't capable of using the optimized
`Bytes::copy_from_bytes` which doesn't do a copy at all. So, instead, we need
to use a dedicated method on `Cursor<Bytes>`: `copy_or_reuse_bytes`.

## Calls to `Buf::to_bytes()`

This method is gone in Bytes 1.x, and replaced by the idiom
`x.copy_to_bytes(x.remaining())`, so I updated callsites of `to_bytes()`
accordingly.

## `fbthrift_ext`

This set of crates provides transports for Thrift calls that rely on Tokio 0.2
for I/O. Unfortunately, Tokio 0.2 uses Bytes 0.5, so that doesn't work well.

For now, I included a copy here (there was only one required, when reading from
the socket). This can be removed if we update the whole `fbthrift_ext` stack to
Bytes 1.x. fanzeyi had been wanting to update this to Tokio 1.x, but was blocked on `thrift/lib/rust` using Bytes 0.5, and confirmed that the overhead of a copy here is fine (besides, this code can now be updated to Tokio 1.x to remove the copy).

## Crates using both Bytes 0.5 & Bytes 1.x

This was mostly the case in Mononoke. That's no coincidence: this is why I'm
working on this. There, I had to make changes that consist of removing Bytes
0.5 to Bytes 1.x copies.

## Misuse of `Buf::bytes()`

Some places use `bytes()` when they probably mean to use `copy_to_bytes()`. For
now, I updated those to use `chunk()`, which keeps the behavior the same but
keeps the code buggy. I filed T91156115 to track fixing those (in all
likelihood I will file tasks for the relevant teams).

Reviewed By: dtolnay

Differential Revision: D28537964

fbshipit-source-id: ca42a614036bc3cb08b21a572166c4add72520ad
2021-05-20 09:44:41 -07:00
Stanislau Hlebik
eab97b6123 mononoke: sync changeset implementation for megarepo
Summary: First stab at implementing sync changeset functionality for megarepo.

Reviewed By: ikostia

Differential Revision: D28357210

fbshipit-source-id: 660e3f9914737929391ab1b29f891b3b5dd47638
2021-05-13 10:04:21 -07:00
Durham Goode
98d9269874 server: copy hg to a new hg-server directory
Summary:
Create a fork of the Mercurial code that we can use to build server
rpms. The hg servers will continue to exist for a few more months while we move
the darkstorm and ediscovery use cases off them. In the mean time, we want to
start making breaking changes to the client, so let's create a stable copy of
the hg code to produce rpms for the hg servers.

The fork is based off c7770c78d, the latest hg release.

This copies the files as is, then adds some minor tweaks to get it to build:
- Disables some lint checks that appear to be bypassed by path
- sed replace eden/scm with eden/hg-server
- Removed a dependency on scm/telemetry from the edenfs-client tests since
  scm/telemetry pulls in the original eden/scm/lib/configparser which conflicts
  with the hg-server conflict parser.

allow-large-files

Reviewed By: quark-zju

Differential Revision: D27632557

fbshipit-source-id: b2f442f4ec000ea08e4d62de068750832198e1f4
2021-04-09 10:09:06 -07:00