Skip to content

Commit

Permalink
Migrate lib/rust from TARGETS to BUCK
Browse files Browse the repository at this point in the history
Summary:
Migrate `lib/rust` from `TARGETS` to `BUCK`. This improves consistency between fbcode and xplat and aligns with the future direction of `BUCK` adoption in fbcode: https://fb.workplace.com/groups/fbcode.fyi/posts/7176797622355977. We have already done the same for most target languages.

Add `thrift_rust_library` and `thrift_rust_unittest` Buck targets that abstract away differences between xplat and fbcode (currently they are noop in xplat) - we have similar macros for C++ and other languages.

Remove remaining dirsync rules.

Remove dependency on icsp - this was clearly broken I'll create a follow-up task to fix it.

Reviewed By: dtolnay

Differential Revision: D62269595

fbshipit-source-id: 534438981e6a683b759ae2b53d8bb9040d208272
  • Loading branch information
vitaut authored and facebook-github-bot committed Sep 13, 2024
1 parent 184146b commit 295d0f6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pub mod ffi {
// compact serialized Any to compact serialized SimpleUnion
fn any_to_simple_union(any: &CxxString) -> UniquePtr<CxxString>;

fn compress_any(basic: &CxxString) -> UniquePtr<CxxString>;
fn decompress_any(basic: &CxxString) -> UniquePtr<CxxString>;
//fn compress_any(basic: &CxxString) -> UniquePtr<CxxString>;
//fn decompress_any(basic: &CxxString) -> UniquePtr<CxxString>;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ fn test_cpp_any_to_simple_union() -> Result<()> {
Ok(())
}

#[test]
/*#[test]
fn test_compression() -> Result<()> {
let basic = Basic {
x: 10,
Expand Down Expand Up @@ -162,4 +162,4 @@ fn test_compression() -> Result<()> {
}
Ok(())
}
}*/
6 changes: 3 additions & 3 deletions third-party/thrift/src/thrift/lib/rust/any/tests/src/cpp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include <thrift/lib/cpp2/type/TypeRegistry.h>
#include <thrift/lib/rust/any/tests/if/gen-cpp2/test_structs_types.h>
#include <thrift/lib/rust/any/tests/src/cpp.h>
#include "icsp/lib/Compression.h"
// #include "icsp/lib/Compression.h"

namespace thrift::rust::thrift_any {

Expand Down Expand Up @@ -88,7 +88,7 @@ std::unique_ptr<std::string> any_to_simple_union(const std::string& any) {
return from_any<cpp2::SimpleUnion>(any);
}

std::unique_ptr<std::string> compress_any(const std::string& any) {
/*std::unique_ptr<std::string> compress_any(const std::string& any) {
const apache::thrift::type::AnyStruct any_obj =
apache::thrift::CompactSerializer::deserialize<
apache::thrift::type::AnyStruct>(any);
Expand All @@ -115,6 +115,6 @@ std::unique_ptr<std::string> decompress_any(const std::string& any) {
anydata.toThrift());
return std::make_unique<std::string>(std::move(compact_t));
}
}*/

} // namespace thrift::rust::thrift_any

0 comments on commit 295d0f6

Please sign in to comment.