mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 00:45:18 +03:00
ef7045e818
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 |
||
---|---|---|
.. | ||
blobrepo_hg | ||
blobsync | ||
changeset_fetcher | ||
common | ||
errors | ||
factory | ||
override | ||
repo_blobstore | ||
src | ||
test | ||
Cargo.toml |