diff --git a/bazel/WASM.md b/bazel/WASM.md index 3952f36d8fbf..df717e59d512 100644 --- a/bazel/WASM.md +++ b/bazel/WASM.md @@ -3,17 +3,5 @@ WebAssembly tests are built using [Proxy-Wasm C++ SDK] and [Proxy-Wasm Rust SDK], as such, they bring their own set of dependencies. -## Cargo dependencies. - -In order to update Cargo dependencies, please make sure that Rust and Cargo -are installed, and run this tool: - -``` -bash tools/update_cargo.sh -``` - -which will regenerate Bazel rules in `bazel/external/cargo/`. - - [Proxy-Wasm C++ SDK]: https://github.com/proxy-wasm/proxy-wasm-cpp-sdk [Proxy-Wasm Rust SDK]: https://github.com/proxy-wasm/proxy-wasm-rust-sdk diff --git a/bazel/dependency_imports.bzl b/bazel/dependency_imports.bzl index dc02f5056cd0..62b71950c9ed 100644 --- a/bazel/dependency_imports.bzl +++ b/bazel/dependency_imports.bzl @@ -6,7 +6,6 @@ load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies", "go_repository") load("@build_bazel_rules_apple//apple:repositories.bzl", "apple_rules_dependencies") load("@upb//bazel:repository_defs.bzl", upb_bazel_version_repository = "bazel_version_repository") load("@io_bazel_rules_rust//rust:repositories.bzl", "rust_repositories") -load("@io_bazel_rules_rust//:workspace.bzl", "bazel_version") load("@config_validation_pip3//:requirements.bzl", config_validation_pip_install = "pip_install") load("@configs_pip3//:requirements.bzl", configs_pip_install = "pip_install") load("@headersplit_pip3//:requirements.bzl", headersplit_pip_install = "pip_install") @@ -14,6 +13,7 @@ load("@kafka_pip3//:requirements.bzl", kafka_pip_install = "pip_install") load("@protodoc_pip3//:requirements.bzl", protodoc_pip_install = "pip_install") load("@thrift_pip3//:requirements.bzl", thrift_pip_install = "pip_install") load("@rules_antlr//antlr:deps.bzl", "antlr_dependencies") +load("@proxy_wasm_rust_sdk//bazel:dependencies.bzl", "proxy_wasm_rust_sdk_dependencies") # go version for rules_go GO_VERSION = "1.14.7" @@ -26,9 +26,9 @@ def envoy_dependency_imports(go_version = GO_VERSION): gazelle_dependencies() apple_rules_dependencies() rust_repositories() - bazel_version(name = "bazel_version") upb_bazel_version_repository(name = "upb_bazel_version") antlr_dependencies(472) + proxy_wasm_rust_sdk_dependencies() custom_exec_properties( name = "envoy_large_machine_exec_property", diff --git a/bazel/external/cargo/BUILD.bazel b/bazel/external/cargo/BUILD.bazel deleted file mode 100644 index fc6e9cba72eb..000000000000 --- a/bazel/external/cargo/BUILD.bazel +++ /dev/null @@ -1,31 +0,0 @@ -""" -@generated -cargo-raze workspace build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -package(default_visibility = ["//visibility:public"]) - -licenses([ - "notice", # See individual crates for specific licenses -]) - -# Aliased targets -alias( - name = "log", - actual = "@raze__log__0_4_11//:log", - tags = [ - "cargo-raze", - "manual", - ], -) - -alias( - name = "proxy_wasm", - actual = "@raze__proxy_wasm__0_1_2//:proxy_wasm", - tags = [ - "cargo-raze", - "manual", - ], -) diff --git a/bazel/external/cargo/Cargo.lock b/bazel/external/cargo/Cargo.lock deleted file mode 100644 index f5cb1dfe9d10..000000000000 --- a/bazel/external/cargo/Cargo.lock +++ /dev/null @@ -1,103 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -[[package]] -name = "ahash" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8fd72866655d1904d6b0997d0b07ba561047d070fbe29de039031c641b61217" - -[[package]] -name = "autocfg" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" - -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - -[[package]] -name = "hashbrown" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96282e96bfcd3da0d3aa9938bedf1e50df3269b6db08b4876d2da0bb1a0841cf" -dependencies = [ - "ahash", - "autocfg", -] - -[[package]] -name = "libc" -version = "0.2.79" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2448f6066e80e3bfc792e9c98bf705b4b0fc6e8ef5b43e5889aff0eaa9c58743" - -[[package]] -name = "log" -version = "0.4.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - -[[package]] -name = "proxy-wasm" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23d0ac96966a8e245ee08f9ef9e46806702917f228cd82bfa46fde464c237d23" -dependencies = [ - "hashbrown", - "log", - "wee_alloc", -] - -[[package]] -name = "proxy-wasm-envoy-tests" -version = "0.0.1" -dependencies = [ - "log", - "proxy-wasm", -] - -[[package]] -name = "wee_alloc" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" -dependencies = [ - "cfg-if", - "libc", - "memory_units", - "winapi", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/bazel/external/cargo/Cargo.toml b/bazel/external/cargo/Cargo.toml deleted file mode 100644 index 610d35df4e60..000000000000 --- a/bazel/external/cargo/Cargo.toml +++ /dev/null @@ -1,67 +0,0 @@ -[package] -description = "Proxy-Wasm tests for Envoy" -name = "proxy-wasm-envoy-tests" -version = "0.0.1" -authors = ["Piotr Sikora "] -edition = "2018" - -[dependencies] -proxy-wasm = "0.1" -log = "0.4" - -[profile.release] -lto = true -opt-level = 3 -panic = "abort" - -[raze] -workspace_path = "//bazel/external/cargo" -genmode = "Remote" - -[raze.crates.log.'0.4.11'] -additional_flags = ["--cfg=atomic_cas"] - -[[example]] -name = "bootstrap_logging_rust" -path = "../../../test/extensions/bootstrap/wasm/test_data/logging_rust.rs" -crate-type = ["cdylib"] - -[[example]] -name = "http_async_call_rust" -path = "../../../test/extensions/filters/http/wasm/test_data/async_call_rust.rs" -crate-type = ["cdylib"] - -[[example]] -name = "http_body_rust" -path = "../../../test/extensions/filters/http/wasm/test_data/body_rust.rs" -crate-type = ["cdylib"] - -[[example]] -name = "http_headers_rust" -path = "../../../test/extensions/filters/http/wasm/test_data/headers_rust.rs" -crate-type = ["cdylib"] - -[[example]] -name = "http_metadata_rust" -path = "../../../test/extensions/filters/http/wasm/test_data/metadata_rust.rs" -crate-type = ["cdylib"] - -[[example]] -name = "http_resume_call_rust" -path = "../../../test/extensions/filters/http/wasm/test_data/resume_call_rust.rs" -crate-type = ["cdylib"] - -[[example]] -name = "http_shared_data_rust" -path = "../../../test/extensions/filters/http/wasm/test_data/shared_data_rust.rs" -crate-type = ["cdylib"] - -[[example]] -name = "http_shared_queue_rust" -path = "../../../test/extensions/filters/http/wasm/test_data/shared_queue_rust.rs" -crate-type = ["cdylib"] - -[[example]] -name = "network_logging_rust" -path = "../../../test/extensions/filters/network/wasm/test_data/logging_rust.rs" -crate-type = ["cdylib"] diff --git a/bazel/external/cargo/crates.bzl b/bazel/external/cargo/crates.bzl deleted file mode 100644 index fee7d192a8fb..000000000000 --- a/bazel/external/cargo/crates.bzl +++ /dev/null @@ -1,132 +0,0 @@ -""" -@generated -cargo-raze crate workspace functions - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -load("@bazel_tools//tools/build_defs/repo:git.bzl", "new_git_repository") # buildifier: disable=load -load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") # buildifier: disable=load -load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe") # buildifier: disable=load - -def raze_fetch_remote_crates(): - """This function defines a collection of repos and should be called in a WORKSPACE file""" - maybe( - http_archive, - name = "raze__ahash__0_3_8", - url = "https://crates.io/api/v1/crates/ahash/0.3.8/download", - type = "tar.gz", - sha256 = "e8fd72866655d1904d6b0997d0b07ba561047d070fbe29de039031c641b61217", - strip_prefix = "ahash-0.3.8", - build_file = Label("//bazel/external/cargo/remote:BUILD.ahash-0.3.8.bazel"), - ) - - maybe( - http_archive, - name = "raze__autocfg__1_0_1", - url = "https://crates.io/api/v1/crates/autocfg/1.0.1/download", - type = "tar.gz", - sha256 = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a", - strip_prefix = "autocfg-1.0.1", - build_file = Label("//bazel/external/cargo/remote:BUILD.autocfg-1.0.1.bazel"), - ) - - maybe( - http_archive, - name = "raze__cfg_if__0_1_10", - url = "https://crates.io/api/v1/crates/cfg-if/0.1.10/download", - type = "tar.gz", - sha256 = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822", - strip_prefix = "cfg-if-0.1.10", - build_file = Label("//bazel/external/cargo/remote:BUILD.cfg-if-0.1.10.bazel"), - ) - - maybe( - http_archive, - name = "raze__hashbrown__0_7_2", - url = "https://crates.io/api/v1/crates/hashbrown/0.7.2/download", - type = "tar.gz", - sha256 = "96282e96bfcd3da0d3aa9938bedf1e50df3269b6db08b4876d2da0bb1a0841cf", - strip_prefix = "hashbrown-0.7.2", - build_file = Label("//bazel/external/cargo/remote:BUILD.hashbrown-0.7.2.bazel"), - ) - - maybe( - http_archive, - name = "raze__libc__0_2_79", - url = "https://crates.io/api/v1/crates/libc/0.2.79/download", - type = "tar.gz", - sha256 = "2448f6066e80e3bfc792e9c98bf705b4b0fc6e8ef5b43e5889aff0eaa9c58743", - strip_prefix = "libc-0.2.79", - build_file = Label("//bazel/external/cargo/remote:BUILD.libc-0.2.79.bazel"), - ) - - maybe( - http_archive, - name = "raze__log__0_4_11", - url = "https://crates.io/api/v1/crates/log/0.4.11/download", - type = "tar.gz", - sha256 = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b", - strip_prefix = "log-0.4.11", - build_file = Label("//bazel/external/cargo/remote:BUILD.log-0.4.11.bazel"), - ) - - maybe( - http_archive, - name = "raze__memory_units__0_4_0", - url = "https://crates.io/api/v1/crates/memory_units/0.4.0/download", - type = "tar.gz", - sha256 = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3", - strip_prefix = "memory_units-0.4.0", - build_file = Label("//bazel/external/cargo/remote:BUILD.memory_units-0.4.0.bazel"), - ) - - maybe( - http_archive, - name = "raze__proxy_wasm__0_1_2", - url = "https://crates.io/api/v1/crates/proxy-wasm/0.1.2/download", - type = "tar.gz", - sha256 = "23d0ac96966a8e245ee08f9ef9e46806702917f228cd82bfa46fde464c237d23", - strip_prefix = "proxy-wasm-0.1.2", - build_file = Label("//bazel/external/cargo/remote:BUILD.proxy-wasm-0.1.2.bazel"), - ) - - maybe( - http_archive, - name = "raze__wee_alloc__0_4_5", - url = "https://crates.io/api/v1/crates/wee_alloc/0.4.5/download", - type = "tar.gz", - sha256 = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e", - strip_prefix = "wee_alloc-0.4.5", - build_file = Label("//bazel/external/cargo/remote:BUILD.wee_alloc-0.4.5.bazel"), - ) - - maybe( - http_archive, - name = "raze__winapi__0_3_9", - url = "https://crates.io/api/v1/crates/winapi/0.3.9/download", - type = "tar.gz", - sha256 = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419", - strip_prefix = "winapi-0.3.9", - build_file = Label("//bazel/external/cargo/remote:BUILD.winapi-0.3.9.bazel"), - ) - - maybe( - http_archive, - name = "raze__winapi_i686_pc_windows_gnu__0_4_0", - url = "https://crates.io/api/v1/crates/winapi-i686-pc-windows-gnu/0.4.0/download", - type = "tar.gz", - sha256 = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6", - strip_prefix = "winapi-i686-pc-windows-gnu-0.4.0", - build_file = Label("//bazel/external/cargo/remote:BUILD.winapi-i686-pc-windows-gnu-0.4.0.bazel"), - ) - - maybe( - http_archive, - name = "raze__winapi_x86_64_pc_windows_gnu__0_4_0", - url = "https://crates.io/api/v1/crates/winapi-x86_64-pc-windows-gnu/0.4.0/download", - type = "tar.gz", - sha256 = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f", - strip_prefix = "winapi-x86_64-pc-windows-gnu-0.4.0", - build_file = Label("//bazel/external/cargo/remote:BUILD.winapi-x86_64-pc-windows-gnu-0.4.0.bazel"), - ) diff --git a/bazel/external/cargo/remote/BUILD.ahash-0.3.8.bazel b/bazel/external/cargo/remote/BUILD.ahash-0.3.8.bazel deleted file mode 100644 index 11259236efb8..000000000000 --- a/bazel/external/cargo/remote/BUILD.ahash-0.3.8.bazel +++ /dev/null @@ -1,62 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load( - "@io_bazel_rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -package(default_visibility = [ - # Public for visibility by "@raze__crate__version//" targets. - # - # Prefer access through "//bazel/external/cargo", which limits external - # visibility to explicit Cargo.toml dependencies. - "//visibility:public", -]) - -licenses([ - "notice", # MIT from expression "MIT OR Apache-2.0" -]) - -# Generated Targets - -# Unsupported target "ahash" with type "bench" omitted - -# Unsupported target "map" with type "bench" omitted - -rust_library( - name = "ahash", - srcs = glob(["**/*.rs"]), - crate_features = [ - ], - crate_root = "src/lib.rs", - crate_type = "lib", - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.3.8", - # buildifier: leave-alone - deps = [ - ], -) - -# Unsupported target "bench" with type "test" omitted - -# Unsupported target "map_tests" with type "test" omitted - -# Unsupported target "nopanic" with type "test" omitted diff --git a/bazel/external/cargo/remote/BUILD.autocfg-1.0.1.bazel b/bazel/external/cargo/remote/BUILD.autocfg-1.0.1.bazel deleted file mode 100644 index b2d66c8ad629..000000000000 --- a/bazel/external/cargo/remote/BUILD.autocfg-1.0.1.bazel +++ /dev/null @@ -1,62 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load( - "@io_bazel_rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -package(default_visibility = [ - # Public for visibility by "@raze__crate__version//" targets. - # - # Prefer access through "//bazel/external/cargo", which limits external - # visibility to explicit Cargo.toml dependencies. - "//visibility:public", -]) - -licenses([ - "notice", # Apache-2.0 from expression "Apache-2.0 OR MIT" -]) - -# Generated Targets - -# Unsupported target "integers" with type "example" omitted - -# Unsupported target "paths" with type "example" omitted - -# Unsupported target "traits" with type "example" omitted - -# Unsupported target "versions" with type "example" omitted - -rust_library( - name = "autocfg", - srcs = glob(["**/*.rs"]), - crate_features = [ - ], - crate_root = "src/lib.rs", - crate_type = "lib", - edition = "2015", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "1.0.1", - # buildifier: leave-alone - deps = [ - ], -) - -# Unsupported target "rustflags" with type "test" omitted diff --git a/bazel/external/cargo/remote/BUILD.bazel b/bazel/external/cargo/remote/BUILD.bazel deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/bazel/external/cargo/remote/BUILD.cfg-if-0.1.10.bazel b/bazel/external/cargo/remote/BUILD.cfg-if-0.1.10.bazel deleted file mode 100644 index 24dd8233bc24..000000000000 --- a/bazel/external/cargo/remote/BUILD.cfg-if-0.1.10.bazel +++ /dev/null @@ -1,54 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load( - "@io_bazel_rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -package(default_visibility = [ - # Public for visibility by "@raze__crate__version//" targets. - # - # Prefer access through "//bazel/external/cargo", which limits external - # visibility to explicit Cargo.toml dependencies. - "//visibility:public", -]) - -licenses([ - "notice", # MIT from expression "MIT OR Apache-2.0" -]) - -# Generated Targets - -rust_library( - name = "cfg_if", - srcs = glob(["**/*.rs"]), - crate_features = [ - ], - crate_root = "src/lib.rs", - crate_type = "lib", - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.1.10", - # buildifier: leave-alone - deps = [ - ], -) - -# Unsupported target "xcrate" with type "test" omitted diff --git a/bazel/external/cargo/remote/BUILD.hashbrown-0.7.2.bazel b/bazel/external/cargo/remote/BUILD.hashbrown-0.7.2.bazel deleted file mode 100644 index 488055bb3082..000000000000 --- a/bazel/external/cargo/remote/BUILD.hashbrown-0.7.2.bazel +++ /dev/null @@ -1,67 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load( - "@io_bazel_rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -package(default_visibility = [ - # Public for visibility by "@raze__crate__version//" targets. - # - # Prefer access through "//bazel/external/cargo", which limits external - # visibility to explicit Cargo.toml dependencies. - "//visibility:public", -]) - -licenses([ - "notice", # Apache-2.0 from expression "Apache-2.0 OR MIT" -]) - -# Generated Targets - -# Unsupported target "bench" with type "bench" omitted - -# Unsupported target "build-script-build" with type "custom-build" omitted - -rust_library( - name = "hashbrown", - srcs = glob(["**/*.rs"]), - crate_features = [ - "ahash", - "inline-more", - ], - crate_root = "src/lib.rs", - crate_type = "lib", - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.7.2", - # buildifier: leave-alone - deps = [ - "@raze__ahash__0_3_8//:ahash", - ], -) - -# Unsupported target "hasher" with type "test" omitted - -# Unsupported target "rayon" with type "test" omitted - -# Unsupported target "serde" with type "test" omitted - -# Unsupported target "set" with type "test" omitted diff --git a/bazel/external/cargo/remote/BUILD.libc-0.2.79.bazel b/bazel/external/cargo/remote/BUILD.libc-0.2.79.bazel deleted file mode 100644 index 45a0f3c195aa..000000000000 --- a/bazel/external/cargo/remote/BUILD.libc-0.2.79.bazel +++ /dev/null @@ -1,56 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load( - "@io_bazel_rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -package(default_visibility = [ - # Public for visibility by "@raze__crate__version//" targets. - # - # Prefer access through "//bazel/external/cargo", which limits external - # visibility to explicit Cargo.toml dependencies. - "//visibility:public", -]) - -licenses([ - "notice", # MIT from expression "MIT OR Apache-2.0" -]) - -# Generated Targets - -# Unsupported target "build-script-build" with type "custom-build" omitted - -rust_library( - name = "libc", - srcs = glob(["**/*.rs"]), - crate_features = [ - ], - crate_root = "src/lib.rs", - crate_type = "lib", - edition = "2015", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.2.79", - # buildifier: leave-alone - deps = [ - ], -) - -# Unsupported target "const_fn" with type "test" omitted diff --git a/bazel/external/cargo/remote/BUILD.log-0.4.11.bazel b/bazel/external/cargo/remote/BUILD.log-0.4.11.bazel deleted file mode 100644 index 290fb1827ab2..000000000000 --- a/bazel/external/cargo/remote/BUILD.log-0.4.11.bazel +++ /dev/null @@ -1,60 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load( - "@io_bazel_rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -package(default_visibility = [ - # Public for visibility by "@raze__crate__version//" targets. - # - # Prefer access through "//bazel/external/cargo", which limits external - # visibility to explicit Cargo.toml dependencies. - "//visibility:public", -]) - -licenses([ - "notice", # MIT from expression "MIT OR Apache-2.0" -]) - -# Generated Targets - -# Unsupported target "build-script-build" with type "custom-build" omitted - -rust_library( - name = "log", - srcs = glob(["**/*.rs"]), - crate_features = [ - ], - crate_root = "src/lib.rs", - crate_type = "lib", - edition = "2015", - rustc_flags = [ - "--cap-lints=allow", - "--cfg=atomic_cas", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.4.11", - # buildifier: leave-alone - deps = [ - "@raze__cfg_if__0_1_10//:cfg_if", - ], -) - -# Unsupported target "filters" with type "test" omitted - -# Unsupported target "macros" with type "test" omitted diff --git a/bazel/external/cargo/remote/BUILD.memory_units-0.4.0.bazel b/bazel/external/cargo/remote/BUILD.memory_units-0.4.0.bazel deleted file mode 100644 index a134586bdc85..000000000000 --- a/bazel/external/cargo/remote/BUILD.memory_units-0.4.0.bazel +++ /dev/null @@ -1,52 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load( - "@io_bazel_rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -package(default_visibility = [ - # Public for visibility by "@raze__crate__version//" targets. - # - # Prefer access through "//bazel/external/cargo", which limits external - # visibility to explicit Cargo.toml dependencies. - "//visibility:public", -]) - -licenses([ - "reciprocal", # MPL-2.0 from expression "MPL-2.0" -]) - -# Generated Targets - -rust_library( - name = "memory_units", - srcs = glob(["**/*.rs"]), - crate_features = [ - ], - crate_root = "src/lib.rs", - crate_type = "lib", - edition = "2015", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.4.0", - # buildifier: leave-alone - deps = [ - ], -) diff --git a/bazel/external/cargo/remote/BUILD.proxy-wasm-0.1.2.bazel b/bazel/external/cargo/remote/BUILD.proxy-wasm-0.1.2.bazel deleted file mode 100644 index f13807192cee..000000000000 --- a/bazel/external/cargo/remote/BUILD.proxy-wasm-0.1.2.bazel +++ /dev/null @@ -1,63 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load( - "@io_bazel_rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -package(default_visibility = [ - # Public for visibility by "@raze__crate__version//" targets. - # - # Prefer access through "//bazel/external/cargo", which limits external - # visibility to explicit Cargo.toml dependencies. - "//visibility:public", -]) - -licenses([ - "notice", # Apache-2.0 from expression "Apache-2.0" -]) - -# Generated Targets - -# Unsupported target "hello_world" with type "example" omitted - -# Unsupported target "http_auth_random" with type "example" omitted - -# Unsupported target "http_body" with type "example" omitted - -# Unsupported target "http_headers" with type "example" omitted - -rust_library( - name = "proxy_wasm", - srcs = glob(["**/*.rs"]), - crate_features = [ - ], - crate_root = "src/lib.rs", - crate_type = "lib", - edition = "2018", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.1.2", - # buildifier: leave-alone - deps = [ - "@raze__hashbrown__0_7_2//:hashbrown", - "@raze__log__0_4_11//:log", - "@raze__wee_alloc__0_4_5//:wee_alloc", - ], -) diff --git a/bazel/external/cargo/remote/BUILD.wee_alloc-0.4.5.bazel b/bazel/external/cargo/remote/BUILD.wee_alloc-0.4.5.bazel deleted file mode 100644 index d8cc38969a80..000000000000 --- a/bazel/external/cargo/remote/BUILD.wee_alloc-0.4.5.bazel +++ /dev/null @@ -1,91 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load( - "@io_bazel_rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -package(default_visibility = [ - # Public for visibility by "@raze__crate__version//" targets. - # - # Prefer access through "//bazel/external/cargo", which limits external - # visibility to explicit Cargo.toml dependencies. - "//visibility:public", -]) - -licenses([ - "reciprocal", # MPL-2.0 from expression "MPL-2.0" -]) - -# Generated Targets - -# Unsupported target "build-script-build" with type "custom-build" omitted - -rust_library( - name = "wee_alloc", - srcs = glob(["**/*.rs"]), - aliases = { - }, - crate_features = [ - "default", - "size_classes", - ], - crate_root = "src/lib.rs", - crate_type = "lib", - edition = "2015", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.4.5", - # buildifier: leave-alone - deps = [ - "@raze__cfg_if__0_1_10//:cfg_if", - "@raze__memory_units__0_4_0//:memory_units", - ] + selects.with_or({ - # cfg(all(unix, not(target_arch = "wasm32"))) - ( - "@io_bazel_rules_rust//rust/platform:aarch64-apple-ios", - "@io_bazel_rules_rust//rust/platform:aarch64-linux-android", - "@io_bazel_rules_rust//rust/platform:aarch64-unknown-linux-gnu", - "@io_bazel_rules_rust//rust/platform:arm-unknown-linux-gnueabi", - "@io_bazel_rules_rust//rust/platform:i686-apple-darwin", - "@io_bazel_rules_rust//rust/platform:i686-linux-android", - "@io_bazel_rules_rust//rust/platform:i686-unknown-freebsd", - "@io_bazel_rules_rust//rust/platform:i686-unknown-linux-gnu", - "@io_bazel_rules_rust//rust/platform:powerpc-unknown-linux-gnu", - "@io_bazel_rules_rust//rust/platform:s390x-unknown-linux-gnu", - "@io_bazel_rules_rust//rust/platform:x86_64-apple-darwin", - "@io_bazel_rules_rust//rust/platform:x86_64-apple-ios", - "@io_bazel_rules_rust//rust/platform:x86_64-linux-android", - "@io_bazel_rules_rust//rust/platform:x86_64-unknown-freebsd", - "@io_bazel_rules_rust//rust/platform:x86_64-unknown-linux-gnu", - ): [ - "@raze__libc__0_2_79//:libc", - ], - "//conditions:default": [], - }) + selects.with_or({ - # cfg(target_os = "windows") - ( - "@io_bazel_rules_rust//rust/platform:i686-pc-windows-msvc", - "@io_bazel_rules_rust//rust/platform:x86_64-pc-windows-msvc", - ): [ - "@raze__winapi__0_3_9//:winapi", - ], - "//conditions:default": [], - }), -) diff --git a/bazel/external/cargo/remote/BUILD.winapi-0.3.9.bazel b/bazel/external/cargo/remote/BUILD.winapi-0.3.9.bazel deleted file mode 100644 index 2c72142e7a10..000000000000 --- a/bazel/external/cargo/remote/BUILD.winapi-0.3.9.bazel +++ /dev/null @@ -1,57 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load( - "@io_bazel_rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -package(default_visibility = [ - # Public for visibility by "@raze__crate__version//" targets. - # - # Prefer access through "//bazel/external/cargo", which limits external - # visibility to explicit Cargo.toml dependencies. - "//visibility:public", -]) - -licenses([ - "notice", # MIT from expression "MIT OR Apache-2.0" -]) - -# Generated Targets - -# Unsupported target "build-script-build" with type "custom-build" omitted - -rust_library( - name = "winapi", - srcs = glob(["**/*.rs"]), - crate_features = [ - "memoryapi", - "synchapi", - "winbase", - ], - crate_root = "src/lib.rs", - crate_type = "lib", - edition = "2015", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.3.9", - # buildifier: leave-alone - deps = [ - ], -) diff --git a/bazel/external/cargo/remote/BUILD.winapi-i686-pc-windows-gnu-0.4.0.bazel b/bazel/external/cargo/remote/BUILD.winapi-i686-pc-windows-gnu-0.4.0.bazel deleted file mode 100644 index 03c41a8dc2e7..000000000000 --- a/bazel/external/cargo/remote/BUILD.winapi-i686-pc-windows-gnu-0.4.0.bazel +++ /dev/null @@ -1,54 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load( - "@io_bazel_rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -package(default_visibility = [ - # Public for visibility by "@raze__crate__version//" targets. - # - # Prefer access through "//bazel/external/cargo", which limits external - # visibility to explicit Cargo.toml dependencies. - "//visibility:public", -]) - -licenses([ - "notice", # MIT from expression "MIT OR Apache-2.0" -]) - -# Generated Targets - -# Unsupported target "build-script-build" with type "custom-build" omitted - -rust_library( - name = "winapi_i686_pc_windows_gnu", - srcs = glob(["**/*.rs"]), - crate_features = [ - ], - crate_root = "src/lib.rs", - crate_type = "lib", - edition = "2015", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.4.0", - # buildifier: leave-alone - deps = [ - ], -) diff --git a/bazel/external/cargo/remote/BUILD.winapi-x86_64-pc-windows-gnu-0.4.0.bazel b/bazel/external/cargo/remote/BUILD.winapi-x86_64-pc-windows-gnu-0.4.0.bazel deleted file mode 100644 index 11e1c0c629c1..000000000000 --- a/bazel/external/cargo/remote/BUILD.winapi-x86_64-pc-windows-gnu-0.4.0.bazel +++ /dev/null @@ -1,54 +0,0 @@ -""" -@generated -cargo-raze crate build file. - -DO NOT EDIT! Replaced on runs of cargo-raze -""" - -# buildifier: disable=load -load( - "@io_bazel_rules_rust//rust:rust.bzl", - "rust_binary", - "rust_library", - "rust_test", -) - -# buildifier: disable=load -load("@bazel_skylib//lib:selects.bzl", "selects") - -package(default_visibility = [ - # Public for visibility by "@raze__crate__version//" targets. - # - # Prefer access through "//bazel/external/cargo", which limits external - # visibility to explicit Cargo.toml dependencies. - "//visibility:public", -]) - -licenses([ - "notice", # MIT from expression "MIT OR Apache-2.0" -]) - -# Generated Targets - -# Unsupported target "build-script-build" with type "custom-build" omitted - -rust_library( - name = "winapi_x86_64_pc_windows_gnu", - srcs = glob(["**/*.rs"]), - crate_features = [ - ], - crate_root = "src/lib.rs", - crate_type = "lib", - edition = "2015", - rustc_flags = [ - "--cap-lints=allow", - ], - tags = [ - "cargo-raze", - "manual", - ], - version = "0.4.0", - # buildifier: leave-alone - deps = [ - ], -) diff --git a/bazel/repositories.bzl b/bazel/repositories.bzl index 557657b89431..db873d30c16f 100644 --- a/bazel/repositories.bzl +++ b/bazel/repositories.bzl @@ -4,7 +4,6 @@ load("@envoy_api//bazel:envoy_http_archive.bzl", "envoy_http_archive") load("@envoy_api//bazel:external_deps.bzl", "load_repository_locations") load(":repository_locations.bzl", "REPOSITORY_LOCATIONS_SPEC") load("@com_google_googleapis//:repository_rules.bzl", "switched_rules_by_language") -load("//bazel/external/cargo:crates.bzl", "raze_fetch_remote_crates") PPC_SKIP_TARGETS = ["envoy.filters.http.lua"] @@ -98,7 +97,6 @@ def _go_deps(skip_targets): def _rust_deps(): external_http_archive("io_bazel_rules_rust") - raze_fetch_remote_crates() def envoy_dependencies(skip_targets = []): # Setup Envoy developer tools. @@ -163,6 +161,7 @@ def envoy_dependencies(skip_targets = []): _proxy_wasm_cpp_sdk() _proxy_wasm_cpp_host() _emscripten_toolchain() + external_http_archive("proxy_wasm_rust_sdk") external_http_archive("com_googlesource_code_re2") _com_google_cel_cpp() external_http_archive("com_github_google_flatbuffers") diff --git a/bazel/repository_locations.bzl b/bazel/repository_locations.bzl index 9755cace04a1..f302cbee9b72 100644 --- a/bazel/repository_locations.bzl +++ b/bazel/repository_locations.bzl @@ -863,6 +863,18 @@ REPOSITORY_LOCATIONS_SPEC = dict( release_date = "2020-11-12", cpe = "N/A", ), + proxy_wasm_rust_sdk = dict( + project_name = "WebAssembly for Proxies (Rust SDK)", + project_desc = "WebAssembly for Proxies (Rust SDK)", + project_url = "https://github.com/proxy-wasm/proxy-wasm-rust-sdk", + version = "802cab2eabc1da106d8b8b7be2c7278b2bfadfbd", + sha256 = "cc247af14ffa903e90d07ae28effeec9ad11215118f5802ab7d22b961cacd365", + strip_prefix = "proxy-wasm-rust-sdk-{version}", + urls = ["https://github.com/proxy-wasm/proxy-wasm-rust-sdk/archive/{version}.tar.gz"], + use_category = ["test_only"], + release_date = "2020-12-05", + cpe = "N/A", + ), emscripten_toolchain = dict( project_name = "Emscripten SDK", project_desc = "Emscripten SDK (use by Wasm)", @@ -878,13 +890,13 @@ REPOSITORY_LOCATIONS_SPEC = dict( project_name = "Bazel rust rules", project_desc = "Bazel rust rules (used by Wasm)", project_url = "https://github.com/bazelbuild/rules_rust", - version = "7b8219a1955ebd599c275bd292d8153e5616d6a4", - sha256 = "426a7712af597d90301dcc29e63d62de5c2e09fb347692e89abb775ec97c74fe", + version = "aa7c6938cf1cc2973bc065c7532f89874bf09818", + sha256 = "5cb2fbcc3debebc7b68f5f66c1b7ef741bdcca87c70594de688d4518538c36c8", strip_prefix = "rules_rust-{version}", urls = ["https://github.com/bazelbuild/rules_rust/archive/{version}.tar.gz"], use_category = ["dataplane_ext"], extensions = ["envoy.wasm.runtime.wasmtime"], - release_date = "2020-10-21", + release_date = "2020-12-04", cpe = "N/A", ), rules_antlr = dict( diff --git a/test/extensions/bootstrap/wasm/test_data/BUILD b/test/extensions/bootstrap/wasm/test_data/BUILD index 23d54d79d921..d26678e60ee0 100644 --- a/test/extensions/bootstrap/wasm/test_data/BUILD +++ b/test/extensions/bootstrap/wasm/test_data/BUILD @@ -13,8 +13,8 @@ wasm_rust_binary( name = "logging_rust.wasm", srcs = ["logging_rust.rs"], deps = [ - "//bazel/external/cargo:log", - "//bazel/external/cargo:proxy_wasm", + "@proxy_wasm_rust_sdk//:proxy_wasm", + "@proxy_wasm_rust_sdk//bazel/cargo:log", ], ) diff --git a/test/extensions/filters/http/wasm/test_data/BUILD b/test/extensions/filters/http/wasm/test_data/BUILD index f35b19e114b7..91b76310e6b0 100644 --- a/test/extensions/filters/http/wasm/test_data/BUILD +++ b/test/extensions/filters/http/wasm/test_data/BUILD @@ -13,8 +13,8 @@ wasm_rust_binary( name = "async_call_rust.wasm", srcs = ["async_call_rust.rs"], deps = [ - "//bazel/external/cargo:log", - "//bazel/external/cargo:proxy_wasm", + "@proxy_wasm_rust_sdk//:proxy_wasm", + "@proxy_wasm_rust_sdk//bazel/cargo:log", ], ) @@ -22,8 +22,8 @@ wasm_rust_binary( name = "body_rust.wasm", srcs = ["body_rust.rs"], deps = [ - "//bazel/external/cargo:log", - "//bazel/external/cargo:proxy_wasm", + "@proxy_wasm_rust_sdk//:proxy_wasm", + "@proxy_wasm_rust_sdk//bazel/cargo:log", ], ) @@ -31,8 +31,8 @@ wasm_rust_binary( name = "headers_rust.wasm", srcs = ["headers_rust.rs"], deps = [ - "//bazel/external/cargo:log", - "//bazel/external/cargo:proxy_wasm", + "@proxy_wasm_rust_sdk//:proxy_wasm", + "@proxy_wasm_rust_sdk//bazel/cargo:log", ], ) @@ -40,8 +40,8 @@ wasm_rust_binary( name = "metadata_rust.wasm", srcs = ["metadata_rust.rs"], deps = [ - "//bazel/external/cargo:log", - "//bazel/external/cargo:proxy_wasm", + "@proxy_wasm_rust_sdk//:proxy_wasm", + "@proxy_wasm_rust_sdk//bazel/cargo:log", ], ) @@ -49,8 +49,8 @@ wasm_rust_binary( name = "resume_call_rust.wasm", srcs = ["resume_call_rust.rs"], deps = [ - "//bazel/external/cargo:log", - "//bazel/external/cargo:proxy_wasm", + "@proxy_wasm_rust_sdk//:proxy_wasm", + "@proxy_wasm_rust_sdk//bazel/cargo:log", ], ) @@ -58,8 +58,8 @@ wasm_rust_binary( name = "shared_data_rust.wasm", srcs = ["shared_data_rust.rs"], deps = [ - "//bazel/external/cargo:log", - "//bazel/external/cargo:proxy_wasm", + "@proxy_wasm_rust_sdk//:proxy_wasm", + "@proxy_wasm_rust_sdk//bazel/cargo:log", ], ) @@ -67,8 +67,8 @@ wasm_rust_binary( name = "shared_queue_rust.wasm", srcs = ["shared_queue_rust.rs"], deps = [ - "//bazel/external/cargo:log", - "//bazel/external/cargo:proxy_wasm", + "@proxy_wasm_rust_sdk//:proxy_wasm", + "@proxy_wasm_rust_sdk//bazel/cargo:log", ], ) diff --git a/test/extensions/filters/network/wasm/test_data/BUILD b/test/extensions/filters/network/wasm/test_data/BUILD index b4e78def8f75..003a36446743 100644 --- a/test/extensions/filters/network/wasm/test_data/BUILD +++ b/test/extensions/filters/network/wasm/test_data/BUILD @@ -13,8 +13,8 @@ wasm_rust_binary( name = "logging_rust.wasm", srcs = ["logging_rust.rs"], deps = [ - "//bazel/external/cargo:log", - "//bazel/external/cargo:proxy_wasm", + "@proxy_wasm_rust_sdk//:proxy_wasm", + "@proxy_wasm_rust_sdk//bazel/cargo:log", ], ) diff --git a/tools/check_repositories.sh b/tools/check_repositories.sh index 8930821652ca..ef3b77e194b3 100755 --- a/tools/check_repositories.sh +++ b/tools/check_repositories.sh @@ -12,8 +12,8 @@ fi # Check whether number of defined `url =` or `urls =` and `sha256 =` kwargs in # repository definitions is equal. -urls_count=$(git grep -E "\