Commit Graph

6 Commits

Author SHA1 Message Date
Chad Austin
4ccb60e46d config: namespace facebook::eden
Summary: Start applying C++17 to our namespace definitions.

Reviewed By: fanzeyi

Differential Revision: D28964224

fbshipit-source-id: 72ad3f93c9304b34eef91d530e4e988420bd8fdc
2021-06-08 19:29:37 -07:00
Jun Wu
f811df8575 edenapi: make Builder more flexible
Summary:
The `Builder` API is the main API used by external users to obtain an `EdenApi`
client.  In the future we want to support different kinds of `EdenApi`, like a
local repo serving it, if `paths.default` is set to something like
`myrepotype:path`. Make `Builder` more flexible to support non-HTTP `EdenApi`s,
by returning `EdenApi` trait objects.

The old builder that is coupled with HTTP is renamed to HttpClientBuilder.

Reviewed By: kulshrax

Differential Revision: D28018586

fbshipit-source-id: 1eff7bbb8f0e5521a9bcf5a225ac361ddf7c310f
2021-04-28 12:24:25 -07:00
Lukas Piatkowski
cd0b6d50e2 autocargo v1: changes to match autocargo v2 generation results.
Summary:
The changes (and fixes) needed were:
- Ignore rules that are not rust_library or thrift_library (previously only ignore rust_bindgen_library, so that binary and test dependencies were incorrectly added to Cargo.toml)
- Thrift package name to match escaping logic of `tools/build_defs/fbcode_macros/build_defs/lib/thrift/rust.bzl`
- Rearrange some attributes, like features, authors, edition etc.
- Authors to use " instead of '
- Features to be sorted
- Sort all dependencies as one instead of grouping third party and fbcode dependencies together
- Manually format certain entries from third-party/rust/Cargo.toml, since V2 formats third party dependency entries and V1 just takes them as is.

Reviewed By: zertosh

Differential Revision: D26544150

fbshipit-source-id: 19d98985bd6c3ac901ad40cff38ee1ced547e8eb
2021-02-19 11:03:55 -08:00
Xavier Deguillard
a24e03f76f rust: update libc crate
Summary: The latest libc has fixes for compiling on the M1 mac, let's update it.

Reviewed By: dtolnay

Differential Revision: D26476625

fbshipit-source-id: d9a997e69c428d53c51fc52353289a6510314c50
2021-02-16 22:31:41 -08:00
Lukas Piatkowski
87ddbe2f74 autocargo v1: update autocargo field format to allow transition to autocargo v2
Summary:
Autocargo V2 will use a more structured format for autocargo field
with the help of `cargo_toml` crate it will be easy to deserialize and handle
it.

Also the "include" field is apparently obsolete as it is used for cargo-publish (see https://doc.rust-lang.org/cargo/reference/manifest.html#the-exclude-and-include-fields). From what I know this might be often wrong, especially if someone tries to publish a package from fbcode, then the private facebook folders might be shipped. Lets just not set it and in the new system one will be able to set it explicitly via autocargo parameter on a rule.

Reviewed By: ahornby

Differential Revision: D26339606

fbshipit-source-id: 510a01a4dd80b3efe58a14553b752009d516d651
2021-02-12 23:28:25 -08:00
Meyer Jacobs
f16ef7dafd bindings: introduce C / C++ bindings to EdenAPI for use by EdenFS
Summary:
Introduce `edenapithin` crate, which offers C bindings to EdenAPI Client.

There are two top-level `owned` types, `EdenApiClient` and `TreeEntryFetch`, which represent `Box`ed results from calls to EdenAPI's blocking client. The C / C++ code is responsible for calling the associated `free` functions for these types, as well as `OwnedString`, which is used to represent error variants of a `Result` as a string.

Most functionality is provided through functions which operate on and return references into these top-level owned types, providing access into Rust `Result`s and `Vec`s (manually-monomorphized), and EdenApi's `TreeEntry` and `TreeChildEntry`.

Additional non-pointer types are defined in the `types` module, which do not require manual memory management.

C++ bindings are not included currently, but will be introduced soon.

Reviewed By: fanzeyi

Differential Revision: D24866065

fbshipit-source-id: bb15127b84cdbc6487b2d0e1798f37ef62e5b32d
2020-12-01 19:07:25 -08:00