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

Unexpected output for field vcs_url in cargo workkspaces #3769

Open
meretp opened this issue May 7, 2024 · 2 comments
Open

Unexpected output for field vcs_url in cargo workkspaces #3769

meretp opened this issue May 7, 2024 · 2 comments
Labels

Comments

@meretp
Copy link
Contributor

meretp commented May 7, 2024

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.
@meretp meretp added the bug label May 7, 2024
@pombredanne
Copy link
Member

@meretp Thanks! Support for Cargo workspace is a recent addition @AyanSinhaMahapatra

@AyanSinhaMahapatra AyanSinhaMahapatra changed the title Unexpected output for field vcs_url in package detection Unexpected output for field vcs_url in cargo workkspaces May 17, 2024
AyanSinhaMahapatra added a commit that referenced this issue May 20, 2024
Reference: #3769
Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
AyanSinhaMahapatra added a commit that referenced this issue May 22, 2024
Reference: #3769
Signed-off-by: Ayan Sinha Mahapatra <[email protected]>
@AyanSinhaMahapatra
Copy link
Member

@meretp this should be fixed with a lot of bugfixes and improvements on cargo workspaces, see #3783 (comment) for details on this.
See also attached the scan results for boring:
boring-master-scan.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants