Skip to content

Commit 3807518

Browse files
committed
build script: adjust build for ppcle64
Allow whiltelist recursively to get around platform related issues. Signed-off-by: Jay Lee <[email protected]>
1 parent 35564e5 commit 3807518

File tree

2 files changed

+118
-6
lines changed

2 files changed

+118
-6
lines changed

grpc-sys/bindings/x86_64-unknown-linux-gnu-bindings.rs

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -636,6 +636,11 @@ fn bindgen_test_layout_grpc_slice_grpc_slice_data() {
636636
)
637637
);
638638
}
639+
impl ::std::fmt::Debug for grpc_slice_grpc_slice_data {
640+
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
641+
write!(f, "grpc_slice_grpc_slice_data {{ union }}")
642+
}
643+
}
639644
#[test]
640645
fn bindgen_test_layout_grpc_slice() {
641646
assert_eq!(
@@ -669,6 +674,15 @@ fn bindgen_test_layout_grpc_slice() {
669674
)
670675
);
671676
}
677+
impl ::std::fmt::Debug for grpc_slice {
678+
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
679+
write!(
680+
f,
681+
"grpc_slice {{ refcount: {:?}, data: {:?} }}",
682+
self.refcount, self.data
683+
)
684+
}
685+
}
672686
#[doc = " Represents an expandable array of slices, to be interpreted as a"]
673687
#[doc = "single item."]
674688
#[repr(C)]
@@ -762,6 +776,11 @@ fn bindgen_test_layout_grpc_slice_buffer() {
762776
)
763777
);
764778
}
779+
impl ::std::fmt::Debug for grpc_slice_buffer {
780+
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
781+
write ! ( f , "grpc_slice_buffer {{ base_slices: {:?}, slices: {:?}, count: {:?}, capacity: {:?}, length: {:?}, inlined: {:?} }}" , self . base_slices , self . slices , self . count , self . capacity , self . length , self . inlined )
782+
}
783+
}
765784
#[repr(u32)]
766785
#[doc = " The clocks we support."]
767786
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
@@ -844,6 +863,7 @@ extern "C" {
844863
) -> gpr_atm;
845864
}
846865
#[repr(C)]
866+
#[derive(Debug, Copy, Clone)]
847867
pub struct gpr_event {
848868
pub state: gpr_atm,
849869
}
@@ -871,6 +891,7 @@ fn bindgen_test_layout_gpr_event() {
871891
);
872892
}
873893
#[repr(C)]
894+
#[derive(Debug, Copy, Clone)]
874895
pub struct gpr_refcount {
875896
pub count: gpr_atm,
876897
}
@@ -898,6 +919,7 @@ fn bindgen_test_layout_gpr_refcount() {
898919
);
899920
}
900921
#[repr(C)]
922+
#[derive(Debug, Copy, Clone)]
901923
pub struct gpr_stats_counter {
902924
pub value: gpr_atm,
903925
}
@@ -1468,6 +1490,11 @@ fn bindgen_test_layout_grpc_byte_buffer_grpc_byte_buffer_data_grpc_compressed_bu
14681490
)
14691491
);
14701492
}
1493+
impl ::std::fmt::Debug for grpc_byte_buffer_grpc_byte_buffer_data_grpc_compressed_buffer {
1494+
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
1495+
write ! ( f , "grpc_byte_buffer_grpc_byte_buffer_data_grpc_compressed_buffer {{ compression: {:?}, slice_buffer: {:?} }}" , self . compression , self . slice_buffer )
1496+
}
1497+
}
14711498
#[test]
14721499
fn bindgen_test_layout_grpc_byte_buffer_grpc_byte_buffer_data() {
14731500
assert_eq!(
@@ -1513,6 +1540,11 @@ fn bindgen_test_layout_grpc_byte_buffer_grpc_byte_buffer_data() {
15131540
)
15141541
);
15151542
}
1543+
impl ::std::fmt::Debug for grpc_byte_buffer_grpc_byte_buffer_data {
1544+
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
1545+
write!(f, "grpc_byte_buffer_grpc_byte_buffer_data {{ union }}")
1546+
}
1547+
}
15161548
#[test]
15171549
fn bindgen_test_layout_grpc_byte_buffer() {
15181550
assert_eq!(
@@ -1556,6 +1588,15 @@ fn bindgen_test_layout_grpc_byte_buffer() {
15561588
)
15571589
);
15581590
}
1591+
impl ::std::fmt::Debug for grpc_byte_buffer {
1592+
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
1593+
write!(
1594+
f,
1595+
"grpc_byte_buffer {{ reserved: {:?}, type: {:?}, data: {:?} }}",
1596+
self.reserved, self.type_, self.data
1597+
)
1598+
}
1599+
}
15591600
#[repr(C)]
15601601
#[derive(Debug, Copy, Clone)]
15611602
pub struct grpc_completion_queue {
@@ -1777,6 +1818,11 @@ fn bindgen_test_layout_grpc_arg_grpc_arg_value() {
17771818
)
17781819
);
17791820
}
1821+
impl ::std::fmt::Debug for grpc_arg_grpc_arg_value {
1822+
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
1823+
write!(f, "grpc_arg_grpc_arg_value {{ union }}")
1824+
}
1825+
}
17801826
#[test]
17811827
fn bindgen_test_layout_grpc_arg() {
17821828
assert_eq!(
@@ -1820,6 +1866,15 @@ fn bindgen_test_layout_grpc_arg() {
18201866
)
18211867
);
18221868
}
1869+
impl ::std::fmt::Debug for grpc_arg {
1870+
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
1871+
write!(
1872+
f,
1873+
"grpc_arg {{ type: {:?}, key: {:?}, value: {:?} }}",
1874+
self.type_, self.key, self.value
1875+
)
1876+
}
1877+
}
18231878
#[doc = " An array of arguments that can be passed around."]
18241879
#[doc = ""]
18251880
#[doc = "Used to set optional channel-level configuration."]
@@ -2014,6 +2069,15 @@ fn bindgen_test_layout_grpc_metadata() {
20142069
)
20152070
);
20162071
}
2072+
impl ::std::fmt::Debug for grpc_metadata {
2073+
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
2074+
write!(
2075+
f,
2076+
"grpc_metadata {{ key: {:?}, value: {:?}, flags: {:?}, internal_data: {:?} }}",
2077+
self.key, self.value, self.flags, self.internal_data
2078+
)
2079+
}
2080+
}
20172081
#[repr(u32)]
20182082
#[doc = " The type of completion (for grpc_event)"]
20192083
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
@@ -2208,6 +2272,11 @@ fn bindgen_test_layout_grpc_call_details() {
22082272
)
22092273
);
22102274
}
2275+
impl ::std::fmt::Debug for grpc_call_details {
2276+
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
2277+
write ! ( f , "grpc_call_details {{ method: {:?}, host: {:?}, deadline: {:?}, flags: {:?}, reserved: {:?} }}" , self . method , self . host , self . deadline , self . flags , self . reserved )
2278+
}
2279+
}
22112280
#[repr(u32)]
22122281
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
22132282
pub enum grpc_op_type {
@@ -2834,6 +2903,11 @@ fn bindgen_test_layout_grpc_op_grpc_op_data() {
28342903
)
28352904
);
28362905
}
2906+
impl ::std::fmt::Debug for grpc_op_grpc_op_data {
2907+
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
2908+
write!(f, "grpc_op_grpc_op_data {{ union }}")
2909+
}
2910+
}
28372911
#[test]
28382912
fn bindgen_test_layout_grpc_op() {
28392913
assert_eq!(
@@ -2887,6 +2961,15 @@ fn bindgen_test_layout_grpc_op() {
28872961
)
28882962
);
28892963
}
2964+
impl ::std::fmt::Debug for grpc_op {
2965+
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
2966+
write!(
2967+
f,
2968+
"grpc_op {{ op: {:?}, flags: {:?}, reserved: {:?}, data: {:?} }}",
2969+
self.op, self.flags, self.reserved, self.data
2970+
)
2971+
}
2972+
}
28902973
#[doc = " Information requested from the channel."]
28912974
#[repr(C)]
28922975
#[derive(Debug, Copy, Clone)]
@@ -5429,6 +5512,14 @@ fn bindgen_test_layout_grpc_byte_buffer_reader_grpc_byte_buffer_reader_current()
54295512
)
54305513
);
54315514
}
5515+
impl ::std::fmt::Debug for grpc_byte_buffer_reader_grpc_byte_buffer_reader_current {
5516+
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
5517+
write!(
5518+
f,
5519+
"grpc_byte_buffer_reader_grpc_byte_buffer_reader_current {{ union }}"
5520+
)
5521+
}
5522+
}
54325523
#[test]
54335524
fn bindgen_test_layout_grpc_byte_buffer_reader() {
54345525
assert_eq!(
@@ -5476,6 +5567,15 @@ fn bindgen_test_layout_grpc_byte_buffer_reader() {
54765567
)
54775568
);
54785569
}
5570+
impl ::std::fmt::Debug for grpc_byte_buffer_reader {
5571+
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
5572+
write!(
5573+
f,
5574+
"grpc_byte_buffer_reader {{ buffer_in: {:?}, buffer_out: {:?}, current: {:?} }}",
5575+
self.buffer_in, self.buffer_out, self.current
5576+
)
5577+
}
5578+
}
54795579
#[repr(C)]
54805580
#[derive(Copy, Clone)]
54815581
pub struct grpcwrap_batch_context {
@@ -5589,6 +5689,11 @@ fn bindgen_test_layout_grpcwrap_batch_context__bindgen_ty_2() {
55895689
)
55905690
);
55915691
}
5692+
impl ::std::fmt::Debug for grpcwrap_batch_context__bindgen_ty_2 {
5693+
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
5694+
write ! ( f , "grpcwrap_batch_context__bindgen_ty_2 {{ trailing_metadata: {:?}, status: {:?}, status_details: {:?} }}" , self . trailing_metadata , self . status , self . status_details )
5695+
}
5696+
}
55925697
#[test]
55935698
fn bindgen_test_layout_grpcwrap_batch_context() {
55945699
assert_eq!(
@@ -5691,6 +5796,11 @@ fn bindgen_test_layout_grpcwrap_batch_context() {
56915796
)
56925797
);
56935798
}
5799+
impl ::std::fmt::Debug for grpcwrap_batch_context {
5800+
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
5801+
write ! ( f , "grpcwrap_batch_context {{ send_initial_metadata: {:?}, send_message: {:?}, send_status_from_server: {:?}, recv_initial_metadata: {:?}, recv_message: {:?}, recv_status_on_client: {:?}, recv_close_on_server_cancelled: {:?} }}" , self . send_initial_metadata , self . send_message , self . send_status_from_server , self . recv_initial_metadata , self . recv_message , self . recv_status_on_client , self . recv_close_on_server_cancelled )
5802+
}
5803+
}
56945804
extern "C" {
56955805
pub fn grpcwrap_batch_context_create() -> *mut grpcwrap_batch_context;
56965806
}
@@ -5752,6 +5862,11 @@ fn bindgen_test_layout_grpcwrap_request_call_context() {
57525862
)
57535863
);
57545864
}
5865+
impl ::std::fmt::Debug for grpcwrap_request_call_context {
5866+
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
5867+
write ! ( f , "grpcwrap_request_call_context {{ call: {:?}, call_details: {:?}, request_metadata: {:?} }}" , self . call , self . call_details , self . request_metadata )
5868+
}
5869+
}
57555870
extern "C" {
57565871
pub fn grpcwrap_request_call_context_create() -> *mut grpcwrap_request_call_context;
57575872
}

grpc-sys/build.rs

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,8 @@ fn bindgen_grpc(mut config: bindgen::Builder, file_path: &PathBuf) {
288288
.clang_arg("-xc++")
289289
.clang_arg("-I./grpc/include")
290290
.clang_arg("-std=c++11")
291-
.whitelist_recursively(false)
291+
.rustfmt_bindings(true)
292+
.impl_debug(true)
292293
.whitelist_function(r"\bgrpc_.*")
293294
.whitelist_function(r"\bgpr_.*")
294295
.whitelist_function(r"\bgrpcwrap_.*")
@@ -298,11 +299,7 @@ fn bindgen_grpc(mut config: bindgen::Builder, file_path: &PathBuf) {
298299
.whitelist_type(r"\bgrpcwrap_.*")
299300
.whitelist_type(r"\bcensus_context.*")
300301
.whitelist_type(r"\bverify_peer_options.*")
301-
.whitelist_type(r"(__)?uint8_t")
302-
.whitelist_type(r"(__darwin_)?size_t")
303-
.whitelist_type(r"(__)?uint32_t")
304-
.whitelist_type(r"(__)?int64_t")
305-
.whitelist_type(r"(__)?int32_t")
302+
.blacklist_type(r"(__)?pthread.*")
306303
.blacklist_function(r"\bgpr_mu_.*")
307304
.blacklist_function(r"\bgpr_cv_.*")
308305
.blacklist_function(r"\bgpr_once_.*")

0 commit comments

Comments
 (0)