vmware-archive / rules_oss_audit

The complexities of identifying and tracking open-source software (OSS) to comply with license requirements adds friction to the development process and can result in product-release delays. At VMware, we solve this problem using Bazel to create an accurate bill of materials containing OSS and third-party packages during a build.
Apache License 2.0
30 stars 11 forks source link

[docs] Update docs referring setup() and dependencies() in workspace #3

Closed luxe closed 2 years ago

luxe commented 2 years ago

When I use the rules in a separate repo I get the following error:

ERROR: /home/luxe/Desktop/repos/bazel-buildfarm/BUILD:144:10: every rule of type oss_audit implicitly depends upon the target '@rules_oss_audit//oss_audit/tools:generate_boms', but this target could not be found because of: error loading package '@rules_oss_audit//oss_audit/tools': Unable to find package for @oss_audit_deps//:requirements.bzl: The repository '@oss_audit_deps' could not be resolved: Repository '@oss_audit_deps' is not defined.
Documentation for implicit attribute _generate_boms of rules of type oss_audit:
Generates the BOM and BOM-issues files and validates oss package usage

Maybe I'm missing something because I thought transitive workspaces were evaluated and therefore the requirements.bzl should have already been generated. My workaround is to call rules_oss_audit_setup() in my own workspace. That resolves the problem? Should we tell users of this ruleset to do the same?

rtabassum commented 2 years ago

@luxe Users need to invoke both of the following from their respective workspace:

load("@rules_oss_audit//oss_audit:repositories.bzl", "rules_oss_audit_dependencies")
rules_oss_audit_dependencies()

load("@rules_oss_audit//oss_audit:setup.bzl", "rules_oss_audit_setup")
rules_oss_audit_setup()

Can you try ^ first and see if that resolves the error on your side? Then update the READme accordingly, please?

luxe commented 2 years ago

that works. fixed!

vmwclabot commented 2 years ago

@luxe, VMware has approved your signed contributor license agreement.