From 8ebfcf78c0551803212dc88bc5254c1bd5f9ef3d Mon Sep 17 00:00:00 2001 From: Takeshi Yoneda Date: Fri, 20 Sep 2024 00:30:24 +0000 Subject: [PATCH 01/10] try using crate_universe Signed-off-by: Takeshi Yoneda --- WORKSPACE | 18 + bazel/repository_locations.bzl | 8 +- .../extensions/dynamic_modules/sdk/rust/BUILD | 16 + .../dynamic_modules/sdk/rust/Cargo.lock | 362 ++++++++++++++++++ .../dynamic_modules/sdk/rust/Cargo.toml | 3 + .../dynamic_modules/sdk/rust/build.rs | 7 + 6 files changed, 411 insertions(+), 3 deletions(-) create mode 100644 source/extensions/dynamic_modules/sdk/rust/build.rs diff --git a/WORKSPACE b/WORKSPACE index 9819ecb5ac1e..30fe417ecbe4 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -27,3 +27,21 @@ envoy_python_dependencies() load("//bazel:dependency_imports.bzl", "envoy_dependency_imports") envoy_dependency_imports() + +# TODO: move them inside proper macros under bazel/** +load("@rules_rust//crate_universe:repositories.bzl", "crate_universe_dependencies") + +crate_universe_dependencies() + +load("@rules_rust//crate_universe:defs.bzl", "crates_repository") + +crates_repository( + name = "dynamic_modules_rust_sdk_crate_index", + cargo_lockfile = "//source/extensions/dynamic_modules/sdk/rust:Cargo.lock", + manifests = ["//source/extensions/dynamic_modules/sdk/rust:Cargo.toml"], +) + +load("@dynamic_modules_rust_sdk_crate_index//:defs.bzl", "crate_repositories") + +crate_repositories() +############# diff --git a/bazel/repository_locations.bzl b/bazel/repository_locations.bzl index 6752ec066cd0..13a2fcd97cbc 100644 --- a/bazel/repository_locations.bzl +++ b/bazel/repository_locations.bzl @@ -1453,9 +1453,11 @@ REPOSITORY_LOCATIONS_SPEC = dict( project_desc = "Bazel rust rules (used by Wasm)", project_url = "https://github.com/bazelbuild/rules_rust", version = "0.50.1", - strip_prefix = "rules_rust-{version}", - sha256 = "ddfc0210b19498086d09c458672ef2a6fb7790103dbb1b2da73c54677c330ed1", - urls = ["https://github.com/bazelbuild/rules_rust/archive/{version}.tar.gz"], + # Note: rules_rust should point to the releases, not archive to avoid the hassle of bootstrapping in crate_universe. + # This is described in https://bazelbuild.github.io/rules_rust/crate_universe.html#setup, otherwise bootstrap + # is required which in turn requires a system CC toolchains, not the bazel controlled ones. + sha256 = "319b1c35c11204ef56b1d94a549f6b9d3532813b778f02d709ef68c837036cf1", + urls = ["https://github.com/bazelbuild/rules_rust/releases/download/{version}/rules_rust-v{version}.tar.gz"], use_category = [ "controlplane", "dataplane_core", diff --git a/source/extensions/dynamic_modules/sdk/rust/BUILD b/source/extensions/dynamic_modules/sdk/rust/BUILD index 480a9432eb58..e7890261849b 100644 --- a/source/extensions/dynamic_modules/sdk/rust/BUILD +++ b/source/extensions/dynamic_modules/sdk/rust/BUILD @@ -1,3 +1,5 @@ +load("@dynamic_modules_rust_sdk_crate_index//:defs.bzl", "all_crate_deps") +load("@rules_rust//cargo:defs.bzl", "cargo_build_script") load("@rules_rust//rust:defs.bzl", "rust_library") load( "//bazel:envoy_build_system.bzl", @@ -8,8 +10,22 @@ licenses(["notice"]) # Apache 2 envoy_extension_package() +cargo_build_script( + name = "build_script", + srcs = ["build.rs"], + data = [], + edition = "2021", + deps = all_crate_deps( + build = True, + normal = True, + ), +) + rust_library( name = "envoy_proxy_dynamic_modules_rust_sdk", srcs = glob(["src/**/*.rs"]), edition = "2021", + deps = all_crate_deps( + normal = True, + ) + [":build_script"], ) diff --git a/source/extensions/dynamic_modules/sdk/rust/Cargo.lock b/source/extensions/dynamic_modules/sdk/rust/Cargo.lock index f6f126e02005..41af8dc487ab 100644 --- a/source/extensions/dynamic_modules/sdk/rust/Cargo.lock +++ b/source/extensions/dynamic_modules/sdk/rust/Cargo.lock @@ -2,6 +2,368 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "aho-corasick" +version = "1.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" +dependencies = [ + "memchr", +] + +[[package]] +name = "bindgen" +version = "0.65.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfdf7b466f9a4903edc73f95d6d2bcd5baf8ae620638762244d3f60143643cc5" +dependencies = [ + "bitflags 1.3.2", + "cexpr", + "clang-sys", + "lazy_static", + "lazycell", + "log", + "peeking_take_while", + "prettyplease", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn", + "which", +] + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "bitflags" +version = "2.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" + +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "clang-sys" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" +dependencies = [ + "glob", + "libc", + "libloading", +] + +[[package]] +name = "either" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" + [[package]] name = "envoy-proxy-dynamic-modules-rust-sdk" version = "0.1.0" +dependencies = [ + "bindgen", +] + +[[package]] +name = "errno" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +dependencies = [ + "libc", + "windows-sys", +] + +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + +[[package]] +name = "home" +version = "0.5.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +dependencies = [ + "windows-sys", +] + +[[package]] +name = "lazy_static" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "lazycell" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" + +[[package]] +name = "libc" +version = "0.2.158" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" + +[[package]] +name = "libloading" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" +dependencies = [ + "cfg-if", + "windows-targets", +] + +[[package]] +name = "linux-raw-sys" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" + +[[package]] +name = "log" +version = "0.4.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" + +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "once_cell" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + +[[package]] +name = "peeking_take_while" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" + +[[package]] +name = "prettyplease" +version = "0.2.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "479cf940fbbb3426c32c5d5176f62ad57549a0bb84773423ba8be9d089f5faba" +dependencies = [ + "proc-macro2", + "syn", +] + +[[package]] +name = "proc-macro2" +version = "1.0.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "regex" +version = "1.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustix" +version = "0.38.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" +dependencies = [ + "bitflags 2.6.0", + "errno", + "libc", + "linux-raw-sys", + "windows-sys", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "syn" +version = "2.0.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "unicode-ident" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" + +[[package]] +name = "which" +version = "4.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" +dependencies = [ + "either", + "home", + "once_cell", + "rustix", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" diff --git a/source/extensions/dynamic_modules/sdk/rust/Cargo.toml b/source/extensions/dynamic_modules/sdk/rust/Cargo.toml index 3874a8a3301b..b7073aa81d96 100644 --- a/source/extensions/dynamic_modules/sdk/rust/Cargo.toml +++ b/source/extensions/dynamic_modules/sdk/rust/Cargo.toml @@ -9,4 +9,7 @@ repository = "https://github.com/envoyproxy/envoy" [dependencies] +[build-dependencies] +bindgen = "0.65.1" + [lib] diff --git a/source/extensions/dynamic_modules/sdk/rust/build.rs b/source/extensions/dynamic_modules/sdk/rust/build.rs new file mode 100644 index 000000000000..6d1413738f6c --- /dev/null +++ b/source/extensions/dynamic_modules/sdk/rust/build.rs @@ -0,0 +1,7 @@ +fn main() { + // TODO: this is just to ensure that bindgen dependency is available in build.rs. + let _ = bindgen::Builder::default() + .header("abi.h") + .parse_callbacks(Box::new(bindgen::CargoCallbacks)) + .generate(); +} From 6cfa17f9fedb84161f0b0bc9d86bd7f266ff6878 Mon Sep 17 00:00:00 2001 From: Takeshi Yoneda Date: Fri, 20 Sep 2024 02:18:18 +0000 Subject: [PATCH 02/10] try Signed-off-by: Takeshi Yoneda --- source/extensions/dynamic_modules/abi.h | 4 -- .../extensions/dynamic_modules/abi_version.h | 2 +- .../extensions/dynamic_modules/sdk/rust/BUILD | 5 +- .../extensions/dynamic_modules/sdk/rust/abi.h | 64 +++++++++++++++++++ .../dynamic_modules/sdk/rust/abi_version.h | 15 +++++ .../dynamic_modules/sdk/rust/build.rs | 16 ++++- .../dynamic_modules/sdk/rust/src/abi.rs | 17 ----- .../dynamic_modules/sdk/rust/src/lib.rs | 11 ++-- .../test_data/c/program_init_fail.c | 2 +- 9 files changed, 105 insertions(+), 31 deletions(-) create mode 100644 source/extensions/dynamic_modules/sdk/rust/abi.h create mode 100644 source/extensions/dynamic_modules/sdk/rust/abi_version.h delete mode 100644 source/extensions/dynamic_modules/sdk/rust/src/abi.rs diff --git a/source/extensions/dynamic_modules/abi.h b/source/extensions/dynamic_modules/abi.h index 460dc00cef58..badf6b962e4a 100644 --- a/source/extensions/dynamic_modules/abi.h +++ b/source/extensions/dynamic_modules/abi.h @@ -14,11 +14,7 @@ // same version of the ABI. #ifdef __cplusplus -#include - extern "C" { -#else -#include #endif // ----------------------------------------------------------------------------- diff --git a/source/extensions/dynamic_modules/abi_version.h b/source/extensions/dynamic_modules/abi_version.h index 6262f9b54bdc..1e17a9a9384b 100644 --- a/source/extensions/dynamic_modules/abi_version.h +++ b/source/extensions/dynamic_modules/abi_version.h @@ -6,7 +6,7 @@ namespace DynamicModules { #endif // This is the ABI version calculated as a sha256 hash of the ABI header files. When the ABI // changes, this value must change, and the correctness of this value is checked by the test. -const char* kAbiVersion = "749b1e6bf97309b7d171009700a80e651ac61e35f9770c24a63460d765895a51"; +const char* kAbiVersion = "4293760426255b24c25b97a18d9fd31b4d1956f10ba0ff2f723580a46ee8fa21"; #ifdef __cplusplus } // namespace DynamicModules diff --git a/source/extensions/dynamic_modules/sdk/rust/BUILD b/source/extensions/dynamic_modules/sdk/rust/BUILD index e7890261849b..00f1f19f33c0 100644 --- a/source/extensions/dynamic_modules/sdk/rust/BUILD +++ b/source/extensions/dynamic_modules/sdk/rust/BUILD @@ -13,7 +13,10 @@ envoy_extension_package() cargo_build_script( name = "build_script", srcs = ["build.rs"], - data = [], + data = [ + "abi.h", + "abi_version.h", + ], edition = "2021", deps = all_crate_deps( build = True, diff --git a/source/extensions/dynamic_modules/sdk/rust/abi.h b/source/extensions/dynamic_modules/sdk/rust/abi.h new file mode 100644 index 000000000000..badf6b962e4a --- /dev/null +++ b/source/extensions/dynamic_modules/sdk/rust/abi.h @@ -0,0 +1,64 @@ +#pragma once + +// NOLINT(namespace-envoy) + +// This is a pure C header file that defines the ABI of the core of dynamic modules used by Envoy. +// +// This must not contain any dependencies besides standard library since it is not only used by +// Envoy itself but also by dynamic module SDKs written in non-C++ languages. +// +// Currently, compatibility is only guaranteed by an exact version match between the Envoy +// codebase and the dynamic module SDKs. In the future, after the ABI is stabilized, we will revisit +// this restriction and hopefully provide a wider compatibility guarantee. Until then, Envoy +// checks the hash of the ABI header files to ensure that the dynamic modules are built against the +// same version of the ABI. + +#ifdef __cplusplus +extern "C" { +#endif + +// ----------------------------------------------------------------------------- +// ---------------------------------- Types ------------------------------------ +// ----------------------------------------------------------------------------- +// +// Types used in the ABI. The name of a type must be prefixed with "envoy_dynamic_module_type_". + +/** + * envoy_dynamic_module_type_abi_version represents a null-terminated string that contains the ABI + * version of the dynamic module. This is used to ensure that the dynamic module is built against + * the compatible version of the ABI. + */ +typedef const char* envoy_dynamic_module_type_abi_version; // NOLINT(modernize-use-using) + +// ----------------------------------------------------------------------------- +// ------------------------------- Event Hooks --------------------------------- +// ----------------------------------------------------------------------------- +// +// Event hooks are functions that are called by Envoy in response to certain events. +// The module must implement and export these functions in the dynamic module object file. +// +// Each event hook is defined as a function prototype. The symbol must be prefixed with +// "envoy_dynamic_module_on_". + +/** + * envoy_dynamic_module_on_program_init is called by the main thread exactly when the module is + * loaded. The function returns the ABI version of the dynamic module. If null is returned, the + * module will be unloaded immediately. + * + * For Envoy, the return value will be used to check the compatibility of the dynamic module. + * + * For dynamic modules, this is useful when they need to perform some process-wide + * initialization or check if the module is compatible with the platform, such as CPU features. + * Note that initialization routines of a dynamic module can also be performed without this function + * through constructor functions in an object file. However, normal constructors cannot be used + * to check compatibility and gracefully fail the initialization because there is no way to + * report an error to Envoy. + * + * @return envoy_dynamic_module_type_abi_version is the ABI version of the dynamic module. Null + * means the error and the module will be unloaded immediately. + */ +envoy_dynamic_module_type_abi_version envoy_dynamic_module_on_program_init(); + +#ifdef __cplusplus +} +#endif diff --git a/source/extensions/dynamic_modules/sdk/rust/abi_version.h b/source/extensions/dynamic_modules/sdk/rust/abi_version.h new file mode 100644 index 000000000000..1e17a9a9384b --- /dev/null +++ b/source/extensions/dynamic_modules/sdk/rust/abi_version.h @@ -0,0 +1,15 @@ +#pragma once +#ifdef __cplusplus +namespace Envoy { +namespace Extensions { +namespace DynamicModules { +#endif +// This is the ABI version calculated as a sha256 hash of the ABI header files. When the ABI +// changes, this value must change, and the correctness of this value is checked by the test. +const char* kAbiVersion = "4293760426255b24c25b97a18d9fd31b4d1956f10ba0ff2f723580a46ee8fa21"; + +#ifdef __cplusplus +} // namespace DynamicModules +} // namespace Extensions +} // namespace Envoy +#endif diff --git a/source/extensions/dynamic_modules/sdk/rust/build.rs b/source/extensions/dynamic_modules/sdk/rust/build.rs index 6d1413738f6c..dd797a97fba6 100644 --- a/source/extensions/dynamic_modules/sdk/rust/build.rs +++ b/source/extensions/dynamic_modules/sdk/rust/build.rs @@ -1,7 +1,17 @@ +use std::env; +use std::path::PathBuf; + fn main() { - // TODO: this is just to ensure that bindgen dependency is available in build.rs. - let _ = bindgen::Builder::default() + println!("cargo:rerun-if-changed=abi.h"); + let bindings = bindgen::Builder::default() .header("abi.h") + .header("abi_version.h") .parse_callbacks(Box::new(bindgen::CargoCallbacks)) - .generate(); + .generate() + .expect("Unable to generate bindings"); + + let out_path = PathBuf::from(env::var("OUT_DIR").unwrap()); + bindings + .write_to_file(out_path.join("bindings.rs")) + .expect("Couldn't write bindings!"); } diff --git a/source/extensions/dynamic_modules/sdk/rust/src/abi.rs b/source/extensions/dynamic_modules/sdk/rust/src/abi.rs deleted file mode 100644 index d673d5b2c599..000000000000 --- a/source/extensions/dynamic_modules/sdk/rust/src/abi.rs +++ /dev/null @@ -1,17 +0,0 @@ -/* automatically generated by rust-bindgen 0.70.1 */ - -pub type wchar_t = ::std::os::raw::c_int; -#[repr(C)] -#[repr(align(16))] -#[derive(Debug, Copy, Clone)] -pub struct max_align_t { - pub __clang_max_align_nonce1: ::std::os::raw::c_longlong, - pub __bindgen_padding_0: u64, - pub __clang_max_align_nonce2: u128, -} -#[doc = " envoy_dynamic_module_type_abi_version represents a null-terminated string that contains the ABI\n version of the dynamic module. This is used to ensure that the dynamic module is built against\n the compatible version of the ABI."] -pub type envoy_dynamic_module_type_abi_version = *const ::std::os::raw::c_char; -extern "C" { - #[doc = " envoy_dynamic_module_on_program_init is called by the main thread exactly when the module is\n loaded. The function returns the ABI version of the dynamic module. If null is returned, the\n module will be unloaded immediately.\n\n For Envoy, the return value will be used to check the compatibility of the dynamic module.\n\n For dynamic modules, this is useful when they need to perform some process-wide\n initialization or check if the module is compatible with the platform, such as CPU features.\n Note that initialization routines of a dynamic module can also be performed without this function\n through constructor functions in an object file. However, normal constructors cannot be used\n to check compatibility and gracefully fail the initialization because there is no way to\n report an error to Envoy.\n\n @return envoy_dynamic_module_type_abi_version is the ABI version of the dynamic module. Null\n means the error and the module will be unloaded immediately."] - pub fn envoy_dynamic_module_on_program_init() -> envoy_dynamic_module_type_abi_version; -} diff --git a/source/extensions/dynamic_modules/sdk/rust/src/lib.rs b/source/extensions/dynamic_modules/sdk/rust/src/lib.rs index e8aa578d6c95..5796d12fe9b1 100644 --- a/source/extensions/dynamic_modules/sdk/rust/src/lib.rs +++ b/source/extensions/dynamic_modules/sdk/rust/src/lib.rs @@ -3,7 +3,12 @@ #![allow(non_snake_case)] #![allow(dead_code)] -mod abi; +/// This module contains the generated bindings for the envoy dynamic modules ABI. +/// +/// This is not meant to be used directly. +pub mod abi { + include!(concat!(env!("OUT_DIR"), "/bindings.rs")); +} /// Declare the init function for the dynamic module. This function is called when the dynamic module is loaded. /// The function must return true on success, and false on failure. When it returns false, @@ -28,9 +33,7 @@ macro_rules! declare_program_init { #[no_mangle] pub extern "C" fn envoy_dynamic_module_on_program_init() -> *const ::std::os::raw::c_char { if ($f()) { - // This magic number is sha256 of the ABI headers which must match the - // value in abi_version.h - b"749b1e6bf97309b7d171009700a80e651ac61e35f9770c24a63460d765895a51\0".as_ptr() + envoy_proxy_dynamic_modules_rust_sdk::abi::kAbiVersion.as_ptr() as *const ::std::os::raw::c_char } else { ::std::ptr::null() diff --git a/test/extensions/dynamic_modules/test_data/c/program_init_fail.c b/test/extensions/dynamic_modules/test_data/c/program_init_fail.c index 62c903ac2dd3..3b8ce5060bad 100644 --- a/test/extensions/dynamic_modules/test_data/c/program_init_fail.c +++ b/test/extensions/dynamic_modules/test_data/c/program_init_fail.c @@ -1,3 +1,3 @@ #include "source/extensions/dynamic_modules/abi.h" -envoy_dynamic_module_type_abi_version envoy_dynamic_module_on_program_init() { return NULL; } +envoy_dynamic_module_type_abi_version envoy_dynamic_module_on_program_init() { return 0; } From 525bcdf19fedb4084bd3823a6eeaf6d2f2a9152a Mon Sep 17 00:00:00 2001 From: Takeshi Yoneda Date: Fri, 20 Sep 2024 03:07:11 +0000 Subject: [PATCH 03/10] cleanup Signed-off-by: Takeshi Yoneda --- WORKSPACE | 18 ++---------------- bazel/dependency_imports.bzl | 11 +++++++++++ .../extensions/dynamic_modules/sdk/README.md | 4 ---- .../extensions/dynamic_modules/sdk/rust/BUILD | 5 +---- .../dynamic_modules/sdk/rust/README.md | 7 ++----- .../dynamic_modules/sdk/rust/abi_version.h | 15 --------------- .../dynamic_modules/sdk/rust/build.rs | 1 - .../dynamic_modules/sdk/rust/src/lib.rs | 6 ++++-- .../test_data/c/program_init_fail.c | 4 +++- 9 files changed, 23 insertions(+), 48 deletions(-) delete mode 100644 source/extensions/dynamic_modules/sdk/README.md delete mode 100644 source/extensions/dynamic_modules/sdk/rust/abi_version.h diff --git a/WORKSPACE b/WORKSPACE index 30fe417ecbe4..e4460bfc5475 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -28,20 +28,6 @@ load("//bazel:dependency_imports.bzl", "envoy_dependency_imports") envoy_dependency_imports() -# TODO: move them inside proper macros under bazel/** -load("@rules_rust//crate_universe:repositories.bzl", "crate_universe_dependencies") +load("//bazel:dependency_imports_extra.bzl", "envoy_dependency_imports_extra") -crate_universe_dependencies() - -load("@rules_rust//crate_universe:defs.bzl", "crates_repository") - -crates_repository( - name = "dynamic_modules_rust_sdk_crate_index", - cargo_lockfile = "//source/extensions/dynamic_modules/sdk/rust:Cargo.lock", - manifests = ["//source/extensions/dynamic_modules/sdk/rust:Cargo.toml"], -) - -load("@dynamic_modules_rust_sdk_crate_index//:defs.bzl", "crate_repositories") - -crate_repositories() -############# +envoy_dependency_imports_extra() diff --git a/bazel/dependency_imports.bzl b/bazel/dependency_imports.bzl index 476ca5b9d29f..c895c5567087 100644 --- a/bazel/dependency_imports.bzl +++ b/bazel/dependency_imports.bzl @@ -14,6 +14,8 @@ load("@rules_foreign_cc//foreign_cc:repositories.bzl", "rules_foreign_cc_depende load("@rules_fuzzing//fuzzing:repositories.bzl", "rules_fuzzing_dependencies") load("@rules_pkg//:deps.bzl", "rules_pkg_dependencies") load("@rules_proto_grpc//:repositories.bzl", "rules_proto_grpc_toolchains") +load("@rules_rust//crate_universe:defs.bzl", "crates_repository") +load("@rules_rust//crate_universe:repositories.bzl", "crate_universe_dependencies") load("@rules_rust//rust:defs.bzl", "rust_common") load("@rules_rust//rust:repositories.bzl", "rules_rust_dependencies", "rust_register_toolchains", "rust_repository_set") @@ -51,6 +53,8 @@ def envoy_dependency_imports(go_version = GO_VERSION, jq_version = JQ_VERSION, y "wasm32-wasi", ], ) + crate_universe_dependencies() + crates_repositories() shellcheck_dependencies() proxy_wasm_rust_sdk_dependencies() rules_fuzzing_dependencies( @@ -196,3 +200,10 @@ def envoy_download_go_sdks(go_version): goarch = "arm64", version = go_version, ) + +def crates_repositories(): + crates_repository( + name = "dynamic_modules_rust_sdk_crate_index", + cargo_lockfile = "//source/extensions/dynamic_modules/sdk/rust:Cargo.lock", + manifests = ["//source/extensions/dynamic_modules/sdk/rust:Cargo.toml"], + ) diff --git a/source/extensions/dynamic_modules/sdk/README.md b/source/extensions/dynamic_modules/sdk/README.md deleted file mode 100644 index 64d61baa62f2..000000000000 --- a/source/extensions/dynamic_modules/sdk/README.md +++ /dev/null @@ -1,4 +0,0 @@ -## Dynamic Modules SDKs - -This directory contains the SDKs for the Dynamic Modules feature. Each SDK passes the same set of tests and -is guaranteed to provide the same functionality. diff --git a/source/extensions/dynamic_modules/sdk/rust/BUILD b/source/extensions/dynamic_modules/sdk/rust/BUILD index 00f1f19f33c0..9dfb20a7985e 100644 --- a/source/extensions/dynamic_modules/sdk/rust/BUILD +++ b/source/extensions/dynamic_modules/sdk/rust/BUILD @@ -13,10 +13,7 @@ envoy_extension_package() cargo_build_script( name = "build_script", srcs = ["build.rs"], - data = [ - "abi.h", - "abi_version.h", - ], + data = ["abi.h"], edition = "2021", deps = all_crate_deps( build = True, diff --git a/source/extensions/dynamic_modules/sdk/rust/README.md b/source/extensions/dynamic_modules/sdk/rust/README.md index 9470ff7b65df..a1bb7bb9ee38 100644 --- a/source/extensions/dynamic_modules/sdk/rust/README.md +++ b/source/extensions/dynamic_modules/sdk/rust/README.md @@ -1,7 +1,4 @@ # Envoy Dynamic Modules Rust SDK -This directory contains the Rust SDK for the Dynamic Modules feature. The SDK passes the same set of tests and is guaranteed to provide the same functionality as the other SDKs. This directory is organized in the way that it can be used as a standalone Rust crate. The SDK is basically the high-level abstraction layer for the Dynamic Modules ABI defined in the [abi.h](../../abi.h). - -Currently, the ABI binding ([src/abi.rs](./src/abi.rs)) is manually generated by [`bindgen`](https://github.com/rust-lang/rust-bindgen) for the ABI header. Ideally, we should be able to do the bindgen in the build.rs file. - -TODO(@mathetake): figure out how to properly setup the bindgen in build.rs with rules_rust. The most recommended way is to use [crate_universe](https://bazelbuild.github.io/rules_rust/crate_universe.html#setup) and use bindgen as a dev-dependency. However, it seems that crate_universe tries to use the underlying gcc system linker which we cannot assume always available. +This directory contains the Rust SDK for the Dynamic Modules feature. This directory is organized in the way that it can be used as a standalone Rust crate. The SDK is basically the high-level abstraction layer for the Dynamic Modules ABI defined in the [abi.h](./abi.h). +This directory is organized in the way that it can be used as a standalone Rust crate, hence the ABI header file is a hard-copy of the original ABI header files, not symlinks. diff --git a/source/extensions/dynamic_modules/sdk/rust/abi_version.h b/source/extensions/dynamic_modules/sdk/rust/abi_version.h deleted file mode 100644 index 1e17a9a9384b..000000000000 --- a/source/extensions/dynamic_modules/sdk/rust/abi_version.h +++ /dev/null @@ -1,15 +0,0 @@ -#pragma once -#ifdef __cplusplus -namespace Envoy { -namespace Extensions { -namespace DynamicModules { -#endif -// This is the ABI version calculated as a sha256 hash of the ABI header files. When the ABI -// changes, this value must change, and the correctness of this value is checked by the test. -const char* kAbiVersion = "4293760426255b24c25b97a18d9fd31b4d1956f10ba0ff2f723580a46ee8fa21"; - -#ifdef __cplusplus -} // namespace DynamicModules -} // namespace Extensions -} // namespace Envoy -#endif diff --git a/source/extensions/dynamic_modules/sdk/rust/build.rs b/source/extensions/dynamic_modules/sdk/rust/build.rs index dd797a97fba6..37622b5ca4a9 100644 --- a/source/extensions/dynamic_modules/sdk/rust/build.rs +++ b/source/extensions/dynamic_modules/sdk/rust/build.rs @@ -5,7 +5,6 @@ fn main() { println!("cargo:rerun-if-changed=abi.h"); let bindings = bindgen::Builder::default() .header("abi.h") - .header("abi_version.h") .parse_callbacks(Box::new(bindgen::CargoCallbacks)) .generate() .expect("Unable to generate bindings"); diff --git a/source/extensions/dynamic_modules/sdk/rust/src/lib.rs b/source/extensions/dynamic_modules/sdk/rust/src/lib.rs index 5796d12fe9b1..3a55c4392e16 100644 --- a/source/extensions/dynamic_modules/sdk/rust/src/lib.rs +++ b/source/extensions/dynamic_modules/sdk/rust/src/lib.rs @@ -6,7 +6,7 @@ /// This module contains the generated bindings for the envoy dynamic modules ABI. /// /// This is not meant to be used directly. -pub mod abi { +mod abi { include!(concat!(env!("OUT_DIR"), "/bindings.rs")); } @@ -33,7 +33,9 @@ macro_rules! declare_program_init { #[no_mangle] pub extern "C" fn envoy_dynamic_module_on_program_init() -> *const ::std::os::raw::c_char { if ($f()) { - envoy_proxy_dynamic_modules_rust_sdk::abi::kAbiVersion.as_ptr() + // This magic number is sha256 of the ABI headers which must match the + // value in abi_version.h + b"4293760426255b24c25b97a18d9fd31b4d1956f10ba0ff2f723580a46ee8fa21\0".as_ptr() as *const ::std::os::raw::c_char } else { ::std::ptr::null() diff --git a/test/extensions/dynamic_modules/test_data/c/program_init_fail.c b/test/extensions/dynamic_modules/test_data/c/program_init_fail.c index 3b8ce5060bad..0a00ce7d439b 100644 --- a/test/extensions/dynamic_modules/test_data/c/program_init_fail.c +++ b/test/extensions/dynamic_modules/test_data/c/program_init_fail.c @@ -1,3 +1,5 @@ +#include + #include "source/extensions/dynamic_modules/abi.h" -envoy_dynamic_module_type_abi_version envoy_dynamic_module_on_program_init() { return 0; } +envoy_dynamic_module_type_abi_version envoy_dynamic_module_on_program_init() { return NULL; } From a25125a3e27717c26b77b0199a899af07f2a327e Mon Sep 17 00:00:00 2001 From: Takeshi Yoneda Date: Fri, 20 Sep 2024 03:08:50 +0000 Subject: [PATCH 04/10] missing file Signed-off-by: Takeshi Yoneda --- bazel/dependency_imports_extra.bzl | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 bazel/dependency_imports_extra.bzl diff --git a/bazel/dependency_imports_extra.bzl b/bazel/dependency_imports_extra.bzl new file mode 100644 index 000000000000..de302800d2e8 --- /dev/null +++ b/bazel/dependency_imports_extra.bzl @@ -0,0 +1,5 @@ +load("@dynamic_modules_rust_sdk_crate_index//:defs.bzl", "crate_repositories") + +# Dependencies that rely on a first stage of envoy_dependency_imports() in dependency_imports.bzl. +def envoy_dependency_imports_extra(): + crate_repositories() From 6bb16fca3adb2f70f3b2f149979b98413838e563 Mon Sep 17 00:00:00 2001 From: Takeshi Yoneda Date: Fri, 20 Sep 2024 03:16:30 +0000 Subject: [PATCH 05/10] test Signed-off-by: Takeshi Yoneda --- test/extensions/dynamic_modules/BUILD | 1 + test/extensions/dynamic_modules/abi_version_test.cc | 11 +++++++++++ .../dynamic_modules/dynamic_modules_test.cc | 3 +-- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/test/extensions/dynamic_modules/BUILD b/test/extensions/dynamic_modules/BUILD index f136dd11269e..5d1ce3838748 100644 --- a/test/extensions/dynamic_modules/BUILD +++ b/test/extensions/dynamic_modules/BUILD @@ -33,6 +33,7 @@ envoy_cc_test( srcs = ["abi_version_test.cc"], data = [ "//source/extensions/dynamic_modules:abi.h", + "//source/extensions/dynamic_modules/sdk/rust:abi.h", ], deps = [ "//source/common/common:hex_lib", diff --git a/test/extensions/dynamic_modules/abi_version_test.cc b/test/extensions/dynamic_modules/abi_version_test.cc index 958295281dde..029c7a1d2c71 100644 --- a/test/extensions/dynamic_modules/abi_version_test.cc +++ b/test/extensions/dynamic_modules/abi_version_test.cc @@ -27,6 +27,17 @@ TEST(DynamicModules, ABIVersionCheck) { EXPECT_EQ(sha256, kAbiVersion); } +// This test ensures that the copied ABI header files in the SDK directory are identical to the +// original ABI headers. +TEST(DynamicModules, ABIHeaderIdentical) { + const std::string original_abi_header = TestEnvironment::readFileToStringForTest( + TestEnvironment::substitute("{{ test_rundir }}/source/extensions/dynamic_modules/abi.h")); + const std::string rust_abi_header = + TestEnvironment::readFileToStringForTest(TestEnvironment::substitute( + "{{ test_rundir }}/source/extensions/dynamic_modules/sdk/rust/abi.h")); + EXPECT_EQ(original_abi_header, rust_abi_header); +} + } // namespace DynamicModules } // namespace Extensions } // namespace Envoy diff --git a/test/extensions/dynamic_modules/dynamic_modules_test.cc b/test/extensions/dynamic_modules/dynamic_modules_test.cc index 7368af924aa1..2177a45db709 100644 --- a/test/extensions/dynamic_modules/dynamic_modules_test.cc +++ b/test/extensions/dynamic_modules/dynamic_modules_test.cc @@ -36,8 +36,7 @@ class DynamicModuleTestLanguages : public ::testing::TestWithParam }; }; -INSTANTIATE_TEST_SUITE_P(LanguageTests, DynamicModuleTestLanguages, - testing::Values("c", "rust"), // TODO: add Go. +INSTANTIATE_TEST_SUITE_P(LanguageTests, DynamicModuleTestLanguages, testing::Values("c", "rust"), DynamicModuleTestLanguages::languageParamToTestName); TEST_P(DynamicModuleTestLanguages, DoNotClose) { From 6a8032879bb013a49585906b028e0e3ca1ac59b5 Mon Sep 17 00:00:00 2001 From: Takeshi Yoneda Date: Fri, 20 Sep 2024 07:45:12 +0000 Subject: [PATCH 06/10] fmt Signed-off-by: Takeshi Yoneda --- source/extensions/dynamic_modules/sdk/rust/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/extensions/dynamic_modules/sdk/rust/README.md b/source/extensions/dynamic_modules/sdk/rust/README.md index a1bb7bb9ee38..dcdb374d62ae 100644 --- a/source/extensions/dynamic_modules/sdk/rust/README.md +++ b/source/extensions/dynamic_modules/sdk/rust/README.md @@ -1,4 +1,4 @@ # Envoy Dynamic Modules Rust SDK -This directory contains the Rust SDK for the Dynamic Modules feature. This directory is organized in the way that it can be used as a standalone Rust crate. The SDK is basically the high-level abstraction layer for the Dynamic Modules ABI defined in the [abi.h](./abi.h). +This directory contains the Rust SDK for the Dynamic Modules feature. This directory is organized in the way that it can be used as a standalone Rust crate. The SDK is basically the high-level abstraction layer for the Dynamic Modules ABI defined in the [abi.h](./abi.h). This directory is organized in the way that it can be used as a standalone Rust crate, hence the ABI header file is a hard-copy of the original ABI header files, not symlinks. From 322e6094d118831363a3aa0fa8f27c02162f07bb Mon Sep 17 00:00:00 2001 From: Takeshi Yoneda Date: Fri, 20 Sep 2024 08:04:30 +0000 Subject: [PATCH 07/10] clean up Signed-off-by: Takeshi Yoneda --- bazel/dependency_imports.bzl | 1 + .../extensions/dynamic_modules/sdk/rust/BUILD | 5 +- .../dynamic_modules/sdk/rust/Cargo.Bazel.lock | 2966 +++++++++++++++++ .../dynamic_modules/sdk/rust/README.md | 9 +- .../extensions/dynamic_modules/sdk/rust/abi.h | 64 - .../dynamic_modules/sdk/rust/build.rs | 5 +- .../dynamic_modules/sdk/rust/src/lib.rs | 6 +- test/extensions/dynamic_modules/BUILD | 1 - .../dynamic_modules/abi_version_test.cc | 11 - 9 files changed, 2984 insertions(+), 84 deletions(-) create mode 100644 source/extensions/dynamic_modules/sdk/rust/Cargo.Bazel.lock delete mode 100644 source/extensions/dynamic_modules/sdk/rust/abi.h diff --git a/bazel/dependency_imports.bzl b/bazel/dependency_imports.bzl index c895c5567087..c68eb4bf3ed2 100644 --- a/bazel/dependency_imports.bzl +++ b/bazel/dependency_imports.bzl @@ -205,5 +205,6 @@ def crates_repositories(): crates_repository( name = "dynamic_modules_rust_sdk_crate_index", cargo_lockfile = "//source/extensions/dynamic_modules/sdk/rust:Cargo.lock", + lockfile = Label("//source/extensions/dynamic_modules/sdk/rust:Cargo.Bazel.lock"), manifests = ["//source/extensions/dynamic_modules/sdk/rust:Cargo.toml"], ) diff --git a/source/extensions/dynamic_modules/sdk/rust/BUILD b/source/extensions/dynamic_modules/sdk/rust/BUILD index 9dfb20a7985e..b3eecb438d72 100644 --- a/source/extensions/dynamic_modules/sdk/rust/BUILD +++ b/source/extensions/dynamic_modules/sdk/rust/BUILD @@ -13,7 +13,10 @@ envoy_extension_package() cargo_build_script( name = "build_script", srcs = ["build.rs"], - data = ["abi.h"], + data = [ + "//source/extensions/dynamic_modules:abi.h", + "//source/extensions/dynamic_modules:abi_version.h", + ], edition = "2021", deps = all_crate_deps( build = True, diff --git a/source/extensions/dynamic_modules/sdk/rust/Cargo.Bazel.lock b/source/extensions/dynamic_modules/sdk/rust/Cargo.Bazel.lock new file mode 100644 index 000000000000..001c57a6a1e6 --- /dev/null +++ b/source/extensions/dynamic_modules/sdk/rust/Cargo.Bazel.lock @@ -0,0 +1,2966 @@ +{ + "checksum": "0e90c306b0b4e0ef4337f6a839a73d398ae2727ba05a8bb7461f24be2e849f0f", + "crates": { + "aho-corasick 1.1.3": { + "name": "aho-corasick", + "version": "1.1.3", + "package_url": "https://github.com/BurntSushi/aho-corasick", + "repository": { + "Http": { + "url": "https://static.crates.io/crates/aho-corasick/1.1.3/download", + "sha256": "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" + } + }, + "targets": [ + { + "Library": { + "crate_name": "aho_corasick", + "crate_root": "src/lib.rs", + "srcs": { + "allow_empty": true, + "include": [ + "**/*.rs" + ] + } + } + } + ], + "library_target_name": "aho_corasick", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "edition": "2021", + "version": "1.1.3" + }, + "license": "Unlicense OR MIT", + "license_ids": [ + "MIT", + "Unlicense" + ], + "license_file": "LICENSE-MIT" + }, + "bindgen 0.65.1": { + "name": "bindgen", + "version": "0.65.1", + "package_url": "https://github.com/rust-lang/rust-bindgen", + "repository": { + "Http": { + "url": "https://static.crates.io/crates/bindgen/0.65.1/download", + "sha256": "cfdf7b466f9a4903edc73f95d6d2bcd5baf8ae620638762244d3f60143643cc5" + } + }, + "targets": [ + { + "Library": { + "crate_name": "bindgen", + "crate_root": "lib.rs", + "srcs": { + "allow_empty": true, + "include": [ + "**/*.rs" + ] + } + } + }, + { + "BuildScript": { + "crate_name": "build_script_build", + "crate_root": "build.rs", + "srcs": { + "allow_empty": true, + "include": [ + "**/*.rs" + ] + } + } + } + ], + "library_target_name": "bindgen", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "crate_features": { + "common": [ + "default", + "log", + "logging", + "runtime", + "which", + "which-rustfmt" + ], + "selects": {} + }, + "deps": { + "common": [ + { + "id": "bindgen 0.65.1", + "target": "build_script_build" + }, + { + "id": "bitflags 1.3.2", + "target": "bitflags" + }, + { + "id": "cexpr 0.6.0", + "target": "cexpr" + }, + { + "id": "clang-sys 1.8.1", + "target": "clang_sys" + }, + { + "id": "lazy_static 1.5.0", + "target": "lazy_static" + }, + { + "id": "lazycell 1.3.0", + "target": "lazycell" + }, + { + "id": "log 0.4.22", + "target": "log" + }, + { + "id": "peeking_take_while 0.1.2", + "target": "peeking_take_while" + }, + { + "id": "prettyplease 0.2.22", + "target": "prettyplease" + }, + { + "id": "proc-macro2 1.0.86", + "target": "proc_macro2" + }, + { + "id": "quote 1.0.37", + "target": "quote" + }, + { + "id": "regex 1.10.6", + "target": "regex" + }, + { + "id": "rustc-hash 1.1.0", + "target": "rustc_hash" + }, + { + "id": "shlex 1.3.0", + "target": "shlex" + }, + { + "id": "syn 2.0.77", + "target": "syn" + }, + { + "id": "which 4.4.2", + "target": "which" + } + ], + "selects": {} + }, + "edition": "2018", + "version": "0.65.1" + }, + "build_script_attrs": { + "compile_data_glob": [ + "**" + ], + "data_glob": [ + "**" + ], + "link_deps": { + "common": [ + { + "id": "clang-sys 1.8.1", + "target": "clang_sys" + }, + { + "id": "prettyplease 0.2.22", + "target": "prettyplease" + } + ], + "selects": {} + } + }, + "license": "BSD-3-Clause", + "license_ids": [ + "BSD-3-Clause" + ], + "license_file": "LICENSE" + }, + "bitflags 1.3.2": { + "name": "bitflags", + "version": "1.3.2", + "package_url": "https://github.com/bitflags/bitflags", + "repository": { + "Http": { + "url": "https://static.crates.io/crates/bitflags/1.3.2/download", + "sha256": "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + } + }, + "targets": [ + { + "Library": { + "crate_name": "bitflags", + "crate_root": "src/lib.rs", + "srcs": { + "allow_empty": true, + "include": [ + "**/*.rs" + ] + } + } + } + ], + "library_target_name": "bitflags", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "crate_features": { + "common": [ + "default" + ], + "selects": {} + }, + "edition": "2018", + "version": "1.3.2" + }, + "license": "MIT/Apache-2.0", + "license_ids": [ + "Apache-2.0", + "MIT" + ], + "license_file": "LICENSE-APACHE" + }, + "bitflags 2.6.0": { + "name": "bitflags", + "version": "2.6.0", + "package_url": "https://github.com/bitflags/bitflags", + "repository": { + "Http": { + "url": "https://static.crates.io/crates/bitflags/2.6.0/download", + "sha256": "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" + } + }, + "targets": [ + { + "Library": { + "crate_name": "bitflags", + "crate_root": "src/lib.rs", + "srcs": { + "allow_empty": true, + "include": [ + "**/*.rs" + ] + } + } + } + ], + "library_target_name": "bitflags", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "crate_features": { + "common": [ + "std" + ], + "selects": {} + }, + "edition": "2021", + "version": "2.6.0" + }, + "license": "MIT OR Apache-2.0", + "license_ids": [ + "Apache-2.0", + "MIT" + ], + "license_file": "LICENSE-APACHE" + }, + "cexpr 0.6.0": { + "name": "cexpr", + "version": "0.6.0", + "package_url": "https://github.com/jethrogb/rust-cexpr", + "repository": { + "Http": { + "url": "https://static.crates.io/crates/cexpr/0.6.0/download", + "sha256": "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" + } + }, + "targets": [ + { + "Library": { + "crate_name": "cexpr", + "crate_root": "src/lib.rs", + "srcs": { + "allow_empty": true, + "include": [ + "**/*.rs" + ] + } + } + } + ], + "library_target_name": "cexpr", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "deps": { + "common": [ + { + "id": "nom 7.1.3", + "target": "nom" + } + ], + "selects": {} + }, + "edition": "2018", + "version": "0.6.0" + }, + "license": "Apache-2.0/MIT", + "license_ids": [ + "Apache-2.0", + "MIT" + ], + "license_file": "LICENSE-APACHE" + }, + "cfg-if 1.0.0": { + "name": "cfg-if", + "version": "1.0.0", + "package_url": "https://github.com/alexcrichton/cfg-if", + "repository": { + "Http": { + "url": "https://static.crates.io/crates/cfg-if/1.0.0/download", + "sha256": "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + } + }, + "targets": [ + { + "Library": { + "crate_name": "cfg_if", + "crate_root": "src/lib.rs", + "srcs": { + "allow_empty": true, + "include": [ + "**/*.rs" + ] + } + } + } + ], + "library_target_name": "cfg_if", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "edition": "2018", + "version": "1.0.0" + }, + "license": "MIT/Apache-2.0", + "license_ids": [ + "Apache-2.0", + "MIT" + ], + "license_file": "LICENSE-APACHE" + }, + "clang-sys 1.8.1": { + "name": "clang-sys", + "version": "1.8.1", + "package_url": "https://github.com/KyleMayes/clang-sys", + "repository": { + "Http": { + "url": "https://static.crates.io/crates/clang-sys/1.8.1/download", + "sha256": "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" + } + }, + "targets": [ + { + "Library": { + "crate_name": "clang_sys", + "crate_root": "src/lib.rs", + "srcs": { + "allow_empty": true, + "include": [ + "**/*.rs" + ] + } + } + }, + { + "BuildScript": { + "crate_name": "build_script_build", + "crate_root": "build.rs", + "srcs": { + "allow_empty": true, + "include": [ + "**/*.rs" + ] + } + } + } + ], + "library_target_name": "clang_sys", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "crate_features": { + "common": [ + "clang_3_5", + "clang_3_6", + "clang_3_7", + "clang_3_8", + "clang_3_9", + "clang_4_0", + "clang_5_0", + "clang_6_0", + "libloading", + "runtime" + ], + "selects": {} + }, + "deps": { + "common": [ + { + "id": "clang-sys 1.8.1", + "target": "build_script_build" + }, + { + "id": "glob 0.3.1", + "target": "glob" + }, + { + "id": "libc 0.2.158", + "target": "libc" + }, + { + "id": "libloading 0.8.5", + "target": "libloading" + } + ], + "selects": {} + }, + "edition": "2021", + "version": "1.8.1" + }, + "build_script_attrs": { + "compile_data_glob": [ + "**" + ], + "data_glob": [ + "**" + ], + "deps": { + "common": [ + { + "id": "glob 0.3.1", + "target": "glob" + } + ], + "selects": {} + }, + "links": "clang" + }, + "license": "Apache-2.0", + "license_ids": [ + "Apache-2.0" + ], + "license_file": "LICENSE.txt" + }, + "either 1.13.0": { + "name": "either", + "version": "1.13.0", + "package_url": "https://github.com/rayon-rs/either", + "repository": { + "Http": { + "url": "https://static.crates.io/crates/either/1.13.0/download", + "sha256": "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" + } + }, + "targets": [ + { + "Library": { + "crate_name": "either", + "crate_root": "src/lib.rs", + "srcs": { + "allow_empty": true, + "include": [ + "**/*.rs" + ] + } + } + } + ], + "library_target_name": "either", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "crate_features": { + "common": [ + "default", + "use_std" + ], + "selects": {} + }, + "edition": "2018", + "version": "1.13.0" + }, + "license": "MIT OR Apache-2.0", + "license_ids": [ + "Apache-2.0", + "MIT" + ], + "license_file": "LICENSE-APACHE" + }, + "envoy-proxy-dynamic-modules-rust-sdk 0.1.0": { + "name": "envoy-proxy-dynamic-modules-rust-sdk", + "version": "0.1.0", + "package_url": "https://github.com/envoyproxy/envoy", + "repository": null, + "targets": [ + { + "Library": { + "crate_name": "envoy_proxy_dynamic_modules_rust_sdk", + "crate_root": "src/lib.rs", + "srcs": { + "allow_empty": true, + "include": [ + "**/*.rs" + ] + } + } + }, + { + "BuildScript": { + "crate_name": "build_script_build", + "crate_root": "build.rs", + "srcs": { + "allow_empty": true, + "include": [ + "**/*.rs" + ] + } + } + } + ], + "library_target_name": "envoy_proxy_dynamic_modules_rust_sdk", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "deps": { + "common": [ + { + "id": "envoy-proxy-dynamic-modules-rust-sdk 0.1.0", + "target": "build_script_build" + } + ], + "selects": {} + }, + "edition": "2021", + "version": "0.1.0" + }, + "build_script_attrs": { + "compile_data_glob": [ + "**" + ], + "data_glob": [ + "**" + ], + "deps": { + "common": [ + { + "id": "bindgen 0.65.1", + "target": "bindgen" + } + ], + "selects": {} + } + }, + "license": "Apache-2.0", + "license_ids": [ + "Apache-2.0" + ], + "license_file": null + }, + "errno 0.3.9": { + "name": "errno", + "version": "0.3.9", + "package_url": "https://github.com/lambda-fairy/rust-errno", + "repository": { + "Http": { + "url": "https://static.crates.io/crates/errno/0.3.9/download", + "sha256": "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" + } + }, + "targets": [ + { + "Library": { + "crate_name": "errno", + "crate_root": "src/lib.rs", + "srcs": { + "allow_empty": true, + "include": [ + "**/*.rs" + ] + } + } + } + ], + "library_target_name": "errno", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "deps": { + "common": [], + "selects": { + "cfg(target_os = \"hermit\")": [ + { + "id": "libc 0.2.158", + "target": "libc" + } + ], + "cfg(target_os = \"wasi\")": [ + { + "id": "libc 0.2.158", + "target": "libc" + } + ], + "cfg(unix)": [ + { + "id": "libc 0.2.158", + "target": "libc" + } + ], + "cfg(windows)": [ + { + "id": "windows-sys 0.52.0", + "target": "windows_sys" + } + ] + } + }, + "edition": "2018", + "version": "0.3.9" + }, + "license": "MIT OR Apache-2.0", + "license_ids": [ + "Apache-2.0", + "MIT" + ], + "license_file": "LICENSE-APACHE" + }, + "glob 0.3.1": { + "name": "glob", + "version": "0.3.1", + "package_url": "https://github.com/rust-lang/glob", + "repository": { + "Http": { + "url": "https://static.crates.io/crates/glob/0.3.1/download", + "sha256": "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + } + }, + "targets": [ + { + "Library": { + "crate_name": "glob", + "crate_root": "src/lib.rs", + "srcs": { + "allow_empty": true, + "include": [ + "**/*.rs" + ] + } + } + } + ], + "library_target_name": "glob", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "edition": "2015", + "version": "0.3.1" + }, + "license": "MIT OR Apache-2.0", + "license_ids": [ + "Apache-2.0", + "MIT" + ], + "license_file": "LICENSE-APACHE" + }, + "home 0.5.9": { + "name": "home", + "version": "0.5.9", + "package_url": "https://github.com/rust-lang/cargo", + "repository": { + "Http": { + "url": "https://static.crates.io/crates/home/0.5.9/download", + "sha256": "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" + } + }, + "targets": [ + { + "Library": { + "crate_name": "home", + "crate_root": "src/lib.rs", + "srcs": { + "allow_empty": true, + "include": [ + "**/*.rs" + ] + } + } + } + ], + "library_target_name": "home", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "deps": { + "common": [], + "selects": { + "cfg(windows)": [ + { + "id": "windows-sys 0.52.0", + "target": "windows_sys" + } + ] + } + }, + "edition": "2021", + "version": "0.5.9" + }, + "license": "MIT OR Apache-2.0", + "license_ids": [ + "Apache-2.0", + "MIT" + ], + "license_file": "LICENSE-APACHE" + }, + "lazy_static 1.5.0": { + "name": "lazy_static", + "version": "1.5.0", + "package_url": "https://github.com/rust-lang-nursery/lazy-static.rs", + "repository": { + "Http": { + "url": "https://static.crates.io/crates/lazy_static/1.5.0/download", + "sha256": "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + } + }, + "targets": [ + { + "Library": { + "crate_name": "lazy_static", + "crate_root": "src/lib.rs", + "srcs": { + "allow_empty": true, + "include": [ + "**/*.rs" + ] + } + } + } + ], + "library_target_name": "lazy_static", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "edition": "2015", + "version": "1.5.0" + }, + "license": "MIT OR Apache-2.0", + "license_ids": [ + "Apache-2.0", + "MIT" + ], + "license_file": "LICENSE-APACHE" + }, + "lazycell 1.3.0": { + "name": "lazycell", + "version": "1.3.0", + "package_url": "https://github.com/indiv0/lazycell", + "repository": { + "Http": { + "url": "https://static.crates.io/crates/lazycell/1.3.0/download", + "sha256": "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" + } + }, + "targets": [ + { + "Library": { + "crate_name": "lazycell", + "crate_root": "src/lib.rs", + "srcs": { + "allow_empty": true, + "include": [ + "**/*.rs" + ] + } + } + } + ], + "library_target_name": "lazycell", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "edition": "2015", + "version": "1.3.0" + }, + "license": "MIT/Apache-2.0", + "license_ids": [ + "Apache-2.0", + "MIT" + ], + "license_file": "LICENSE-APACHE" + }, + "libc 0.2.158": { + "name": "libc", + "version": "0.2.158", + "package_url": "https://github.com/rust-lang/libc", + "repository": { + "Http": { + "url": "https://static.crates.io/crates/libc/0.2.158/download", + "sha256": "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" + } + }, + "targets": [ + { + "Library": { + "crate_name": "libc", + "crate_root": "src/lib.rs", + "srcs": { + "allow_empty": true, + "include": [ + "**/*.rs" + ] + } + } + }, + { + "BuildScript": { + "crate_name": "build_script_build", + "crate_root": "build.rs", + "srcs": { + "allow_empty": true, + "include": [ + "**/*.rs" + ] + } + } + } + ], + "library_target_name": "libc", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "deps": { + "common": [ + { + "id": "libc 0.2.158", + "target": "build_script_build" + } + ], + "selects": {} + }, + "edition": "2015", + "version": "0.2.158" + }, + "build_script_attrs": { + "compile_data_glob": [ + "**" + ], + "data_glob": [ + "**" + ] + }, + "license": "MIT OR Apache-2.0", + "license_ids": [ + "Apache-2.0", + "MIT" + ], + "license_file": "LICENSE-APACHE" + }, + "libloading 0.8.5": { + "name": "libloading", + "version": "0.8.5", + "package_url": "https://github.com/nagisa/rust_libloading/", + "repository": { + "Http": { + "url": "https://static.crates.io/crates/libloading/0.8.5/download", + "sha256": "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" + } + }, + "targets": [ + { + "Library": { + "crate_name": "libloading", + "crate_root": "src/lib.rs", + "srcs": { + "allow_empty": true, + "include": [ + "**/*.rs" + ] + } + } + } + ], + "library_target_name": "libloading", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "deps": { + "common": [], + "selects": { + "cfg(unix)": [ + { + "id": "cfg-if 1.0.0", + "target": "cfg_if" + } + ], + "cfg(windows)": [ + { + "id": "windows-targets 0.52.6", + "target": "windows_targets" + } + ] + } + }, + "edition": "2015", + "version": "0.8.5" + }, + "license": "ISC", + "license_ids": [ + "ISC" + ], + "license_file": "LICENSE" + }, + "linux-raw-sys 0.4.14": { + "name": "linux-raw-sys", + "version": "0.4.14", + "package_url": "https://github.com/sunfishcode/linux-raw-sys", + "repository": { + "Http": { + "url": "https://static.crates.io/crates/linux-raw-sys/0.4.14/download", + "sha256": "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" + } + }, + "targets": [ + { + "Library": { + "crate_name": "linux_raw_sys", + "crate_root": "src/lib.rs", + "srcs": { + "allow_empty": true, + "include": [ + "**/*.rs" + ] + } + } + } + ], + "library_target_name": "linux_raw_sys", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "crate_features": { + "common": [ + "elf", + "errno", + "general", + "ioctl", + "no_std" + ], + "selects": {} + }, + "edition": "2021", + "version": "0.4.14" + }, + "license": "Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT", + "license_ids": [ + "Apache-2.0", + "MIT" + ], + "license_file": "LICENSE-APACHE" + }, + "log 0.4.22": { + "name": "log", + "version": "0.4.22", + "package_url": "https://github.com/rust-lang/log", + "repository": { + "Http": { + "url": "https://static.crates.io/crates/log/0.4.22/download", + "sha256": "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" + } + }, + "targets": [ + { + "Library": { + "crate_name": "log", + "crate_root": "src/lib.rs", + "srcs": { + "allow_empty": true, + "include": [ + "**/*.rs" + ] + } + } + } + ], + "library_target_name": "log", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "edition": "2021", + "version": "0.4.22" + }, + "license": "MIT OR Apache-2.0", + "license_ids": [ + "Apache-2.0", + "MIT" + ], + "license_file": "LICENSE-APACHE" + }, + "memchr 2.7.4": { + "name": "memchr", + "version": "2.7.4", + "package_url": "https://github.com/BurntSushi/memchr", + "repository": { + "Http": { + "url": "https://static.crates.io/crates/memchr/2.7.4/download", + "sha256": "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" + } + }, + "targets": [ + { + "Library": { + "crate_name": "memchr", + "crate_root": "src/lib.rs", + "srcs": { + "allow_empty": true, + "include": [ + "**/*.rs" + ] + } + } + } + ], + "library_target_name": "memchr", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "crate_features": { + "common": [ + "alloc", + "std" + ], + "selects": {} + }, + "edition": "2021", + "version": "2.7.4" + }, + "license": "Unlicense OR MIT", + "license_ids": [ + "MIT", + "Unlicense" + ], + "license_file": "LICENSE-MIT" + }, + "minimal-lexical 0.2.1": { + "name": "minimal-lexical", + "version": "0.2.1", + "package_url": "https://github.com/Alexhuszagh/minimal-lexical", + "repository": { + "Http": { + "url": "https://static.crates.io/crates/minimal-lexical/0.2.1/download", + "sha256": "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + } + }, + "targets": [ + { + "Library": { + "crate_name": "minimal_lexical", + "crate_root": "src/lib.rs", + "srcs": { + "allow_empty": true, + "include": [ + "**/*.rs" + ] + } + } + } + ], + "library_target_name": "minimal_lexical", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "crate_features": { + "common": [ + "std" + ], + "selects": {} + }, + "edition": "2018", + "version": "0.2.1" + }, + "license": "MIT/Apache-2.0", + "license_ids": [ + "Apache-2.0", + "MIT" + ], + "license_file": "LICENSE-APACHE" + }, + "nom 7.1.3": { + "name": "nom", + "version": "7.1.3", + "package_url": "https://github.com/Geal/nom", + "repository": { + "Http": { + "url": "https://static.crates.io/crates/nom/7.1.3/download", + "sha256": "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" + } + }, + "targets": [ + { + "Library": { + "crate_name": "nom", + "crate_root": "src/lib.rs", + "srcs": { + "allow_empty": true, + "include": [ + "**/*.rs" + ] + } + } + } + ], + "library_target_name": "nom", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "crate_features": { + "common": [ + "alloc", + "std" + ], + "selects": {} + }, + "deps": { + "common": [ + { + "id": "memchr 2.7.4", + "target": "memchr" + }, + { + "id": "minimal-lexical 0.2.1", + "target": "minimal_lexical" + } + ], + "selects": {} + }, + "edition": "2018", + "version": "7.1.3" + }, + "license": "MIT", + "license_ids": [ + "MIT" + ], + "license_file": "LICENSE" + }, + "once_cell 1.19.0": { + "name": "once_cell", + "version": "1.19.0", + "package_url": "https://github.com/matklad/once_cell", + "repository": { + "Http": { + "url": "https://static.crates.io/crates/once_cell/1.19.0/download", + "sha256": "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" + } + }, + "targets": [ + { + "Library": { + "crate_name": "once_cell", + "crate_root": "src/lib.rs", + "srcs": { + "allow_empty": true, + "include": [ + "**/*.rs" + ] + } + } + } + ], + "library_target_name": "once_cell", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "edition": "2021", + "version": "1.19.0" + }, + "license": "MIT OR Apache-2.0", + "license_ids": [ + "Apache-2.0", + "MIT" + ], + "license_file": "LICENSE-APACHE" + }, + "peeking_take_while 0.1.2": { + "name": "peeking_take_while", + "version": "0.1.2", + "package_url": "https://github.com/fitzgen/peeking_take_while", + "repository": { + "Http": { + "url": "https://static.crates.io/crates/peeking_take_while/0.1.2/download", + "sha256": "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" + } + }, + "targets": [ + { + "Library": { + "crate_name": "peeking_take_while", + "crate_root": "src/lib.rs", + "srcs": { + "allow_empty": true, + "include": [ + "**/*.rs" + ] + } + } + } + ], + "library_target_name": "peeking_take_while", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "edition": "2015", + "version": "0.1.2" + }, + "license": "Apache-2.0/MIT", + "license_ids": [ + "Apache-2.0", + "MIT" + ], + "license_file": "LICENSE-APACHE" + }, + "prettyplease 0.2.22": { + "name": "prettyplease", + "version": "0.2.22", + "package_url": "https://github.com/dtolnay/prettyplease", + "repository": { + "Http": { + "url": "https://static.crates.io/crates/prettyplease/0.2.22/download", + "sha256": "479cf940fbbb3426c32c5d5176f62ad57549a0bb84773423ba8be9d089f5faba" + } + }, + "targets": [ + { + "Library": { + "crate_name": "prettyplease", + "crate_root": "src/lib.rs", + "srcs": { + "allow_empty": true, + "include": [ + "**/*.rs" + ] + } + } + }, + { + "BuildScript": { + "crate_name": "build_script_build", + "crate_root": "build.rs", + "srcs": { + "allow_empty": true, + "include": [ + "**/*.rs" + ] + } + } + } + ], + "library_target_name": "prettyplease", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "deps": { + "common": [ + { + "id": "prettyplease 0.2.22", + "target": "build_script_build" + }, + { + "id": "proc-macro2 1.0.86", + "target": "proc_macro2" + }, + { + "id": "syn 2.0.77", + "target": "syn" + } + ], + "selects": {} + }, + "edition": "2021", + "version": "0.2.22" + }, + "build_script_attrs": { + "compile_data_glob": [ + "**" + ], + "data_glob": [ + "**" + ], + "links": "prettyplease02" + }, + "license": "MIT OR Apache-2.0", + "license_ids": [ + "Apache-2.0", + "MIT" + ], + "license_file": "LICENSE-APACHE" + }, + "proc-macro2 1.0.86": { + "name": "proc-macro2", + "version": "1.0.86", + "package_url": "https://github.com/dtolnay/proc-macro2", + "repository": { + "Http": { + "url": "https://static.crates.io/crates/proc-macro2/1.0.86/download", + "sha256": "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" + } + }, + "targets": [ + { + "Library": { + "crate_name": "proc_macro2", + "crate_root": "src/lib.rs", + "srcs": { + "allow_empty": true, + "include": [ + "**/*.rs" + ] + } + } + }, + { + "BuildScript": { + "crate_name": "build_script_build", + "crate_root": "build.rs", + "srcs": { + "allow_empty": true, + "include": [ + "**/*.rs" + ] + } + } + } + ], + "library_target_name": "proc_macro2", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "crate_features": { + "common": [ + "proc-macro" + ], + "selects": {} + }, + "deps": { + "common": [ + { + "id": "proc-macro2 1.0.86", + "target": "build_script_build" + }, + { + "id": "unicode-ident 1.0.13", + "target": "unicode_ident" + } + ], + "selects": {} + }, + "edition": "2021", + "version": "1.0.86" + }, + "build_script_attrs": { + "compile_data_glob": [ + "**" + ], + "data_glob": [ + "**" + ] + }, + "license": "MIT OR Apache-2.0", + "license_ids": [ + "Apache-2.0", + "MIT" + ], + "license_file": "LICENSE-APACHE" + }, + "quote 1.0.37": { + "name": "quote", + "version": "1.0.37", + "package_url": "https://github.com/dtolnay/quote", + "repository": { + "Http": { + "url": "https://static.crates.io/crates/quote/1.0.37/download", + "sha256": "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" + } + }, + "targets": [ + { + "Library": { + "crate_name": "quote", + "crate_root": "src/lib.rs", + "srcs": { + "allow_empty": true, + "include": [ + "**/*.rs" + ] + } + } + } + ], + "library_target_name": "quote", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "crate_features": { + "common": [ + "proc-macro" + ], + "selects": {} + }, + "deps": { + "common": [ + { + "id": "proc-macro2 1.0.86", + "target": "proc_macro2" + } + ], + "selects": {} + }, + "edition": "2018", + "version": "1.0.37" + }, + "license": "MIT OR Apache-2.0", + "license_ids": [ + "Apache-2.0", + "MIT" + ], + "license_file": "LICENSE-APACHE" + }, + "regex 1.10.6": { + "name": "regex", + "version": "1.10.6", + "package_url": "https://github.com/rust-lang/regex", + "repository": { + "Http": { + "url": "https://static.crates.io/crates/regex/1.10.6/download", + "sha256": "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" + } + }, + "targets": [ + { + "Library": { + "crate_name": "regex", + "crate_root": "src/lib.rs", + "srcs": { + "allow_empty": true, + "include": [ + "**/*.rs" + ] + } + } + } + ], + "library_target_name": "regex", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "crate_features": { + "common": [ + "std", + "unicode", + "unicode-age", + "unicode-bool", + "unicode-case", + "unicode-gencat", + "unicode-perl", + "unicode-script", + "unicode-segment" + ], + "selects": {} + }, + "deps": { + "common": [ + { + "id": "regex-automata 0.4.7", + "target": "regex_automata" + }, + { + "id": "regex-syntax 0.8.4", + "target": "regex_syntax" + } + ], + "selects": {} + }, + "edition": "2021", + "version": "1.10.6" + }, + "license": "MIT OR Apache-2.0", + "license_ids": [ + "Apache-2.0", + "MIT" + ], + "license_file": "LICENSE-APACHE" + }, + "regex-automata 0.4.7": { + "name": "regex-automata", + "version": "0.4.7", + "package_url": "https://github.com/rust-lang/regex/tree/master/regex-automata", + "repository": { + "Http": { + "url": "https://static.crates.io/crates/regex-automata/0.4.7/download", + "sha256": "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" + } + }, + "targets": [ + { + "Library": { + "crate_name": "regex_automata", + "crate_root": "src/lib.rs", + "srcs": { + "allow_empty": true, + "include": [ + "**/*.rs" + ] + } + } + } + ], + "library_target_name": "regex_automata", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "crate_features": { + "common": [ + "alloc", + "meta", + "nfa-pikevm", + "nfa-thompson", + "std", + "syntax", + "unicode", + "unicode-age", + "unicode-bool", + "unicode-case", + "unicode-gencat", + "unicode-perl", + "unicode-script", + "unicode-segment", + "unicode-word-boundary" + ], + "selects": {} + }, + "deps": { + "common": [ + { + "id": "regex-syntax 0.8.4", + "target": "regex_syntax" + } + ], + "selects": {} + }, + "edition": "2021", + "version": "0.4.7" + }, + "license": "MIT OR Apache-2.0", + "license_ids": [ + "Apache-2.0", + "MIT" + ], + "license_file": "LICENSE-APACHE" + }, + "regex-syntax 0.8.4": { + "name": "regex-syntax", + "version": "0.8.4", + "package_url": "https://github.com/rust-lang/regex/tree/master/regex-syntax", + "repository": { + "Http": { + "url": "https://static.crates.io/crates/regex-syntax/0.8.4/download", + "sha256": "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" + } + }, + "targets": [ + { + "Library": { + "crate_name": "regex_syntax", + "crate_root": "src/lib.rs", + "srcs": { + "allow_empty": true, + "include": [ + "**/*.rs" + ] + } + } + } + ], + "library_target_name": "regex_syntax", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "crate_features": { + "common": [ + "std", + "unicode", + "unicode-age", + "unicode-bool", + "unicode-case", + "unicode-gencat", + "unicode-perl", + "unicode-script", + "unicode-segment" + ], + "selects": {} + }, + "edition": "2021", + "version": "0.8.4" + }, + "license": "MIT OR Apache-2.0", + "license_ids": [ + "Apache-2.0", + "MIT" + ], + "license_file": "LICENSE-APACHE" + }, + "rustc-hash 1.1.0": { + "name": "rustc-hash", + "version": "1.1.0", + "package_url": "https://github.com/rust-lang-nursery/rustc-hash", + "repository": { + "Http": { + "url": "https://static.crates.io/crates/rustc-hash/1.1.0/download", + "sha256": "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + } + }, + "targets": [ + { + "Library": { + "crate_name": "rustc_hash", + "crate_root": "src/lib.rs", + "srcs": { + "allow_empty": true, + "include": [ + "**/*.rs" + ] + } + } + } + ], + "library_target_name": "rustc_hash", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "crate_features": { + "common": [ + "default", + "std" + ], + "selects": {} + }, + "edition": "2015", + "version": "1.1.0" + }, + "license": "Apache-2.0/MIT", + "license_ids": [ + "Apache-2.0", + "MIT" + ], + "license_file": "LICENSE-APACHE" + }, + "rustix 0.38.37": { + "name": "rustix", + "version": "0.38.37", + "package_url": "https://github.com/bytecodealliance/rustix", + "repository": { + "Http": { + "url": "https://static.crates.io/crates/rustix/0.38.37/download", + "sha256": "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" + } + }, + "targets": [ + { + "Library": { + "crate_name": "rustix", + "crate_root": "src/lib.rs", + "srcs": { + "allow_empty": true, + "include": [ + "**/*.rs" + ] + } + } + }, + { + "BuildScript": { + "crate_name": "build_script_build", + "crate_root": "build.rs", + "srcs": { + "allow_empty": true, + "include": [ + "**/*.rs" + ] + } + } + } + ], + "library_target_name": "rustix", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "crate_features": { + "common": [ + "alloc", + "fs", + "libc-extra-traits", + "std" + ], + "selects": {} + }, + "deps": { + "common": [ + { + "id": "bitflags 2.6.0", + "target": "bitflags" + }, + { + "id": "rustix 0.38.37", + "target": "build_script_build" + } + ], + "selects": { + "cfg(all(any(target_os = \"android\", target_os = \"linux\"), any(rustix_use_libc, miri, not(all(target_os = \"linux\", target_endian = \"little\", any(target_arch = \"arm\", all(target_arch = \"aarch64\", target_pointer_width = \"64\"), target_arch = \"riscv64\", all(rustix_use_experimental_asm, target_arch = \"powerpc64\"), all(rustix_use_experimental_asm, target_arch = \"mips\"), all(rustix_use_experimental_asm, target_arch = \"mips32r6\"), all(rustix_use_experimental_asm, target_arch = \"mips64\"), all(rustix_use_experimental_asm, target_arch = \"mips64r6\"), target_arch = \"x86\", all(target_arch = \"x86_64\", target_pointer_width = \"64\")))))))": [ + { + "id": "linux-raw-sys 0.4.14", + "target": "linux_raw_sys" + } + ], + "cfg(all(not(rustix_use_libc), not(miri), target_os = \"linux\", target_endian = \"little\", any(target_arch = \"arm\", all(target_arch = \"aarch64\", target_pointer_width = \"64\"), target_arch = \"riscv64\", all(rustix_use_experimental_asm, target_arch = \"powerpc64\"), all(rustix_use_experimental_asm, target_arch = \"mips\"), all(rustix_use_experimental_asm, target_arch = \"mips32r6\"), all(rustix_use_experimental_asm, target_arch = \"mips64\"), all(rustix_use_experimental_asm, target_arch = \"mips64r6\"), target_arch = \"x86\", all(target_arch = \"x86_64\", target_pointer_width = \"64\"))))": [ + { + "id": "linux-raw-sys 0.4.14", + "target": "linux_raw_sys" + } + ], + "cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = \"linux\", target_endian = \"little\", any(target_arch = \"arm\", all(target_arch = \"aarch64\", target_pointer_width = \"64\"), target_arch = \"riscv64\", all(rustix_use_experimental_asm, target_arch = \"powerpc64\"), all(rustix_use_experimental_asm, target_arch = \"mips\"), all(rustix_use_experimental_asm, target_arch = \"mips32r6\"), all(rustix_use_experimental_asm, target_arch = \"mips64\"), all(rustix_use_experimental_asm, target_arch = \"mips64r6\"), target_arch = \"x86\", all(target_arch = \"x86_64\", target_pointer_width = \"64\")))))))": [ + { + "id": "errno 0.3.9", + "target": "errno", + "alias": "libc_errno" + }, + { + "id": "libc 0.2.158", + "target": "libc" + } + ], + "cfg(windows)": [ + { + "id": "errno 0.3.9", + "target": "errno", + "alias": "libc_errno" + }, + { + "id": "windows-sys 0.52.0", + "target": "windows_sys" + } + ] + } + }, + "edition": "2021", + "version": "0.38.37" + }, + "build_script_attrs": { + "compile_data_glob": [ + "**" + ], + "data_glob": [ + "**" + ] + }, + "license": "Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT", + "license_ids": [ + "Apache-2.0", + "MIT" + ], + "license_file": "LICENSE-APACHE" + }, + "shlex 1.3.0": { + "name": "shlex", + "version": "1.3.0", + "package_url": "https://github.com/comex/rust-shlex", + "repository": { + "Http": { + "url": "https://static.crates.io/crates/shlex/1.3.0/download", + "sha256": "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + } + }, + "targets": [ + { + "Library": { + "crate_name": "shlex", + "crate_root": "src/lib.rs", + "srcs": { + "allow_empty": true, + "include": [ + "**/*.rs" + ] + } + } + } + ], + "library_target_name": "shlex", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "crate_features": { + "common": [ + "default", + "std" + ], + "selects": {} + }, + "edition": "2015", + "version": "1.3.0" + }, + "license": "MIT OR Apache-2.0", + "license_ids": [ + "Apache-2.0", + "MIT" + ], + "license_file": "LICENSE-APACHE" + }, + "syn 2.0.77": { + "name": "syn", + "version": "2.0.77", + "package_url": "https://github.com/dtolnay/syn", + "repository": { + "Http": { + "url": "https://static.crates.io/crates/syn/2.0.77/download", + "sha256": "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" + } + }, + "targets": [ + { + "Library": { + "crate_name": "syn", + "crate_root": "src/lib.rs", + "srcs": { + "allow_empty": true, + "include": [ + "**/*.rs" + ] + } + } + } + ], + "library_target_name": "syn", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "crate_features": { + "common": [ + "clone-impls", + "default", + "derive", + "extra-traits", + "full", + "parsing", + "printing", + "proc-macro", + "visit-mut" + ], + "selects": {} + }, + "deps": { + "common": [ + { + "id": "proc-macro2 1.0.86", + "target": "proc_macro2" + }, + { + "id": "quote 1.0.37", + "target": "quote" + }, + { + "id": "unicode-ident 1.0.13", + "target": "unicode_ident" + } + ], + "selects": {} + }, + "edition": "2021", + "version": "2.0.77" + }, + "license": "MIT OR Apache-2.0", + "license_ids": [ + "Apache-2.0", + "MIT" + ], + "license_file": "LICENSE-APACHE" + }, + "unicode-ident 1.0.13": { + "name": "unicode-ident", + "version": "1.0.13", + "package_url": "https://github.com/dtolnay/unicode-ident", + "repository": { + "Http": { + "url": "https://static.crates.io/crates/unicode-ident/1.0.13/download", + "sha256": "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" + } + }, + "targets": [ + { + "Library": { + "crate_name": "unicode_ident", + "crate_root": "src/lib.rs", + "srcs": { + "allow_empty": true, + "include": [ + "**/*.rs" + ] + } + } + } + ], + "library_target_name": "unicode_ident", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "edition": "2018", + "version": "1.0.13" + }, + "license": "(MIT OR Apache-2.0) AND Unicode-DFS-2016", + "license_ids": [ + "Apache-2.0", + "MIT", + "Unicode-DFS-2016" + ], + "license_file": "LICENSE-APACHE" + }, + "which 4.4.2": { + "name": "which", + "version": "4.4.2", + "package_url": "https://github.com/harryfei/which-rs.git", + "repository": { + "Http": { + "url": "https://static.crates.io/crates/which/4.4.2/download", + "sha256": "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" + } + }, + "targets": [ + { + "Library": { + "crate_name": "which", + "crate_root": "src/lib.rs", + "srcs": { + "allow_empty": true, + "include": [ + "**/*.rs" + ] + } + } + } + ], + "library_target_name": "which", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "deps": { + "common": [ + { + "id": "either 1.13.0", + "target": "either" + }, + { + "id": "rustix 0.38.37", + "target": "rustix" + } + ], + "selects": { + "cfg(any(windows, unix, target_os = \"redox\"))": [ + { + "id": "home 0.5.9", + "target": "home" + } + ], + "cfg(windows)": [ + { + "id": "once_cell 1.19.0", + "target": "once_cell" + } + ] + } + }, + "edition": "2021", + "version": "4.4.2" + }, + "license": "MIT", + "license_ids": [ + "MIT" + ], + "license_file": "LICENSE.txt" + }, + "windows-sys 0.52.0": { + "name": "windows-sys", + "version": "0.52.0", + "package_url": "https://github.com/microsoft/windows-rs", + "repository": { + "Http": { + "url": "https://static.crates.io/crates/windows-sys/0.52.0/download", + "sha256": "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" + } + }, + "targets": [ + { + "Library": { + "crate_name": "windows_sys", + "crate_root": "src/lib.rs", + "srcs": { + "allow_empty": true, + "include": [ + "**/*.rs" + ] + } + } + } + ], + "library_target_name": "windows_sys", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "deps": { + "common": [ + { + "id": "windows-targets 0.52.6", + "target": "windows_targets" + } + ], + "selects": {} + }, + "edition": "2021", + "version": "0.52.0" + }, + "license": "MIT OR Apache-2.0", + "license_ids": [ + "Apache-2.0", + "MIT" + ], + "license_file": "license-apache-2.0" + }, + "windows-targets 0.52.6": { + "name": "windows-targets", + "version": "0.52.6", + "package_url": "https://github.com/microsoft/windows-rs", + "repository": { + "Http": { + "url": "https://static.crates.io/crates/windows-targets/0.52.6/download", + "sha256": "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" + } + }, + "targets": [ + { + "Library": { + "crate_name": "windows_targets", + "crate_root": "src/lib.rs", + "srcs": { + "allow_empty": true, + "include": [ + "**/*.rs" + ] + } + } + } + ], + "library_target_name": "windows_targets", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "deps": { + "common": [], + "selects": { + "aarch64-pc-windows-gnullvm": [ + { + "id": "windows_aarch64_gnullvm 0.52.6", + "target": "windows_aarch64_gnullvm" + } + ], + "cfg(all(any(target_arch = \"x86_64\", target_arch = \"arm64ec\"), target_env = \"msvc\", not(windows_raw_dylib)))": [ + { + "id": "windows_x86_64_msvc 0.52.6", + "target": "windows_x86_64_msvc" + } + ], + "cfg(all(target_arch = \"aarch64\", target_env = \"msvc\", not(windows_raw_dylib)))": [ + { + "id": "windows_aarch64_msvc 0.52.6", + "target": "windows_aarch64_msvc" + } + ], + "cfg(all(target_arch = \"x86\", target_env = \"gnu\", not(target_abi = \"llvm\"), not(windows_raw_dylib)))": [ + { + "id": "windows_i686_gnu 0.52.6", + "target": "windows_i686_gnu" + } + ], + "cfg(all(target_arch = \"x86\", target_env = \"msvc\", not(windows_raw_dylib)))": [ + { + "id": "windows_i686_msvc 0.52.6", + "target": "windows_i686_msvc" + } + ], + "cfg(all(target_arch = \"x86_64\", target_env = \"gnu\", not(target_abi = \"llvm\"), not(windows_raw_dylib)))": [ + { + "id": "windows_x86_64_gnu 0.52.6", + "target": "windows_x86_64_gnu" + } + ], + "i686-pc-windows-gnullvm": [ + { + "id": "windows_i686_gnullvm 0.52.6", + "target": "windows_i686_gnullvm" + } + ], + "x86_64-pc-windows-gnullvm": [ + { + "id": "windows_x86_64_gnullvm 0.52.6", + "target": "windows_x86_64_gnullvm" + } + ] + } + }, + "edition": "2021", + "version": "0.52.6" + }, + "license": "MIT OR Apache-2.0", + "license_ids": [ + "Apache-2.0", + "MIT" + ], + "license_file": "license-apache-2.0" + }, + "windows_aarch64_gnullvm 0.52.6": { + "name": "windows_aarch64_gnullvm", + "version": "0.52.6", + "package_url": "https://github.com/microsoft/windows-rs", + "repository": { + "Http": { + "url": "https://static.crates.io/crates/windows_aarch64_gnullvm/0.52.6/download", + "sha256": "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + } + }, + "targets": [ + { + "Library": { + "crate_name": "windows_aarch64_gnullvm", + "crate_root": "src/lib.rs", + "srcs": { + "allow_empty": true, + "include": [ + "**/*.rs" + ] + } + } + }, + { + "BuildScript": { + "crate_name": "build_script_build", + "crate_root": "build.rs", + "srcs": { + "allow_empty": true, + "include": [ + "**/*.rs" + ] + } + } + } + ], + "library_target_name": "windows_aarch64_gnullvm", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "deps": { + "common": [ + { + "id": "windows_aarch64_gnullvm 0.52.6", + "target": "build_script_build" + } + ], + "selects": {} + }, + "edition": "2021", + "version": "0.52.6" + }, + "build_script_attrs": { + "compile_data_glob": [ + "**" + ], + "data_glob": [ + "**" + ] + }, + "license": "MIT OR Apache-2.0", + "license_ids": [ + "Apache-2.0", + "MIT" + ], + "license_file": "license-apache-2.0" + }, + "windows_aarch64_msvc 0.52.6": { + "name": "windows_aarch64_msvc", + "version": "0.52.6", + "package_url": "https://github.com/microsoft/windows-rs", + "repository": { + "Http": { + "url": "https://static.crates.io/crates/windows_aarch64_msvc/0.52.6/download", + "sha256": "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + } + }, + "targets": [ + { + "Library": { + "crate_name": "windows_aarch64_msvc", + "crate_root": "src/lib.rs", + "srcs": { + "allow_empty": true, + "include": [ + "**/*.rs" + ] + } + } + }, + { + "BuildScript": { + "crate_name": "build_script_build", + "crate_root": "build.rs", + "srcs": { + "allow_empty": true, + "include": [ + "**/*.rs" + ] + } + } + } + ], + "library_target_name": "windows_aarch64_msvc", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "deps": { + "common": [ + { + "id": "windows_aarch64_msvc 0.52.6", + "target": "build_script_build" + } + ], + "selects": {} + }, + "edition": "2021", + "version": "0.52.6" + }, + "build_script_attrs": { + "compile_data_glob": [ + "**" + ], + "data_glob": [ + "**" + ] + }, + "license": "MIT OR Apache-2.0", + "license_ids": [ + "Apache-2.0", + "MIT" + ], + "license_file": "license-apache-2.0" + }, + "windows_i686_gnu 0.52.6": { + "name": "windows_i686_gnu", + "version": "0.52.6", + "package_url": "https://github.com/microsoft/windows-rs", + "repository": { + "Http": { + "url": "https://static.crates.io/crates/windows_i686_gnu/0.52.6/download", + "sha256": "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + } + }, + "targets": [ + { + "Library": { + "crate_name": "windows_i686_gnu", + "crate_root": "src/lib.rs", + "srcs": { + "allow_empty": true, + "include": [ + "**/*.rs" + ] + } + } + }, + { + "BuildScript": { + "crate_name": "build_script_build", + "crate_root": "build.rs", + "srcs": { + "allow_empty": true, + "include": [ + "**/*.rs" + ] + } + } + } + ], + "library_target_name": "windows_i686_gnu", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "deps": { + "common": [ + { + "id": "windows_i686_gnu 0.52.6", + "target": "build_script_build" + } + ], + "selects": {} + }, + "edition": "2021", + "version": "0.52.6" + }, + "build_script_attrs": { + "compile_data_glob": [ + "**" + ], + "data_glob": [ + "**" + ] + }, + "license": "MIT OR Apache-2.0", + "license_ids": [ + "Apache-2.0", + "MIT" + ], + "license_file": "license-apache-2.0" + }, + "windows_i686_gnullvm 0.52.6": { + "name": "windows_i686_gnullvm", + "version": "0.52.6", + "package_url": "https://github.com/microsoft/windows-rs", + "repository": { + "Http": { + "url": "https://static.crates.io/crates/windows_i686_gnullvm/0.52.6/download", + "sha256": "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + } + }, + "targets": [ + { + "Library": { + "crate_name": "windows_i686_gnullvm", + "crate_root": "src/lib.rs", + "srcs": { + "allow_empty": true, + "include": [ + "**/*.rs" + ] + } + } + }, + { + "BuildScript": { + "crate_name": "build_script_build", + "crate_root": "build.rs", + "srcs": { + "allow_empty": true, + "include": [ + "**/*.rs" + ] + } + } + } + ], + "library_target_name": "windows_i686_gnullvm", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "deps": { + "common": [ + { + "id": "windows_i686_gnullvm 0.52.6", + "target": "build_script_build" + } + ], + "selects": {} + }, + "edition": "2021", + "version": "0.52.6" + }, + "build_script_attrs": { + "compile_data_glob": [ + "**" + ], + "data_glob": [ + "**" + ] + }, + "license": "MIT OR Apache-2.0", + "license_ids": [ + "Apache-2.0", + "MIT" + ], + "license_file": "license-apache-2.0" + }, + "windows_i686_msvc 0.52.6": { + "name": "windows_i686_msvc", + "version": "0.52.6", + "package_url": "https://github.com/microsoft/windows-rs", + "repository": { + "Http": { + "url": "https://static.crates.io/crates/windows_i686_msvc/0.52.6/download", + "sha256": "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + } + }, + "targets": [ + { + "Library": { + "crate_name": "windows_i686_msvc", + "crate_root": "src/lib.rs", + "srcs": { + "allow_empty": true, + "include": [ + "**/*.rs" + ] + } + } + }, + { + "BuildScript": { + "crate_name": "build_script_build", + "crate_root": "build.rs", + "srcs": { + "allow_empty": true, + "include": [ + "**/*.rs" + ] + } + } + } + ], + "library_target_name": "windows_i686_msvc", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "deps": { + "common": [ + { + "id": "windows_i686_msvc 0.52.6", + "target": "build_script_build" + } + ], + "selects": {} + }, + "edition": "2021", + "version": "0.52.6" + }, + "build_script_attrs": { + "compile_data_glob": [ + "**" + ], + "data_glob": [ + "**" + ] + }, + "license": "MIT OR Apache-2.0", + "license_ids": [ + "Apache-2.0", + "MIT" + ], + "license_file": "license-apache-2.0" + }, + "windows_x86_64_gnu 0.52.6": { + "name": "windows_x86_64_gnu", + "version": "0.52.6", + "package_url": "https://github.com/microsoft/windows-rs", + "repository": { + "Http": { + "url": "https://static.crates.io/crates/windows_x86_64_gnu/0.52.6/download", + "sha256": "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + } + }, + "targets": [ + { + "Library": { + "crate_name": "windows_x86_64_gnu", + "crate_root": "src/lib.rs", + "srcs": { + "allow_empty": true, + "include": [ + "**/*.rs" + ] + } + } + }, + { + "BuildScript": { + "crate_name": "build_script_build", + "crate_root": "build.rs", + "srcs": { + "allow_empty": true, + "include": [ + "**/*.rs" + ] + } + } + } + ], + "library_target_name": "windows_x86_64_gnu", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "deps": { + "common": [ + { + "id": "windows_x86_64_gnu 0.52.6", + "target": "build_script_build" + } + ], + "selects": {} + }, + "edition": "2021", + "version": "0.52.6" + }, + "build_script_attrs": { + "compile_data_glob": [ + "**" + ], + "data_glob": [ + "**" + ] + }, + "license": "MIT OR Apache-2.0", + "license_ids": [ + "Apache-2.0", + "MIT" + ], + "license_file": "license-apache-2.0" + }, + "windows_x86_64_gnullvm 0.52.6": { + "name": "windows_x86_64_gnullvm", + "version": "0.52.6", + "package_url": "https://github.com/microsoft/windows-rs", + "repository": { + "Http": { + "url": "https://static.crates.io/crates/windows_x86_64_gnullvm/0.52.6/download", + "sha256": "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + } + }, + "targets": [ + { + "Library": { + "crate_name": "windows_x86_64_gnullvm", + "crate_root": "src/lib.rs", + "srcs": { + "allow_empty": true, + "include": [ + "**/*.rs" + ] + } + } + }, + { + "BuildScript": { + "crate_name": "build_script_build", + "crate_root": "build.rs", + "srcs": { + "allow_empty": true, + "include": [ + "**/*.rs" + ] + } + } + } + ], + "library_target_name": "windows_x86_64_gnullvm", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "deps": { + "common": [ + { + "id": "windows_x86_64_gnullvm 0.52.6", + "target": "build_script_build" + } + ], + "selects": {} + }, + "edition": "2021", + "version": "0.52.6" + }, + "build_script_attrs": { + "compile_data_glob": [ + "**" + ], + "data_glob": [ + "**" + ] + }, + "license": "MIT OR Apache-2.0", + "license_ids": [ + "Apache-2.0", + "MIT" + ], + "license_file": "license-apache-2.0" + }, + "windows_x86_64_msvc 0.52.6": { + "name": "windows_x86_64_msvc", + "version": "0.52.6", + "package_url": "https://github.com/microsoft/windows-rs", + "repository": { + "Http": { + "url": "https://static.crates.io/crates/windows_x86_64_msvc/0.52.6/download", + "sha256": "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + } + }, + "targets": [ + { + "Library": { + "crate_name": "windows_x86_64_msvc", + "crate_root": "src/lib.rs", + "srcs": { + "allow_empty": true, + "include": [ + "**/*.rs" + ] + } + } + }, + { + "BuildScript": { + "crate_name": "build_script_build", + "crate_root": "build.rs", + "srcs": { + "allow_empty": true, + "include": [ + "**/*.rs" + ] + } + } + } + ], + "library_target_name": "windows_x86_64_msvc", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "deps": { + "common": [ + { + "id": "windows_x86_64_msvc 0.52.6", + "target": "build_script_build" + } + ], + "selects": {} + }, + "edition": "2021", + "version": "0.52.6" + }, + "build_script_attrs": { + "compile_data_glob": [ + "**" + ], + "data_glob": [ + "**" + ] + }, + "license": "MIT OR Apache-2.0", + "license_ids": [ + "Apache-2.0", + "MIT" + ], + "license_file": "license-apache-2.0" + } + }, + "binary_crates": [], + "workspace_members": { + "envoy-proxy-dynamic-modules-rust-sdk 0.1.0": "source/extensions/dynamic_modules/sdk/rust" + }, + "conditions": { + "aarch64-apple-darwin": [ + "aarch64-apple-darwin" + ], + "aarch64-apple-ios": [ + "aarch64-apple-ios" + ], + "aarch64-apple-ios-sim": [ + "aarch64-apple-ios-sim" + ], + "aarch64-fuchsia": [ + "aarch64-fuchsia" + ], + "aarch64-linux-android": [ + "aarch64-linux-android" + ], + "aarch64-pc-windows-gnullvm": [], + "aarch64-pc-windows-msvc": [ + "aarch64-pc-windows-msvc" + ], + "aarch64-unknown-linux-gnu": [ + "aarch64-unknown-linux-gnu" + ], + "aarch64-unknown-nixos-gnu": [ + "aarch64-unknown-nixos-gnu" + ], + "aarch64-unknown-nto-qnx710": [ + "aarch64-unknown-nto-qnx710" + ], + "arm-unknown-linux-gnueabi": [ + "arm-unknown-linux-gnueabi" + ], + "armv7-linux-androideabi": [ + "armv7-linux-androideabi" + ], + "armv7-unknown-linux-gnueabi": [ + "armv7-unknown-linux-gnueabi" + ], + "cfg(all(any(target_arch = \"x86_64\", target_arch = \"arm64ec\"), target_env = \"msvc\", not(windows_raw_dylib)))": [ + "x86_64-pc-windows-msvc" + ], + "cfg(all(any(target_os = \"android\", target_os = \"linux\"), any(rustix_use_libc, miri, not(all(target_os = \"linux\", target_endian = \"little\", any(target_arch = \"arm\", all(target_arch = \"aarch64\", target_pointer_width = \"64\"), target_arch = \"riscv64\", all(rustix_use_experimental_asm, target_arch = \"powerpc64\"), all(rustix_use_experimental_asm, target_arch = \"mips\"), all(rustix_use_experimental_asm, target_arch = \"mips32r6\"), all(rustix_use_experimental_asm, target_arch = \"mips64\"), all(rustix_use_experimental_asm, target_arch = \"mips64r6\"), target_arch = \"x86\", all(target_arch = \"x86_64\", target_pointer_width = \"64\")))))))": [ + "aarch64-linux-android", + "armv7-linux-androideabi", + "i686-linux-android", + "powerpc-unknown-linux-gnu", + "s390x-unknown-linux-gnu", + "x86_64-linux-android" + ], + "cfg(all(not(rustix_use_libc), not(miri), target_os = \"linux\", target_endian = \"little\", any(target_arch = \"arm\", all(target_arch = \"aarch64\", target_pointer_width = \"64\"), target_arch = \"riscv64\", all(rustix_use_experimental_asm, target_arch = \"powerpc64\"), all(rustix_use_experimental_asm, target_arch = \"mips\"), all(rustix_use_experimental_asm, target_arch = \"mips32r6\"), all(rustix_use_experimental_asm, target_arch = \"mips64\"), all(rustix_use_experimental_asm, target_arch = \"mips64r6\"), target_arch = \"x86\", all(target_arch = \"x86_64\", target_pointer_width = \"64\"))))": [ + "aarch64-unknown-linux-gnu", + "aarch64-unknown-nixos-gnu", + "arm-unknown-linux-gnueabi", + "armv7-unknown-linux-gnueabi", + "i686-unknown-linux-gnu", + "x86_64-unknown-linux-gnu", + "x86_64-unknown-nixos-gnu" + ], + "cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = \"linux\", target_endian = \"little\", any(target_arch = \"arm\", all(target_arch = \"aarch64\", target_pointer_width = \"64\"), target_arch = \"riscv64\", all(rustix_use_experimental_asm, target_arch = \"powerpc64\"), all(rustix_use_experimental_asm, target_arch = \"mips\"), all(rustix_use_experimental_asm, target_arch = \"mips32r6\"), all(rustix_use_experimental_asm, target_arch = \"mips64\"), all(rustix_use_experimental_asm, target_arch = \"mips64r6\"), target_arch = \"x86\", all(target_arch = \"x86_64\", target_pointer_width = \"64\")))))))": [ + "aarch64-apple-darwin", + "aarch64-apple-ios", + "aarch64-apple-ios-sim", + "aarch64-fuchsia", + "aarch64-linux-android", + "aarch64-unknown-nto-qnx710", + "armv7-linux-androideabi", + "i686-apple-darwin", + "i686-linux-android", + "i686-unknown-freebsd", + "powerpc-unknown-linux-gnu", + "riscv32imc-unknown-none-elf", + "riscv64gc-unknown-none-elf", + "s390x-unknown-linux-gnu", + "thumbv7em-none-eabi", + "thumbv8m.main-none-eabi", + "wasm32-unknown-unknown", + "wasm32-wasi", + "x86_64-apple-darwin", + "x86_64-apple-ios", + "x86_64-fuchsia", + "x86_64-linux-android", + "x86_64-unknown-freebsd", + "x86_64-unknown-none" + ], + "cfg(all(target_arch = \"aarch64\", target_env = \"msvc\", not(windows_raw_dylib)))": [ + "aarch64-pc-windows-msvc" + ], + "cfg(all(target_arch = \"x86\", target_env = \"gnu\", not(target_abi = \"llvm\"), not(windows_raw_dylib)))": [ + "i686-unknown-linux-gnu" + ], + "cfg(all(target_arch = \"x86\", target_env = \"msvc\", not(windows_raw_dylib)))": [ + "i686-pc-windows-msvc" + ], + "cfg(all(target_arch = \"x86_64\", target_env = \"gnu\", not(target_abi = \"llvm\"), not(windows_raw_dylib)))": [ + "x86_64-unknown-linux-gnu", + "x86_64-unknown-nixos-gnu" + ], + "cfg(any(windows, unix, target_os = \"redox\"))": [ + "aarch64-apple-darwin", + "aarch64-apple-ios", + "aarch64-apple-ios-sim", + "aarch64-fuchsia", + "aarch64-linux-android", + "aarch64-pc-windows-msvc", + "aarch64-unknown-linux-gnu", + "aarch64-unknown-nixos-gnu", + "aarch64-unknown-nto-qnx710", + "arm-unknown-linux-gnueabi", + "armv7-linux-androideabi", + "armv7-unknown-linux-gnueabi", + "i686-apple-darwin", + "i686-linux-android", + "i686-pc-windows-msvc", + "i686-unknown-freebsd", + "i686-unknown-linux-gnu", + "powerpc-unknown-linux-gnu", + "s390x-unknown-linux-gnu", + "x86_64-apple-darwin", + "x86_64-apple-ios", + "x86_64-fuchsia", + "x86_64-linux-android", + "x86_64-pc-windows-msvc", + "x86_64-unknown-freebsd", + "x86_64-unknown-linux-gnu", + "x86_64-unknown-nixos-gnu" + ], + "cfg(target_os = \"hermit\")": [], + "cfg(target_os = \"wasi\")": [ + "wasm32-wasi" + ], + "cfg(unix)": [ + "aarch64-apple-darwin", + "aarch64-apple-ios", + "aarch64-apple-ios-sim", + "aarch64-fuchsia", + "aarch64-linux-android", + "aarch64-unknown-linux-gnu", + "aarch64-unknown-nixos-gnu", + "aarch64-unknown-nto-qnx710", + "arm-unknown-linux-gnueabi", + "armv7-linux-androideabi", + "armv7-unknown-linux-gnueabi", + "i686-apple-darwin", + "i686-linux-android", + "i686-unknown-freebsd", + "i686-unknown-linux-gnu", + "powerpc-unknown-linux-gnu", + "s390x-unknown-linux-gnu", + "x86_64-apple-darwin", + "x86_64-apple-ios", + "x86_64-fuchsia", + "x86_64-linux-android", + "x86_64-unknown-freebsd", + "x86_64-unknown-linux-gnu", + "x86_64-unknown-nixos-gnu" + ], + "cfg(windows)": [ + "aarch64-pc-windows-msvc", + "i686-pc-windows-msvc", + "x86_64-pc-windows-msvc" + ], + "i686-apple-darwin": [ + "i686-apple-darwin" + ], + "i686-linux-android": [ + "i686-linux-android" + ], + "i686-pc-windows-gnullvm": [], + "i686-pc-windows-msvc": [ + "i686-pc-windows-msvc" + ], + "i686-unknown-freebsd": [ + "i686-unknown-freebsd" + ], + "i686-unknown-linux-gnu": [ + "i686-unknown-linux-gnu" + ], + "powerpc-unknown-linux-gnu": [ + "powerpc-unknown-linux-gnu" + ], + "riscv32imc-unknown-none-elf": [ + "riscv32imc-unknown-none-elf" + ], + "riscv64gc-unknown-none-elf": [ + "riscv64gc-unknown-none-elf" + ], + "s390x-unknown-linux-gnu": [ + "s390x-unknown-linux-gnu" + ], + "thumbv7em-none-eabi": [ + "thumbv7em-none-eabi" + ], + "thumbv8m.main-none-eabi": [ + "thumbv8m.main-none-eabi" + ], + "wasm32-unknown-unknown": [ + "wasm32-unknown-unknown" + ], + "wasm32-wasi": [ + "wasm32-wasi" + ], + "x86_64-apple-darwin": [ + "x86_64-apple-darwin" + ], + "x86_64-apple-ios": [ + "x86_64-apple-ios" + ], + "x86_64-fuchsia": [ + "x86_64-fuchsia" + ], + "x86_64-linux-android": [ + "x86_64-linux-android" + ], + "x86_64-pc-windows-gnullvm": [], + "x86_64-pc-windows-msvc": [ + "x86_64-pc-windows-msvc" + ], + "x86_64-unknown-freebsd": [ + "x86_64-unknown-freebsd" + ], + "x86_64-unknown-linux-gnu": [ + "x86_64-unknown-linux-gnu" + ], + "x86_64-unknown-nixos-gnu": [ + "x86_64-unknown-nixos-gnu" + ], + "x86_64-unknown-none": [ + "x86_64-unknown-none" + ] + }, + "direct_deps": [ + "bindgen 0.65.1" + ], + "direct_dev_deps": [] +} diff --git a/source/extensions/dynamic_modules/sdk/rust/README.md b/source/extensions/dynamic_modules/sdk/rust/README.md index dcdb374d62ae..0f82d6141ef6 100644 --- a/source/extensions/dynamic_modules/sdk/rust/README.md +++ b/source/extensions/dynamic_modules/sdk/rust/README.md @@ -1,4 +1,11 @@ # Envoy Dynamic Modules Rust SDK This directory contains the Rust SDK for the Dynamic Modules feature. This directory is organized in the way that it can be used as a standalone Rust crate. The SDK is basically the high-level abstraction layer for the Dynamic Modules ABI defined in the [abi.h](./abi.h). -This directory is organized in the way that it can be used as a standalone Rust crate, hence the ABI header file is a hard-copy of the original ABI header files, not symlinks. + +Note that this crate references the local ABI header files, so this is intended to be used as +``` +[dependencies] +envoy-proxy-dynamic-modules-rust-sdk = { git = "https://github.com/envoyproxy/envoy", tag = "v1.50.1" } +``` + +instead of `envoy-proxy-dynamic-modules-rust-sdk = "X.Y.Z"`. diff --git a/source/extensions/dynamic_modules/sdk/rust/abi.h b/source/extensions/dynamic_modules/sdk/rust/abi.h deleted file mode 100644 index badf6b962e4a..000000000000 --- a/source/extensions/dynamic_modules/sdk/rust/abi.h +++ /dev/null @@ -1,64 +0,0 @@ -#pragma once - -// NOLINT(namespace-envoy) - -// This is a pure C header file that defines the ABI of the core of dynamic modules used by Envoy. -// -// This must not contain any dependencies besides standard library since it is not only used by -// Envoy itself but also by dynamic module SDKs written in non-C++ languages. -// -// Currently, compatibility is only guaranteed by an exact version match between the Envoy -// codebase and the dynamic module SDKs. In the future, after the ABI is stabilized, we will revisit -// this restriction and hopefully provide a wider compatibility guarantee. Until then, Envoy -// checks the hash of the ABI header files to ensure that the dynamic modules are built against the -// same version of the ABI. - -#ifdef __cplusplus -extern "C" { -#endif - -// ----------------------------------------------------------------------------- -// ---------------------------------- Types ------------------------------------ -// ----------------------------------------------------------------------------- -// -// Types used in the ABI. The name of a type must be prefixed with "envoy_dynamic_module_type_". - -/** - * envoy_dynamic_module_type_abi_version represents a null-terminated string that contains the ABI - * version of the dynamic module. This is used to ensure that the dynamic module is built against - * the compatible version of the ABI. - */ -typedef const char* envoy_dynamic_module_type_abi_version; // NOLINT(modernize-use-using) - -// ----------------------------------------------------------------------------- -// ------------------------------- Event Hooks --------------------------------- -// ----------------------------------------------------------------------------- -// -// Event hooks are functions that are called by Envoy in response to certain events. -// The module must implement and export these functions in the dynamic module object file. -// -// Each event hook is defined as a function prototype. The symbol must be prefixed with -// "envoy_dynamic_module_on_". - -/** - * envoy_dynamic_module_on_program_init is called by the main thread exactly when the module is - * loaded. The function returns the ABI version of the dynamic module. If null is returned, the - * module will be unloaded immediately. - * - * For Envoy, the return value will be used to check the compatibility of the dynamic module. - * - * For dynamic modules, this is useful when they need to perform some process-wide - * initialization or check if the module is compatible with the platform, such as CPU features. - * Note that initialization routines of a dynamic module can also be performed without this function - * through constructor functions in an object file. However, normal constructors cannot be used - * to check compatibility and gracefully fail the initialization because there is no way to - * report an error to Envoy. - * - * @return envoy_dynamic_module_type_abi_version is the ABI version of the dynamic module. Null - * means the error and the module will be unloaded immediately. - */ -envoy_dynamic_module_type_abi_version envoy_dynamic_module_on_program_init(); - -#ifdef __cplusplus -} -#endif diff --git a/source/extensions/dynamic_modules/sdk/rust/build.rs b/source/extensions/dynamic_modules/sdk/rust/build.rs index 37622b5ca4a9..af83327e744c 100644 --- a/source/extensions/dynamic_modules/sdk/rust/build.rs +++ b/source/extensions/dynamic_modules/sdk/rust/build.rs @@ -4,7 +4,8 @@ use std::path::PathBuf; fn main() { println!("cargo:rerun-if-changed=abi.h"); let bindings = bindgen::Builder::default() - .header("abi.h") + .header("../../abi.h") + .header("../../abi_version.h") .parse_callbacks(Box::new(bindgen::CargoCallbacks)) .generate() .expect("Unable to generate bindings"); @@ -12,5 +13,5 @@ fn main() { let out_path = PathBuf::from(env::var("OUT_DIR").unwrap()); bindings .write_to_file(out_path.join("bindings.rs")) - .expect("Couldn't write bindings!"); + .expect("Couldn't write bindings"); } diff --git a/source/extensions/dynamic_modules/sdk/rust/src/lib.rs b/source/extensions/dynamic_modules/sdk/rust/src/lib.rs index 3a55c4392e16..5796d12fe9b1 100644 --- a/source/extensions/dynamic_modules/sdk/rust/src/lib.rs +++ b/source/extensions/dynamic_modules/sdk/rust/src/lib.rs @@ -6,7 +6,7 @@ /// This module contains the generated bindings for the envoy dynamic modules ABI. /// /// This is not meant to be used directly. -mod abi { +pub mod abi { include!(concat!(env!("OUT_DIR"), "/bindings.rs")); } @@ -33,9 +33,7 @@ macro_rules! declare_program_init { #[no_mangle] pub extern "C" fn envoy_dynamic_module_on_program_init() -> *const ::std::os::raw::c_char { if ($f()) { - // This magic number is sha256 of the ABI headers which must match the - // value in abi_version.h - b"4293760426255b24c25b97a18d9fd31b4d1956f10ba0ff2f723580a46ee8fa21\0".as_ptr() + envoy_proxy_dynamic_modules_rust_sdk::abi::kAbiVersion.as_ptr() as *const ::std::os::raw::c_char } else { ::std::ptr::null() diff --git a/test/extensions/dynamic_modules/BUILD b/test/extensions/dynamic_modules/BUILD index 5d1ce3838748..f136dd11269e 100644 --- a/test/extensions/dynamic_modules/BUILD +++ b/test/extensions/dynamic_modules/BUILD @@ -33,7 +33,6 @@ envoy_cc_test( srcs = ["abi_version_test.cc"], data = [ "//source/extensions/dynamic_modules:abi.h", - "//source/extensions/dynamic_modules/sdk/rust:abi.h", ], deps = [ "//source/common/common:hex_lib", diff --git a/test/extensions/dynamic_modules/abi_version_test.cc b/test/extensions/dynamic_modules/abi_version_test.cc index 029c7a1d2c71..958295281dde 100644 --- a/test/extensions/dynamic_modules/abi_version_test.cc +++ b/test/extensions/dynamic_modules/abi_version_test.cc @@ -27,17 +27,6 @@ TEST(DynamicModules, ABIVersionCheck) { EXPECT_EQ(sha256, kAbiVersion); } -// This test ensures that the copied ABI header files in the SDK directory are identical to the -// original ABI headers. -TEST(DynamicModules, ABIHeaderIdentical) { - const std::string original_abi_header = TestEnvironment::readFileToStringForTest( - TestEnvironment::substitute("{{ test_rundir }}/source/extensions/dynamic_modules/abi.h")); - const std::string rust_abi_header = - TestEnvironment::readFileToStringForTest(TestEnvironment::substitute( - "{{ test_rundir }}/source/extensions/dynamic_modules/sdk/rust/abi.h")); - EXPECT_EQ(original_abi_header, rust_abi_header); -} - } // namespace DynamicModules } // namespace Extensions } // namespace Envoy From 5d37fcd986f9384c99c051e11fe17106b13a3bbd Mon Sep 17 00:00:00 2001 From: Takeshi Yoneda Date: Fri, 20 Sep 2024 08:09:58 +0000 Subject: [PATCH 08/10] ok Signed-off-by: Takeshi Yoneda --- source/extensions/dynamic_modules/sdk/rust/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/extensions/dynamic_modules/sdk/rust/README.md b/source/extensions/dynamic_modules/sdk/rust/README.md index 0f82d6141ef6..634ff520f616 100644 --- a/source/extensions/dynamic_modules/sdk/rust/README.md +++ b/source/extensions/dynamic_modules/sdk/rust/README.md @@ -1,6 +1,6 @@ # Envoy Dynamic Modules Rust SDK -This directory contains the Rust SDK for the Dynamic Modules feature. This directory is organized in the way that it can be used as a standalone Rust crate. The SDK is basically the high-level abstraction layer for the Dynamic Modules ABI defined in the [abi.h](./abi.h). +This directory contains the Rust SDK for the Dynamic Modules feature. This directory is organized in the way that it can be used as a standalone Rust crate. The SDK is basically the high-level abstraction layer for the Dynamic Modules ABI defined in the [abi.h](../../abi.h). Note that this crate references the local ABI header files, so this is intended to be used as ``` From 0641dfe5209b743db830fa9f6650893ec0231d5d Mon Sep 17 00:00:00 2001 From: Takeshi Yoneda Date: Fri, 20 Sep 2024 08:25:07 +0000 Subject: [PATCH 09/10] fmt Signed-off-by: Takeshi Yoneda --- source/extensions/dynamic_modules/sdk/rust/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/extensions/dynamic_modules/sdk/rust/README.md b/source/extensions/dynamic_modules/sdk/rust/README.md index 634ff520f616..ffce6dbae4da 100644 --- a/source/extensions/dynamic_modules/sdk/rust/README.md +++ b/source/extensions/dynamic_modules/sdk/rust/README.md @@ -2,7 +2,7 @@ This directory contains the Rust SDK for the Dynamic Modules feature. This directory is organized in the way that it can be used as a standalone Rust crate. The SDK is basically the high-level abstraction layer for the Dynamic Modules ABI defined in the [abi.h](../../abi.h). -Note that this crate references the local ABI header files, so this is intended to be used as +Note that this crate references the local ABI header files, so this is intended to be used as ``` [dependencies] envoy-proxy-dynamic-modules-rust-sdk = { git = "https://github.com/envoyproxy/envoy", tag = "v1.50.1" } From 83bd9c9dd591bc955a2eb6db0e2e1c0804304053 Mon Sep 17 00:00:00 2001 From: Takeshi Yoneda Date: Sat, 21 Sep 2024 02:46:57 +0000 Subject: [PATCH 10/10] update Signed-off-by: Takeshi Yoneda --- .../dynamic_modules/sdk/rust/Cargo.Bazel.lock | 770 ++---------------- .../dynamic_modules/sdk/rust/Cargo.lock | 99 +-- .../dynamic_modules/sdk/rust/Cargo.toml | 2 +- .../dynamic_modules/sdk/rust/build.rs | 2 +- 4 files changed, 62 insertions(+), 811 deletions(-) diff --git a/source/extensions/dynamic_modules/sdk/rust/Cargo.Bazel.lock b/source/extensions/dynamic_modules/sdk/rust/Cargo.Bazel.lock index 001c57a6a1e6..fa6012f40646 100644 --- a/source/extensions/dynamic_modules/sdk/rust/Cargo.Bazel.lock +++ b/source/extensions/dynamic_modules/sdk/rust/Cargo.Bazel.lock @@ -1,5 +1,5 @@ { - "checksum": "0e90c306b0b4e0ef4337f6a839a73d398ae2727ba05a8bb7461f24be2e849f0f", + "checksum": "96b309ddded40cf6f46a62829d15a02d7253b4cc94af2ac1890e492f9c07e93f", "crates": { "aho-corasick 1.1.3": { "name": "aho-corasick", @@ -40,14 +40,14 @@ ], "license_file": "LICENSE-MIT" }, - "bindgen 0.65.1": { + "bindgen 0.70.1": { "name": "bindgen", - "version": "0.65.1", + "version": "0.70.1", "package_url": "https://github.com/rust-lang/rust-bindgen", "repository": { "Http": { - "url": "https://static.crates.io/crates/bindgen/0.65.1/download", - "sha256": "cfdf7b466f9a4903edc73f95d6d2bcd5baf8ae620638762244d3f60143643cc5" + "url": "https://static.crates.io/crates/bindgen/0.70.1/download", + "sha256": "f49d8fed880d473ea71efb9bf597651e77201bdd4893efe54c9e5d65ae04ce6f" } }, "targets": [ @@ -84,22 +84,20 @@ "crate_features": { "common": [ "default", - "log", "logging", - "runtime", - "which", - "which-rustfmt" + "prettyplease", + "runtime" ], "selects": {} }, "deps": { "common": [ { - "id": "bindgen 0.65.1", + "id": "bindgen 0.70.1", "target": "build_script_build" }, { - "id": "bitflags 1.3.2", + "id": "bitflags 2.6.0", "target": "bitflags" }, { @@ -111,21 +109,13 @@ "target": "clang_sys" }, { - "id": "lazy_static 1.5.0", - "target": "lazy_static" - }, - { - "id": "lazycell 1.3.0", - "target": "lazycell" + "id": "itertools 0.13.0", + "target": "itertools" }, { "id": "log 0.4.22", "target": "log" }, - { - "id": "peeking_take_while 0.1.2", - "target": "peeking_take_while" - }, { "id": "prettyplease 0.2.22", "target": "prettyplease" @@ -153,16 +143,12 @@ { "id": "syn 2.0.77", "target": "syn" - }, - { - "id": "which 4.4.2", - "target": "which" } ], "selects": {} }, "edition": "2018", - "version": "0.65.1" + "version": "0.70.1" }, "build_script_attrs": { "compile_data_glob": [ @@ -191,51 +177,6 @@ ], "license_file": "LICENSE" }, - "bitflags 1.3.2": { - "name": "bitflags", - "version": "1.3.2", - "package_url": "https://github.com/bitflags/bitflags", - "repository": { - "Http": { - "url": "https://static.crates.io/crates/bitflags/1.3.2/download", - "sha256": "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - } - }, - "targets": [ - { - "Library": { - "crate_name": "bitflags", - "crate_root": "src/lib.rs", - "srcs": { - "allow_empty": true, - "include": [ - "**/*.rs" - ] - } - } - } - ], - "library_target_name": "bitflags", - "common_attrs": { - "compile_data_glob": [ - "**" - ], - "crate_features": { - "common": [ - "default" - ], - "selects": {} - }, - "edition": "2018", - "version": "1.3.2" - }, - "license": "MIT/Apache-2.0", - "license_ids": [ - "Apache-2.0", - "MIT" - ], - "license_file": "LICENSE-APACHE" - }, "bitflags 2.6.0": { "name": "bitflags", "version": "2.6.0", @@ -265,12 +206,6 @@ "compile_data_glob": [ "**" ], - "crate_features": { - "common": [ - "std" - ], - "selects": {} - }, "edition": "2021", "version": "2.6.0" }, @@ -501,13 +436,6 @@ "compile_data_glob": [ "**" ], - "crate_features": { - "common": [ - "default", - "use_std" - ], - "selects": {} - }, "edition": "2018", "version": "1.13.0" }, @@ -576,7 +504,7 @@ "deps": { "common": [ { - "id": "bindgen 0.65.1", + "id": "bindgen 0.70.1", "target": "bindgen" } ], @@ -589,74 +517,6 @@ ], "license_file": null }, - "errno 0.3.9": { - "name": "errno", - "version": "0.3.9", - "package_url": "https://github.com/lambda-fairy/rust-errno", - "repository": { - "Http": { - "url": "https://static.crates.io/crates/errno/0.3.9/download", - "sha256": "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" - } - }, - "targets": [ - { - "Library": { - "crate_name": "errno", - "crate_root": "src/lib.rs", - "srcs": { - "allow_empty": true, - "include": [ - "**/*.rs" - ] - } - } - } - ], - "library_target_name": "errno", - "common_attrs": { - "compile_data_glob": [ - "**" - ], - "deps": { - "common": [], - "selects": { - "cfg(target_os = \"hermit\")": [ - { - "id": "libc 0.2.158", - "target": "libc" - } - ], - "cfg(target_os = \"wasi\")": [ - { - "id": "libc 0.2.158", - "target": "libc" - } - ], - "cfg(unix)": [ - { - "id": "libc 0.2.158", - "target": "libc" - } - ], - "cfg(windows)": [ - { - "id": "windows-sys 0.52.0", - "target": "windows_sys" - } - ] - } - }, - "edition": "2018", - "version": "0.3.9" - }, - "license": "MIT OR Apache-2.0", - "license_ids": [ - "Apache-2.0", - "MIT" - ], - "license_file": "LICENSE-APACHE" - }, "glob 0.3.1": { "name": "glob", "version": "0.3.1", @@ -696,20 +556,20 @@ ], "license_file": "LICENSE-APACHE" }, - "home 0.5.9": { - "name": "home", - "version": "0.5.9", - "package_url": "https://github.com/rust-lang/cargo", + "itertools 0.13.0": { + "name": "itertools", + "version": "0.13.0", + "package_url": "https://github.com/rust-itertools/itertools", "repository": { "Http": { - "url": "https://static.crates.io/crates/home/0.5.9/download", - "sha256": "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" + "url": "https://static.crates.io/crates/itertools/0.13.0/download", + "sha256": "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" } }, "targets": [ { "Library": { - "crate_name": "home", + "crate_name": "itertools", "crate_root": "src/lib.rs", "srcs": { "allow_empty": true, @@ -720,63 +580,22 @@ } } ], - "library_target_name": "home", + "library_target_name": "itertools", "common_attrs": { "compile_data_glob": [ "**" ], "deps": { - "common": [], - "selects": { - "cfg(windows)": [ - { - "id": "windows-sys 0.52.0", - "target": "windows_sys" - } - ] - } - }, - "edition": "2021", - "version": "0.5.9" - }, - "license": "MIT OR Apache-2.0", - "license_ids": [ - "Apache-2.0", - "MIT" - ], - "license_file": "LICENSE-APACHE" - }, - "lazy_static 1.5.0": { - "name": "lazy_static", - "version": "1.5.0", - "package_url": "https://github.com/rust-lang-nursery/lazy-static.rs", - "repository": { - "Http": { - "url": "https://static.crates.io/crates/lazy_static/1.5.0/download", - "sha256": "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" - } - }, - "targets": [ - { - "Library": { - "crate_name": "lazy_static", - "crate_root": "src/lib.rs", - "srcs": { - "allow_empty": true, - "include": [ - "**/*.rs" - ] + "common": [ + { + "id": "either 1.13.0", + "target": "either" } - } - } - ], - "library_target_name": "lazy_static", - "common_attrs": { - "compile_data_glob": [ - "**" - ], - "edition": "2015", - "version": "1.5.0" + ], + "selects": {} + }, + "edition": "2018", + "version": "0.13.0" }, "license": "MIT OR Apache-2.0", "license_ids": [ @@ -785,45 +604,6 @@ ], "license_file": "LICENSE-APACHE" }, - "lazycell 1.3.0": { - "name": "lazycell", - "version": "1.3.0", - "package_url": "https://github.com/indiv0/lazycell", - "repository": { - "Http": { - "url": "https://static.crates.io/crates/lazycell/1.3.0/download", - "sha256": "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" - } - }, - "targets": [ - { - "Library": { - "crate_name": "lazycell", - "crate_root": "src/lib.rs", - "srcs": { - "allow_empty": true, - "include": [ - "**/*.rs" - ] - } - } - } - ], - "library_target_name": "lazycell", - "common_attrs": { - "compile_data_glob": [ - "**" - ], - "edition": "2015", - "version": "1.3.0" - }, - "license": "MIT/Apache-2.0", - "license_ids": [ - "Apache-2.0", - "MIT" - ], - "license_file": "LICENSE-APACHE" - }, "libc 0.2.158": { "name": "libc", "version": "0.2.158", @@ -947,55 +727,6 @@ ], "license_file": "LICENSE" }, - "linux-raw-sys 0.4.14": { - "name": "linux-raw-sys", - "version": "0.4.14", - "package_url": "https://github.com/sunfishcode/linux-raw-sys", - "repository": { - "Http": { - "url": "https://static.crates.io/crates/linux-raw-sys/0.4.14/download", - "sha256": "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" - } - }, - "targets": [ - { - "Library": { - "crate_name": "linux_raw_sys", - "crate_root": "src/lib.rs", - "srcs": { - "allow_empty": true, - "include": [ - "**/*.rs" - ] - } - } - } - ], - "library_target_name": "linux_raw_sys", - "common_attrs": { - "compile_data_glob": [ - "**" - ], - "crate_features": { - "common": [ - "elf", - "errno", - "general", - "ioctl", - "no_std" - ], - "selects": {} - }, - "edition": "2021", - "version": "0.4.14" - }, - "license": "Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT", - "license_ids": [ - "Apache-2.0", - "MIT" - ], - "license_file": "LICENSE-APACHE" - }, "log 0.4.22": { "name": "log", "version": "0.4.22", @@ -1166,101 +897,23 @@ "common": [ { "id": "memchr 2.7.4", - "target": "memchr" - }, - { - "id": "minimal-lexical 0.2.1", - "target": "minimal_lexical" - } - ], - "selects": {} - }, - "edition": "2018", - "version": "7.1.3" - }, - "license": "MIT", - "license_ids": [ - "MIT" - ], - "license_file": "LICENSE" - }, - "once_cell 1.19.0": { - "name": "once_cell", - "version": "1.19.0", - "package_url": "https://github.com/matklad/once_cell", - "repository": { - "Http": { - "url": "https://static.crates.io/crates/once_cell/1.19.0/download", - "sha256": "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - } - }, - "targets": [ - { - "Library": { - "crate_name": "once_cell", - "crate_root": "src/lib.rs", - "srcs": { - "allow_empty": true, - "include": [ - "**/*.rs" - ] - } - } - } - ], - "library_target_name": "once_cell", - "common_attrs": { - "compile_data_glob": [ - "**" - ], - "edition": "2021", - "version": "1.19.0" - }, - "license": "MIT OR Apache-2.0", - "license_ids": [ - "Apache-2.0", - "MIT" - ], - "license_file": "LICENSE-APACHE" - }, - "peeking_take_while 0.1.2": { - "name": "peeking_take_while", - "version": "0.1.2", - "package_url": "https://github.com/fitzgen/peeking_take_while", - "repository": { - "Http": { - "url": "https://static.crates.io/crates/peeking_take_while/0.1.2/download", - "sha256": "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" - } - }, - "targets": [ - { - "Library": { - "crate_name": "peeking_take_while", - "crate_root": "src/lib.rs", - "srcs": { - "allow_empty": true, - "include": [ - "**/*.rs" - ] - } - } - } - ], - "library_target_name": "peeking_take_while", - "common_attrs": { - "compile_data_glob": [ - "**" - ], - "edition": "2015", - "version": "0.1.2" + "target": "memchr" + }, + { + "id": "minimal-lexical 0.2.1", + "target": "minimal_lexical" + } + ], + "selects": {} + }, + "edition": "2018", + "version": "7.1.3" }, - "license": "Apache-2.0/MIT", + "license": "MIT", "license_ids": [ - "Apache-2.0", "MIT" ], - "license_file": "LICENSE-APACHE" + "license_file": "LICENSE" }, "prettyplease 0.2.22": { "name": "prettyplease", @@ -1303,6 +956,12 @@ "compile_data_glob": [ "**" ], + "crate_features": { + "common": [ + "verbatim" + ], + "selects": {} + }, "deps": { "common": [ { @@ -1503,14 +1162,7 @@ "crate_features": { "common": [ "std", - "unicode", - "unicode-age", - "unicode-bool", - "unicode-case", - "unicode-gencat", - "unicode-perl", - "unicode-script", - "unicode-segment" + "unicode-perl" ], "selects": {} }, @@ -1574,14 +1226,7 @@ "nfa-thompson", "std", "syntax", - "unicode", - "unicode-age", - "unicode-bool", - "unicode-case", - "unicode-gencat", "unicode-perl", - "unicode-script", - "unicode-segment", "unicode-word-boundary" ], "selects": {} @@ -1637,14 +1282,7 @@ "crate_features": { "common": [ "std", - "unicode", - "unicode-age", - "unicode-bool", - "unicode-case", - "unicode-gencat", - "unicode-perl", - "unicode-script", - "unicode-segment" + "unicode-perl" ], "selects": {} }, @@ -1704,122 +1342,6 @@ ], "license_file": "LICENSE-APACHE" }, - "rustix 0.38.37": { - "name": "rustix", - "version": "0.38.37", - "package_url": "https://github.com/bytecodealliance/rustix", - "repository": { - "Http": { - "url": "https://static.crates.io/crates/rustix/0.38.37/download", - "sha256": "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" - } - }, - "targets": [ - { - "Library": { - "crate_name": "rustix", - "crate_root": "src/lib.rs", - "srcs": { - "allow_empty": true, - "include": [ - "**/*.rs" - ] - } - } - }, - { - "BuildScript": { - "crate_name": "build_script_build", - "crate_root": "build.rs", - "srcs": { - "allow_empty": true, - "include": [ - "**/*.rs" - ] - } - } - } - ], - "library_target_name": "rustix", - "common_attrs": { - "compile_data_glob": [ - "**" - ], - "crate_features": { - "common": [ - "alloc", - "fs", - "libc-extra-traits", - "std" - ], - "selects": {} - }, - "deps": { - "common": [ - { - "id": "bitflags 2.6.0", - "target": "bitflags" - }, - { - "id": "rustix 0.38.37", - "target": "build_script_build" - } - ], - "selects": { - "cfg(all(any(target_os = \"android\", target_os = \"linux\"), any(rustix_use_libc, miri, not(all(target_os = \"linux\", target_endian = \"little\", any(target_arch = \"arm\", all(target_arch = \"aarch64\", target_pointer_width = \"64\"), target_arch = \"riscv64\", all(rustix_use_experimental_asm, target_arch = \"powerpc64\"), all(rustix_use_experimental_asm, target_arch = \"mips\"), all(rustix_use_experimental_asm, target_arch = \"mips32r6\"), all(rustix_use_experimental_asm, target_arch = \"mips64\"), all(rustix_use_experimental_asm, target_arch = \"mips64r6\"), target_arch = \"x86\", all(target_arch = \"x86_64\", target_pointer_width = \"64\")))))))": [ - { - "id": "linux-raw-sys 0.4.14", - "target": "linux_raw_sys" - } - ], - "cfg(all(not(rustix_use_libc), not(miri), target_os = \"linux\", target_endian = \"little\", any(target_arch = \"arm\", all(target_arch = \"aarch64\", target_pointer_width = \"64\"), target_arch = \"riscv64\", all(rustix_use_experimental_asm, target_arch = \"powerpc64\"), all(rustix_use_experimental_asm, target_arch = \"mips\"), all(rustix_use_experimental_asm, target_arch = \"mips32r6\"), all(rustix_use_experimental_asm, target_arch = \"mips64\"), all(rustix_use_experimental_asm, target_arch = \"mips64r6\"), target_arch = \"x86\", all(target_arch = \"x86_64\", target_pointer_width = \"64\"))))": [ - { - "id": "linux-raw-sys 0.4.14", - "target": "linux_raw_sys" - } - ], - "cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = \"linux\", target_endian = \"little\", any(target_arch = \"arm\", all(target_arch = \"aarch64\", target_pointer_width = \"64\"), target_arch = \"riscv64\", all(rustix_use_experimental_asm, target_arch = \"powerpc64\"), all(rustix_use_experimental_asm, target_arch = \"mips\"), all(rustix_use_experimental_asm, target_arch = \"mips32r6\"), all(rustix_use_experimental_asm, target_arch = \"mips64\"), all(rustix_use_experimental_asm, target_arch = \"mips64r6\"), target_arch = \"x86\", all(target_arch = \"x86_64\", target_pointer_width = \"64\")))))))": [ - { - "id": "errno 0.3.9", - "target": "errno", - "alias": "libc_errno" - }, - { - "id": "libc 0.2.158", - "target": "libc" - } - ], - "cfg(windows)": [ - { - "id": "errno 0.3.9", - "target": "errno", - "alias": "libc_errno" - }, - { - "id": "windows-sys 0.52.0", - "target": "windows_sys" - } - ] - } - }, - "edition": "2021", - "version": "0.38.37" - }, - "build_script_attrs": { - "compile_data_glob": [ - "**" - ], - "data_glob": [ - "**" - ] - }, - "license": "Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT", - "license_ids": [ - "Apache-2.0", - "MIT" - ], - "license_file": "LICENSE-APACHE" - }, "shlex 1.3.0": { "name": "shlex", "version": "1.3.0", @@ -1976,118 +1498,6 @@ ], "license_file": "LICENSE-APACHE" }, - "which 4.4.2": { - "name": "which", - "version": "4.4.2", - "package_url": "https://github.com/harryfei/which-rs.git", - "repository": { - "Http": { - "url": "https://static.crates.io/crates/which/4.4.2/download", - "sha256": "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" - } - }, - "targets": [ - { - "Library": { - "crate_name": "which", - "crate_root": "src/lib.rs", - "srcs": { - "allow_empty": true, - "include": [ - "**/*.rs" - ] - } - } - } - ], - "library_target_name": "which", - "common_attrs": { - "compile_data_glob": [ - "**" - ], - "deps": { - "common": [ - { - "id": "either 1.13.0", - "target": "either" - }, - { - "id": "rustix 0.38.37", - "target": "rustix" - } - ], - "selects": { - "cfg(any(windows, unix, target_os = \"redox\"))": [ - { - "id": "home 0.5.9", - "target": "home" - } - ], - "cfg(windows)": [ - { - "id": "once_cell 1.19.0", - "target": "once_cell" - } - ] - } - }, - "edition": "2021", - "version": "4.4.2" - }, - "license": "MIT", - "license_ids": [ - "MIT" - ], - "license_file": "LICENSE.txt" - }, - "windows-sys 0.52.0": { - "name": "windows-sys", - "version": "0.52.0", - "package_url": "https://github.com/microsoft/windows-rs", - "repository": { - "Http": { - "url": "https://static.crates.io/crates/windows-sys/0.52.0/download", - "sha256": "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" - } - }, - "targets": [ - { - "Library": { - "crate_name": "windows_sys", - "crate_root": "src/lib.rs", - "srcs": { - "allow_empty": true, - "include": [ - "**/*.rs" - ] - } - } - } - ], - "library_target_name": "windows_sys", - "common_attrs": { - "compile_data_glob": [ - "**" - ], - "deps": { - "common": [ - { - "id": "windows-targets 0.52.6", - "target": "windows_targets" - } - ], - "selects": {} - }, - "edition": "2021", - "version": "0.52.0" - }, - "license": "MIT OR Apache-2.0", - "license_ids": [ - "Apache-2.0", - "MIT" - ], - "license_file": "license-apache-2.0" - }, "windows-targets 0.52.6": { "name": "windows-targets", "version": "0.52.6", @@ -2770,49 +2180,6 @@ "cfg(all(any(target_arch = \"x86_64\", target_arch = \"arm64ec\"), target_env = \"msvc\", not(windows_raw_dylib)))": [ "x86_64-pc-windows-msvc" ], - "cfg(all(any(target_os = \"android\", target_os = \"linux\"), any(rustix_use_libc, miri, not(all(target_os = \"linux\", target_endian = \"little\", any(target_arch = \"arm\", all(target_arch = \"aarch64\", target_pointer_width = \"64\"), target_arch = \"riscv64\", all(rustix_use_experimental_asm, target_arch = \"powerpc64\"), all(rustix_use_experimental_asm, target_arch = \"mips\"), all(rustix_use_experimental_asm, target_arch = \"mips32r6\"), all(rustix_use_experimental_asm, target_arch = \"mips64\"), all(rustix_use_experimental_asm, target_arch = \"mips64r6\"), target_arch = \"x86\", all(target_arch = \"x86_64\", target_pointer_width = \"64\")))))))": [ - "aarch64-linux-android", - "armv7-linux-androideabi", - "i686-linux-android", - "powerpc-unknown-linux-gnu", - "s390x-unknown-linux-gnu", - "x86_64-linux-android" - ], - "cfg(all(not(rustix_use_libc), not(miri), target_os = \"linux\", target_endian = \"little\", any(target_arch = \"arm\", all(target_arch = \"aarch64\", target_pointer_width = \"64\"), target_arch = \"riscv64\", all(rustix_use_experimental_asm, target_arch = \"powerpc64\"), all(rustix_use_experimental_asm, target_arch = \"mips\"), all(rustix_use_experimental_asm, target_arch = \"mips32r6\"), all(rustix_use_experimental_asm, target_arch = \"mips64\"), all(rustix_use_experimental_asm, target_arch = \"mips64r6\"), target_arch = \"x86\", all(target_arch = \"x86_64\", target_pointer_width = \"64\"))))": [ - "aarch64-unknown-linux-gnu", - "aarch64-unknown-nixos-gnu", - "arm-unknown-linux-gnueabi", - "armv7-unknown-linux-gnueabi", - "i686-unknown-linux-gnu", - "x86_64-unknown-linux-gnu", - "x86_64-unknown-nixos-gnu" - ], - "cfg(all(not(windows), any(rustix_use_libc, miri, not(all(target_os = \"linux\", target_endian = \"little\", any(target_arch = \"arm\", all(target_arch = \"aarch64\", target_pointer_width = \"64\"), target_arch = \"riscv64\", all(rustix_use_experimental_asm, target_arch = \"powerpc64\"), all(rustix_use_experimental_asm, target_arch = \"mips\"), all(rustix_use_experimental_asm, target_arch = \"mips32r6\"), all(rustix_use_experimental_asm, target_arch = \"mips64\"), all(rustix_use_experimental_asm, target_arch = \"mips64r6\"), target_arch = \"x86\", all(target_arch = \"x86_64\", target_pointer_width = \"64\")))))))": [ - "aarch64-apple-darwin", - "aarch64-apple-ios", - "aarch64-apple-ios-sim", - "aarch64-fuchsia", - "aarch64-linux-android", - "aarch64-unknown-nto-qnx710", - "armv7-linux-androideabi", - "i686-apple-darwin", - "i686-linux-android", - "i686-unknown-freebsd", - "powerpc-unknown-linux-gnu", - "riscv32imc-unknown-none-elf", - "riscv64gc-unknown-none-elf", - "s390x-unknown-linux-gnu", - "thumbv7em-none-eabi", - "thumbv8m.main-none-eabi", - "wasm32-unknown-unknown", - "wasm32-wasi", - "x86_64-apple-darwin", - "x86_64-apple-ios", - "x86_64-fuchsia", - "x86_64-linux-android", - "x86_64-unknown-freebsd", - "x86_64-unknown-none" - ], "cfg(all(target_arch = \"aarch64\", target_env = \"msvc\", not(windows_raw_dylib)))": [ "aarch64-pc-windows-msvc" ], @@ -2826,39 +2193,6 @@ "x86_64-unknown-linux-gnu", "x86_64-unknown-nixos-gnu" ], - "cfg(any(windows, unix, target_os = \"redox\"))": [ - "aarch64-apple-darwin", - "aarch64-apple-ios", - "aarch64-apple-ios-sim", - "aarch64-fuchsia", - "aarch64-linux-android", - "aarch64-pc-windows-msvc", - "aarch64-unknown-linux-gnu", - "aarch64-unknown-nixos-gnu", - "aarch64-unknown-nto-qnx710", - "arm-unknown-linux-gnueabi", - "armv7-linux-androideabi", - "armv7-unknown-linux-gnueabi", - "i686-apple-darwin", - "i686-linux-android", - "i686-pc-windows-msvc", - "i686-unknown-freebsd", - "i686-unknown-linux-gnu", - "powerpc-unknown-linux-gnu", - "s390x-unknown-linux-gnu", - "x86_64-apple-darwin", - "x86_64-apple-ios", - "x86_64-fuchsia", - "x86_64-linux-android", - "x86_64-pc-windows-msvc", - "x86_64-unknown-freebsd", - "x86_64-unknown-linux-gnu", - "x86_64-unknown-nixos-gnu" - ], - "cfg(target_os = \"hermit\")": [], - "cfg(target_os = \"wasi\")": [ - "wasm32-wasi" - ], "cfg(unix)": [ "aarch64-apple-darwin", "aarch64-apple-ios", @@ -2960,7 +2294,7 @@ ] }, "direct_deps": [ - "bindgen 0.65.1" + "bindgen 0.70.1" ], "direct_dev_deps": [] } diff --git a/source/extensions/dynamic_modules/sdk/rust/Cargo.lock b/source/extensions/dynamic_modules/sdk/rust/Cargo.lock index 41af8dc487ab..8c86727781a8 100644 --- a/source/extensions/dynamic_modules/sdk/rust/Cargo.lock +++ b/source/extensions/dynamic_modules/sdk/rust/Cargo.lock @@ -13,17 +13,15 @@ dependencies = [ [[package]] name = "bindgen" -version = "0.65.1" +version = "0.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfdf7b466f9a4903edc73f95d6d2bcd5baf8ae620638762244d3f60143643cc5" +checksum = "f49d8fed880d473ea71efb9bf597651e77201bdd4893efe54c9e5d65ae04ce6f" dependencies = [ - "bitflags 1.3.2", + "bitflags", "cexpr", "clang-sys", - "lazy_static", - "lazycell", + "itertools", "log", - "peeking_take_while", "prettyplease", "proc-macro2", "quote", @@ -31,15 +29,8 @@ dependencies = [ "rustc-hash", "shlex", "syn", - "which", ] -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - [[package]] name = "bitflags" version = "2.6.0" @@ -85,16 +76,6 @@ dependencies = [ "bindgen", ] -[[package]] -name = "errno" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" -dependencies = [ - "libc", - "windows-sys", -] - [[package]] name = "glob" version = "0.3.1" @@ -102,26 +83,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] -name = "home" -version = "0.5.9" +name = "itertools" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" dependencies = [ - "windows-sys", + "either", ] -[[package]] -name = "lazy_static" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" - -[[package]] -name = "lazycell" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" - [[package]] name = "libc" version = "0.2.158" @@ -138,12 +107,6 @@ dependencies = [ "windows-targets", ] -[[package]] -name = "linux-raw-sys" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" - [[package]] name = "log" version = "0.4.22" @@ -172,18 +135,6 @@ dependencies = [ "minimal-lexical", ] -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[package]] -name = "peeking_take_while" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" - [[package]] name = "prettyplease" version = "0.2.22" @@ -247,19 +198,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" -[[package]] -name = "rustix" -version = "0.38.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" -dependencies = [ - "bitflags 2.6.0", - "errno", - "libc", - "linux-raw-sys", - "windows-sys", -] - [[package]] name = "shlex" version = "1.3.0" @@ -283,27 +221,6 @@ version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" -[[package]] -name = "which" -version = "4.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" -dependencies = [ - "either", - "home", - "once_cell", - "rustix", -] - -[[package]] -name = "windows-sys" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" -dependencies = [ - "windows-targets", -] - [[package]] name = "windows-targets" version = "0.52.6" diff --git a/source/extensions/dynamic_modules/sdk/rust/Cargo.toml b/source/extensions/dynamic_modules/sdk/rust/Cargo.toml index b7073aa81d96..14a1faf6353b 100644 --- a/source/extensions/dynamic_modules/sdk/rust/Cargo.toml +++ b/source/extensions/dynamic_modules/sdk/rust/Cargo.toml @@ -10,6 +10,6 @@ repository = "https://github.com/envoyproxy/envoy" [dependencies] [build-dependencies] -bindgen = "0.65.1" +bindgen = "0.70.1" [lib] diff --git a/source/extensions/dynamic_modules/sdk/rust/build.rs b/source/extensions/dynamic_modules/sdk/rust/build.rs index af83327e744c..d3ad0d987e77 100644 --- a/source/extensions/dynamic_modules/sdk/rust/build.rs +++ b/source/extensions/dynamic_modules/sdk/rust/build.rs @@ -6,7 +6,7 @@ fn main() { let bindings = bindgen::Builder::default() .header("../../abi.h") .header("../../abi_version.h") - .parse_callbacks(Box::new(bindgen::CargoCallbacks)) + .parse_callbacks(Box::new(bindgen::CargoCallbacks::new())) .generate() .expect("Unable to generate bindings");