9
9
} ;
10
10
11
11
#[ derive( Debug , Deserialize ) ]
12
+ #[ serde( deny_unknown_fields) ]
12
13
pub struct LinkEntry {
13
14
pub name : String ,
14
15
pub path_static : Option < String > ,
@@ -18,6 +19,7 @@ pub struct LinkEntry {
18
19
}
19
20
20
21
#[ derive( Debug , Deserialize ) ]
22
+ #[ serde( deny_unknown_fields) ]
21
23
pub struct PythonBuildExtensionInfo {
22
24
pub in_core : bool ,
23
25
pub init_fn : String ,
@@ -33,6 +35,7 @@ pub struct PythonBuildExtensionInfo {
33
35
}
34
36
35
37
#[ derive( Debug , Deserialize ) ]
38
+ #[ serde( deny_unknown_fields) ]
36
39
pub struct PythonBuildCoreInfo {
37
40
pub objs : Vec < String > ,
38
41
pub links : Vec < LinkEntry > ,
@@ -41,6 +44,7 @@ pub struct PythonBuildCoreInfo {
41
44
}
42
45
43
46
#[ derive( Debug , Deserialize ) ]
47
+ #[ serde( deny_unknown_fields) ]
44
48
pub struct PythonBuildInfo {
45
49
pub core : PythonBuildCoreInfo ,
46
50
pub extensions : BTreeMap < String , Vec < PythonBuildExtensionInfo > > ,
@@ -51,36 +55,38 @@ pub struct PythonBuildInfo {
51
55
}
52
56
53
57
#[ derive( Debug , Deserialize ) ]
58
+ #[ serde( deny_unknown_fields) ]
54
59
pub struct PythonJsonMain {
55
- pub version : String ,
56
- pub target_triple : String ,
60
+ pub build_info : PythonBuildInfo ,
61
+ pub crt_features : Vec < String > ,
62
+ pub libpython_link_mode : String ,
63
+ pub licenses : Option < Vec < String > > ,
64
+ pub license_path : Option < String > ,
57
65
pub optimizations : String ,
58
- pub python_tag : String ,
59
66
pub python_abi_tag : Option < String > ,
67
+ pub python_bytecode_magic_number : String ,
60
68
pub python_config_vars : HashMap < String , String > ,
61
- pub python_platform_tag : String ,
69
+ pub python_exe : String ,
70
+ pub python_extension_module_loading : Vec < String > ,
62
71
pub python_implementation_cache_tag : String ,
63
72
pub python_implementation_hex_version : u64 ,
64
73
pub python_implementation_name : String ,
65
74
pub python_implementation_version : Vec < String > ,
66
- pub python_version : String ,
67
75
pub python_major_minor_version : String ,
68
- pub python_paths : HashMap < String , String > ,
69
76
pub python_paths_abstract : HashMap < String , String > ,
70
- pub python_exe : String ,
77
+ pub python_paths : HashMap < String , String > ,
78
+ pub python_platform_tag : String ,
79
+ pub python_stdlib_platform_config : Option < String > ,
71
80
pub python_stdlib_test_packages : Vec < String > ,
72
81
pub python_suffixes : HashMap < String , Vec < String > > ,
73
- pub python_bytecode_magic_number : String ,
74
82
pub python_symbol_visibility : String ,
75
- pub python_extension_module_loading : Vec < String > ,
76
- pub libpython_link_mode : String ,
77
- pub crt_features : Vec < String > ,
83
+ pub python_tag : String ,
84
+ pub python_version : String ,
85
+ pub target_triple : String ,
78
86
pub run_tests : String ,
79
- pub build_info : PythonBuildInfo ,
80
- pub licenses : Option < Vec < String > > ,
81
- pub license_path : Option < String > ,
82
87
pub tcl_library_path : Option < String > ,
83
88
pub tcl_library_paths : Option < Vec < String > > ,
89
+ pub version : String ,
84
90
}
85
91
86
92
pub fn parse_python_json ( json_data : & [ u8 ] ) -> Result < PythonJsonMain > {
0 commit comments