Skip to content

Commit 66fb111

Browse files
timothytrippeljwnrt
authored andcommitted
[bazel] fix/add patches to enable downstream builds
The opentitan-provisioning loads this repo as a bazel dependency to build opentitanlib. Minor updates to rules rust in this repo broke builds downstream. This should fix them. Signed-off-by: Tim Trippel <ttrippel@google.com> (cherry picked from commit 6e8e395)
1 parent 855538e commit 66fb111

File tree

4 files changed

+32
-2
lines changed

4 files changed

+32
-2
lines changed

MODULE.bazel

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ single_version_override(
4949
module_name = "rules_rust",
5050
patch_strip = 1,
5151
patches = [
52+
"@lowrisc_opentitan//third_party/rust/patches:rules_rust.experimental.patch",
5253
"@lowrisc_opentitan//third_party/rust/patches:rules_rust.extra_rustc_toolchain_dirs.patch",
5354
],
5455
version = "0.59.2",
@@ -59,6 +60,7 @@ single_version_override(
5960
patch_strip = 3,
6061
patches = [
6162
"@lowrisc_opentitan//third_party/rust/patches:rules_rust.bindgen_static_lib.patch",
63+
"@lowrisc_opentitan//third_party/rust/patches:rules_rust.transition.patch",
6264
],
6365
version = "0.59.2",
6466
)

MODULE.bazel.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
diff --git a/rust/private/rustc.bzl b/rust/private/rustc.bzl
2+
--- a/rust/private/rustc.bzl
3+
+++ b/rust/private/rustc.bzl
4+
@@ -1518,11 +1518,6 @@ def rustc_compile_action(
5+
"source_attributes": ["srcs"],
6+
}
7+
8+
- if experimental_use_coverage_metadata_files:
9+
- instrumented_files_kwargs.update({
10+
- "metadata_files": coverage_runfiles + [executable] if executable else [],
11+
- })
12+
-
13+
providers = [
14+
DefaultInfo(
15+
# nb. This field is required for cc_library to depend on our output.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/extensions/bindgen/private/llvm_utils.bzl b/extensions/bindgen/private/llvm_utils.bzl
2+
--- a/extensions/bindgen/private/llvm_utils.bzl
3+
+++ b/extensions/bindgen/private/llvm_utils.bzl
4+
@@ -42,6 +42,9 @@ _COMMON_ATTRS = {
5+
doc = "The target to transition.",
6+
mandatory = True,
7+
),
8+
+ "_allowlist_function_transition": attr.label(
9+
+ default = "@bazel_tools//tools/allowlists/function_transition_allowlist",
10+
+ ),
11+
}
12+
13+
def _cc_stdcc17_transitioned_target_impl(ctx):

0 commit comments

Comments
 (0)