Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

licenses_info_to_json failed as the TransitiveLicensesInfo is empty #55

Open
dhmemi opened this issue Nov 3, 2022 · 0 comments · May be fixed by #161
Open

licenses_info_to_json failed as the TransitiveLicensesInfo is empty #55

dhmemi opened this issue Nov 3, 2022 · 0 comments · May be fixed by #161
Labels
bug Something isn't working P2

Comments

@dhmemi
Copy link

dhmemi commented Nov 3, 2022

Expected Behavior

Rule Usage example:

load("@rules_license//rules:compliance.bzl", "check_license")

check_license(
    name = "third_party_licenses",
    license_texts = "third_party_licenses.txt",
    report = "third_party_reports.txt",
    deps = _ROOT_TARGETS,
)

Actual Behavior

ERROR: C:/users/dhmem/***/BUILD:116:14: in _check_license rule //third_party_licenses:                                                                    
Traceback (most recent call last):
        File "C:/users/dhmem/_bazel_dhmem/36t2vbit/external/rules_license/rules/compliance.bzl", line 33, column 24, in _check_license_impl
                write_licenses_info(ctx, ctx.attr.deps, licenses_file)
        File "C:/users/dhmem/_bazel_dhmem/36t2vbit/external/rules_license/rules/gather_licenses_info.bzl", line 144, column 50, in write_licenses_info
                licenses.extend(licenses_info_to_json(dep[TransitiveLicensesInfo]))
        File "C:/users/dhmem/_bazel_dhmem/36t2vbit/external/rules_license/rules/gather_licenses_info.bzl", line 245, column 58, in licenses_info_to_json
                top_level_target = _strip_null_repo(licenses_info.target_under_license),
Error: 'TransitiveLicensesInfo' value has no field or method 'target_under_license'
Available attributes: deps, licenses, traces
ERROR: C:/users/dhmem/***/BUILD:116:14: Analysis of target '//third_party_licenses' failed                                                                
ERROR: Analysis of target '//third_party_licenses' failed; build aborted:                                                                                                           
INFO: Elapsed time: 0.696s                                                                                                                                                               
INFO: 0 processes.                                                                                                                                                                       
FAILED: Build did NOT complete successfully (1 packages loaded, 0 targets configured)

Caused by an empty TransitiveLicensesInfo:

DEBUG: C:/users/dhmem/_bazel_dhmem/36t2vbit/external/rules_license/rules/gather_licenses_info.bzl:243:10: licenses_info.target_under_license:  struct(deps = depset([]), licenses = depset([]), traces = [])

And the empty TransitiveLicensesInfo is from

return [provider_factory(deps = depset(), licenses = depset(), traces = [])]

Specifications

  • Version: 0.0.4
  • Platform: Windows
@aiuto aiuto added bug Something isn't working P2 labels Oct 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P2
Projects
None yet
2 participants