License Scanning silently fails: syntax error in dotnet-install.sh
Summary
License Scanning silently fails when scanning a C# .NET. There are syntax errors in dotnet-install.sh
. A report is created and the exit code is 0, but .NET dependencies are not in the report.
Workaround: none.
Steps to reproduce
Run license-finder (License Scanning job) on a .NET project.
Example Project
https://gitlab.com/gitlab-org/security-products/tests/csharp-nuget-dotnetcore/
What is the current bug behavior?
It logs error messages and silently fails. The License Scanning report contains nothing.
What is the expected correct behavior?
The License Scanning report covers the dependencies of the .NET project.
Relevant logs and/or screenshots
https://gitlab.com/gitlab-org/security-products/tests/csharp-nuget-dotnetcore/-/jobs/2269447280#L337
Installing the CLI requested version 3.1.302. Please wait, installation may take a few minutes.
/opt/asdf/installs/dotnet-core/3.1.302/dotnet-install.sh: line 1: $'\r': command not found
/opt/asdf/installs/dotnet-core/3.1.302/dotnet-install.sh: line 2: $'\r': command not found
/opt/asdf/installs/dotnet-core/3.1.302/dotnet-install.sh: line 3: !DOCTYPE: No such file or directory
/opt/asdf/installs/dotnet-core/3.1.302/dotnet-install.sh: line 4: html: No such file or directory
/opt/asdf/installs/dotnet-core/3.1.302/dotnet-install.sh: line 5: head: No such file or directory
/opt/asdf/installs/dotnet-core/3.1.302/dotnet-install.sh: line 6: meta: No such file or directory
/opt/asdf/installs/dotnet-core/3.1.302/dotnet-install.sh: line 7: $'\r': command not found
/opt/asdf/installs/dotnet-core/3.1.302/dotnet-install.sh: line 8: !--: No such file or directory
/opt/asdf/installs/dotnet-core/3.1.302/dotnet-install.sh: line 9: meta: No such file or directory
/opt/asdf/installs/dotnet-core/3.1.302/dotnet-install.sh: line 10: $'\r': command not found
/opt/asdf/installs/dotnet-core/3.1.302/dotnet-install.sh: line 11: syntax error near unexpected token `404'
Possible fixes
To be fixed upstream in https://github.com/emersonsoares/asdf-dotnet-core.
A possible workaround is to use a fork that fixes the problem, similar to what we did in gitlab-org/security-products/analyzers/license-finder!33 (merged).