thii/rules_swiftlint

Error: 'OutputGroupInfo' value has no field or method '_validation'

Closed this issue · 1 comments

I followed all the instructions in the README but I'm receiving an error when I try to build with validations:

bazelisk build //BazelSample:BuildTest
Starting local Bazel server and connecting to it...
ERROR: /Users/andre.alves/Documents/Works/swiftlint-sample-bug/BazelSample/BUILD:17:14: in @com_github_thii_rules_swiftlint//swiftlint/private:aspects.bzl%swiftlint_aspect aspect on swift_library rule //BazelSample:CocktailDBInterface: 
Traceback (most recent call last):
	File "/private/var/tmp/_bazel_andre.alves/47bd25c17eef0078807a5b06795f8181/external/com_github_thii_rules_swiftlint/swiftlint/private/aspects.bzl", line 79, column 27, in _swiftlint_aspect_impl
		d[OutputGroupInfo]._validation
Error: 'OutputGroupInfo' value has no field or method '_validation'
Available attributes: _hidden_top_level_INTERNAL_
ERROR: Analysis of aspects '[@com_github_thii_rules_swiftlint//swiftlint:defs.bzl%swiftlint_aspect] with parameters {} on //BazelSample:BuildTest' failed; build aborted: Analysis of target '//BazelSample:CocktailDBInterface' failed
INFO: Elapsed time: 8.825s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (70 packages loaded, 854 targets configured)

I created a sample project to help (Bazel 6.0.0):

rules_swiftlint_sample.zip

BazelSample/BUILD

ios_framework(
    name = "BuildTest",
    bundle_id = "com.test.frameworks.BuildTest",
    deps = [":CocktailDBInterface"],
    families = [
        "iphone",
        "ipad"
    ],
    infoplists = ["Info.plist"],
    minimum_os_version = "14.0",
    visibility = ["//visibility:public"],
)

swift_library(
    name = "CocktailDBInterface",
    module_name = "CocktailDBInterface",
    visibility = ["//visibility:public"],
    srcs = glob(["CocktailDBInterface/Sources/**/*.swift"]),
    deps = ["//Pods:Cartography"],
    tags = ["manual"],
)

Pods/BUILD

apple_static_xcframework_import(
    name = "Cartography",
    xcframework_imports = glob(["Cartography/Frameworks/Cartography.xcframework/**"]),
    visibility = ["//visibility:public"],
)

Command

bazel build //BazelSample:BuildTest

I noticed that the error doesn't happen if I remove the line deps = ["//Pods:Cartography"].

thii commented

This has been fixed in 0.4.0. Can you try again?