Skip to content

Commit 2f86339

Browse files
authored
Update crate dependencies (#69)
This is not only regular dependency gardening, it also switches from `structopt` to `clap` to avoid some unmaintained dependencies (`atty`, `ansi_term`). This also switches to `env_logger` instead of the `pretty_env_logger` wrapper. As a result of updating `bindgen`, the bindings need to be updated (only minor tweaks) and the `libloading` library must be ignored by cargo-deny (`bindgen` has a different version than the `openvino-sys` crate).
1 parent a6caa09 commit 2f86339

File tree

19 files changed

+806
-838
lines changed

19 files changed

+806
-838
lines changed

Cargo.lock

Lines changed: 382 additions & 178 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/openvino-finder/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ cfg-if = "1.0"
1616
log = "0.4"
1717

1818
[dev-dependencies]
19-
pretty_env_logger = "0.4"
19+
env_logger = "0.10"

crates/openvino-finder/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ mod test {
301301
/// system.
302302
#[test]
303303
fn find_openvino_c_locally() {
304-
pretty_env_logger::init();
304+
env_logger::init();
305305
assert!(find("openvino_c").is_some());
306306
}
307307

crates/openvino-sys/Cargo.toml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,20 @@ include = [
2525
links = "inference_engine_c_api"
2626

2727
[dependencies]
28-
once_cell = {version = "1.12.0", optional = true }
29-
libloading = {version = "0.7", optional = true }
30-
openvino-finder = {version = "0.5.0", path = "../openvino-finder" }
28+
once_cell = { version = "1.18", optional = true }
29+
libloading = { version = "0.8", optional = true }
30+
openvino-finder = { version = "0.5.0", path = "../openvino-finder" }
3131

3232
[build-dependencies]
33-
openvino-finder = {version = "0.5.0", path = "../openvino-finder" }
34-
pretty_env_logger = "0.4"
33+
openvino-finder = { version = "0.5.0", path = "../openvino-finder" }
34+
env_logger = "0.10"
3535

3636
[features]
3737
# Linking features: `build.rs` will default to dynamic linking if none is selected.
38-
dynamic-linking = [] # Will find and bind to an OpenVINO shared library at compile time.
39-
runtime-linking = ["libloading", "once_cell"] # Will bind to an OpenVINO shared library at runtime using `load`.
38+
# - Will find and bind to an OpenVINO shared library at compile time.
39+
dynamic-linking = []
40+
# - Will bind to an OpenVINO shared library at runtime using `load`.
41+
runtime-linking = ["libloading", "once_cell"]
4042

4143
[package.metadata.docs.rs]
4244
features = ["runtime-linking"]

crates/openvino-sys/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const ENV_OPENVINO_BUILD_DIR: &str = "OPENVINO_BUILD_DIR";
1818

1919
fn main() {
2020
// This allows us to log the `openvino-finder` search paths, for troubleshooting.
21-
let _ = pretty_env_logger::try_init();
21+
let _ = env_logger::try_init();
2222

2323
// Trigger rebuild on changes to build.rs and Cargo.toml and every source file.
2424
println!("cargo:rerun-if-changed=build.rs");

crates/openvino-sys/src/generated/functions.rs

Lines changed: 75 additions & 415 deletions
Large diffs are not rendered by default.

crates/openvino-sys/src/generated/types.rs

Lines changed: 34 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* automatically generated by rust-bindgen 0.61.0 */
1+
/* automatically generated by rust-bindgen 0.68.1 */
22

33
#[repr(C)]
44
#[derive(Debug, Copy, Clone)]
@@ -30,8 +30,7 @@ pub struct ie_blob {
3030
_unused: [u8; 0],
3131
}
3232
pub type ie_blob_t = ie_blob;
33-
#[doc = " @struct ie_version"]
34-
#[doc = " @brief Represents an API version information that reflects the set of supported features"]
33+
#[doc = " @struct ie_version\n @brief Represents an API version information that reflects the set of supported features"]
3534
#[repr(C)]
3635
#[derive(Debug, Copy, Clone)]
3736
pub struct ie_version {
@@ -63,11 +62,9 @@ fn bindgen_test_layout_ie_version() {
6362
)
6463
);
6564
}
66-
#[doc = " @struct ie_version"]
67-
#[doc = " @brief Represents an API version information that reflects the set of supported features"]
65+
#[doc = " @struct ie_version\n @brief Represents an API version information that reflects the set of supported features"]
6866
pub type ie_version_t = ie_version;
69-
#[doc = " @struct ie_core_version"]
70-
#[doc = " @brief Represents version information that describes devices and the inference engine runtime library"]
67+
#[doc = " @struct ie_core_version\n @brief Represents version information that describes devices and the inference engine runtime library"]
7168
#[repr(C)]
7269
#[derive(Debug, Copy, Clone)]
7370
pub struct ie_core_version {
@@ -147,11 +144,9 @@ fn bindgen_test_layout_ie_core_version() {
147144
)
148145
);
149146
}
150-
#[doc = " @struct ie_core_version"]
151-
#[doc = " @brief Represents version information that describes devices and the inference engine runtime library"]
147+
#[doc = " @struct ie_core_version\n @brief Represents version information that describes devices and the inference engine runtime library"]
152148
pub type ie_core_version_t = ie_core_version;
153-
#[doc = " @struct ie_core_versions"]
154-
#[doc = " @brief Represents all versions information that describes all devices and the inference engine runtime library"]
149+
#[doc = " @struct ie_core_versions\n @brief Represents all versions information that describes all devices and the inference engine runtime library"]
155150
#[repr(C)]
156151
#[derive(Debug, Copy, Clone)]
157152
pub struct ie_core_versions {
@@ -195,11 +190,9 @@ fn bindgen_test_layout_ie_core_versions() {
195190
)
196191
);
197192
}
198-
#[doc = " @struct ie_core_versions"]
199-
#[doc = " @brief Represents all versions information that describes all devices and the inference engine runtime library"]
193+
#[doc = " @struct ie_core_versions\n @brief Represents all versions information that describes all devices and the inference engine runtime library"]
200194
pub type ie_core_versions_t = ie_core_versions;
201-
#[doc = " @struct ie_config"]
202-
#[doc = " @brief Represents configuration information that describes devices"]
195+
#[doc = " @struct ie_config\n @brief Represents configuration information that describes devices"]
203196
#[repr(C)]
204197
#[derive(Debug, Copy, Clone)]
205198
pub struct ie_config {
@@ -255,11 +248,9 @@ fn bindgen_test_layout_ie_config() {
255248
)
256249
);
257250
}
258-
#[doc = " @struct ie_config"]
259-
#[doc = " @brief Represents configuration information that describes devices"]
251+
#[doc = " @struct ie_config\n @brief Represents configuration information that describes devices"]
260252
pub type ie_config_t = ie_config;
261-
#[doc = " @struct ie_param"]
262-
#[doc = " @brief metric and config parameters."]
253+
#[doc = " @struct ie_param\n @brief metric and config parameters."]
263254
#[repr(C)]
264255
#[derive(Copy, Clone)]
265256
pub struct ie_param {
@@ -344,11 +335,9 @@ fn bindgen_test_layout_ie_param() {
344335
concat!("Alignment of ", stringify!(ie_param))
345336
);
346337
}
347-
#[doc = " @struct ie_param"]
348-
#[doc = " @brief metric and config parameters."]
338+
#[doc = " @struct ie_param\n @brief metric and config parameters."]
349339
pub type ie_param_t = ie_param;
350-
#[doc = " @struct ie_param_config"]
351-
#[doc = " @brief Represents configuration parameter information"]
340+
#[doc = " @struct ie_param_config\n @brief Represents configuration parameter information"]
352341
#[repr(C)]
353342
#[derive(Debug, Copy, Clone)]
354343
pub struct ie_param_config {
@@ -390,11 +379,9 @@ fn bindgen_test_layout_ie_param_config() {
390379
)
391380
);
392381
}
393-
#[doc = " @struct ie_param_config"]
394-
#[doc = " @brief Represents configuration parameter information"]
382+
#[doc = " @struct ie_param_config\n @brief Represents configuration parameter information"]
395383
pub type ie_param_config_t = ie_param_config;
396-
#[doc = " @struct dimensions"]
397-
#[doc = " @brief Represents dimensions for input or output data"]
384+
#[doc = " @struct dimensions\n @brief Represents dimensions for input or output data"]
398385
#[repr(C)]
399386
#[derive(Debug, Copy, Clone)]
400387
pub struct dimensions {
@@ -438,12 +425,10 @@ fn bindgen_test_layout_dimensions() {
438425
)
439426
);
440427
}
441-
#[doc = " @struct dimensions"]
442-
#[doc = " @brief Represents dimensions for input or output data"]
428+
#[doc = " @struct dimensions\n @brief Represents dimensions for input or output data"]
443429
pub type dimensions_t = dimensions;
444430
#[repr(u32)]
445-
#[doc = " @enum layout_e"]
446-
#[doc = " @brief Layouts that the inference engine supports"]
431+
#[doc = " @enum layout_e\n @brief Layouts that the inference engine supports"]
447432
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
448433
pub enum layout_e {
449434
#[doc = "!< \"ANY\" layout"]
@@ -474,8 +459,7 @@ pub enum layout_e {
474459
BLOCKED = 200,
475460
}
476461
#[repr(u32)]
477-
#[doc = " @enum precision_e"]
478-
#[doc = " @brief Precisions that the inference engine supports"]
462+
#[doc = " @enum precision_e\n @brief Precisions that the inference engine supports"]
479463
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
480464
pub enum precision_e {
481465
#[doc = "< Unspecified value. Used by default"]
@@ -515,8 +499,7 @@ pub enum precision_e {
515499
#[doc = "< custom precision has it's own name and size of elements"]
516500
CUSTOM = 80,
517501
}
518-
#[doc = " @struct tensor_desc"]
519-
#[doc = " @brief Represents detailed information for a tensor"]
502+
#[doc = " @struct tensor_desc\n @brief Represents detailed information for a tensor"]
520503
#[repr(C)]
521504
#[derive(Debug, Copy, Clone)]
522505
pub struct tensor_desc {
@@ -569,12 +552,10 @@ fn bindgen_test_layout_tensor_desc() {
569552
)
570553
);
571554
}
572-
#[doc = " @struct tensor_desc"]
573-
#[doc = " @brief Represents detailed information for a tensor"]
555+
#[doc = " @struct tensor_desc\n @brief Represents detailed information for a tensor"]
574556
pub type tensor_desc_t = tensor_desc;
575557
#[repr(u32)]
576-
#[doc = " @enum colorformat_e"]
577-
#[doc = " @brief Extra information about input color format for preprocessing"]
558+
#[doc = " @enum colorformat_e\n @brief Extra information about input color format for preprocessing"]
578559
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
579560
pub enum colorformat_e {
580561
#[doc = "!< Plain blob (default), no extra color processing required"]
@@ -593,8 +574,7 @@ pub enum colorformat_e {
593574
I420 = 6,
594575
}
595576
#[repr(u32)]
596-
#[doc = " @enum resize_alg_e"]
597-
#[doc = " @brief Represents the list of supported resize algorithms."]
577+
#[doc = " @enum resize_alg_e\n @brief Represents the list of supported resize algorithms."]
598578
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
599579
pub enum resize_alg_e {
600580
#[doc = "!< \"No resize\" mode"]
@@ -618,11 +598,9 @@ pub const IEStatusCode_NOT_ALLOCATED: IEStatusCode = -10;
618598
pub const IEStatusCode_INFER_NOT_STARTED: IEStatusCode = -11;
619599
pub const IEStatusCode_NETWORK_NOT_READ: IEStatusCode = -12;
620600
pub const IEStatusCode_INFER_CANCELLED: IEStatusCode = -13;
621-
#[doc = " @enum IEStatusCode"]
622-
#[doc = " @brief This enum contains codes for all possible return values of the interface functions"]
601+
#[doc = " @enum IEStatusCode\n @brief This enum contains codes for all possible return values of the interface functions"]
623602
pub type IEStatusCode = ::std::os::raw::c_int;
624-
#[doc = " @struct roi_t"]
625-
#[doc = " @brief This structure describes roi data."]
603+
#[doc = " @struct roi_t\n @brief This structure describes roi data."]
626604
#[repr(C)]
627605
#[derive(Debug, Copy, Clone)]
628606
pub struct roi {
@@ -687,11 +665,9 @@ fn bindgen_test_layout_roi() {
687665
)
688666
);
689667
}
690-
#[doc = " @struct roi_t"]
691-
#[doc = " @brief This structure describes roi data."]
668+
#[doc = " @struct roi_t\n @brief This structure describes roi data."]
692669
pub type roi_t = roi;
693-
#[doc = " @struct input_shape"]
694-
#[doc = " @brief Represents shape for input data"]
670+
#[doc = " @struct input_shape\n @brief Represents shape for input data"]
695671
#[repr(C)]
696672
#[derive(Debug, Copy, Clone)]
697673
pub struct input_shape {
@@ -733,11 +709,9 @@ fn bindgen_test_layout_input_shape() {
733709
)
734710
);
735711
}
736-
#[doc = " @struct input_shape"]
737-
#[doc = " @brief Represents shape for input data"]
712+
#[doc = " @struct input_shape\n @brief Represents shape for input data"]
738713
pub type input_shape_t = input_shape;
739-
#[doc = " @struct input_shapes"]
740-
#[doc = " @brief Represents shapes for all input data"]
714+
#[doc = " @struct input_shapes\n @brief Represents shapes for all input data"]
741715
#[repr(C)]
742716
#[derive(Debug, Copy, Clone)]
743717
pub struct input_shapes {
@@ -779,11 +753,9 @@ fn bindgen_test_layout_input_shapes() {
779753
)
780754
);
781755
}
782-
#[doc = " @struct input_shapes"]
783-
#[doc = " @brief Represents shapes for all input data"]
756+
#[doc = " @struct input_shapes\n @brief Represents shapes for all input data"]
784757
pub type input_shapes_t = input_shapes;
785-
#[doc = " @struct ie_blob_buffer"]
786-
#[doc = " @brief Represents copied data from the given blob."]
758+
#[doc = " @struct ie_blob_buffer\n @brief Represents copied data from the given blob."]
787759
#[repr(C)]
788760
#[derive(Copy, Clone)]
789761
pub struct ie_blob_buffer {
@@ -846,11 +818,9 @@ fn bindgen_test_layout_ie_blob_buffer() {
846818
concat!("Alignment of ", stringify!(ie_blob_buffer))
847819
);
848820
}
849-
#[doc = " @struct ie_blob_buffer"]
850-
#[doc = " @brief Represents copied data from the given blob."]
821+
#[doc = " @struct ie_blob_buffer\n @brief Represents copied data from the given blob."]
851822
pub type ie_blob_buffer_t = ie_blob_buffer;
852-
#[doc = " @struct ie_complete_call_back"]
853-
#[doc = " @brief Completion callback definition about the function and args"]
823+
#[doc = " @struct ie_complete_call_back\n @brief Completion callback definition about the function and args"]
854824
#[repr(C)]
855825
#[derive(Debug, Copy, Clone)]
856826
pub struct ie_complete_call_back {
@@ -894,11 +864,9 @@ fn bindgen_test_layout_ie_complete_call_back() {
894864
)
895865
);
896866
}
897-
#[doc = " @struct ie_complete_call_back"]
898-
#[doc = " @brief Completion callback definition about the function and args"]
867+
#[doc = " @struct ie_complete_call_back\n @brief Completion callback definition about the function and args"]
899868
pub type ie_complete_call_back_t = ie_complete_call_back;
900-
#[doc = " @struct ie_available_devices"]
901-
#[doc = " @brief Represent all available devices."]
869+
#[doc = " @struct ie_available_devices\n @brief Represent all available devices."]
902870
#[repr(C)]
903871
#[derive(Debug, Copy, Clone)]
904872
pub struct ie_available_devices {
@@ -940,6 +908,5 @@ fn bindgen_test_layout_ie_available_devices() {
940908
)
941909
);
942910
}
943-
#[doc = " @struct ie_available_devices"]
944-
#[doc = " @brief Represent all available devices."]
911+
#[doc = " @struct ie_available_devices\n @brief Represent all available devices."]
945912
pub type ie_available_devices_t = ie_available_devices;

0 commit comments

Comments
 (0)