Skip to content

Unexpected output for field vcs_url in cargo workkspaces #3769

@meretp

Description

@meretp

Description

When scanning /boring-sys/Cargo.toml with the current release of ScanCode I get the following package data detection including an object for the vcs_url. Is this the expected behaviour? From the model definition of a package I would have expected an optional string here. Also, I don't really know how to interpret this value.

 "files": [
    {
      "path": "Cargo.toml",
      "type": "file",
      "package_data": [
        {
          "type": "cargo",
          "namespace": null,
          "name": "boring-sys",
          "version": null,
          "qualifiers": {},
          "subpath": null,
          "primary_language": "Rust",
          "description": "FFI bindings to BoringSSL",
          "release_date": null,
          "parties": [
            {
              "type": "person",
              "role": "author",
              "name": "Alex Crichton",
              "email": "[email protected]",
              "url": null
            },
            {
              "type": "person",
              "role": "author",
              "name": "Steven Fackler",
              "email": "[email protected]",
              "url": null
            },
            {
              "type": "person",
              "role": "author",
              "name": "Ivan Nikulin",
              "email": "[email protected]",
              "url": null
            }
          ],
          "keywords": [],
          "homepage_url": null,
          "download_url": null,
          "size": null,
          "sha1": null,
          "md5": null,
          "sha256": null,
          "sha512": null,
          "bug_tracking_url": null,
          "code_view_url": null,
          "vcs_url": {
            "workspace": true
          },
          ...]}

There is also a scan_error, maybe this is related to the unexpected output here?

"scan_errors": [
        "get_package_and_deps: Failed to assemble PackageData: PackageData(type='cargo', namespace=None, name='boring-sys', version=None, datasource_id='cargo_toml'):\nTraceback (most recent call last):\n  File \"../scancode-toolkit-v32.1.0/venv/lib/python3.11/site-packages/packagedcode/plugin_package.py\", line 413, in get_package_and_deps\n    for item in items:\n  File \"../scancode-toolkit-v32.1.0/venv/lib/python3.11/site-packages/packagedcode/cargo.py\", line 44, in assemble\n    workspace_root_path = resource.parent(codebase).path\n                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nAttributeError: 'bool' object has no attribute 'path'\n"
      ]

How To Reproduce

This is the command I used, executed within the extracted directory of the latest release downloaded from GitHub.
./scancode -clpu --only-findings -n 20 --license-text --json result_boring_cargo.json ../boring/boring-sys/Cargo.toml

System configuration

  • What OS are you running on? Linux
  • What version of scancode-toolkit was used to generate the scan file? v32.1.0, I also checked with a previous version v 32.0.8, but there the vcs_url is just null.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions