Skip to content

Commit

Permalink
deps: Bump rules_rust -> 0.8.1 (envoyproxy#22253)
Browse files Browse the repository at this point in the history
Fix envoyproxy#22073

Signed-off-by: Ryan Northey <[email protected]>

Signed-off-by: phlax <[email protected]>
  • Loading branch information
phlax committed Nov 24, 2022
1 parent 3843c7d commit 2e3aa7a
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 4 deletions.
5 changes: 4 additions & 1 deletion bazel/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,10 @@ def _go_deps(skip_targets):
external_http_archive("bazel_gazelle")

def _rust_deps():
external_http_archive("rules_rust")
external_http_archive(
"rules_rust",
patches = ["@envoy//bazel:rules_rust.patch"],
)

def envoy_dependencies(skip_targets = []):
# Add a binding for repository variables.
Expand Down
6 changes: 3 additions & 3 deletions bazel/repository_locations.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -1104,12 +1104,12 @@ 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 = "0.3.1",
sha256 = "e074f1e203607c5fcd549929d956170346f8807d2bbaeb98b2ed213c37e0870f",
version = "0.8.1",
sha256 = "05e15e536cc1e5fd7b395d044fc2dabf73d2b27622fbc10504b7e48219bb09bc",
urls = ["https://github.com/bazelbuild/rules_rust/releases/download/{version}/rules_rust-v{version}.tar.gz"],
use_category = ["dataplane_ext"],
extensions = ["envoy.wasm.runtime.wasmtime"],
release_date = "2022-04-26",
release_date = "2022-07-26",
cpe = "N/A",
),
rules_antlr = dict(
Expand Down
31 changes: 31 additions & 0 deletions bazel/rules_rust.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# https://github.com/bazelbuild/rules_rust/pull/1259

--- rust/platform/triple_mappings.bzl
+++ rust/platform/triple_mappings.bzl
@@ -269,6 +269,13 @@ def triple_to_constraint_set(target_triple):
"@rules_rust//rust/platform/os:unknown",
]

+ # Workaround for https://github.com/bazelbuild/bazel/issues/14982
+ if target_triple in ("armv7-linux-androideabi", "thumbv7neon-linux-androideabi"):
+ return [
+ "@platforms//cpu:arm",
+ "@platforms//os:android",
+ ]
+
triple_struct = triple(target_triple)

constraint_set = []


--- rust/private/rustc.bzl
+++ rust/private/rustc.bzl
@@ -1024,7 +1024,7 @@ def rustc_compile_action(
),
]

- if crate_info.type in ["staticlib", "cdylib"]:
+ if crate_info.type in ["staticlib", "cdylib"] and not out_binary:
# These rules are not supposed to be depended on by other rust targets, and
# as such they shouldn't provide a CrateInfo. However, one may still want to
# write a rust_test for them, so we provide the CrateInfo wrapped in a provider

0 comments on commit 2e3aa7a

Please sign in to comment.