Commit Graph

3 Commits

Author SHA1 Message Date
David Tolnay
b09140b832 Soft deprecate client, mock, and server modules
Summary:
This is the start of the codemod for https://fb.workplace.com/groups/rust.language/posts/25780668961555042.

It follows the same approach as {D53374511} by adding a comment above the re-exports to identify the correct Buck target to use instead. This way I can codemod all uses by locally changing the comment into a real `#[deprecated = "..."]` attribute, compiling all Rust targets with `-Awarnings -Wdeprecated` in rustflags, parsing the deprecation warnings, and programmatically applying the correct fix.

Note that the deprecation needs to be on a `pub mod` rather than a `pub use` because deprecation on re-exports is not supported by Rust.

Reviewed By: zertosh

Differential Revision: D54332814

fbshipit-source-id: 16358f211032a7b1a701c08d909078b86b53d65f
2024-02-28 20:20:39 -08:00
David Tolnay
df6405bf25 Disable Cargo documentation generation for Thrift targets
Summary:
I came across this failure in `oss-mononoke-linux-getdeps` likely caused by {D53302058}:

> error: document output filename collision
> The lib `bonsai_globalrev_mapping_thrift` in package `bonsai_globalrev_mapping_thrift_types v0.1.0 (/data/sandcastle/temp/skycastle/fbcode_builder_getdeps/build/mononoke/source/eden/mononoke/bonsai_globalrev_mapping/if/types)` has the same name as the lib `bonsai_globalrev_mapping_thrift` in package `bonsai_globalrev_mapping_thrift v0.1.0 (/data/sandcastle/temp/skycastle/fbcode_builder_getdeps/build/mononoke/source/eden/mononoke/bonsai_globalrev_mapping/if)`.
> Only one may be documented at once since they output to the same path.
> Consider documenting only one, renaming one, or marking one with `doc = false` in Cargo.toml.

We don't need Cargo-generated docs of Thrift targets.

Reviewed By: zertosh

Differential Revision: D53339579

fbshipit-source-id: 3dc0d404777ca436e0f6de7ae7491925d709e331
2024-02-02 07:45:58 -08:00
David Tolnay
7cdd8ec65a Eliminate deps from clients to servers and vice versa
Summary:
# Before:

If a Thrift library A depends on Thrift library B, all of the dependencies on B are bottlenecked through B's main library. That means building A's clients requires building B's servers, and building A's servers requires building B's clients, neither of which should be necessary.

```lang=mermaid
flowchart TD;
    A --> A-clients;
    A --> A-types;
    A --> A-services;
    A-clients --> A-types;
    A-services --> A-types;

    B --> B-clients;
    B --> B-types;
    B --> B-services;
    B-clients --> B-types;
    B-services --> B-types;

    A --> B;
    A-clients --> B;
    A-services --> B;
    A-types --> B;
```

# After:

A tidy lattice. Projects that implement a Thrift service can build only the servers for A and B, without also building all their clients. Projects that need Thrift clients for various services can build just the clients without also building a bunch of unused infrastructure for writing a server implementation.

```lang=mermaid
flowchart TD;
    A --> A-clients;
    A --> A-types;
    A --> A-services;
    A-clients --> A-types;
    A-services --> A-types;

    B --> B-clients;
    B --> B-types;
    B --> B-services;
    B-clients --> B-types;
    B-services --> B-types;

    A --> B;
    A-clients --> B-clients;
    A-services --> B-services;
    A-types --> B-types;
```

Reviewed By: shayne-fletcher

Differential Revision: D53246158

fbshipit-source-id: 37cc5cb111c39c567c69e8fb2eaf23fd940082b3
2024-02-01 07:14:06 -08:00