From 87e87d82549c2aa7595bfc81a9b3cc8b8ddd5993 Mon Sep 17 00:00:00 2001 From: Piotr Sikora Date: Sun, 27 Oct 2024 12:22:10 -0400 Subject: [PATCH 01/15] Update version to v0.2.3-dev. (#272) Found with cargo publish (nightly). Signed-off-by: Piotr Sikora --- Cargo.toml | 2 +- bazel/cargo/Cargo.Bazel.lock | 2 +- bazel/cargo/remote/BUILD.bazel | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index c59d968c..500f4447 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "proxy-wasm" -version = "0.2.2" +version = "0.2.3-dev" authors = ["Piotr Sikora "] rust-version = "1.64" description = "WebAssembly for Proxies" diff --git a/bazel/cargo/Cargo.Bazel.lock b/bazel/cargo/Cargo.Bazel.lock index 94a3d133..8130736f 100644 --- a/bazel/cargo/Cargo.Bazel.lock +++ b/bazel/cargo/Cargo.Bazel.lock @@ -59,7 +59,7 @@ dependencies = [ [[package]] name = "proxy-wasm" -version = "0.2.2" +version = "0.2.3-dev" dependencies = [ "hashbrown", "log", diff --git a/bazel/cargo/remote/BUILD.bazel b/bazel/cargo/remote/BUILD.bazel index 5392ecbc..af7cfc33 100644 --- a/bazel/cargo/remote/BUILD.bazel +++ b/bazel/cargo/remote/BUILD.bazel @@ -45,6 +45,6 @@ alias( alias( name = "proxy-wasm", - actual = "@crates_vendor__proxy-wasm-0.2.2//:proxy_wasm", + actual = "@crates_vendor__proxy-wasm-0.2.3-dev//:proxy_wasm", tags = ["manual"], ) From 236626b60055566678e46588a18772de044d9523 Mon Sep 17 00:00:00 2001 From: Piotr Sikora Date: Sun, 27 Oct 2024 12:32:13 -0400 Subject: [PATCH 02/15] Update hashbrown to v0.15. (#273) Signed-off-by: Piotr Sikora --- Cargo.toml | 2 +- bazel/cargo/Cargo.Bazel.lock | 98 +------- bazel/cargo/remote/BUILD.ahash-0.8.11.bazel | 230 ------------------ bazel/cargo/remote/BUILD.bazel | 2 +- ...9.4.bazel => BUILD.equivalent-1.0.1.bazel} | 6 +- ...1.0.0.bazel => BUILD.foldhash-0.1.3.bazel} | 8 +- ...4.5.bazel => BUILD.hashbrown-0.15.0.bazel} | 9 +- .../cargo/remote/BUILD.once_cell-1.19.0.bazel | 85 ------- .../remote/BUILD.proc-macro2-1.0.86.bazel | 128 ---------- bazel/cargo/remote/BUILD.quote-1.0.36.bazel | 84 ------- bazel/cargo/remote/BUILD.syn-2.0.71.bazel | 85 ------- .../remote/BUILD.unicode-ident-1.0.12.bazel | 81 ------ .../cargo/remote/BUILD.zerocopy-0.7.35.bazel | 84 ------- .../remote/BUILD.zerocopy-derive-0.7.35.bazel | 86 ------- bazel/cargo/remote/defs.bzl | 126 ++-------- 15 files changed, 50 insertions(+), 1064 deletions(-) delete mode 100644 bazel/cargo/remote/BUILD.ahash-0.8.11.bazel rename bazel/cargo/remote/{BUILD.version_check-0.9.4.bazel => BUILD.equivalent-1.0.1.bazel} (97%) rename bazel/cargo/remote/{BUILD.cfg-if-1.0.0.bazel => BUILD.foldhash-0.1.3.bazel} (97%) rename bazel/cargo/remote/{BUILD.hashbrown-0.14.5.bazel => BUILD.hashbrown-0.15.0.bazel} (94%) delete mode 100644 bazel/cargo/remote/BUILD.once_cell-1.19.0.bazel delete mode 100644 bazel/cargo/remote/BUILD.proc-macro2-1.0.86.bazel delete mode 100644 bazel/cargo/remote/BUILD.quote-1.0.36.bazel delete mode 100644 bazel/cargo/remote/BUILD.syn-2.0.71.bazel delete mode 100644 bazel/cargo/remote/BUILD.unicode-ident-1.0.12.bazel delete mode 100644 bazel/cargo/remote/BUILD.zerocopy-0.7.35.bazel delete mode 100644 bazel/cargo/remote/BUILD.zerocopy-derive-0.7.35.bazel diff --git a/Cargo.toml b/Cargo.toml index 500f4447..24193eb8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,7 @@ edition = "2018" build = "build.rs" [dependencies] -hashbrown = "0.14" +hashbrown = "0.15" log = "0.4" [profile.release] diff --git a/bazel/cargo/Cargo.Bazel.lock b/bazel/cargo/Cargo.Bazel.lock index 8130736f..f4d451ea 100644 --- a/bazel/cargo/Cargo.Bazel.lock +++ b/bazel/cargo/Cargo.Bazel.lock @@ -2,18 +2,6 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "ahash" -version = "0.8.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - [[package]] name = "allocator-api2" version = "0.2.18" @@ -21,19 +9,26 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" [[package]] -name = "cfg-if" -version = "1.0.0" +name = "equivalent" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" + +[[package]] +name = "foldhash" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f81ec6369c545a7d40e4589b5597581fa1c441fe1cce96dd1de43159910a36a2" [[package]] name = "hashbrown" -version = "0.14.5" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" dependencies = [ - "ahash", "allocator-api2", + "equivalent", + "foldhash", ] [[package]] @@ -42,21 +37,6 @@ version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" -[[package]] -name = "once_cell" -version = "1.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" - -[[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 = "proxy-wasm" version = "0.2.3-dev" @@ -64,55 +44,3 @@ dependencies = [ "hashbrown", "log", ] - -[[package]] -name = "quote" -version = "1.0.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "syn" -version = "2.0.71" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b146dcf730474b4bcd16c311627b31ede9ab149045db4d6088b3becaea046462" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "unicode-ident" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "zerocopy" -version = "0.7.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" -dependencies = [ - "zerocopy-derive", -] - -[[package]] -name = "zerocopy-derive" -version = "0.7.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] diff --git a/bazel/cargo/remote/BUILD.ahash-0.8.11.bazel b/bazel/cargo/remote/BUILD.ahash-0.8.11.bazel deleted file mode 100644 index 18921d08..00000000 --- a/bazel/cargo/remote/BUILD.ahash-0.8.11.bazel +++ /dev/null @@ -1,230 +0,0 @@ -############################################################################### -# @generated -# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To -# regenerate this file, run the following: -# -# bazel run @//bazel/cargo:crates_vendor -############################################################################### - -load("@rules_rust//cargo:defs.bzl", "cargo_build_script") -load("@rules_rust//rust:defs.bzl", "rust_library") - -package(default_visibility = ["//visibility:public"]) - -rust_library( - name = "ahash", - srcs = glob( - include = ["**/*.rs"], - allow_empty = True, - ), - compile_data = glob( - include = ["**"], - allow_empty = True, - exclude = [ - "**/* *", - ".tmp_git_root/**/*", - "BUILD", - "BUILD.bazel", - "WORKSPACE", - "WORKSPACE.bazel", - ], - ), - crate_root = "src/lib.rs", - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-bazel", - "crate-name=ahash", - "manual", - "noclippy", - "norustfmt", - ], - target_compatible_with = select({ - "@rules_rust//rust/platform:aarch64-apple-darwin": [], - "@rules_rust//rust/platform:aarch64-apple-ios": [], - "@rules_rust//rust/platform:aarch64-apple-ios-sim": [], - "@rules_rust//rust/platform:aarch64-fuchsia": [], - "@rules_rust//rust/platform:aarch64-linux-android": [], - "@rules_rust//rust/platform:aarch64-pc-windows-msvc": [], - "@rules_rust//rust/platform:aarch64-unknown-linux-gnu": [], - "@rules_rust//rust/platform:aarch64-unknown-nixos-gnu": [], - "@rules_rust//rust/platform:aarch64-unknown-nto-qnx710": [], - "@rules_rust//rust/platform:arm-unknown-linux-gnueabi": [], - "@rules_rust//rust/platform:armv7-linux-androideabi": [], - "@rules_rust//rust/platform:armv7-unknown-linux-gnueabi": [], - "@rules_rust//rust/platform:i686-apple-darwin": [], - "@rules_rust//rust/platform:i686-linux-android": [], - "@rules_rust//rust/platform:i686-pc-windows-msvc": [], - "@rules_rust//rust/platform:i686-unknown-freebsd": [], - "@rules_rust//rust/platform:i686-unknown-linux-gnu": [], - "@rules_rust//rust/platform:powerpc-unknown-linux-gnu": [], - "@rules_rust//rust/platform:riscv32imc-unknown-none-elf": [], - "@rules_rust//rust/platform:riscv64gc-unknown-none-elf": [], - "@rules_rust//rust/platform:s390x-unknown-linux-gnu": [], - "@rules_rust//rust/platform:thumbv7em-none-eabi": [], - "@rules_rust//rust/platform:thumbv8m.main-none-eabi": [], - "@rules_rust//rust/platform:wasm32-unknown-unknown": [], - "@rules_rust//rust/platform:wasm32-wasi": [], - "@rules_rust//rust/platform:x86_64-apple-darwin": [], - "@rules_rust//rust/platform:x86_64-apple-ios": [], - "@rules_rust//rust/platform:x86_64-fuchsia": [], - "@rules_rust//rust/platform:x86_64-linux-android": [], - "@rules_rust//rust/platform:x86_64-pc-windows-msvc": [], - "@rules_rust//rust/platform:x86_64-unknown-freebsd": [], - "@rules_rust//rust/platform:x86_64-unknown-linux-gnu": [], - "@rules_rust//rust/platform:x86_64-unknown-nixos-gnu": [], - "@rules_rust//rust/platform:x86_64-unknown-none": [], - "//conditions:default": ["@platforms//:incompatible"], - }), - version = "0.8.11", - deps = [ - "@crates_vendor__ahash-0.8.11//:build_script_build", - "@crates_vendor__cfg-if-1.0.0//:cfg_if", - "@crates_vendor__zerocopy-0.7.35//:zerocopy", - ] + select({ - "@rules_rust//rust/platform:aarch64-apple-darwin": [ - "@crates_vendor__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none"))) - ], - "@rules_rust//rust/platform:aarch64-apple-ios": [ - "@crates_vendor__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none"))) - ], - "@rules_rust//rust/platform:aarch64-apple-ios-sim": [ - "@crates_vendor__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none"))) - ], - "@rules_rust//rust/platform:aarch64-fuchsia": [ - "@crates_vendor__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none"))) - ], - "@rules_rust//rust/platform:aarch64-linux-android": [ - "@crates_vendor__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none"))) - ], - "@rules_rust//rust/platform:aarch64-pc-windows-msvc": [ - "@crates_vendor__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none"))) - ], - "@rules_rust//rust/platform:aarch64-unknown-linux-gnu": [ - "@crates_vendor__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none"))) - ], - "@rules_rust//rust/platform:aarch64-unknown-nixos-gnu": [ - "@crates_vendor__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none"))) - ], - "@rules_rust//rust/platform:aarch64-unknown-nto-qnx710": [ - "@crates_vendor__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none"))) - ], - "@rules_rust//rust/platform:arm-unknown-linux-gnueabi": [ - "@crates_vendor__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none"))) - ], - "@rules_rust//rust/platform:armv7-linux-androideabi": [ - "@crates_vendor__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none"))) - ], - "@rules_rust//rust/platform:armv7-unknown-linux-gnueabi": [ - "@crates_vendor__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none"))) - ], - "@rules_rust//rust/platform:i686-apple-darwin": [ - "@crates_vendor__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none"))) - ], - "@rules_rust//rust/platform:i686-linux-android": [ - "@crates_vendor__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none"))) - ], - "@rules_rust//rust/platform:i686-pc-windows-msvc": [ - "@crates_vendor__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none"))) - ], - "@rules_rust//rust/platform:i686-unknown-freebsd": [ - "@crates_vendor__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none"))) - ], - "@rules_rust//rust/platform:i686-unknown-linux-gnu": [ - "@crates_vendor__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none"))) - ], - "@rules_rust//rust/platform:powerpc-unknown-linux-gnu": [ - "@crates_vendor__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none"))) - ], - "@rules_rust//rust/platform:riscv32imc-unknown-none-elf": [ - "@crates_vendor__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none"))) - ], - "@rules_rust//rust/platform:riscv64gc-unknown-none-elf": [ - "@crates_vendor__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none"))) - ], - "@rules_rust//rust/platform:s390x-unknown-linux-gnu": [ - "@crates_vendor__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none"))) - ], - "@rules_rust//rust/platform:wasm32-unknown-unknown": [ - "@crates_vendor__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none"))) - ], - "@rules_rust//rust/platform:wasm32-wasi": [ - "@crates_vendor__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none"))) - ], - "@rules_rust//rust/platform:x86_64-apple-darwin": [ - "@crates_vendor__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none"))) - ], - "@rules_rust//rust/platform:x86_64-apple-ios": [ - "@crates_vendor__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none"))) - ], - "@rules_rust//rust/platform:x86_64-fuchsia": [ - "@crates_vendor__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none"))) - ], - "@rules_rust//rust/platform:x86_64-linux-android": [ - "@crates_vendor__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none"))) - ], - "@rules_rust//rust/platform:x86_64-pc-windows-msvc": [ - "@crates_vendor__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none"))) - ], - "@rules_rust//rust/platform:x86_64-unknown-freebsd": [ - "@crates_vendor__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none"))) - ], - "@rules_rust//rust/platform:x86_64-unknown-linux-gnu": [ - "@crates_vendor__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none"))) - ], - "@rules_rust//rust/platform:x86_64-unknown-nixos-gnu": [ - "@crates_vendor__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none"))) - ], - "@rules_rust//rust/platform:x86_64-unknown-none": [ - "@crates_vendor__once_cell-1.19.0//:once_cell", # cfg(not(all(target_arch = "arm", target_os = "none"))) - ], - "//conditions:default": [], - }), -) - -cargo_build_script( - name = "_bs", - srcs = glob( - include = ["**/*.rs"], - allow_empty = True, - ), - crate_name = "build_script_build", - crate_root = "build.rs", - data = glob( - include = ["**"], - allow_empty = True, - exclude = [ - "**/* *", - ".tmp_git_root/**/*", - "BUILD", - "BUILD.bazel", - "WORKSPACE", - "WORKSPACE.bazel", - ], - ), - edition = "2018", - pkg_name = "ahash", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-bazel", - "crate-name=ahash", - "manual", - "noclippy", - "norustfmt", - ], - version = "0.8.11", - visibility = ["//visibility:private"], - deps = [ - "@crates_vendor__version_check-0.9.4//:version_check", - ], -) - -alias( - name = "build_script_build", - actual = ":_bs", - tags = ["manual"], -) diff --git a/bazel/cargo/remote/BUILD.bazel b/bazel/cargo/remote/BUILD.bazel index af7cfc33..f62c1da8 100644 --- a/bazel/cargo/remote/BUILD.bazel +++ b/bazel/cargo/remote/BUILD.bazel @@ -33,7 +33,7 @@ filegroup( # Workspace Member Dependencies alias( name = "hashbrown", - actual = "@crates_vendor__hashbrown-0.14.5//:hashbrown", + actual = "@crates_vendor__hashbrown-0.15.0//:hashbrown", tags = ["manual"], ) diff --git a/bazel/cargo/remote/BUILD.version_check-0.9.4.bazel b/bazel/cargo/remote/BUILD.equivalent-1.0.1.bazel similarity index 97% rename from bazel/cargo/remote/BUILD.version_check-0.9.4.bazel rename to bazel/cargo/remote/BUILD.equivalent-1.0.1.bazel index 0e6c5d80..d474161c 100644 --- a/bazel/cargo/remote/BUILD.version_check-0.9.4.bazel +++ b/bazel/cargo/remote/BUILD.equivalent-1.0.1.bazel @@ -11,7 +11,7 @@ load("@rules_rust//rust:defs.bzl", "rust_library") package(default_visibility = ["//visibility:public"]) rust_library( - name = "version_check", + name = "equivalent", srcs = glob( include = ["**/*.rs"], allow_empty = True, @@ -35,7 +35,7 @@ rust_library( ], tags = [ "cargo-bazel", - "crate-name=version_check", + "crate-name=equivalent", "manual", "noclippy", "norustfmt", @@ -77,5 +77,5 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-none": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "0.9.4", + version = "1.0.1", ) diff --git a/bazel/cargo/remote/BUILD.cfg-if-1.0.0.bazel b/bazel/cargo/remote/BUILD.foldhash-0.1.3.bazel similarity index 97% rename from bazel/cargo/remote/BUILD.cfg-if-1.0.0.bazel rename to bazel/cargo/remote/BUILD.foldhash-0.1.3.bazel index efecb9f1..ff3aed7d 100644 --- a/bazel/cargo/remote/BUILD.cfg-if-1.0.0.bazel +++ b/bazel/cargo/remote/BUILD.foldhash-0.1.3.bazel @@ -11,7 +11,7 @@ load("@rules_rust//rust:defs.bzl", "rust_library") package(default_visibility = ["//visibility:public"]) rust_library( - name = "cfg_if", + name = "foldhash", srcs = glob( include = ["**/*.rs"], allow_empty = True, @@ -29,13 +29,13 @@ rust_library( ], ), crate_root = "src/lib.rs", - edition = "2018", + edition = "2021", rustc_flags = [ "--cap-lints=allow", ], tags = [ "cargo-bazel", - "crate-name=cfg-if", + "crate-name=foldhash", "manual", "noclippy", "norustfmt", @@ -77,5 +77,5 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-none": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "1.0.0", + version = "0.1.3", ) diff --git a/bazel/cargo/remote/BUILD.hashbrown-0.14.5.bazel b/bazel/cargo/remote/BUILD.hashbrown-0.15.0.bazel similarity index 94% rename from bazel/cargo/remote/BUILD.hashbrown-0.14.5.bazel rename to bazel/cargo/remote/BUILD.hashbrown-0.15.0.bazel index 361204cd..66f0728c 100644 --- a/bazel/cargo/remote/BUILD.hashbrown-0.14.5.bazel +++ b/bazel/cargo/remote/BUILD.hashbrown-0.15.0.bazel @@ -29,10 +29,12 @@ rust_library( ], ), crate_features = [ - "ahash", "allocator-api2", "default", + "default-hasher", + "equivalent", "inline-more", + "raw-entry", ], crate_root = "src/lib.rs", edition = "2021", @@ -83,9 +85,10 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-none": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "0.14.5", + version = "0.15.0", deps = [ - "@crates_vendor__ahash-0.8.11//:ahash", "@crates_vendor__allocator-api2-0.2.18//:allocator_api2", + "@crates_vendor__equivalent-1.0.1//:equivalent", + "@crates_vendor__foldhash-0.1.3//:foldhash", ], ) diff --git a/bazel/cargo/remote/BUILD.once_cell-1.19.0.bazel b/bazel/cargo/remote/BUILD.once_cell-1.19.0.bazel deleted file mode 100644 index ff471b6a..00000000 --- a/bazel/cargo/remote/BUILD.once_cell-1.19.0.bazel +++ /dev/null @@ -1,85 +0,0 @@ -############################################################################### -# @generated -# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To -# regenerate this file, run the following: -# -# bazel run @//bazel/cargo:crates_vendor -############################################################################### - -load("@rules_rust//rust:defs.bzl", "rust_library") - -package(default_visibility = ["//visibility:public"]) - -rust_library( - name = "once_cell", - srcs = glob( - include = ["**/*.rs"], - allow_empty = True, - ), - compile_data = glob( - include = ["**"], - allow_empty = True, - exclude = [ - "**/* *", - ".tmp_git_root/**/*", - "BUILD", - "BUILD.bazel", - "WORKSPACE", - "WORKSPACE.bazel", - ], - ), - crate_features = [ - "alloc", - "race", - ], - crate_root = "src/lib.rs", - edition = "2021", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-bazel", - "crate-name=once_cell", - "manual", - "noclippy", - "norustfmt", - ], - target_compatible_with = select({ - "@rules_rust//rust/platform:aarch64-apple-darwin": [], - "@rules_rust//rust/platform:aarch64-apple-ios": [], - "@rules_rust//rust/platform:aarch64-apple-ios-sim": [], - "@rules_rust//rust/platform:aarch64-fuchsia": [], - "@rules_rust//rust/platform:aarch64-linux-android": [], - "@rules_rust//rust/platform:aarch64-pc-windows-msvc": [], - "@rules_rust//rust/platform:aarch64-unknown-linux-gnu": [], - "@rules_rust//rust/platform:aarch64-unknown-nixos-gnu": [], - "@rules_rust//rust/platform:aarch64-unknown-nto-qnx710": [], - "@rules_rust//rust/platform:arm-unknown-linux-gnueabi": [], - "@rules_rust//rust/platform:armv7-linux-androideabi": [], - "@rules_rust//rust/platform:armv7-unknown-linux-gnueabi": [], - "@rules_rust//rust/platform:i686-apple-darwin": [], - "@rules_rust//rust/platform:i686-linux-android": [], - "@rules_rust//rust/platform:i686-pc-windows-msvc": [], - "@rules_rust//rust/platform:i686-unknown-freebsd": [], - "@rules_rust//rust/platform:i686-unknown-linux-gnu": [], - "@rules_rust//rust/platform:powerpc-unknown-linux-gnu": [], - "@rules_rust//rust/platform:riscv32imc-unknown-none-elf": [], - "@rules_rust//rust/platform:riscv64gc-unknown-none-elf": [], - "@rules_rust//rust/platform:s390x-unknown-linux-gnu": [], - "@rules_rust//rust/platform:thumbv7em-none-eabi": [], - "@rules_rust//rust/platform:thumbv8m.main-none-eabi": [], - "@rules_rust//rust/platform:wasm32-unknown-unknown": [], - "@rules_rust//rust/platform:wasm32-wasi": [], - "@rules_rust//rust/platform:x86_64-apple-darwin": [], - "@rules_rust//rust/platform:x86_64-apple-ios": [], - "@rules_rust//rust/platform:x86_64-fuchsia": [], - "@rules_rust//rust/platform:x86_64-linux-android": [], - "@rules_rust//rust/platform:x86_64-pc-windows-msvc": [], - "@rules_rust//rust/platform:x86_64-unknown-freebsd": [], - "@rules_rust//rust/platform:x86_64-unknown-linux-gnu": [], - "@rules_rust//rust/platform:x86_64-unknown-nixos-gnu": [], - "@rules_rust//rust/platform:x86_64-unknown-none": [], - "//conditions:default": ["@platforms//:incompatible"], - }), - version = "1.19.0", -) diff --git a/bazel/cargo/remote/BUILD.proc-macro2-1.0.86.bazel b/bazel/cargo/remote/BUILD.proc-macro2-1.0.86.bazel deleted file mode 100644 index f15d7f29..00000000 --- a/bazel/cargo/remote/BUILD.proc-macro2-1.0.86.bazel +++ /dev/null @@ -1,128 +0,0 @@ -############################################################################### -# @generated -# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To -# regenerate this file, run the following: -# -# bazel run @//bazel/cargo:crates_vendor -############################################################################### - -load("@rules_rust//cargo:defs.bzl", "cargo_build_script") -load("@rules_rust//rust:defs.bzl", "rust_library") - -package(default_visibility = ["//visibility:public"]) - -rust_library( - name = "proc_macro2", - srcs = glob( - include = ["**/*.rs"], - allow_empty = True, - ), - compile_data = glob( - include = ["**"], - allow_empty = True, - exclude = [ - "**/* *", - ".tmp_git_root/**/*", - "BUILD", - "BUILD.bazel", - "WORKSPACE", - "WORKSPACE.bazel", - ], - ), - crate_root = "src/lib.rs", - edition = "2021", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-bazel", - "crate-name=proc-macro2", - "manual", - "noclippy", - "norustfmt", - ], - target_compatible_with = select({ - "@rules_rust//rust/platform:aarch64-apple-darwin": [], - "@rules_rust//rust/platform:aarch64-apple-ios": [], - "@rules_rust//rust/platform:aarch64-apple-ios-sim": [], - "@rules_rust//rust/platform:aarch64-fuchsia": [], - "@rules_rust//rust/platform:aarch64-linux-android": [], - "@rules_rust//rust/platform:aarch64-pc-windows-msvc": [], - "@rules_rust//rust/platform:aarch64-unknown-linux-gnu": [], - "@rules_rust//rust/platform:aarch64-unknown-nixos-gnu": [], - "@rules_rust//rust/platform:aarch64-unknown-nto-qnx710": [], - "@rules_rust//rust/platform:arm-unknown-linux-gnueabi": [], - "@rules_rust//rust/platform:armv7-linux-androideabi": [], - "@rules_rust//rust/platform:armv7-unknown-linux-gnueabi": [], - "@rules_rust//rust/platform:i686-apple-darwin": [], - "@rules_rust//rust/platform:i686-linux-android": [], - "@rules_rust//rust/platform:i686-pc-windows-msvc": [], - "@rules_rust//rust/platform:i686-unknown-freebsd": [], - "@rules_rust//rust/platform:i686-unknown-linux-gnu": [], - "@rules_rust//rust/platform:powerpc-unknown-linux-gnu": [], - "@rules_rust//rust/platform:riscv32imc-unknown-none-elf": [], - "@rules_rust//rust/platform:riscv64gc-unknown-none-elf": [], - "@rules_rust//rust/platform:s390x-unknown-linux-gnu": [], - "@rules_rust//rust/platform:thumbv7em-none-eabi": [], - "@rules_rust//rust/platform:thumbv8m.main-none-eabi": [], - "@rules_rust//rust/platform:wasm32-unknown-unknown": [], - "@rules_rust//rust/platform:wasm32-wasi": [], - "@rules_rust//rust/platform:x86_64-apple-darwin": [], - "@rules_rust//rust/platform:x86_64-apple-ios": [], - "@rules_rust//rust/platform:x86_64-fuchsia": [], - "@rules_rust//rust/platform:x86_64-linux-android": [], - "@rules_rust//rust/platform:x86_64-pc-windows-msvc": [], - "@rules_rust//rust/platform:x86_64-unknown-freebsd": [], - "@rules_rust//rust/platform:x86_64-unknown-linux-gnu": [], - "@rules_rust//rust/platform:x86_64-unknown-nixos-gnu": [], - "@rules_rust//rust/platform:x86_64-unknown-none": [], - "//conditions:default": ["@platforms//:incompatible"], - }), - version = "1.0.86", - deps = [ - "@crates_vendor__proc-macro2-1.0.86//:build_script_build", - "@crates_vendor__unicode-ident-1.0.12//:unicode_ident", - ], -) - -cargo_build_script( - name = "_bs", - srcs = glob( - include = ["**/*.rs"], - allow_empty = True, - ), - crate_name = "build_script_build", - crate_root = "build.rs", - data = glob( - include = ["**"], - allow_empty = True, - exclude = [ - "**/* *", - ".tmp_git_root/**/*", - "BUILD", - "BUILD.bazel", - "WORKSPACE", - "WORKSPACE.bazel", - ], - ), - edition = "2021", - pkg_name = "proc-macro2", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-bazel", - "crate-name=proc-macro2", - "manual", - "noclippy", - "norustfmt", - ], - version = "1.0.86", - visibility = ["//visibility:private"], -) - -alias( - name = "build_script_build", - actual = ":_bs", - tags = ["manual"], -) diff --git a/bazel/cargo/remote/BUILD.quote-1.0.36.bazel b/bazel/cargo/remote/BUILD.quote-1.0.36.bazel deleted file mode 100644 index c50669ce..00000000 --- a/bazel/cargo/remote/BUILD.quote-1.0.36.bazel +++ /dev/null @@ -1,84 +0,0 @@ -############################################################################### -# @generated -# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To -# regenerate this file, run the following: -# -# bazel run @//bazel/cargo:crates_vendor -############################################################################### - -load("@rules_rust//rust:defs.bzl", "rust_library") - -package(default_visibility = ["//visibility:public"]) - -rust_library( - name = "quote", - srcs = glob( - include = ["**/*.rs"], - allow_empty = True, - ), - compile_data = glob( - include = ["**"], - allow_empty = True, - exclude = [ - "**/* *", - ".tmp_git_root/**/*", - "BUILD", - "BUILD.bazel", - "WORKSPACE", - "WORKSPACE.bazel", - ], - ), - crate_root = "src/lib.rs", - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-bazel", - "crate-name=quote", - "manual", - "noclippy", - "norustfmt", - ], - target_compatible_with = select({ - "@rules_rust//rust/platform:aarch64-apple-darwin": [], - "@rules_rust//rust/platform:aarch64-apple-ios": [], - "@rules_rust//rust/platform:aarch64-apple-ios-sim": [], - "@rules_rust//rust/platform:aarch64-fuchsia": [], - "@rules_rust//rust/platform:aarch64-linux-android": [], - "@rules_rust//rust/platform:aarch64-pc-windows-msvc": [], - "@rules_rust//rust/platform:aarch64-unknown-linux-gnu": [], - "@rules_rust//rust/platform:aarch64-unknown-nixos-gnu": [], - "@rules_rust//rust/platform:aarch64-unknown-nto-qnx710": [], - "@rules_rust//rust/platform:arm-unknown-linux-gnueabi": [], - "@rules_rust//rust/platform:armv7-linux-androideabi": [], - "@rules_rust//rust/platform:armv7-unknown-linux-gnueabi": [], - "@rules_rust//rust/platform:i686-apple-darwin": [], - "@rules_rust//rust/platform:i686-linux-android": [], - "@rules_rust//rust/platform:i686-pc-windows-msvc": [], - "@rules_rust//rust/platform:i686-unknown-freebsd": [], - "@rules_rust//rust/platform:i686-unknown-linux-gnu": [], - "@rules_rust//rust/platform:powerpc-unknown-linux-gnu": [], - "@rules_rust//rust/platform:riscv32imc-unknown-none-elf": [], - "@rules_rust//rust/platform:riscv64gc-unknown-none-elf": [], - "@rules_rust//rust/platform:s390x-unknown-linux-gnu": [], - "@rules_rust//rust/platform:thumbv7em-none-eabi": [], - "@rules_rust//rust/platform:thumbv8m.main-none-eabi": [], - "@rules_rust//rust/platform:wasm32-unknown-unknown": [], - "@rules_rust//rust/platform:wasm32-wasi": [], - "@rules_rust//rust/platform:x86_64-apple-darwin": [], - "@rules_rust//rust/platform:x86_64-apple-ios": [], - "@rules_rust//rust/platform:x86_64-fuchsia": [], - "@rules_rust//rust/platform:x86_64-linux-android": [], - "@rules_rust//rust/platform:x86_64-pc-windows-msvc": [], - "@rules_rust//rust/platform:x86_64-unknown-freebsd": [], - "@rules_rust//rust/platform:x86_64-unknown-linux-gnu": [], - "@rules_rust//rust/platform:x86_64-unknown-nixos-gnu": [], - "@rules_rust//rust/platform:x86_64-unknown-none": [], - "//conditions:default": ["@platforms//:incompatible"], - }), - version = "1.0.36", - deps = [ - "@crates_vendor__proc-macro2-1.0.86//:proc_macro2", - ], -) diff --git a/bazel/cargo/remote/BUILD.syn-2.0.71.bazel b/bazel/cargo/remote/BUILD.syn-2.0.71.bazel deleted file mode 100644 index ea9b8f09..00000000 --- a/bazel/cargo/remote/BUILD.syn-2.0.71.bazel +++ /dev/null @@ -1,85 +0,0 @@ -############################################################################### -# @generated -# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To -# regenerate this file, run the following: -# -# bazel run @//bazel/cargo:crates_vendor -############################################################################### - -load("@rules_rust//rust:defs.bzl", "rust_library") - -package(default_visibility = ["//visibility:public"]) - -rust_library( - name = "syn", - srcs = glob( - include = ["**/*.rs"], - allow_empty = True, - ), - compile_data = glob( - include = ["**"], - allow_empty = True, - exclude = [ - "**/* *", - ".tmp_git_root/**/*", - "BUILD", - "BUILD.bazel", - "WORKSPACE", - "WORKSPACE.bazel", - ], - ), - crate_root = "src/lib.rs", - edition = "2021", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-bazel", - "crate-name=syn", - "manual", - "noclippy", - "norustfmt", - ], - target_compatible_with = select({ - "@rules_rust//rust/platform:aarch64-apple-darwin": [], - "@rules_rust//rust/platform:aarch64-apple-ios": [], - "@rules_rust//rust/platform:aarch64-apple-ios-sim": [], - "@rules_rust//rust/platform:aarch64-fuchsia": [], - "@rules_rust//rust/platform:aarch64-linux-android": [], - "@rules_rust//rust/platform:aarch64-pc-windows-msvc": [], - "@rules_rust//rust/platform:aarch64-unknown-linux-gnu": [], - "@rules_rust//rust/platform:aarch64-unknown-nixos-gnu": [], - "@rules_rust//rust/platform:aarch64-unknown-nto-qnx710": [], - "@rules_rust//rust/platform:arm-unknown-linux-gnueabi": [], - "@rules_rust//rust/platform:armv7-linux-androideabi": [], - "@rules_rust//rust/platform:armv7-unknown-linux-gnueabi": [], - "@rules_rust//rust/platform:i686-apple-darwin": [], - "@rules_rust//rust/platform:i686-linux-android": [], - "@rules_rust//rust/platform:i686-pc-windows-msvc": [], - "@rules_rust//rust/platform:i686-unknown-freebsd": [], - "@rules_rust//rust/platform:i686-unknown-linux-gnu": [], - "@rules_rust//rust/platform:powerpc-unknown-linux-gnu": [], - "@rules_rust//rust/platform:riscv32imc-unknown-none-elf": [], - "@rules_rust//rust/platform:riscv64gc-unknown-none-elf": [], - "@rules_rust//rust/platform:s390x-unknown-linux-gnu": [], - "@rules_rust//rust/platform:thumbv7em-none-eabi": [], - "@rules_rust//rust/platform:thumbv8m.main-none-eabi": [], - "@rules_rust//rust/platform:wasm32-unknown-unknown": [], - "@rules_rust//rust/platform:wasm32-wasi": [], - "@rules_rust//rust/platform:x86_64-apple-darwin": [], - "@rules_rust//rust/platform:x86_64-apple-ios": [], - "@rules_rust//rust/platform:x86_64-fuchsia": [], - "@rules_rust//rust/platform:x86_64-linux-android": [], - "@rules_rust//rust/platform:x86_64-pc-windows-msvc": [], - "@rules_rust//rust/platform:x86_64-unknown-freebsd": [], - "@rules_rust//rust/platform:x86_64-unknown-linux-gnu": [], - "@rules_rust//rust/platform:x86_64-unknown-nixos-gnu": [], - "@rules_rust//rust/platform:x86_64-unknown-none": [], - "//conditions:default": ["@platforms//:incompatible"], - }), - version = "2.0.71", - deps = [ - "@crates_vendor__proc-macro2-1.0.86//:proc_macro2", - "@crates_vendor__unicode-ident-1.0.12//:unicode_ident", - ], -) diff --git a/bazel/cargo/remote/BUILD.unicode-ident-1.0.12.bazel b/bazel/cargo/remote/BUILD.unicode-ident-1.0.12.bazel deleted file mode 100644 index 5a234e81..00000000 --- a/bazel/cargo/remote/BUILD.unicode-ident-1.0.12.bazel +++ /dev/null @@ -1,81 +0,0 @@ -############################################################################### -# @generated -# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To -# regenerate this file, run the following: -# -# bazel run @//bazel/cargo:crates_vendor -############################################################################### - -load("@rules_rust//rust:defs.bzl", "rust_library") - -package(default_visibility = ["//visibility:public"]) - -rust_library( - name = "unicode_ident", - srcs = glob( - include = ["**/*.rs"], - allow_empty = True, - ), - compile_data = glob( - include = ["**"], - allow_empty = True, - exclude = [ - "**/* *", - ".tmp_git_root/**/*", - "BUILD", - "BUILD.bazel", - "WORKSPACE", - "WORKSPACE.bazel", - ], - ), - crate_root = "src/lib.rs", - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-bazel", - "crate-name=unicode-ident", - "manual", - "noclippy", - "norustfmt", - ], - target_compatible_with = select({ - "@rules_rust//rust/platform:aarch64-apple-darwin": [], - "@rules_rust//rust/platform:aarch64-apple-ios": [], - "@rules_rust//rust/platform:aarch64-apple-ios-sim": [], - "@rules_rust//rust/platform:aarch64-fuchsia": [], - "@rules_rust//rust/platform:aarch64-linux-android": [], - "@rules_rust//rust/platform:aarch64-pc-windows-msvc": [], - "@rules_rust//rust/platform:aarch64-unknown-linux-gnu": [], - "@rules_rust//rust/platform:aarch64-unknown-nixos-gnu": [], - "@rules_rust//rust/platform:aarch64-unknown-nto-qnx710": [], - "@rules_rust//rust/platform:arm-unknown-linux-gnueabi": [], - "@rules_rust//rust/platform:armv7-linux-androideabi": [], - "@rules_rust//rust/platform:armv7-unknown-linux-gnueabi": [], - "@rules_rust//rust/platform:i686-apple-darwin": [], - "@rules_rust//rust/platform:i686-linux-android": [], - "@rules_rust//rust/platform:i686-pc-windows-msvc": [], - "@rules_rust//rust/platform:i686-unknown-freebsd": [], - "@rules_rust//rust/platform:i686-unknown-linux-gnu": [], - "@rules_rust//rust/platform:powerpc-unknown-linux-gnu": [], - "@rules_rust//rust/platform:riscv32imc-unknown-none-elf": [], - "@rules_rust//rust/platform:riscv64gc-unknown-none-elf": [], - "@rules_rust//rust/platform:s390x-unknown-linux-gnu": [], - "@rules_rust//rust/platform:thumbv7em-none-eabi": [], - "@rules_rust//rust/platform:thumbv8m.main-none-eabi": [], - "@rules_rust//rust/platform:wasm32-unknown-unknown": [], - "@rules_rust//rust/platform:wasm32-wasi": [], - "@rules_rust//rust/platform:x86_64-apple-darwin": [], - "@rules_rust//rust/platform:x86_64-apple-ios": [], - "@rules_rust//rust/platform:x86_64-fuchsia": [], - "@rules_rust//rust/platform:x86_64-linux-android": [], - "@rules_rust//rust/platform:x86_64-pc-windows-msvc": [], - "@rules_rust//rust/platform:x86_64-unknown-freebsd": [], - "@rules_rust//rust/platform:x86_64-unknown-linux-gnu": [], - "@rules_rust//rust/platform:x86_64-unknown-nixos-gnu": [], - "@rules_rust//rust/platform:x86_64-unknown-none": [], - "//conditions:default": ["@platforms//:incompatible"], - }), - version = "1.0.12", -) diff --git a/bazel/cargo/remote/BUILD.zerocopy-0.7.35.bazel b/bazel/cargo/remote/BUILD.zerocopy-0.7.35.bazel deleted file mode 100644 index ec06675c..00000000 --- a/bazel/cargo/remote/BUILD.zerocopy-0.7.35.bazel +++ /dev/null @@ -1,84 +0,0 @@ -############################################################################### -# @generated -# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To -# regenerate this file, run the following: -# -# bazel run @//bazel/cargo:crates_vendor -############################################################################### - -load("@rules_rust//rust:defs.bzl", "rust_library") - -package(default_visibility = ["//visibility:public"]) - -rust_library( - name = "zerocopy", - srcs = glob( - include = ["**/*.rs"], - allow_empty = True, - ), - compile_data = glob( - include = ["**"], - allow_empty = True, - exclude = [ - "**/* *", - ".tmp_git_root/**/*", - "BUILD", - "BUILD.bazel", - "WORKSPACE", - "WORKSPACE.bazel", - ], - ), - crate_features = [ - "simd", - ], - crate_root = "src/lib.rs", - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-bazel", - "crate-name=zerocopy", - "manual", - "noclippy", - "norustfmt", - ], - target_compatible_with = select({ - "@rules_rust//rust/platform:aarch64-apple-darwin": [], - "@rules_rust//rust/platform:aarch64-apple-ios": [], - "@rules_rust//rust/platform:aarch64-apple-ios-sim": [], - "@rules_rust//rust/platform:aarch64-fuchsia": [], - "@rules_rust//rust/platform:aarch64-linux-android": [], - "@rules_rust//rust/platform:aarch64-pc-windows-msvc": [], - "@rules_rust//rust/platform:aarch64-unknown-linux-gnu": [], - "@rules_rust//rust/platform:aarch64-unknown-nixos-gnu": [], - "@rules_rust//rust/platform:aarch64-unknown-nto-qnx710": [], - "@rules_rust//rust/platform:arm-unknown-linux-gnueabi": [], - "@rules_rust//rust/platform:armv7-linux-androideabi": [], - "@rules_rust//rust/platform:armv7-unknown-linux-gnueabi": [], - "@rules_rust//rust/platform:i686-apple-darwin": [], - "@rules_rust//rust/platform:i686-linux-android": [], - "@rules_rust//rust/platform:i686-pc-windows-msvc": [], - "@rules_rust//rust/platform:i686-unknown-freebsd": [], - "@rules_rust//rust/platform:i686-unknown-linux-gnu": [], - "@rules_rust//rust/platform:powerpc-unknown-linux-gnu": [], - "@rules_rust//rust/platform:riscv32imc-unknown-none-elf": [], - "@rules_rust//rust/platform:riscv64gc-unknown-none-elf": [], - "@rules_rust//rust/platform:s390x-unknown-linux-gnu": [], - "@rules_rust//rust/platform:thumbv7em-none-eabi": [], - "@rules_rust//rust/platform:thumbv8m.main-none-eabi": [], - "@rules_rust//rust/platform:wasm32-unknown-unknown": [], - "@rules_rust//rust/platform:wasm32-wasi": [], - "@rules_rust//rust/platform:x86_64-apple-darwin": [], - "@rules_rust//rust/platform:x86_64-apple-ios": [], - "@rules_rust//rust/platform:x86_64-fuchsia": [], - "@rules_rust//rust/platform:x86_64-linux-android": [], - "@rules_rust//rust/platform:x86_64-pc-windows-msvc": [], - "@rules_rust//rust/platform:x86_64-unknown-freebsd": [], - "@rules_rust//rust/platform:x86_64-unknown-linux-gnu": [], - "@rules_rust//rust/platform:x86_64-unknown-nixos-gnu": [], - "@rules_rust//rust/platform:x86_64-unknown-none": [], - "//conditions:default": ["@platforms//:incompatible"], - }), - version = "0.7.35", -) diff --git a/bazel/cargo/remote/BUILD.zerocopy-derive-0.7.35.bazel b/bazel/cargo/remote/BUILD.zerocopy-derive-0.7.35.bazel deleted file mode 100644 index e44a65cb..00000000 --- a/bazel/cargo/remote/BUILD.zerocopy-derive-0.7.35.bazel +++ /dev/null @@ -1,86 +0,0 @@ -############################################################################### -# @generated -# DO NOT MODIFY: This file is auto-generated by a crate_universe tool. To -# regenerate this file, run the following: -# -# bazel run @//bazel/cargo:crates_vendor -############################################################################### - -load("@rules_rust//rust:defs.bzl", "rust_proc_macro") - -package(default_visibility = ["//visibility:public"]) - -rust_proc_macro( - name = "zerocopy_derive", - srcs = glob( - include = ["**/*.rs"], - allow_empty = True, - ), - compile_data = glob( - include = ["**"], - allow_empty = True, - exclude = [ - "**/* *", - ".tmp_git_root/**/*", - "BUILD", - "BUILD.bazel", - "WORKSPACE", - "WORKSPACE.bazel", - ], - ), - crate_root = "src/lib.rs", - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-bazel", - "crate-name=zerocopy-derive", - "manual", - "noclippy", - "norustfmt", - ], - target_compatible_with = select({ - "@rules_rust//rust/platform:aarch64-apple-darwin": [], - "@rules_rust//rust/platform:aarch64-apple-ios": [], - "@rules_rust//rust/platform:aarch64-apple-ios-sim": [], - "@rules_rust//rust/platform:aarch64-fuchsia": [], - "@rules_rust//rust/platform:aarch64-linux-android": [], - "@rules_rust//rust/platform:aarch64-pc-windows-msvc": [], - "@rules_rust//rust/platform:aarch64-unknown-linux-gnu": [], - "@rules_rust//rust/platform:aarch64-unknown-nixos-gnu": [], - "@rules_rust//rust/platform:aarch64-unknown-nto-qnx710": [], - "@rules_rust//rust/platform:arm-unknown-linux-gnueabi": [], - "@rules_rust//rust/platform:armv7-linux-androideabi": [], - "@rules_rust//rust/platform:armv7-unknown-linux-gnueabi": [], - "@rules_rust//rust/platform:i686-apple-darwin": [], - "@rules_rust//rust/platform:i686-linux-android": [], - "@rules_rust//rust/platform:i686-pc-windows-msvc": [], - "@rules_rust//rust/platform:i686-unknown-freebsd": [], - "@rules_rust//rust/platform:i686-unknown-linux-gnu": [], - "@rules_rust//rust/platform:powerpc-unknown-linux-gnu": [], - "@rules_rust//rust/platform:riscv32imc-unknown-none-elf": [], - "@rules_rust//rust/platform:riscv64gc-unknown-none-elf": [], - "@rules_rust//rust/platform:s390x-unknown-linux-gnu": [], - "@rules_rust//rust/platform:thumbv7em-none-eabi": [], - "@rules_rust//rust/platform:thumbv8m.main-none-eabi": [], - "@rules_rust//rust/platform:wasm32-unknown-unknown": [], - "@rules_rust//rust/platform:wasm32-wasi": [], - "@rules_rust//rust/platform:x86_64-apple-darwin": [], - "@rules_rust//rust/platform:x86_64-apple-ios": [], - "@rules_rust//rust/platform:x86_64-fuchsia": [], - "@rules_rust//rust/platform:x86_64-linux-android": [], - "@rules_rust//rust/platform:x86_64-pc-windows-msvc": [], - "@rules_rust//rust/platform:x86_64-unknown-freebsd": [], - "@rules_rust//rust/platform:x86_64-unknown-linux-gnu": [], - "@rules_rust//rust/platform:x86_64-unknown-nixos-gnu": [], - "@rules_rust//rust/platform:x86_64-unknown-none": [], - "//conditions:default": ["@platforms//:incompatible"], - }), - version = "0.7.35", - deps = [ - "@crates_vendor__proc-macro2-1.0.86//:proc_macro2", - "@crates_vendor__quote-1.0.36//:quote", - "@crates_vendor__syn-2.0.71//:syn", - ], -) diff --git a/bazel/cargo/remote/defs.bzl b/bazel/cargo/remote/defs.bzl index b1367f3a..e4051261 100644 --- a/bazel/cargo/remote/defs.bzl +++ b/bazel/cargo/remote/defs.bzl @@ -295,7 +295,7 @@ def aliases( _NORMAL_DEPENDENCIES = { "": { _COMMON_CONDITION: { - "hashbrown": Label("@crates_vendor__hashbrown-0.14.5//:hashbrown"), + "hashbrown": Label("@crates_vendor__hashbrown-0.15.0//:hashbrown"), "log": Label("@crates_vendor__log-0.4.22//:log"), }, }, @@ -371,8 +371,6 @@ _CONDITIONS = { "arm-unknown-linux-gnueabi": ["@rules_rust//rust/platform:arm-unknown-linux-gnueabi"], "armv7-linux-androideabi": ["@rules_rust//rust/platform:armv7-linux-androideabi"], "armv7-unknown-linux-gnueabi": ["@rules_rust//rust/platform:armv7-unknown-linux-gnueabi"], - "cfg(any())": [], - "cfg(not(all(target_arch = \"arm\", target_os = \"none\")))": ["@rules_rust//rust/platform:aarch64-apple-darwin", "@rules_rust//rust/platform:aarch64-apple-ios", "@rules_rust//rust/platform:aarch64-apple-ios-sim", "@rules_rust//rust/platform:aarch64-fuchsia", "@rules_rust//rust/platform:aarch64-linux-android", "@rules_rust//rust/platform:aarch64-pc-windows-msvc", "@rules_rust//rust/platform:aarch64-unknown-linux-gnu", "@rules_rust//rust/platform:aarch64-unknown-nixos-gnu", "@rules_rust//rust/platform:aarch64-unknown-nto-qnx710", "@rules_rust//rust/platform:arm-unknown-linux-gnueabi", "@rules_rust//rust/platform:armv7-linux-androideabi", "@rules_rust//rust/platform:armv7-unknown-linux-gnueabi", "@rules_rust//rust/platform:i686-apple-darwin", "@rules_rust//rust/platform:i686-linux-android", "@rules_rust//rust/platform:i686-pc-windows-msvc", "@rules_rust//rust/platform:i686-unknown-freebsd", "@rules_rust//rust/platform:i686-unknown-linux-gnu", "@rules_rust//rust/platform:powerpc-unknown-linux-gnu", "@rules_rust//rust/platform:riscv32imc-unknown-none-elf", "@rules_rust//rust/platform:riscv64gc-unknown-none-elf", "@rules_rust//rust/platform:s390x-unknown-linux-gnu", "@rules_rust//rust/platform:wasm32-unknown-unknown", "@rules_rust//rust/platform:wasm32-wasi", "@rules_rust//rust/platform:x86_64-apple-darwin", "@rules_rust//rust/platform:x86_64-apple-ios", "@rules_rust//rust/platform:x86_64-fuchsia", "@rules_rust//rust/platform:x86_64-linux-android", "@rules_rust//rust/platform:x86_64-pc-windows-msvc", "@rules_rust//rust/platform:x86_64-unknown-freebsd", "@rules_rust//rust/platform:x86_64-unknown-linux-gnu", "@rules_rust//rust/platform:x86_64-unknown-nixos-gnu", "@rules_rust//rust/platform:x86_64-unknown-none"], "i686-apple-darwin": ["@rules_rust//rust/platform:i686-apple-darwin"], "i686-linux-android": ["@rules_rust//rust/platform:i686-linux-android"], "i686-pc-windows-msvc": ["@rules_rust//rust/platform:i686-pc-windows-msvc"], @@ -405,16 +403,6 @@ def crate_repositories(): Returns: A list of repos visible to the module through the module extension. """ - maybe( - http_archive, - name = "crates_vendor__ahash-0.8.11", - sha256 = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011", - type = "tar.gz", - urls = ["https://static.crates.io/crates/ahash/0.8.11/download"], - strip_prefix = "ahash-0.8.11", - build_file = Label("@proxy_wasm_rust_sdk//bazel/cargo/remote:BUILD.ahash-0.8.11.bazel"), - ) - maybe( http_archive, name = "crates_vendor__allocator-api2-0.2.18", @@ -427,115 +415,45 @@ def crate_repositories(): maybe( http_archive, - name = "crates_vendor__cfg-if-1.0.0", - sha256 = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd", - type = "tar.gz", - urls = ["https://static.crates.io/crates/cfg-if/1.0.0/download"], - strip_prefix = "cfg-if-1.0.0", - build_file = Label("@proxy_wasm_rust_sdk//bazel/cargo/remote:BUILD.cfg-if-1.0.0.bazel"), - ) - - maybe( - http_archive, - name = "crates_vendor__hashbrown-0.14.5", - sha256 = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1", - type = "tar.gz", - urls = ["https://static.crates.io/crates/hashbrown/0.14.5/download"], - strip_prefix = "hashbrown-0.14.5", - build_file = Label("@proxy_wasm_rust_sdk//bazel/cargo/remote:BUILD.hashbrown-0.14.5.bazel"), - ) - - maybe( - http_archive, - name = "crates_vendor__log-0.4.22", - sha256 = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24", - type = "tar.gz", - urls = ["https://static.crates.io/crates/log/0.4.22/download"], - strip_prefix = "log-0.4.22", - build_file = Label("@proxy_wasm_rust_sdk//bazel/cargo/remote:BUILD.log-0.4.22.bazel"), - ) - - maybe( - http_archive, - name = "crates_vendor__once_cell-1.19.0", - sha256 = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92", + name = "crates_vendor__equivalent-1.0.1", + sha256 = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5", type = "tar.gz", - urls = ["https://static.crates.io/crates/once_cell/1.19.0/download"], - strip_prefix = "once_cell-1.19.0", - build_file = Label("@proxy_wasm_rust_sdk//bazel/cargo/remote:BUILD.once_cell-1.19.0.bazel"), + urls = ["https://static.crates.io/crates/equivalent/1.0.1/download"], + strip_prefix = "equivalent-1.0.1", + build_file = Label("@proxy_wasm_rust_sdk//bazel/cargo/remote:BUILD.equivalent-1.0.1.bazel"), ) maybe( http_archive, - name = "crates_vendor__proc-macro2-1.0.86", - sha256 = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77", + name = "crates_vendor__foldhash-0.1.3", + sha256 = "f81ec6369c545a7d40e4589b5597581fa1c441fe1cce96dd1de43159910a36a2", type = "tar.gz", - urls = ["https://static.crates.io/crates/proc-macro2/1.0.86/download"], - strip_prefix = "proc-macro2-1.0.86", - build_file = Label("@proxy_wasm_rust_sdk//bazel/cargo/remote:BUILD.proc-macro2-1.0.86.bazel"), + urls = ["https://static.crates.io/crates/foldhash/0.1.3/download"], + strip_prefix = "foldhash-0.1.3", + build_file = Label("@proxy_wasm_rust_sdk//bazel/cargo/remote:BUILD.foldhash-0.1.3.bazel"), ) maybe( http_archive, - name = "crates_vendor__quote-1.0.36", - sha256 = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7", + name = "crates_vendor__hashbrown-0.15.0", + sha256 = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb", type = "tar.gz", - urls = ["https://static.crates.io/crates/quote/1.0.36/download"], - strip_prefix = "quote-1.0.36", - build_file = Label("@proxy_wasm_rust_sdk//bazel/cargo/remote:BUILD.quote-1.0.36.bazel"), + urls = ["https://static.crates.io/crates/hashbrown/0.15.0/download"], + strip_prefix = "hashbrown-0.15.0", + build_file = Label("@proxy_wasm_rust_sdk//bazel/cargo/remote:BUILD.hashbrown-0.15.0.bazel"), ) maybe( http_archive, - name = "crates_vendor__syn-2.0.71", - sha256 = "b146dcf730474b4bcd16c311627b31ede9ab149045db4d6088b3becaea046462", - type = "tar.gz", - urls = ["https://static.crates.io/crates/syn/2.0.71/download"], - strip_prefix = "syn-2.0.71", - build_file = Label("@proxy_wasm_rust_sdk//bazel/cargo/remote:BUILD.syn-2.0.71.bazel"), - ) - - maybe( - http_archive, - name = "crates_vendor__unicode-ident-1.0.12", - sha256 = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b", - type = "tar.gz", - urls = ["https://static.crates.io/crates/unicode-ident/1.0.12/download"], - strip_prefix = "unicode-ident-1.0.12", - build_file = Label("@proxy_wasm_rust_sdk//bazel/cargo/remote:BUILD.unicode-ident-1.0.12.bazel"), - ) - - maybe( - http_archive, - name = "crates_vendor__version_check-0.9.4", - sha256 = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f", - type = "tar.gz", - urls = ["https://static.crates.io/crates/version_check/0.9.4/download"], - strip_prefix = "version_check-0.9.4", - build_file = Label("@proxy_wasm_rust_sdk//bazel/cargo/remote:BUILD.version_check-0.9.4.bazel"), - ) - - maybe( - http_archive, - name = "crates_vendor__zerocopy-0.7.35", - sha256 = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0", - type = "tar.gz", - urls = ["https://static.crates.io/crates/zerocopy/0.7.35/download"], - strip_prefix = "zerocopy-0.7.35", - build_file = Label("@proxy_wasm_rust_sdk//bazel/cargo/remote:BUILD.zerocopy-0.7.35.bazel"), - ) - - maybe( - http_archive, - name = "crates_vendor__zerocopy-derive-0.7.35", - sha256 = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e", + name = "crates_vendor__log-0.4.22", + sha256 = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24", type = "tar.gz", - urls = ["https://static.crates.io/crates/zerocopy-derive/0.7.35/download"], - strip_prefix = "zerocopy-derive-0.7.35", - build_file = Label("@proxy_wasm_rust_sdk//bazel/cargo/remote:BUILD.zerocopy-derive-0.7.35.bazel"), + urls = ["https://static.crates.io/crates/log/0.4.22/download"], + strip_prefix = "log-0.4.22", + build_file = Label("@proxy_wasm_rust_sdk//bazel/cargo/remote:BUILD.log-0.4.22.bazel"), ) return [ - struct(repo = "crates_vendor__hashbrown-0.14.5", is_dev_dep = False), + struct(repo = "crates_vendor__hashbrown-0.15.0", is_dev_dep = False), struct(repo = "crates_vendor__log-0.4.22", is_dev_dep = False), ] From a0a21732b989abec1d83dbb52f61a7481b0a0071 Mon Sep 17 00:00:00 2001 From: Piotr Sikora Date: Sun, 27 Oct 2024 12:41:54 -0400 Subject: [PATCH 03/15] Update Bazel to v7.4.0. (#274) Signed-off-by: Piotr Sikora --- .bazelversion | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.bazelversion b/.bazelversion index b26a34e4..ba7f754d 100644 --- a/.bazelversion +++ b/.bazelversion @@ -1 +1 @@ -7.2.1 +7.4.0 From 434cdd5a7bb600167a6e8c9143ab3d5e12596427 Mon Sep 17 00:00:00 2001 From: Piotr Sikora Date: Sun, 27 Oct 2024 12:52:45 -0400 Subject: [PATCH 04/15] Update rules_rust to v0.53.0 (with Rust v1.81.0). (#275) While there, expand buildifier's coverage to include generated BUILD files, since they're correctly formatted nowadays. Signed-off-by: Piotr Sikora --- .github/workflows/rust.yml | 3 +-- bazel/BUILD | 1 - bazel/dependencies.bzl | 2 +- bazel/repositories.bzl | 4 ++-- bazel/rules_rust.patch | 4 ++-- 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 11de901a..e17f91d3 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -80,8 +80,7 @@ jobs: run: | go install github.com/bazelbuild/buildtools/buildifier@latest export PATH=$PATH:$(go env GOPATH)/bin - buildifier -mode=check WORKSPACE - buildifier -mode=check BUILD + buildifier -mode=check -r . - name: Format (rules_rust) run: | diff --git a/bazel/BUILD b/bazel/BUILD index bb488a81..6d6d1266 100644 --- a/bazel/BUILD +++ b/bazel/BUILD @@ -11,4 +11,3 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. - diff --git a/bazel/dependencies.bzl b/bazel/dependencies.bzl index 646fe2d8..ec69cafa 100644 --- a/bazel/dependencies.bzl +++ b/bazel/dependencies.bzl @@ -13,8 +13,8 @@ # limitations under the License. load("@proxy_wasm_rust_sdk//bazel/cargo/remote:defs.bzl", "crate_repositories") -load("@rules_rust//rust:repositories.bzl", "rust_repositories") load("@rules_rust//crate_universe:repositories.bzl", "crate_universe_dependencies") +load("@rules_rust//rust:repositories.bzl", "rust_repositories") def proxy_wasm_rust_sdk_dependencies(): rust_repositories() diff --git a/bazel/repositories.bzl b/bazel/repositories.bzl index c02bf0af..860f6344 100644 --- a/bazel/repositories.bzl +++ b/bazel/repositories.bzl @@ -26,8 +26,8 @@ def proxy_wasm_rust_sdk_repositories(): maybe( http_archive, name = "rules_rust", - sha256 = "df973075339aaaabb8cbe697808514d82d8f00a333e3ebb227bfd4308182985b", - url = "https://github.com/bazelbuild/rules_rust/releases/download/0.47.1/rules_rust-v0.47.1.tar.gz", + sha256 = "85e2013727ab26fb22abdffe4b2ac0c27a2d5b6296167ba63d8f6e13140f51f9", + url = "https://github.com/bazelbuild/rules_rust/releases/download/0.53.0/rules_rust-v0.53.0.tar.gz", patches = ["//bazel:rules_rust.patch"], patch_args = ["-p1"], ) diff --git a/bazel/rules_rust.patch b/bazel/rules_rust.patch index c494f262..fab21386 100644 --- a/bazel/rules_rust.patch +++ b/bazel/rules_rust.patch @@ -1,10 +1,10 @@ # https://github.com/bazelbuild/rules_rust/pull/1315 diff --git a/rust/private/rustc.bzl b/rust/private/rustc.bzl -index eff542eb..9efe645c 100644 +index 20a09f94..53122967 100644 --- a/rust/private/rustc.bzl +++ b/rust/private/rustc.bzl -@@ -1467,7 +1467,7 @@ def rustc_compile_action( +@@ -1518,7 +1518,7 @@ def rustc_compile_action( }) crate_info = rust_common.create_crate_info(**crate_info_dict) From abc45a3781f9ed905ff7ca97c3818f0227ce8f8e Mon Sep 17 00:00:00 2001 From: Piotr Sikora Date: Sun, 27 Oct 2024 13:02:54 -0400 Subject: [PATCH 05/15] Disable audit and outdated checks on nightly. (#281) Neither cargo audit nor cargo outdated tools support Cargo lockfile v4 yet, so those checks are always failing. Signed-off-by: Piotr Sikora --- .github/workflows/rust.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index e17f91d3..33a62a14 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -395,11 +395,13 @@ jobs: - name: Format (manifest) run: cargo verify-project - - name: Run cargo audit - run: cargo audit + # TODO: Re-enable once cargo audit supports Cargo lockfile v4. + #- name: Run cargo audit + # run: cargo audit - - name: Run cargo outdated - run: cargo outdated --root-deps-only --exit-code 1 + # TODO: Re-enable once cargo outdated supports Cargo lockfile v4. + #- name: Run cargo outdated + # run: cargo outdated --root-deps-only --exit-code 1 - name: Rename .wasm to match expected filename run: | From 36623cd54886a60481f779977f92b019ecad9521 Mon Sep 17 00:00:00 2001 From: Piotr Sikora Date: Sun, 27 Oct 2024 13:12:21 -0400 Subject: [PATCH 06/15] Skip audit and outdated checks in examples when testing locally. (#280) Building those tools takes significant amount of time and resources, and it doesn't provide too much value in examples. Signed-off-by: Piotr Sikora --- .github/workflows/rust.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 33a62a14..2a3702d0 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -325,9 +325,11 @@ jobs: run: cargo verify-project - name: Run cargo audit + if: ${{ !env.ACT }} run: cargo audit - name: Run cargo outdated + if: ${{ !env.ACT }} run: cargo outdated --root-deps-only --exit-code 1 - name: Validate Envoy config @@ -397,10 +399,12 @@ jobs: # TODO: Re-enable once cargo audit supports Cargo lockfile v4. #- name: Run cargo audit + # if: ${{ !env.ACT }} # run: cargo audit # TODO: Re-enable once cargo outdated supports Cargo lockfile v4. #- name: Run cargo outdated + # if: ${{ !env.ACT }} # run: cargo outdated --root-deps-only --exit-code 1 - name: Rename .wasm to match expected filename From 53769674e278411460bc532fb27ede8d6f16cc7e Mon Sep 17 00:00:00 2001 From: Piotr Sikora Date: Sun, 27 Oct 2024 13:29:32 -0400 Subject: [PATCH 07/15] Cache artifacts in all GitHub Actions when testing locally. (#278) Signed-off-by: Piotr Sikora --- .github/workflows/rust.yml | 118 +++++++++++++++++++++++++++++++++++-- 1 file changed, 112 insertions(+), 6 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 2a3702d0..2fd1fa27 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -38,6 +38,14 @@ jobs: with: go-version: '^1.16' + - name: Cache + if: ${{ env.ACT }} + uses: actions/cache@v2 + with: + path: | + ~/go/pkg/mod + key: licenses-${{ hashFiles('.github/workflows/rust.yml') }} + - name: Check licenses run: | go install github.com/google/addlicense@latest @@ -53,11 +61,6 @@ jobs: with: go-version: '^1.16' - - name: Install dependencies - if: ${{ env.ACT }} - run: | - go install github.com/bazelbuild/bazelisk@v1.19.0 - - name: Cache uses: actions/cache@v2 with: @@ -66,9 +69,16 @@ jobs: ~/.cache/bazelisk ~/.cargo/.crates.toml ~/.cargo/.crates2.json + ~/.cargo/advisory-db ~/.cargo/bin ~/.cargo/registry - key: ${{ hashFiles('WORKSPACE', '.bazelrc', '.bazelversion', 'bazel/cargo/Cargo.Bazel.lock', 'bazel/dependencies.bzl', 'bazel/repositories.bzl') }} + ~/go/pkg/mod + key: bazel-${{ hashFiles('BUILD', 'WORKSPACE', '.bazelrc', '.bazelversion', 'bazel/cargo/Cargo.Bazel.lock', 'bazel/dependencies.bzl', 'bazel/repositories.bzl') }} + + - name: Install dependencies + if: ${{ env.ACT }} + run: | + go install github.com/bazelbuild/bazelisk@v1.19.0 - name: Build (wasm32-unknown-unknown) run: bazelisk --noworkspace_rc build --noenable_bzlmod --platforms=@rules_rust//rust/platform:wasm //... @@ -96,6 +106,20 @@ jobs: steps: - uses: actions/checkout@v2 + - name: Cache + if: ${{ env.ACT }} + uses: actions/cache@v2 + with: + path: | + ~/.cargo/.crates.toml + ~/.cargo/.crates2.json + ~/.cargo/advisory-db + ~/.cargo/bin + ~/.cargo/registry + ~/.rustup + **/target + key: msrv-${{ hashFiles('Cargo.toml') }} + - name: Install dependencies if: ${{ env.ACT }} run: | @@ -145,6 +169,20 @@ jobs: steps: - uses: actions/checkout@v2 + - name: Cache + if: ${{ env.ACT }} + uses: actions/cache@v2 + with: + path: | + ~/.cargo/.crates.toml + ~/.cargo/.crates2.json + ~/.cargo/advisory-db + ~/.cargo/bin + ~/.cargo/registry + ~/.rustup + **/target + key: stable-${{ hashFiles('Cargo.toml') }} + - name: Install dependencies if: ${{ env.ACT }} run: | @@ -193,6 +231,20 @@ jobs: steps: - uses: actions/checkout@v2 + - name: Cache + if: ${{ env.ACT }} + uses: actions/cache@v2 + with: + path: | + ~/.cargo/.crates.toml + ~/.cargo/.crates2.json + ~/.cargo/advisory-db + ~/.cargo/bin + ~/.cargo/registry + ~/.rustup + **/target + key: nightly-${{ hashFiles('Cargo.toml') }} + - name: Install dependencies if: ${{ env.ACT }} run: | @@ -239,6 +291,19 @@ jobs: steps: - uses: actions/checkout@v2 + - name: Cache + if: ${{ env.ACT }} + uses: actions/cache@v2 + with: + path: | + ~/.cargo/.crates.toml + ~/.cargo/.crates2.json + ~/.cargo/advisory-db + ~/.cargo/bin + ~/.cargo/registry + ~/.rustup + key: outdated-${{ hashFiles('Cargo.toml') }} + - name: Install dependencies if: ${{ env.ACT }} run: | @@ -259,6 +324,19 @@ jobs: steps: - uses: actions/checkout@v2 + - name: Cache + if: ${{ env.ACT }} + uses: actions/cache@v2 + with: + path: | + ~/.cargo/.crates.toml + ~/.cargo/.crates2.json + ~/.cargo/advisory-db + ~/.cargo/bin + ~/.cargo/registry + ~/.rustup + key: audit-${{ hashFiles('Cargo.toml') }} + - name: Install dependencies if: ${{ env.ACT }} run: | @@ -298,6 +376,20 @@ jobs: steps: - uses: actions/checkout@v2 + - name: Cache + if: ${{ env.ACT }} + uses: actions/cache@v2 + with: + path: | + ~/.cargo/.crates.toml + ~/.cargo/.crates2.json + ~/.cargo/advisory-db + ~/.cargo/bin + ~/.cargo/registry + ~/.rustup + **/target + key: example-${{ matrix.example }}-${{ hashFiles('Cargo.toml') }} + - name: Install dependencies if: ${{ env.ACT }} run: | @@ -364,6 +456,20 @@ jobs: steps: - uses: actions/checkout@v2 + - name: Cache + if: ${{ env.ACT }} + uses: actions/cache@v2 + with: + path: | + ~/.cargo/.crates.toml + ~/.cargo/.crates2.json + ~/.cargo/advisory-db + ~/.cargo/bin + ~/.cargo/registry + ~/.rustup + **/target + key: reactor-${{ matrix.example }}-${{ hashFiles('Cargo.toml') }} + - name: Install dependencies if: ${{ env.ACT }} run: | From 7266794c126e750372026512ad9bb04c7eda76e1 Mon Sep 17 00:00:00 2001 From: Piotr Sikora Date: Sun, 27 Oct 2024 13:42:28 -0400 Subject: [PATCH 08/15] Add instructions for running GitHub Actions locally. (#279) While there, rename example and reactor jobs to their plural forms. Signed-off-by: Piotr Sikora --- .github/workflows/rust.yml | 6 +++--- DEVELOPMENT.md | 32 ++++++++++++++++++++++++++++++++ README.md | 8 ++------ 3 files changed, 37 insertions(+), 9 deletions(-) create mode 100644 DEVELOPMENT.md diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 2fd1fa27..c1a72a68 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -353,7 +353,7 @@ jobs: cp -p bazel/cargo/Cargo.Bazel.lock Cargo.lock cargo audit - example: + examples: runs-on: ubuntu-latest strategy: @@ -433,7 +433,7 @@ jobs: --mode validate \ -c envoy.yaml - reactor: + reactors: runs-on: ubuntu-latest strategy: @@ -475,7 +475,7 @@ jobs: run: | curl -OL https://static.rust-lang.org/rustup/rustup-init.sh chmod +x ./rustup-init.sh - ./rustup-init.sh -y + ./rustup-init.sh -y --default-toolchain nightly rm rustup-init.sh echo "$HOME/.cargo/bin" >> $GITHUB_PATH diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md new file mode 100644 index 00000000..46b44669 --- /dev/null +++ b/DEVELOPMENT.md @@ -0,0 +1,32 @@ +# Development + +## Testing + +GitHub Actions can be executed locally using the [`act`] tool. + +All tests can be executed using: + + act + +Individual tests can be executed using `-j` and `--matrix` parameters, e.g.: + + act -j bazel + act -j stable + act -j nightly + act -j examples --matrix example:http_auth_random + +By default, all jobs are cached in `~/.cache/actcache`. This can be disabled +using the `--no-cache-server` parameter. + +## Updating Bazel dependencies + +When adding or updating Cargo dependencies, the existing Bazel `BUILD` files +must be regenerated using the [`bazelisk`] tool: + +```sh +bazelisk run //bazel/cargo:crates_vendor -- --repin all +``` + + +[`act`]: https://github.com/nektos/act +[`bazelisk`]: https://github.com/bazelbuild/bazelisk diff --git a/README.md b/README.md index 464be212..7db3cdc2 100644 --- a/README.md +++ b/README.md @@ -28,10 +28,6 @@ - [Extending Envoy with WASM and Rust](https://antweiss.com/blog/extending-envoy-with-wasm-and-rust/) - [Writing Envoy filters in Rust with WebAssembly](https://content.red-badger.com/resources/extending-istio-with-rust-and-webassembly) -## Updating dependencies +## Contributing changes -When updating dependencies, you need to regenerate Bazel `BUILD` files to match updated `Cargo.toml`: - -```sh -bazel run //bazel/cargo:crates_vendor -- --repin all -``` +See [CONTRIBUTING.md](./CONTRIBUTING.md) and [DEVELOPMENT.md](./DEVELOPMENT.md) files. From 6d88ed54d5dbb3576ecb7d50bc9adc014f700c39 Mon Sep 17 00:00:00 2001 From: Piotr Sikora Date: Sun, 27 Oct 2024 13:46:47 -0400 Subject: [PATCH 09/15] Use wasm32-wasip1 target. (#277) Note that @rules_rust//rust/platform:wasi still evaluates to wasm32-wasi, and there is no @platforms//os defined for wasip1, so this doesn't change anything for Bazel builds. Signed-off-by: Piotr Sikora --- .github/workflows/rust.yml | 48 +++++++++---------- examples/grpc_auth_random/README.md | 2 +- examples/grpc_auth_random/docker-compose.yaml | 2 +- examples/hello_world/README.md | 2 +- examples/hello_world/docker-compose.yaml | 2 +- examples/http_auth_random/README.md | 2 +- examples/http_auth_random/docker-compose.yaml | 2 +- examples/http_body/README.md | 2 +- examples/http_body/docker-compose.yaml | 2 +- examples/http_config/README.md | 2 +- examples/http_config/docker-compose.yaml | 2 +- examples/http_headers/README.md | 2 +- examples/http_headers/docker-compose.yaml | 2 +- 13 files changed, 36 insertions(+), 36 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index c1a72a68..da9683f9 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -83,7 +83,7 @@ jobs: - name: Build (wasm32-unknown-unknown) run: bazelisk --noworkspace_rc build --noenable_bzlmod --platforms=@rules_rust//rust/platform:wasm //... - - name: Build (wasm32-wasi) + - name: Build (wasm32-wasip1) run: bazelisk --noworkspace_rc build --noenable_bzlmod --platforms=@rules_rust//rust/platform:wasi //... - name: Format (buildifier) @@ -196,7 +196,7 @@ jobs: run: | rustup toolchain install stable --component clippy --component rustfmt rustup target add wasm32-unknown-unknown - rustup target add wasm32-wasi + rustup target add wasm32-wasip1 - name: Build (wasm32-unknown-unknown) run: cargo build --release --all-targets --target=wasm32-unknown-unknown @@ -204,11 +204,11 @@ jobs: - name: Clippy (wasm32-unknown-unknown) run: cargo clippy --release --all-targets --target=wasm32-unknown-unknown - - name: Build (wasm32-wasi) - run: cargo build --release --all-targets --target=wasm32-wasi + - name: Build (wasm32-wasip1) + run: cargo build --release --all-targets --target=wasm32-wasip1 - - name: Clippy (wasm32-wasi) - run: cargo clippy --release --all-targets --target=wasm32-wasi + - name: Clippy (wasm32-wasip1) + run: cargo clippy --release --all-targets --target=wasm32-wasip1 - name: Format (rustfmt) run: cargo fmt -- --check @@ -259,7 +259,7 @@ jobs: rustup toolchain install nightly --component clippy --component rustfmt rustup default nightly rustup target add wasm32-unknown-unknown - rustup target add wasm32-wasi + rustup target add wasm32-wasip1 - name: Build (wasm32-unknown-unknown) run: cargo build --release --all-targets --target=wasm32-unknown-unknown @@ -267,11 +267,11 @@ jobs: - name: Clippy (wasm32-unknown-unknown) run: cargo clippy --release --all-targets --target=wasm32-unknown-unknown - - name: Build (wasm32-wasi) - run: cargo build --release --all-targets --target=wasm32-wasi + - name: Build (wasm32-wasip1) + run: cargo build --release --all-targets --target=wasm32-wasip1 - - name: Clippy (wasm32-wasi) - run: cargo clippy --release --all-targets --target=wasm32-wasi + - name: Clippy (wasm32-wasip1) + run: cargo clippy --release --all-targets --target=wasm32-wasip1 - name: Format (rustfmt) run: cargo fmt -- --check @@ -402,13 +402,13 @@ jobs: - name: Update Rust run: | rustup toolchain install stable --component clippy --component rustfmt - rustup target add wasm32-wasi + rustup target add wasm32-wasip1 - - name: Build (wasm32-wasi) - run: cargo build --release --target=wasm32-wasi + - name: Build (wasm32-wasip1) + run: cargo build --release --target=wasm32-wasip1 - - name: Clippy (wasm32-wasi) - run: cargo clippy --release --target=wasm32-wasi + - name: Clippy (wasm32-wasip1) + run: cargo clippy --release --target=wasm32-wasip1 - name: Format (rustfmt) run: cargo fmt -- --check @@ -428,7 +428,7 @@ jobs: run: | docker run --rm \ -v $(pwd)/envoy.yaml:/envoy.yaml \ - -v $(pwd)/target/wasm32-wasi/release:/etc/envoy/proxy-wasm-plugins \ + -v $(pwd)/target/wasm32-wasip1/release:/etc/envoy/proxy-wasm-plugins \ envoyproxy/envoy:v1.31-latest \ --mode validate \ -c envoy.yaml @@ -482,8 +482,8 @@ jobs: - name: Update Rust run: | rustup toolchain install nightly --component clippy --component rustfmt - rustup +nightly target add wasm32-wasi rustup default nightly + rustup target add wasm32-wasip1 - name: Change crate type from library to binary run: | @@ -491,11 +491,11 @@ jobs: grep -v '^crate-type' Cargo.tmp > Cargo.toml mv src/lib.rs src/main.rs - - name: Build (wasm32-wasi) - run: cargo build --release --target=wasm32-wasi + - name: Build (wasm32-wasip1) + run: cargo build --release --target=wasm32-wasip1 - - name: Clippy (wasm32-wasi) - run: cargo clippy --release --target=wasm32-wasi + - name: Clippy (wasm32-wasip1) + run: cargo clippy --release --target=wasm32-wasip1 - name: Format (rustfmt) run: cargo fmt -- --check @@ -515,7 +515,7 @@ jobs: - name: Rename .wasm to match expected filename run: | - cd target/wasm32-wasi/release + cd target/wasm32-wasip1/release for file in $(ls -1 *.wasm); do \ mv $file $(echo $file | sed 's/-/_/g'); \ done @@ -524,7 +524,7 @@ jobs: run: | docker run --rm \ -v $(pwd)/envoy.yaml:/envoy.yaml \ - -v $(pwd)/target/wasm32-wasi/release:/etc/envoy/proxy-wasm-plugins \ + -v $(pwd)/target/wasm32-wasip1/release:/etc/envoy/proxy-wasm-plugins \ envoyproxy/envoy:v1.31-latest \ --mode validate \ -c envoy.yaml diff --git a/examples/grpc_auth_random/README.md b/examples/grpc_auth_random/README.md index a153bb57..3c0028a7 100644 --- a/examples/grpc_auth_random/README.md +++ b/examples/grpc_auth_random/README.md @@ -5,7 +5,7 @@ Proxy-Wasm plugin that grants access based on a result of gRPC callout. ### Building ```sh -$ cargo build --target wasm32-wasi --release +$ cargo build --target wasm32-wasip1 --release ``` ### Using in Envoy diff --git a/examples/grpc_auth_random/docker-compose.yaml b/examples/grpc_auth_random/docker-compose.yaml index 267aaf50..40a2efb3 100644 --- a/examples/grpc_auth_random/docker-compose.yaml +++ b/examples/grpc_auth_random/docker-compose.yaml @@ -20,7 +20,7 @@ services: - "10000:10000" volumes: - ./envoy.yaml:/etc/envoy/envoy.yaml - - ./target/wasm32-wasi/release:/etc/envoy/proxy-wasm-plugins + - ./target/wasm32-wasip1/release:/etc/envoy/proxy-wasm-plugins networks: - envoymesh depends_on: diff --git a/examples/hello_world/README.md b/examples/hello_world/README.md index 48cab8b2..f830d714 100644 --- a/examples/hello_world/README.md +++ b/examples/hello_world/README.md @@ -5,7 +5,7 @@ Proxy-Wasm background service plugin that logs time and random numbers. ### Building ```sh -$ cargo build --target wasm32-wasi --release +$ cargo build --target wasm32-wasip1 --release ``` ### Using in Envoy diff --git a/examples/hello_world/docker-compose.yaml b/examples/hello_world/docker-compose.yaml index cbd96355..844dc9b7 100644 --- a/examples/hello_world/docker-compose.yaml +++ b/examples/hello_world/docker-compose.yaml @@ -20,7 +20,7 @@ services: - "10000:10000" volumes: - ./envoy.yaml:/etc/envoy/envoy.yaml - - ./target/wasm32-wasi/release:/etc/envoy/proxy-wasm-plugins + - ./target/wasm32-wasip1/release:/etc/envoy/proxy-wasm-plugins networks: - envoymesh networks: diff --git a/examples/http_auth_random/README.md b/examples/http_auth_random/README.md index 08ea67ad..d604efa2 100644 --- a/examples/http_auth_random/README.md +++ b/examples/http_auth_random/README.md @@ -5,7 +5,7 @@ Proxy-Wasm plugin that grants access based on a result of HTTP callout. ### Building ```sh -$ cargo build --target wasm32-wasi --release +$ cargo build --target wasm32-wasip1 --release ``` ### Using in Envoy diff --git a/examples/http_auth_random/docker-compose.yaml b/examples/http_auth_random/docker-compose.yaml index 6a188511..1dbb8238 100644 --- a/examples/http_auth_random/docker-compose.yaml +++ b/examples/http_auth_random/docker-compose.yaml @@ -20,7 +20,7 @@ services: - "10000:10000" volumes: - ./envoy.yaml:/etc/envoy/envoy.yaml - - ./target/wasm32-wasi/release:/etc/envoy/proxy-wasm-plugins + - ./target/wasm32-wasip1/release:/etc/envoy/proxy-wasm-plugins networks: - envoymesh depends_on: diff --git a/examples/http_body/README.md b/examples/http_body/README.md index 87185540..466eaf73 100644 --- a/examples/http_body/README.md +++ b/examples/http_body/README.md @@ -5,7 +5,7 @@ Proxy-Wasm plugin that redacts sensitive HTTP responses. ### Building ```sh -$ cargo build --target wasm32-wasi --release +$ cargo build --target wasm32-wasip1 --release ``` ### Using in Envoy diff --git a/examples/http_body/docker-compose.yaml b/examples/http_body/docker-compose.yaml index cbd96355..844dc9b7 100644 --- a/examples/http_body/docker-compose.yaml +++ b/examples/http_body/docker-compose.yaml @@ -20,7 +20,7 @@ services: - "10000:10000" volumes: - ./envoy.yaml:/etc/envoy/envoy.yaml - - ./target/wasm32-wasi/release:/etc/envoy/proxy-wasm-plugins + - ./target/wasm32-wasip1/release:/etc/envoy/proxy-wasm-plugins networks: - envoymesh networks: diff --git a/examples/http_config/README.md b/examples/http_config/README.md index e14b55d9..7f49a545 100644 --- a/examples/http_config/README.md +++ b/examples/http_config/README.md @@ -5,7 +5,7 @@ Proxy-Wasm plugin that injects HTTP response header with a value from Envoy conf ### Building ```sh -$ cargo build --target wasm32-wasi --release +$ cargo build --target wasm32-wasip1 --release ``` ### Using in Envoy diff --git a/examples/http_config/docker-compose.yaml b/examples/http_config/docker-compose.yaml index cbd96355..844dc9b7 100644 --- a/examples/http_config/docker-compose.yaml +++ b/examples/http_config/docker-compose.yaml @@ -20,7 +20,7 @@ services: - "10000:10000" volumes: - ./envoy.yaml:/etc/envoy/envoy.yaml - - ./target/wasm32-wasi/release:/etc/envoy/proxy-wasm-plugins + - ./target/wasm32-wasip1/release:/etc/envoy/proxy-wasm-plugins networks: - envoymesh networks: diff --git a/examples/http_headers/README.md b/examples/http_headers/README.md index 6180cde8..d64590a5 100644 --- a/examples/http_headers/README.md +++ b/examples/http_headers/README.md @@ -5,7 +5,7 @@ Proxy-Wasm plugin that logs HTTP request/response headers. ### Building ```sh -$ cargo build --target wasm32-wasi --release +$ cargo build --target wasm32-wasip1 --release ``` ### Using in Envoy diff --git a/examples/http_headers/docker-compose.yaml b/examples/http_headers/docker-compose.yaml index cbd96355..844dc9b7 100644 --- a/examples/http_headers/docker-compose.yaml +++ b/examples/http_headers/docker-compose.yaml @@ -20,7 +20,7 @@ services: - "10000:10000" volumes: - ./envoy.yaml:/etc/envoy/envoy.yaml - - ./target/wasm32-wasi/release:/etc/envoy/proxy-wasm-plugins + - ./target/wasm32-wasip1/release:/etc/envoy/proxy-wasm-plugins networks: - envoymesh networks: From 764fcead559a20a247787a1ac62bcc918478fbfe Mon Sep 17 00:00:00 2001 From: Piotr Sikora Date: Sun, 1 Dec 2024 21:38:31 -0500 Subject: [PATCH 10/15] Optimize Vec allocations in map deserialization. (#285) Before: utils::bench_deserialize_map ... bench: 171.39 ns/iter (+/- 3.53) utils::bench_deserialize_map_bytes ... bench: 148.27 ns/iter (+/- 3.19) After: utils::bench_deserialize_map ... bench: 168.34 ns/iter (+/- 3.19) utils::bench_deserialize_map_bytes ... bench: 145.40 ns/iter (+/- 1.92) Signed-off-by: Piotr Sikora --- src/hostcalls.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/hostcalls.rs b/src/hostcalls.rs index 15687888..f8252c56 100644 --- a/src/hostcalls.rs +++ b/src/hostcalls.rs @@ -152,8 +152,8 @@ pub fn get_map(map_type: MapType) -> Result, Status> { match proxy_get_header_map_pairs(map_type, &mut return_data, &mut return_size) { Status::Ok => { if !return_data.is_null() { - let serialized_map = Vec::from_raw_parts(return_data, return_size, return_size); - Ok(utils::deserialize_map(&serialized_map)) + let serialized_map = std::slice::from_raw_parts(return_data, return_size); + Ok(utils::deserialize_map(serialized_map)) } else { Ok(Vec::new()) } @@ -170,8 +170,8 @@ pub fn get_map_bytes(map_type: MapType) -> Result, Status> match proxy_get_header_map_pairs(map_type, &mut return_data, &mut return_size) { Status::Ok => { if !return_data.is_null() { - let serialized_map = Vec::from_raw_parts(return_data, return_size, return_size); - Ok(utils::deserialize_map_bytes(&serialized_map)) + let serialized_map = std::slice::from_raw_parts(return_data, return_size); + Ok(utils::deserialize_map_bytes(serialized_map)) } else { Ok(Vec::new()) } @@ -1200,11 +1200,11 @@ mod utils { } pub(super) fn deserialize_map(bytes: &[u8]) -> Vec<(String, String)> { - let mut map = Vec::new(); if bytes.is_empty() { - return map; + return Vec::new(); } let size = u32::from_le_bytes(<[u8; 4]>::try_from(&bytes[0..4]).unwrap()) as usize; + let mut map = Vec::with_capacity(size); let mut p = 4 + size * 8; for n in 0..size { let s = 4 + n * 8; @@ -1224,11 +1224,11 @@ mod utils { } pub(super) fn deserialize_map_bytes(bytes: &[u8]) -> Vec<(String, Bytes)> { - let mut map = Vec::new(); if bytes.is_empty() { - return map; + return Vec::new(); } let size = u32::from_le_bytes(<[u8; 4]>::try_from(&bytes[0..4]).unwrap()) as usize; + let mut map = Vec::with_capacity(size); let mut p = 4 + size * 8; for n in 0..size { let s = 4 + n * 8; From 597634dbba0f3fa201e39abc025f2dcc31f97fae Mon Sep 17 00:00:00 2001 From: Piotr Sikora Date: Sun, 1 Dec 2024 21:39:15 -0500 Subject: [PATCH 11/15] Update MSRV to Rust v1.65.0. (#291) Hashbrown updated its MSRV in a patch release (v0.15.1), so we have to follow. Signed-off-by: Piotr Sikora --- .github/workflows/rust.yml | 6 +++--- Cargo.toml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index da9683f9..76bd7980 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -125,14 +125,14 @@ jobs: run: | curl -OL https://static.rust-lang.org/rustup/rustup-init.sh chmod +x ./rustup-init.sh - ./rustup-init.sh -y --default-toolchain 1.64.0 + ./rustup-init.sh -y --default-toolchain 1.65.0 rm rustup-init.sh echo "$HOME/.cargo/bin" >> $GITHUB_PATH - name: Update Rust run: | - rustup toolchain install 1.64.0 --component clippy --component rustfmt - rustup default 1.64.0 + rustup toolchain install 1.65.0 --component clippy --component rustfmt + rustup default 1.65.0 rustup target add wasm32-unknown-unknown rustup target add wasm32-wasi diff --git a/Cargo.toml b/Cargo.toml index 24193eb8..7b0469bc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ name = "proxy-wasm" version = "0.2.3-dev" authors = ["Piotr Sikora "] -rust-version = "1.64" +rust-version = "1.65" description = "WebAssembly for Proxies" readme = "README.md" license = "Apache-2.0" From 1ce09fdd0a3eede1ee693252bf1c229e7b69f2e9 Mon Sep 17 00:00:00 2001 From: Piotr Sikora Date: Mon, 2 Dec 2024 08:50:09 -0500 Subject: [PATCH 12/15] Use cargo outdated fork to workaround its outdated dependencies. (#292) While there, re-enable cargo audit now that it supports Cargo lockfile v4. Signed-off-by: Piotr Sikora --- .github/workflows/rust.yml | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 76bd7980..4087b156 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -312,11 +312,12 @@ jobs: ./rustup-init.sh -y rm rustup-init.sh echo "$HOME/.cargo/bin" >> $GITHUB_PATH - export PATH=$PATH:$HOME/.cargo/bin - cargo install cargo-outdated - name: Run cargo outdated - run: cargo outdated --root-deps-only --exit-code 1 + run: | + # TODO: Switch back to the official version once it supports Cargo lockfile v4. + cargo install --git https://github.com/MonterraByte/cargo-outdated.git --branch cargo-update + cargo outdated --root-deps-only --exit-code 1 audit: runs-on: ubuntu-latest @@ -420,9 +421,10 @@ jobs: if: ${{ !env.ACT }} run: cargo audit - - name: Run cargo outdated - if: ${{ !env.ACT }} - run: cargo outdated --root-deps-only --exit-code 1 + # TODO: Re-enable once cargo outdated supports Cargo lockfile v4. + #- name: Run cargo outdated + # if: ${{ !env.ACT }} + # run: cargo outdated --root-deps-only --exit-code 1 - name: Validate Envoy config run: | @@ -503,10 +505,9 @@ jobs: - name: Format (manifest) run: cargo verify-project - # TODO: Re-enable once cargo audit supports Cargo lockfile v4. - #- name: Run cargo audit - # if: ${{ !env.ACT }} - # run: cargo audit + - name: Run cargo audit + if: ${{ !env.ACT }} + run: cargo audit # TODO: Re-enable once cargo outdated supports Cargo lockfile v4. #- name: Run cargo outdated From c1485d3d59927302cdeb9617f00c73274f8bbf2b Mon Sep 17 00:00:00 2001 From: Piotr Sikora Date: Wed, 15 Jan 2025 05:35:37 -0500 Subject: [PATCH 13/15] Adjust GitHub Actions for Ubuntu 24.04. (#297) GitHub migrated `ubuntu-latest` to `ubuntu-24.04`, which comes with a different set of pre-installed software. Most notably, both cargo audit and outdated tools are missing. While there, pin runner image and tools to specific versions. Signed-off-by: Piotr Sikora --- .actrc | 1 + .github/workflows/rust.yml | 102 ++++++++++++++++++------------------- 2 files changed, 52 insertions(+), 51 deletions(-) create mode 100644 .actrc diff --git a/.actrc b/.actrc new file mode 100644 index 00000000..e497961c --- /dev/null +++ b/.actrc @@ -0,0 +1 @@ +-P ubuntu-24.04=catthehacker/ubuntu:act-24.04 diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 4087b156..4e3b338d 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -30,7 +30,7 @@ on: jobs: licenses: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v2 @@ -46,14 +46,17 @@ jobs: ~/go/pkg/mod key: licenses-${{ hashFiles('.github/workflows/rust.yml') }} - - name: Check licenses + - name: Install dependencies run: | - go install github.com/google/addlicense@latest + go install github.com/google/addlicense@v1.1.1 export PATH=$PATH:$(go env GOPATH)/bin + + - name: Check licenses + run: | addlicense -check -ignore "bazel/cargo/remote/**" . bazel: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v2 @@ -73,12 +76,13 @@ jobs: ~/.cargo/bin ~/.cargo/registry ~/go/pkg/mod - key: bazel-${{ hashFiles('BUILD', 'WORKSPACE', '.bazelrc', '.bazelversion', 'bazel/cargo/Cargo.Bazel.lock', 'bazel/dependencies.bzl', 'bazel/repositories.bzl') }} + key: bazel-${{ hashFiles('.github/workflows/rust.yml', 'BUILD', 'WORKSPACE', '.bazelrc', '.bazelversion', 'bazel/cargo/Cargo.Bazel.lock', 'bazel/dependencies.bzl', 'bazel/repositories.bzl') }} - name: Install dependencies - if: ${{ env.ACT }} run: | - go install github.com/bazelbuild/bazelisk@v1.19.0 + go install github.com/bazelbuild/bazelisk@v1.25.0 + go install github.com/bazelbuild/buildtools/buildifier@v0.0.0-20241212155839-a9c248f4b684 + export PATH=$PATH:$(go env GOPATH)/bin - name: Build (wasm32-unknown-unknown) run: bazelisk --noworkspace_rc build --noenable_bzlmod --platforms=@rules_rust//rust/platform:wasm //... @@ -88,8 +92,6 @@ jobs: - name: Format (buildifier) run: | - go install github.com/bazelbuild/buildtools/buildifier@latest - export PATH=$PATH:$(go env GOPATH)/bin buildifier -mode=check -r . - name: Format (rules_rust) @@ -98,7 +100,7 @@ jobs: git diff --exit-code msrv: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 env: RUSTFLAGS: -D warnings @@ -120,7 +122,7 @@ jobs: **/target key: msrv-${{ hashFiles('Cargo.toml') }} - - name: Install dependencies + - name: Install Rustup if: ${{ env.ACT }} run: | curl -OL https://static.rust-lang.org/rustup/rustup-init.sh @@ -161,7 +163,7 @@ jobs: run: cargo publish --dry-run --target=wasm32-unknown-unknown stable: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 env: RUSTFLAGS: -D warnings @@ -183,7 +185,7 @@ jobs: **/target key: stable-${{ hashFiles('Cargo.toml') }} - - name: Install dependencies + - name: Install Rustup if: ${{ env.ACT }} run: | curl -OL https://static.rust-lang.org/rustup/rustup-init.sh @@ -223,7 +225,7 @@ jobs: run: cargo publish --dry-run --target=wasm32-unknown-unknown nightly: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 env: RUSTFLAGS: -D warnings @@ -245,7 +247,7 @@ jobs: **/target key: nightly-${{ hashFiles('Cargo.toml') }} - - name: Install dependencies + - name: Install Rustup if: ${{ env.ACT }} run: | curl -OL https://static.rust-lang.org/rustup/rustup-init.sh @@ -286,13 +288,12 @@ jobs: run: cargo publish --dry-run --target=wasm32-unknown-unknown outdated: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v2 - name: Cache - if: ${{ env.ACT }} uses: actions/cache@v2 with: path: | @@ -302,9 +303,9 @@ jobs: ~/.cargo/bin ~/.cargo/registry ~/.rustup - key: outdated-${{ hashFiles('Cargo.toml') }} + key: outdated-${{ hashFiles('.github/workflows/rust.yml', 'Cargo.toml') }} - - name: Install dependencies + - name: Install Rustup if: ${{ env.ACT }} run: | curl -OL https://static.rust-lang.org/rustup/rustup-init.sh @@ -313,20 +314,28 @@ jobs: rm rustup-init.sh echo "$HOME/.cargo/bin" >> $GITHUB_PATH - - name: Run cargo outdated + - name: Install dependencies + run: | + cargo install cargo-outdated --version 0.16.0 + + - name: Run cargo outdated (main) run: | - # TODO: Switch back to the official version once it supports Cargo lockfile v4. - cargo install --git https://github.com/MonterraByte/cargo-outdated.git --branch cargo-update cargo outdated --root-deps-only --exit-code 1 + - name: Run cargo outdated (examples) + run: | + for example in $(find examples -name Cargo.toml); do \ + cd $(dirname $GITHUB_WORKSPACE/$example); \ + cargo outdated --root-deps-only --exit-code 1; \ + done + audit: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v2 - name: Cache - if: ${{ env.ACT }} uses: actions/cache@v2 with: path: | @@ -336,9 +345,9 @@ jobs: ~/.cargo/bin ~/.cargo/registry ~/.rustup - key: audit-${{ hashFiles('Cargo.toml') }} + key: audit-${{ hashFiles('.github/workflows/rust.yml', 'Cargo.toml') }} - - name: Install dependencies + - name: Install Rustup if: ${{ env.ACT }} run: | curl -OL https://static.rust-lang.org/rustup/rustup-init.sh @@ -346,16 +355,25 @@ jobs: ./rustup-init.sh -y rm rustup-init.sh echo "$HOME/.cargo/bin" >> $GITHUB_PATH - export PATH=$PATH:$HOME/.cargo/bin - cargo install cargo-audit - - name: Run cargo audit + - name: Install dependencies + run: | + cargo install cargo-audit --version 0.21.0 + + - name: Run cargo audit (main) run: | cp -p bazel/cargo/Cargo.Bazel.lock Cargo.lock cargo audit + - name: Run cargo audit (examples) + run: | + for example in $(find examples -name Cargo.toml); do \ + cd $(dirname $GITHUB_WORKSPACE/$example); \ + cargo audit; \ + done + examples: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 strategy: matrix: @@ -391,7 +409,7 @@ jobs: **/target key: example-${{ matrix.example }}-${{ hashFiles('Cargo.toml') }} - - name: Install dependencies + - name: Install Rustup if: ${{ env.ACT }} run: | curl -OL https://static.rust-lang.org/rustup/rustup-init.sh @@ -417,15 +435,6 @@ jobs: - name: Format (manifest) run: cargo verify-project - - name: Run cargo audit - if: ${{ !env.ACT }} - run: cargo audit - - # TODO: Re-enable once cargo outdated supports Cargo lockfile v4. - #- name: Run cargo outdated - # if: ${{ !env.ACT }} - # run: cargo outdated --root-deps-only --exit-code 1 - - name: Validate Envoy config run: | docker run --rm \ @@ -436,7 +445,7 @@ jobs: -c envoy.yaml reactors: - runs-on: ubuntu-latest + runs-on: ubuntu-24.04 strategy: matrix: @@ -472,7 +481,7 @@ jobs: **/target key: reactor-${{ matrix.example }}-${{ hashFiles('Cargo.toml') }} - - name: Install dependencies + - name: Install Rustup if: ${{ env.ACT }} run: | curl -OL https://static.rust-lang.org/rustup/rustup-init.sh @@ -505,15 +514,6 @@ jobs: - name: Format (manifest) run: cargo verify-project - - name: Run cargo audit - if: ${{ !env.ACT }} - run: cargo audit - - # TODO: Re-enable once cargo outdated supports Cargo lockfile v4. - #- name: Run cargo outdated - # if: ${{ !env.ACT }} - # run: cargo outdated --root-deps-only --exit-code 1 - - name: Rename .wasm to match expected filename run: | cd target/wasm32-wasip1/release From e71c1afe038a2541e6fd19d770fee43e45ecaaa7 Mon Sep 17 00:00:00 2001 From: Piotr Sikora Date: Wed, 15 Jan 2025 05:46:08 -0500 Subject: [PATCH 14/15] Update hashbrown to v0.15.2. (#298) The RUSTSEC-2024-0402 advisory was published for a feature of hashbrown that we don't use, but we need to update its version in the lockfile to silence the warning. Signed-off-by: Piotr Sikora --- bazel/cargo/Cargo.Bazel.lock | 12 +++---- ...azel => BUILD.allocator-api2-0.2.21.bazel} | 2 +- bazel/cargo/remote/BUILD.bazel | 2 +- ...0.1.3.bazel => BUILD.foldhash-0.1.4.bazel} | 2 +- ...5.0.bazel => BUILD.hashbrown-0.15.2.bazel} | 6 ++-- bazel/cargo/remote/defs.bzl | 34 +++++++++---------- 6 files changed, 29 insertions(+), 29 deletions(-) rename bazel/cargo/remote/{BUILD.allocator-api2-0.2.18.bazel => BUILD.allocator-api2-0.2.21.bazel} (99%) rename bazel/cargo/remote/{BUILD.foldhash-0.1.3.bazel => BUILD.foldhash-0.1.4.bazel} (99%) rename bazel/cargo/remote/{BUILD.hashbrown-0.15.0.bazel => BUILD.hashbrown-0.15.2.bazel} (96%) diff --git a/bazel/cargo/Cargo.Bazel.lock b/bazel/cargo/Cargo.Bazel.lock index f4d451ea..00f3900a 100644 --- a/bazel/cargo/Cargo.Bazel.lock +++ b/bazel/cargo/Cargo.Bazel.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "allocator-api2" -version = "0.2.18" +version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" [[package]] name = "equivalent" @@ -16,15 +16,15 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "foldhash" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f81ec6369c545a7d40e4589b5597581fa1c441fe1cce96dd1de43159910a36a2" +checksum = "a0d2fde1f7b3d48b8395d5f2de76c18a528bd6a9cdde438df747bfcba3e05d6f" [[package]] name = "hashbrown" -version = "0.15.0" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" dependencies = [ "allocator-api2", "equivalent", diff --git a/bazel/cargo/remote/BUILD.allocator-api2-0.2.18.bazel b/bazel/cargo/remote/BUILD.allocator-api2-0.2.21.bazel similarity index 99% rename from bazel/cargo/remote/BUILD.allocator-api2-0.2.18.bazel rename to bazel/cargo/remote/BUILD.allocator-api2-0.2.21.bazel index 15db0bd5..0c6e7433 100644 --- a/bazel/cargo/remote/BUILD.allocator-api2-0.2.18.bazel +++ b/bazel/cargo/remote/BUILD.allocator-api2-0.2.21.bazel @@ -80,5 +80,5 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-none": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "0.2.18", + version = "0.2.21", ) diff --git a/bazel/cargo/remote/BUILD.bazel b/bazel/cargo/remote/BUILD.bazel index f62c1da8..fadb2745 100644 --- a/bazel/cargo/remote/BUILD.bazel +++ b/bazel/cargo/remote/BUILD.bazel @@ -33,7 +33,7 @@ filegroup( # Workspace Member Dependencies alias( name = "hashbrown", - actual = "@crates_vendor__hashbrown-0.15.0//:hashbrown", + actual = "@crates_vendor__hashbrown-0.15.2//:hashbrown", tags = ["manual"], ) diff --git a/bazel/cargo/remote/BUILD.foldhash-0.1.3.bazel b/bazel/cargo/remote/BUILD.foldhash-0.1.4.bazel similarity index 99% rename from bazel/cargo/remote/BUILD.foldhash-0.1.3.bazel rename to bazel/cargo/remote/BUILD.foldhash-0.1.4.bazel index ff3aed7d..ebff4d28 100644 --- a/bazel/cargo/remote/BUILD.foldhash-0.1.3.bazel +++ b/bazel/cargo/remote/BUILD.foldhash-0.1.4.bazel @@ -77,5 +77,5 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-none": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "0.1.3", + version = "0.1.4", ) diff --git a/bazel/cargo/remote/BUILD.hashbrown-0.15.0.bazel b/bazel/cargo/remote/BUILD.hashbrown-0.15.2.bazel similarity index 96% rename from bazel/cargo/remote/BUILD.hashbrown-0.15.0.bazel rename to bazel/cargo/remote/BUILD.hashbrown-0.15.2.bazel index 66f0728c..5b55c9c2 100644 --- a/bazel/cargo/remote/BUILD.hashbrown-0.15.0.bazel +++ b/bazel/cargo/remote/BUILD.hashbrown-0.15.2.bazel @@ -85,10 +85,10 @@ rust_library( "@rules_rust//rust/platform:x86_64-unknown-none": [], "//conditions:default": ["@platforms//:incompatible"], }), - version = "0.15.0", + version = "0.15.2", deps = [ - "@crates_vendor__allocator-api2-0.2.18//:allocator_api2", + "@crates_vendor__allocator-api2-0.2.21//:allocator_api2", "@crates_vendor__equivalent-1.0.1//:equivalent", - "@crates_vendor__foldhash-0.1.3//:foldhash", + "@crates_vendor__foldhash-0.1.4//:foldhash", ], ) diff --git a/bazel/cargo/remote/defs.bzl b/bazel/cargo/remote/defs.bzl index e4051261..0a8b604b 100644 --- a/bazel/cargo/remote/defs.bzl +++ b/bazel/cargo/remote/defs.bzl @@ -295,7 +295,7 @@ def aliases( _NORMAL_DEPENDENCIES = { "": { _COMMON_CONDITION: { - "hashbrown": Label("@crates_vendor__hashbrown-0.15.0//:hashbrown"), + "hashbrown": Label("@crates_vendor__hashbrown-0.15.2//:hashbrown"), "log": Label("@crates_vendor__log-0.4.22//:log"), }, }, @@ -405,12 +405,12 @@ def crate_repositories(): """ maybe( http_archive, - name = "crates_vendor__allocator-api2-0.2.18", - sha256 = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f", + name = "crates_vendor__allocator-api2-0.2.21", + sha256 = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923", type = "tar.gz", - urls = ["https://static.crates.io/crates/allocator-api2/0.2.18/download"], - strip_prefix = "allocator-api2-0.2.18", - build_file = Label("@proxy_wasm_rust_sdk//bazel/cargo/remote:BUILD.allocator-api2-0.2.18.bazel"), + urls = ["https://static.crates.io/crates/allocator-api2/0.2.21/download"], + strip_prefix = "allocator-api2-0.2.21", + build_file = Label("@proxy_wasm_rust_sdk//bazel/cargo/remote:BUILD.allocator-api2-0.2.21.bazel"), ) maybe( @@ -425,22 +425,22 @@ def crate_repositories(): maybe( http_archive, - name = "crates_vendor__foldhash-0.1.3", - sha256 = "f81ec6369c545a7d40e4589b5597581fa1c441fe1cce96dd1de43159910a36a2", + name = "crates_vendor__foldhash-0.1.4", + sha256 = "a0d2fde1f7b3d48b8395d5f2de76c18a528bd6a9cdde438df747bfcba3e05d6f", type = "tar.gz", - urls = ["https://static.crates.io/crates/foldhash/0.1.3/download"], - strip_prefix = "foldhash-0.1.3", - build_file = Label("@proxy_wasm_rust_sdk//bazel/cargo/remote:BUILD.foldhash-0.1.3.bazel"), + urls = ["https://static.crates.io/crates/foldhash/0.1.4/download"], + strip_prefix = "foldhash-0.1.4", + build_file = Label("@proxy_wasm_rust_sdk//bazel/cargo/remote:BUILD.foldhash-0.1.4.bazel"), ) maybe( http_archive, - name = "crates_vendor__hashbrown-0.15.0", - sha256 = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb", + name = "crates_vendor__hashbrown-0.15.2", + sha256 = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289", type = "tar.gz", - urls = ["https://static.crates.io/crates/hashbrown/0.15.0/download"], - strip_prefix = "hashbrown-0.15.0", - build_file = Label("@proxy_wasm_rust_sdk//bazel/cargo/remote:BUILD.hashbrown-0.15.0.bazel"), + urls = ["https://static.crates.io/crates/hashbrown/0.15.2/download"], + strip_prefix = "hashbrown-0.15.2", + build_file = Label("@proxy_wasm_rust_sdk//bazel/cargo/remote:BUILD.hashbrown-0.15.2.bazel"), ) maybe( @@ -454,6 +454,6 @@ def crate_repositories(): ) return [ - struct(repo = "crates_vendor__hashbrown-0.15.0", is_dev_dep = False), + struct(repo = "crates_vendor__hashbrown-0.15.2", is_dev_dep = False), struct(repo = "crates_vendor__log-0.4.22", is_dev_dep = False), ] From c502d382db34cae18fefc252b4b67efc636ae777 Mon Sep 17 00:00:00 2001 From: Piotr Sikora Date: Wed, 15 Jan 2025 05:59:27 -0500 Subject: [PATCH 15/15] Fix conditional attributes in exported allocator name. (#299) `#[export_name]` already takes precedence over `#[no_mangle]`, so this is a no-op, but it silences the warning. Found with nightly. Signed-off-by: Piotr Sikora --- src/allocator.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/allocator.rs b/src/allocator.rs index aef28f5a..852d0194 100644 --- a/src/allocator.rs +++ b/src/allocator.rs @@ -18,7 +18,7 @@ use std::mem::MaybeUninit; all(target_arch = "wasm32", target_os = "unknown"), export_name = "malloc" )] -#[no_mangle] +#[cfg_attr(not(all(target_arch = "wasm32", target_os = "unknown")), no_mangle)] pub extern "C" fn proxy_on_memory_allocate(size: usize) -> *mut u8 { let mut vec: Vec> = Vec::with_capacity(size); unsafe {