From e109ad20bde9bda5766f9185fbb495a73fc02da0 Mon Sep 17 00:00:00 2001 From: UebelAndre Date: Mon, 27 Sep 2021 10:38:43 -0700 Subject: [PATCH 1/2] Updated `bazel_skylib` to `1.1.1` --- rust/repositories.bzl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rust/repositories.bzl b/rust/repositories.bzl index 44995606ff..6cdb89bf11 100644 --- a/rust/repositories.bzl +++ b/rust/repositories.bzl @@ -88,11 +88,11 @@ def rust_repositories( maybe( http_archive, name = "bazel_skylib", - sha256 = "1c531376ac7e5a180e0237938a2536de0c54d93f5c278634818e0efc952dd56c", urls = [ - "https://github.com/bazelbuild/bazel-skylib/releases/download/1.0.3/bazel-skylib-1.0.3.tar.gz", - "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.0.3/bazel-skylib-1.0.3.tar.gz", + "https://github.com/bazelbuild/bazel-skylib/releases/download/1.1.1/bazel-skylib-1.1.1.tar.gz", + "https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/1.1.1/bazel-skylib-1.1.1.tar.gz", ], + sha256 = "c6966ec828da198c5d9adbaa94c05e3a1c7f21bd012a0b29ba8ddbccb2c93b0d", ) for exec_triple, name in DEFAULT_TOOLCHAIN_TRIPLES.items(): From a210d694e714c8d98be3eafa7dc0672bad76209f Mon Sep 17 00:00:00 2001 From: UebelAndre Date: Mon, 27 Sep 2021 10:43:33 -0700 Subject: [PATCH 2/2] Updated unit tests to benefit from new `bazel_skylib` features --- test/unit/clippy/clippy_test.bzl | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/test/unit/clippy/clippy_test.bzl b/test/unit/clippy/clippy_test.bzl index c423209bd3..f08cb6cc40 100644 --- a/test/unit/clippy/clippy_test.bzl +++ b/test/unit/clippy/clippy_test.bzl @@ -12,10 +12,7 @@ def _find_clippy_action(actions): def _clippy_aspect_action_has_flag_impl(ctx, flags): env = analysistest.begin(ctx) - - # TODO: Replace with `analysistest.target_under_test(env)` upstream fix - # https://github.com/bazelbuild/bazel-skylib/pull/299 - target = env.ctx.attr.target_under_test_with_aspect + target = analysistest.target_under_test(env) clippy_action = _find_clippy_action(target.actions) @@ -68,11 +65,7 @@ def _test_clippy_aspect_action_has_warnings_flag_test_impl(ctx): def make_clippy_aspect_unittest(impl): return analysistest.make( impl, - attrs = { - # We can't just use target_under_test because we need to add our own aspect to the attribute. - # See https://github.com/bazelbuild/bazel-skylib/pull/299 - "target_under_test_with_aspect": attr.label(aspects = [rust_clippy_aspect], mandatory = True), - }, + extra_target_under_test_aspects = [rust_clippy_aspect], ) binary_clippy_aspect_action_has_warnings_flag_test = make_clippy_aspect_unittest(_binary_clippy_aspect_action_has_warnings_flag_test_impl) @@ -89,17 +82,14 @@ def clippy_test_suite(name): binary_clippy_aspect_action_has_warnings_flag_test( name = "binary_clippy_aspect_action_has_warnings_flag_test", target_under_test = Label("//test/clippy:ok_binary"), - target_under_test_with_aspect = Label("//test/clippy:ok_binary"), ) library_clippy_aspect_action_has_warnings_flag_test( name = "library_clippy_aspect_action_has_warnings_flag_test", target_under_test = Label("//test/clippy:ok_library"), - target_under_test_with_aspect = Label("//test/clippy:ok_library"), ) test_clippy_aspect_action_has_warnings_flag_test( name = "test_clippy_aspect_action_has_warnings_flag_test", target_under_test = Label("//test/clippy:ok_test"), - target_under_test_with_aspect = Label("//test/clippy:ok_test"), ) native.test_suite(