Snyk crashes when presented with an empty directory to scan. Examples:
A freshly cleaned ~/.conan/data, just before the user should run conan install...
A project living on a development host, where the project doesn't have any dependencies (and may even not have need of conan).
The path ~/.conan/data may for any reason not be a directory, or not exist, or not be readable by the current user.
In all such cases, we can improve the Snyk crash behavior by first checking for at least one accessible child path within ~/.conan/data. If so, continue on to running Snyk.
Else, present a clear "warning: no cached conan packages found", skip running Snyk, and treat the Snyk audit task as having been successful.
One of the benefits of this error handling, is that we will be able to copy & paste the same Snyk task between more projects, so that even projects that have no third party dependencies at all, can be more secure by default. In case they later introduce any conan dependencies.
Snyk crashes when presented with an empty directory to scan. Examples:
conan install
...In all such cases, we can improve the Snyk crash behavior by first checking for at least one accessible child path within ~/.conan/data. If so, continue on to running Snyk.
Else, present a clear "warning: no cached conan packages found", skip running Snyk, and treat the Snyk audit task as having been successful.
One of the benefits of this error handling, is that we will be able to copy & paste the same Snyk task between more projects, so that even projects that have no third party dependencies at all, can be more secure by default. In case they later introduce any conan dependencies.
Projects: