-
-
Notifications
You must be signed in to change notification settings - Fork 595
Detecting npm dependencies licenses, fetching remote data from the registry #2591
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
Comments
@IanMoroney We should document what is performed by ScanCode... it does not fetch nor resolve your dependencies. It scans what you point it to. That said, it could be mightily useful to fetch and resolve packages alright too! |
The only thing i'm actually interested in is understanding what licenses our dependencies have, for compliance purposes.
Example would be, our own code might have an MIT license, but our first party dependencies might have both MIT and GPL, so it would be really good to know that. |
If the license data is not present in the target codebase for the Scan, then this is not a job for ScanCode Toolkit (SCTK). We have a newer project called ScanCode.io where you run a Pipeline that can include any steps that you want to run pre- or post-Scan - see https://scancodeio.readthedocs.io/en/latest/. We have some sandbox tools separate from SCTK to fetch and scan package dependencies that we will release soon and they should fit nicely into a ScanCode.io Pipeline. |
As a good example of what is achievable in ScanCode.io see this work in progress https://github.com/nexB/scancode.io/issues/191by @aalexanderr and @quepop which is for Alpine packages |
@IanMoroney Are you OK if we move this issue to ScanCode.io ? |
Actually we will also add some support here. |
I am running into the same exactly issue as described here: docker run -v $PWD:/project scancode-toolkit -clpui --processes 5 --verbose --json-pp /project/result.json /project/yarn.lock results in empty license data. Why does this not work as expected? What is the fix? I would rather not use scancode.io.... I just want a parseable json file. |
@emmahsax Thank you for the feedback! For now, scancode has been strictly working offline e.g., without any network connection and without running a build. Offline means that we do not have/fetch details for things that do not exist in the codebase. Getting license for packages that do not exist locally can be resolved in two ways:
Short of these, there most dependencies are just name/version constraints pairs (with one notable exception with PHP composer.lock lockfile that contains the whole package details of every dependencies including declared license). So we have already some code to do a good part of the solution... there is still quite a bit of work to complete these though we could focus on a simple case of npm and yarn lock for a start: help is mucho welcomed to speed up the process! |
@pombredanne In order to get some results, I've just been passing in |
@emmahsax sorry for missing your report above... do you mind creating a different issues for this? |
@pombredanne My team actually switched to using a different tool, so I haven't had a chance to really see these issues again. So if I'm 100% honest, I probably won't come across this issue again, and therefore won't have the information I'd need to make a proper issue. But I'd encourage anybody else that sees time out issues or incomplete answers or long runs (over 10 minutes) to make an issue. The repository I was running this on had a massive |
@emmahsax thanks! can you tell which tool you use? |
We've been using https://github.com/pivotal/LicenseFinder, and so far it's been a fantastic tool to use, both for our bundler gems and our node modules installed via yarn. Also seems to work with our go modules. |
Description
Given the below dependencies and devdependencies, I'm expecting scancode to tell me the license types of these dependencies, but it's not reporting them.
In the example above, these are the actual licenses for the dependencies:
the package.json scan (or the scan of the project) when shown in scancode-workbench doesn't report these licenses.
In the json results itself, packages.dependencies.fastify-swagger as an example, has the below output:
But, the npm page for fastify-swagger reports the license type as MIT:
https://www.npmjs.com/package/fastify-swagger
Additionally, the source also does:
https://github.com/fastify/fastify-swagger/blob/master/LICENSE
How To Reproduce
System configuration
The text was updated successfully, but these errors were encountered: