Open andrei-epure-sonarsource opened 2 years ago
If I have the following step in a dockerfile:
RUN sudo dotnet tool install dotnet-sonarscanner --tool-path /usr/local/bin
With the container running, it results in the following on dotnet sonarscanner end
:
An error occurred trying to start process '/usr/local/bin/.store/dotnet-sonarscanner/5.13.0/dotnet-sonarscanner/5.13.0/tools/net5.0/any/sonar-scanner-4.8.0.2856/bin/sonar-scanner' with working directory ...
Is there a recommended approach to determining that path, or should +x
be set at a higher level?
Hi @JohnYoungers - could you please ask the question on https://community.sonarsource.com/ ? We monitor that for such questions, and it's better suited for discussions and clarifications. Thanks.
This is related to #493.
The problem
Currently, at the
END
step the scanner is failing on Unix systems because the executable bit is not set on the scanner-cli. The error looks like below.This is bad user experience because:
My proposal
Fail at the
BEGIN
step if thesonar-scanner
does not have the executable bit set. This check can easily be done during the begin step.Furthermore, the scanner should first attempt to set the executable bit, catch the exception if not allowed and fail with a nice error message like: