Skip to content

License References table missing from HTML output #4101

@pepper-jk

Description

@pepper-jk

Image

Description

The license references table in the HTML output does not get created with the current version of scancode (32.3.1).
The table was previously (31.2.6) called licenses and was located at the very bottom the static HTML output, see image above.
It summarized all licenses found in the scanned project in one table.

Investigation of the issue revealed this is due to an empty license_references list given to the template:

return template.generate(files=files, license_references=license_references, version=version)

The list is obtained from codebase.attributes.license_references:
license_references = codebase.attributes.license_references

Evidence suggests that this is broken ever since 32.0.0, specifically PR #3275, where the source of the license references was changed.
I was able to reproduce the issue on 32.0.1 and 32.3.1 alike. 31.2.6 worked fine, all installed via pip in a miniconda venv.
32.0.0 was not tested directly due to not running out of the box.

Unfortunately I was not able to follow the codebase rabbit hole, as its attributes seem to get constructed during runtime.
However, I did create a POC, where I reverted the source of license references the legacy implementation: html-license-ref-table-poc
This should show that the html template is not to blame.

Thanks in advance for taking the time Scancode Team.

Kind regards
Jens Keim (JJ)
FOSS Office
HELLA Aglaia

How To Reproduce

$ cd path/to/project
$ scancode --license --package --copyright --classify --verbose --info --json-pp result-scancode.json --ignore ort --ignore result-scancode.json --ignore result-scancode.html .
$ scancode --from-json result-scancode.json --html result-scancode.html

Open result-scancode.html and observe.

I also tried to output directly to html instead of json, but the license_references list was still empty.
I really hope I did not miss any obvious CLI arguments to fix the issue.

As test input I used paho.mqtt.python at current master (d45de37).

I uploaded the html results here:

System configuration

  • OS: Linux, but the bug was reported to us by users running Windows iirc
  • scancode-toolkit version: 32.3.1
  • installation method: pip in venv and later miniconda venv

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