Skip to content

Commit

Permalink
[bazel] Bump the bazel version to fix a UI bug
Browse files Browse the repository at this point in the history
See bazelbuild/bazel#13985

Signed-off-by: Miguel Young de la Sota <mcyoung@google.com>
  • Loading branch information
mcy authored and timothytrippel committed Apr 23, 2022
1 parent ec30c9f commit 4b01c7a
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 39 deletions.
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.2.0
5.1.1
26 changes: 0 additions & 26 deletions rules/bugfix.bzl

This file was deleted.

8 changes: 4 additions & 4 deletions rules/cc_side_outputs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"""Aspects and rules for making cc_* libraries emit more outputs."""

load("@rules_cc//cc:action_names.bzl", "ACTION_NAMES", "C_COMPILE_ACTION_NAME")
load("//rules:bugfix.bzl", "find_cc_toolchain")
load("@rules_cc//cc:find_cc_toolchain.bzl", "find_cc_toolchain")
load("//rules:rv.bzl", "rv_rule")

CcSideProductInfo = provider(fields = ["files"])
Expand Down Expand Up @@ -63,7 +63,7 @@ def _cc_compile_different_output(name, target, ctx, extension, flags, process_al
)
cc_compile_ctx = cc_info.compilation_context

cc_toolchain = find_cc_toolchain(ctx)
cc_toolchain = find_cc_toolchain(ctx).cc
feature_configuration = cc_common.configure_features(
ctx = ctx,
cc_toolchain = cc_toolchain,
Expand Down Expand Up @@ -226,7 +226,7 @@ cc_asm_aspect = aspect(
)

def _cc_llvm_aspect_impl(target, ctx):
cc_toolchain = find_cc_toolchain(ctx)
cc_toolchain = find_cc_toolchain(ctx).cc
if cc_toolchain.compiler.find("clang") == -1:
return CcSideProductInfo(files = depset())
return _cc_compile_different_output("LLVMOutput", target, ctx, "ll", ["-S", "-emit-llvm"])
Expand Down Expand Up @@ -273,7 +273,7 @@ def _cc_relink_with_linkmap_aspect_impl(target, ctx):

output_file = ctx.actions.declare_file(target.label.name + ".ldmap")

cc_toolchain = find_cc_toolchain(ctx)
cc_toolchain = find_cc_toolchain(ctx).cc
feature_configuration = cc_common.configure_features(
ctx = ctx,
cc_toolchain = cc_toolchain,
Expand Down
8 changes: 3 additions & 5 deletions rules/opentitan.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0

# TODO(drewmacrae) this should be in rules_cc
# pending resolution of https://github.com/bazelbuild/rules_cc/issues/75
load("//rules:bugfix.bzl", "find_cc_toolchain")
load("@rules_cc//cc:find_cc_toolchain.bzl", "find_cc_toolchain")
load(
"//rules:cc_side_outputs.bzl",
"rv_asm",
Expand Down Expand Up @@ -43,7 +41,7 @@ PER_DEVICE_DEPS = {
}

def _obj_transform_impl(ctx):
cc_toolchain = find_cc_toolchain(ctx)
cc_toolchain = find_cc_toolchain(ctx).cc
outputs = []
for src in ctx.files.srcs:
binary = ctx.actions.declare_file("{}.{}".format(src.basename, ctx.attr.suffix))
Expand Down Expand Up @@ -125,7 +123,7 @@ sign_bin = rv_rule(
)

def _elf_to_disassembly_impl(ctx):
cc_toolchain = find_cc_toolchain(ctx)
cc_toolchain = find_cc_toolchain(ctx).cc
outputs = []
for src in ctx.files.srcs:
disassembly = ctx.actions.declare_file("{}.elf.s".format(src.basename))
Expand Down
6 changes: 3 additions & 3 deletions rules/otbn.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# SPDX-License-Identifier: Apache-2.0

load("//rules:rv.bzl", "rv_rule")
load("//rules:bugfix.bzl", "find_cc_toolchain")
load("@rules_cc//cc:find_cc_toolchain.bzl", "find_cc_toolchain")

def _get_assembler(cc_toolchain):
"""Find the path to riscv-unknown-elf-as."""
Expand All @@ -20,7 +20,7 @@ def _otbn_assemble_sources(ctx):
producing a corresponding object file. Returns a list of all object files
that will be generated by these actions.
"""
cc_toolchain = find_cc_toolchain(ctx)
cc_toolchain = find_cc_toolchain(ctx).cc
assembler = _get_assembler(cc_toolchain)

objs = []
Expand Down Expand Up @@ -77,7 +77,7 @@ def _otbn_binary(ctx):
We achieve by having `otbn_build.py` emit a conventional RV32I library
that other rules can depend on in their `deps`.
"""
cc_toolchain = find_cc_toolchain(ctx)
cc_toolchain = find_cc_toolchain(ctx).cc
assembler = _get_assembler(cc_toolchain)

# Run the otbn assembler on source files to produce object (.o) files.
Expand Down

0 comments on commit 4b01c7a

Please sign in to comment.