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

Avoid duplicate packages #112

Open
mering opened this issue Sep 11, 2023 · 0 comments
Open

Avoid duplicate packages #112

mering opened this issue Sep 11, 2023 · 0 comments
Labels
bug Something isn't working P2

Comments

@mering
Copy link
Contributor

mering commented Sep 11, 2023

Expected Behavior

When running bazel build //examples/sboms:write_sbom_sbom, the resulting JSON should look as follows:

[
  {
    "top_level_target": "//tools:write_sbom",
    "dependencies": [
      {
        "target_under_license": "//tools:write_sbom",
        "licenses": [
          "//:license"
        ]
      }
    ],
    "licenses": [
      {
        "label": "//:license",
        "bazel_package": "//",
        "license_kinds": [
          {
            "target": "@//licenses/spdx:Apache-2.0",
            "name": "Apache-2.0",
            "conditions": []
          }
        ],
        "copyright_notice": "",
        "package_name": "rules_license",
        "package_url": "",
        "package_version": "0.0.7",
        "license_text": "LICENSE",
        "used_by": [
          "//tools:write_sbom"
        ]
      }
    ],
    "packages": [
          {
            "target": "//:package_info",
            "bazel_package": "//",
            "package_name": "rules_license",
            "package_url": "",
            "package_version": "0.0.7"
          }
    ]
  }
]

Actual Behavior

When running bazel build //examples/sboms:write_sbom_sbom, the resulting JSON actually looks as follows:

[
  {
    "top_level_target": "//tools:write_sbom",
    "dependencies": [
      {
        "target_under_license": "//tools:write_sbom",
        "licenses": [
          "//:license"
        ]
      }
    ],
    "licenses": [
      {
        "label": "//:license",
        "bazel_package": "//",
        "license_kinds": [
          {
            "target": "@//licenses/spdx:Apache-2.0",
            "name": "Apache-2.0",
            "conditions": []
          }
        ],
        "copyright_notice": "",
        "package_name": "",
        "package_url": "",
        "package_version": "",
        "license_text": "LICENSE",
        "used_by": [
          "//tools:write_sbom"
        ]
      }
    ],
    "packages": [
          {
            "target": "//:package_info",
            "bazel_package": "//",
            "package_name": "rules_license",
            "package_url": "",
            "package_version": "0.0.7"
          },
          {
            "target": "//:package_info",
            "bazel_package": "//",
            "package_name": "rules_license",
            "package_url": "",
            "package_version": "0.0.7"
          }
    ]
  }
]

Specifically, the same package is included twice and the license doesn't contain package_name and package_version fields.

Steps to Reproduce the Problem

  1. Run bazel build //examples/sboms:write_sbom_sbom
  2. Inspect bazel-bin/examples/sboms/_write_sbom_sbom_licenses_info.json

Specifications

  • Version:
  • Platform:
@aiuto aiuto added bug Something isn't working P2 labels Oct 17, 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
Development

No branches or pull requests

2 participants