sapling/eden/mononoke/blobrepo
Thomas Orozco ef7045e818 common/rust: use fbinit-tokio
Summary:
This diffs add a layer of indirection between fbinit and tokio, thus allowing
us to use fbinit with tokio 0.2 or tokio 1.x.

The way this works is that you specify the Tokio you want by adding it as an
extra dependency alongside `fbinit` in your `TARGETS` (before this, you had to
always include `tokio-02`).

If you use `fbinit-tokio`, then `#[fbinit::main]` and `#[fbinit::test]` get you
a Tokio 1.x runtime, whereas if you use `fbinit-tokio-02`, you get a Tokio 0.2
runtime.

This diff is big, because it needs to change all the TARGETS that reference
this in the same diff that introduces the mechanism. I also didn't produce it
by hand.

Instead, I scripted the transformation using this script: P242773846

I then ran it using:

```
{ hg grep -l "fbinit::test"; hg grep -l "fbinit::main"  } | \
  sort | \
  uniq | \
  xargs ~/codemod/codemod.py \
&&  yes | arc lint \
&& common/rust/cargo_from_buck/bin/autocargo
```

Finally, I grabbed the files returned by `hg grep`, then fed them to:

```
arc lint-rust --paths-from ~/files2 --apply-patches --take RUSTFIXDEPS
```

(I had to modify the file list a bit: notably I removed stuff from scripts/ because
some of that causes Buck to crash when running lint-rust, and I also had to add
fbcode/ as a prefix everywhere).

Reviewed By: mitrandir77

Differential Revision: D26754757

fbshipit-source-id: 326b1c4efc9a57ea89db9b1d390677bcd2ab985e
2021-03-03 04:09:15 -08:00
..
blobrepo_hg Format fbsource with rustfmt-2.0.0-rc.2 2021-02-27 18:46:09 -08:00
blobsync common/rust: use fbinit-tokio 2021-03-03 04:09:15 -08:00
changeset_fetcher autocargo v1: reformating of oss-dependencies, workspace and patch sections and thrift files to match v2 2021-02-25 15:10:56 -08:00
common autocargo v1: reformating of oss-dependencies, workspace and patch sections and thrift files to match v2 2021-02-25 15:10:56 -08:00
errors autocargo v1: reformating of oss-dependencies, workspace and patch sections and thrift files to match v2 2021-02-25 15:10:56 -08:00
factory autocargo v1: reformating of oss-dependencies, workspace and patch sections and thrift files to match v2 2021-02-25 15:10:56 -08:00
override autocargo v1: reformating of oss-dependencies, workspace and patch sections and thrift files to match v2 2021-02-25 15:10:56 -08:00
repo_blobstore Add blobstore name information to logging 2021-03-02 03:40:54 -08:00
src add BonsaiSvnrevMapping to blobrepo 2021-02-17 12:43:00 -08:00
test Add blobstore name information to logging 2021-03-02 03:40:54 -08:00
Cargo.toml common/rust: use fbinit-tokio 2021-03-03 04:09:15 -08:00