Skip to content
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

Support relative path in explicit ErrorLog value #1074

Open
pavel-mikula-sonarsource opened this issue Sep 6, 2021 · 3 comments
Open

Support relative path in explicit ErrorLog value #1074

pavel-mikula-sonarsource opened this issue Sep 6, 2021 · 3 comments

Comments

@pavel-mikula-sonarsource
Copy link
Contributor

Description

#1015 fixed an issue that the explicit ErrorLog property provided by a user wasn't handled properly. Since 5.3.0 we do accept user-provided values.

Problem is that we only support absolute paths now because ErrorLog could be relative to the project directory. Such value gets propagated to the ProjectInfo.xml as a relative path but they don't share the same base when processing.

Originally reported on community forum

Reproducer

To reproduce the issue, add relative ErrorLog property to a project file:

<ErrorLog>obj\issues.json</ErrorLog>

Then end step will produce a warning:

WARN: No Roslyn issue reports were found. The C# files have not been analyzed. You can get help on the community forum: https://community.sonarsource.com

Workaround

To workaround the issue, you can set absolute path in the ErrorLog property:

<ErrorLog>$(MSBuildProjectDirectory)\obj\issues.json</ErrorLog>
@pavel-mikula-sonarsource
Copy link
Contributor Author

The same issue affects the Razor property as well.

@andrei-epure-sonarsource
Copy link
Contributor

should this be supported in the S4NET or rather in the SQ plugin @pavel-mikula-sonarsource ?

@pavel-mikula-sonarsource
Copy link
Contributor Author

This should be fixed on S4NET side as the target file also contains the ultimate source of truth about the base path that the ErrorLog is relative to.

@andrei-epure-sonarsource andrei-epure-sonarsource added this to the 5.7.0 milestone May 30, 2022
@andrei-epure-sonarsource andrei-epure-sonarsource removed this from the 5.7.0 milestone Jun 16, 2022
@costin-zaharia-sonarsource costin-zaharia-sonarsource added this to the 5.14.0 milestone Apr 6, 2023
@costin-zaharia-sonarsource costin-zaharia-sonarsource modified the milestones: 5.14.0, 6.1.0 Sep 25, 2023
@martin-strecker-sonarsource martin-strecker-sonarsource removed this from the 7.0 milestone Jul 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants