1- load ("@prelude//rust:cargo_package.bzl" , "cargo" )
1+ load ("@prelude//toolchains:rust.bzl" , "system_rust_toolchain" )
2+ load ("//third-party/rust/crates/serde/1.0.60:build.bzl" , "get_rustc_flags" , "get_rust_features" , "get_conditional_deps" )
23
34# This BUCK file is for the serde_derive crate
45# It provides proc macro implementations of #[derive(Serialize, Deserialize)]
5- cargo .rust_library (
6- name = "serde_derive" ,
7- edition = "2015" , # Using original edition to avoid syntax compatibility issues
8- srcs = glob (["src/**/*.rs" , "crates-io.md" ]),
6+ # Serde library implementation
7+ rust_library (
8+ name = "serde" ,
9+ # Note: Cargo.toml does not specify an edition, so we use 2015 (the default for older crates)
10+ edition = "2015" ,
11+ srcs = glob (["src/**/*.rs" ]),
912 crate_root = "src/lib.rs" ,
13+ features = get_rust_features (),
14+ rustc_flags = get_rustc_flags (),
15+ env = {},
16+ deps = get_conditional_deps (),
1017 visibility = ["PUBLIC" ],
11- features = ["default" ],
12- deps = [
13- "//third-party/rust/crates/proc-macro2/1.0.74:proc-macro2" ,
14- "//third-party/rust/crates/quote/1.0.35:quote" ,
15- "//third-party/rust/crates/syn/2.0.81:syn" ,
16- ],
17- proc_macro = True ,
18- rustc_flags = [
19- # Allow bare trait objects (no 'dyn' keyword)
20- "-A" , "bare_trait_objects" ,
21- # Allow other deprecated syntax
22- "-A" , "deprecated" ,
23- # Allow absolute paths in macro
24- "-A" , "absolute_paths_not_starting_with_crate" ,
25- # Allow using old-style trait bounds
26- "-A" , "improper_ctypes_definitions" ,
27- # These help with using newer dependencies with older code
28- "--allow-features=impl_trait_in_bindings" ,
29- "--allow-features=proc_macro_span" ,
30- ],
31- )
32-
33- # Version with deserialize_in_place feature
34- cargo .rust_library (
35- name = "serde_derive-deserialize_in_place" ,
36- edition = "2015" , # Using original edition to avoid syntax compatibility issues
37- srcs = glob (["src/**/*.rs" , "crates-io.md" ]),
38- crate_root = "src/lib.rs" ,
39- visibility = ["PUBLIC" ],
40- features = ["deserialize_in_place" ],
41- deps = [
42- "//third-party/rust/crates/proc-macro2/1.0.74:proc-macro2" ,
43- "//third-party/rust/crates/quote/1.0.35:quote" ,
44- "//third-party/rust/crates/syn/2.0.81:syn" ,
45- ],
46- proc_macro = True ,
47- rustc_flags = [
48- "-A" , "bare_trait_objects" ,
49- "-A" , "deprecated" ,
50- "-A" , "absolute_paths_not_starting_with_crate" ,
51- "-A" , "improper_ctypes_definitions" ,
52- "--allow-features=impl_trait_in_bindings" ,
53- "--allow-features=proc_macro_span" ,
54- ],
55- )
18+ )
0 commit comments