Skip to content

Commit

Permalink
Update crate dependencies (intel#69)
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
abrown committed Sep 21, 2023
1 parent a6caa09 commit 2f86339
Show file tree
Hide file tree
Showing 19 changed files with 806 additions and 838 deletions.
560 changes: 382 additions & 178 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion crates/openvino-finder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ cfg-if = "1.0"
log = "0.4"

[dev-dependencies]
pretty_env_logger = "0.4"
env_logger = "0.10"
2 changes: 1 addition & 1 deletion crates/openvino-finder/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ mod test {
/// system.
#[test]
fn find_openvino_c_locally() {
pretty_env_logger::init();
env_logger::init();
assert!(find("openvino_c").is_some());
}

Expand Down
16 changes: 9 additions & 7 deletions crates/openvino-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,20 @@ include = [
links = "inference_engine_c_api"

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

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

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

[package.metadata.docs.rs]
features = ["runtime-linking"]
2 changes: 1 addition & 1 deletion crates/openvino-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const ENV_OPENVINO_BUILD_DIR: &str = "OPENVINO_BUILD_DIR";

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

// Trigger rebuild on changes to build.rs and Cargo.toml and every source file.
println!("cargo:rerun-if-changed=build.rs");
Expand Down
490 changes: 75 additions & 415 deletions crates/openvino-sys/src/generated/functions.rs

Large diffs are not rendered by default.

101 changes: 34 additions & 67 deletions crates/openvino-sys/src/generated/types.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* automatically generated by rust-bindgen 0.61.0 */
/* automatically generated by rust-bindgen 0.68.1 */

#[repr(C)]
#[derive(Debug, Copy, Clone)]
Expand Down Expand Up @@ -30,8 +30,7 @@ pub struct ie_blob {
_unused: [u8; 0],
}
pub type ie_blob_t = ie_blob;
#[doc = " @struct ie_version"]
#[doc = " @brief Represents an API version information that reflects the set of supported features"]
#[doc = " @struct ie_version\n @brief Represents an API version information that reflects the set of supported features"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ie_version {
Expand Down Expand Up @@ -63,11 +62,9 @@ fn bindgen_test_layout_ie_version() {
)
);
}
#[doc = " @struct ie_version"]
#[doc = " @brief Represents an API version information that reflects the set of supported features"]
#[doc = " @struct ie_version\n @brief Represents an API version information that reflects the set of supported features"]
pub type ie_version_t = ie_version;
#[doc = " @struct ie_core_version"]
#[doc = " @brief Represents version information that describes devices and the inference engine runtime library"]
#[doc = " @struct ie_core_version\n @brief Represents version information that describes devices and the inference engine runtime library"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ie_core_version {
Expand Down Expand Up @@ -147,11 +144,9 @@ fn bindgen_test_layout_ie_core_version() {
)
);
}
#[doc = " @struct ie_core_version"]
#[doc = " @brief Represents version information that describes devices and the inference engine runtime library"]
#[doc = " @struct ie_core_version\n @brief Represents version information that describes devices and the inference engine runtime library"]
pub type ie_core_version_t = ie_core_version;
#[doc = " @struct ie_core_versions"]
#[doc = " @brief Represents all versions information that describes all devices and the inference engine runtime library"]
#[doc = " @struct ie_core_versions\n @brief Represents all versions information that describes all devices and the inference engine runtime library"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ie_core_versions {
Expand Down Expand Up @@ -195,11 +190,9 @@ fn bindgen_test_layout_ie_core_versions() {
)
);
}
#[doc = " @struct ie_core_versions"]
#[doc = " @brief Represents all versions information that describes all devices and the inference engine runtime library"]
#[doc = " @struct ie_core_versions\n @brief Represents all versions information that describes all devices and the inference engine runtime library"]
pub type ie_core_versions_t = ie_core_versions;
#[doc = " @struct ie_config"]
#[doc = " @brief Represents configuration information that describes devices"]
#[doc = " @struct ie_config\n @brief Represents configuration information that describes devices"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ie_config {
Expand Down Expand Up @@ -255,11 +248,9 @@ fn bindgen_test_layout_ie_config() {
)
);
}
#[doc = " @struct ie_config"]
#[doc = " @brief Represents configuration information that describes devices"]
#[doc = " @struct ie_config\n @brief Represents configuration information that describes devices"]
pub type ie_config_t = ie_config;
#[doc = " @struct ie_param"]
#[doc = " @brief metric and config parameters."]
#[doc = " @struct ie_param\n @brief metric and config parameters."]
#[repr(C)]
#[derive(Copy, Clone)]
pub struct ie_param {
Expand Down Expand Up @@ -344,11 +335,9 @@ fn bindgen_test_layout_ie_param() {
concat!("Alignment of ", stringify!(ie_param))
);
}
#[doc = " @struct ie_param"]
#[doc = " @brief metric and config parameters."]
#[doc = " @struct ie_param\n @brief metric and config parameters."]
pub type ie_param_t = ie_param;
#[doc = " @struct ie_param_config"]
#[doc = " @brief Represents configuration parameter information"]
#[doc = " @struct ie_param_config\n @brief Represents configuration parameter information"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ie_param_config {
Expand Down Expand Up @@ -390,11 +379,9 @@ fn bindgen_test_layout_ie_param_config() {
)
);
}
#[doc = " @struct ie_param_config"]
#[doc = " @brief Represents configuration parameter information"]
#[doc = " @struct ie_param_config\n @brief Represents configuration parameter information"]
pub type ie_param_config_t = ie_param_config;
#[doc = " @struct dimensions"]
#[doc = " @brief Represents dimensions for input or output data"]
#[doc = " @struct dimensions\n @brief Represents dimensions for input or output data"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct dimensions {
Expand Down Expand Up @@ -438,12 +425,10 @@ fn bindgen_test_layout_dimensions() {
)
);
}
#[doc = " @struct dimensions"]
#[doc = " @brief Represents dimensions for input or output data"]
#[doc = " @struct dimensions\n @brief Represents dimensions for input or output data"]
pub type dimensions_t = dimensions;
#[repr(u32)]
#[doc = " @enum layout_e"]
#[doc = " @brief Layouts that the inference engine supports"]
#[doc = " @enum layout_e\n @brief Layouts that the inference engine supports"]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum layout_e {
#[doc = "!< \"ANY\" layout"]
Expand Down Expand Up @@ -474,8 +459,7 @@ pub enum layout_e {
BLOCKED = 200,
}
#[repr(u32)]
#[doc = " @enum precision_e"]
#[doc = " @brief Precisions that the inference engine supports"]
#[doc = " @enum precision_e\n @brief Precisions that the inference engine supports"]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum precision_e {
#[doc = "< Unspecified value. Used by default"]
Expand Down Expand Up @@ -515,8 +499,7 @@ pub enum precision_e {
#[doc = "< custom precision has it's own name and size of elements"]
CUSTOM = 80,
}
#[doc = " @struct tensor_desc"]
#[doc = " @brief Represents detailed information for a tensor"]
#[doc = " @struct tensor_desc\n @brief Represents detailed information for a tensor"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct tensor_desc {
Expand Down Expand Up @@ -569,12 +552,10 @@ fn bindgen_test_layout_tensor_desc() {
)
);
}
#[doc = " @struct tensor_desc"]
#[doc = " @brief Represents detailed information for a tensor"]
#[doc = " @struct tensor_desc\n @brief Represents detailed information for a tensor"]
pub type tensor_desc_t = tensor_desc;
#[repr(u32)]
#[doc = " @enum colorformat_e"]
#[doc = " @brief Extra information about input color format for preprocessing"]
#[doc = " @enum colorformat_e\n @brief Extra information about input color format for preprocessing"]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum colorformat_e {
#[doc = "!< Plain blob (default), no extra color processing required"]
Expand All @@ -593,8 +574,7 @@ pub enum colorformat_e {
I420 = 6,
}
#[repr(u32)]
#[doc = " @enum resize_alg_e"]
#[doc = " @brief Represents the list of supported resize algorithms."]
#[doc = " @enum resize_alg_e\n @brief Represents the list of supported resize algorithms."]
#[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
pub enum resize_alg_e {
#[doc = "!< \"No resize\" mode"]
Expand All @@ -618,11 +598,9 @@ pub const IEStatusCode_NOT_ALLOCATED: IEStatusCode = -10;
pub const IEStatusCode_INFER_NOT_STARTED: IEStatusCode = -11;
pub const IEStatusCode_NETWORK_NOT_READ: IEStatusCode = -12;
pub const IEStatusCode_INFER_CANCELLED: IEStatusCode = -13;
#[doc = " @enum IEStatusCode"]
#[doc = " @brief This enum contains codes for all possible return values of the interface functions"]
#[doc = " @enum IEStatusCode\n @brief This enum contains codes for all possible return values of the interface functions"]
pub type IEStatusCode = ::std::os::raw::c_int;
#[doc = " @struct roi_t"]
#[doc = " @brief This structure describes roi data."]
#[doc = " @struct roi_t\n @brief This structure describes roi data."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct roi {
Expand Down Expand Up @@ -687,11 +665,9 @@ fn bindgen_test_layout_roi() {
)
);
}
#[doc = " @struct roi_t"]
#[doc = " @brief This structure describes roi data."]
#[doc = " @struct roi_t\n @brief This structure describes roi data."]
pub type roi_t = roi;
#[doc = " @struct input_shape"]
#[doc = " @brief Represents shape for input data"]
#[doc = " @struct input_shape\n @brief Represents shape for input data"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct input_shape {
Expand Down Expand Up @@ -733,11 +709,9 @@ fn bindgen_test_layout_input_shape() {
)
);
}
#[doc = " @struct input_shape"]
#[doc = " @brief Represents shape for input data"]
#[doc = " @struct input_shape\n @brief Represents shape for input data"]
pub type input_shape_t = input_shape;
#[doc = " @struct input_shapes"]
#[doc = " @brief Represents shapes for all input data"]
#[doc = " @struct input_shapes\n @brief Represents shapes for all input data"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct input_shapes {
Expand Down Expand Up @@ -779,11 +753,9 @@ fn bindgen_test_layout_input_shapes() {
)
);
}
#[doc = " @struct input_shapes"]
#[doc = " @brief Represents shapes for all input data"]
#[doc = " @struct input_shapes\n @brief Represents shapes for all input data"]
pub type input_shapes_t = input_shapes;
#[doc = " @struct ie_blob_buffer"]
#[doc = " @brief Represents copied data from the given blob."]
#[doc = " @struct ie_blob_buffer\n @brief Represents copied data from the given blob."]
#[repr(C)]
#[derive(Copy, Clone)]
pub struct ie_blob_buffer {
Expand Down Expand Up @@ -846,11 +818,9 @@ fn bindgen_test_layout_ie_blob_buffer() {
concat!("Alignment of ", stringify!(ie_blob_buffer))
);
}
#[doc = " @struct ie_blob_buffer"]
#[doc = " @brief Represents copied data from the given blob."]
#[doc = " @struct ie_blob_buffer\n @brief Represents copied data from the given blob."]
pub type ie_blob_buffer_t = ie_blob_buffer;
#[doc = " @struct ie_complete_call_back"]
#[doc = " @brief Completion callback definition about the function and args"]
#[doc = " @struct ie_complete_call_back\n @brief Completion callback definition about the function and args"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ie_complete_call_back {
Expand Down Expand Up @@ -894,11 +864,9 @@ fn bindgen_test_layout_ie_complete_call_back() {
)
);
}
#[doc = " @struct ie_complete_call_back"]
#[doc = " @brief Completion callback definition about the function and args"]
#[doc = " @struct ie_complete_call_back\n @brief Completion callback definition about the function and args"]
pub type ie_complete_call_back_t = ie_complete_call_back;
#[doc = " @struct ie_available_devices"]
#[doc = " @brief Represent all available devices."]
#[doc = " @struct ie_available_devices\n @brief Represent all available devices."]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct ie_available_devices {
Expand Down Expand Up @@ -940,6 +908,5 @@ fn bindgen_test_layout_ie_available_devices() {
)
);
}
#[doc = " @struct ie_available_devices"]
#[doc = " @brief Represent all available devices."]
#[doc = " @struct ie_available_devices\n @brief Represent all available devices."]
pub type ie_available_devices_t = ie_available_devices;
Loading

0 comments on commit 2f86339

Please sign in to comment.