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

SLVS-1167 Feature/cfamily migration #5922

Merged
merged 21 commits into from
Dec 24, 2024

Conversation

georgii-borovinskikh-sonarsource
Copy link
Contributor

@georgii-borovinskikh-sonarsource georgii-borovinskikh-sonarsource commented Dec 24, 2024

vnaskos-sonar and others added 20 commits December 24, 2024 10:36
[SLVS-1668](https://sonarsource.atlassian.net/browse/SLVS-1668)

Part of SLVS-1637

See the linked ticket for details about the problems we identified. This
PR introduces the following changes:

- To communicate the header file language, I am adding the relevant
switches to the generated command in the header case as well. This helps
analyze C headers as such when they are located inside C VCX projects.
- Since `HeaderFileLanguage` is no longer needed, I am removing it from
`FileConfig`.

[SLVS-1668]:
https://sonarsource.atlassian.net/browse/SLVS-1668?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
[SLVS-1690](https://sonarsource.atlassian.net/browse/SLVS-1690)

This is done by including a special environment variable in the
compilation database entry generated for header files. This environment
variable is recognized starting with CFamily analyzer v6.62 (CPP-5898).

Additionally, the PR adds some verbose logs to describe which env
variables were overwritten/added (similar to what we used to have
[here](https://github.com/SonarSource/sonarlint-visualstudio/blob/6498da7a3788467884af7446966029aaab5625ce/src/CFamily/Subprocess/ProcessRunner.cs#L172-L1930)).

[SLVS-1690]:
https://sonarsource.atlassian.net/browse/SLVS-1690?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
we add a new fallback way to get the compiler path correctly.
This fixes the `clang-cl` support, which is currently broken because the
`ClCompilerPath` property we rely on evaluates to `/clang-cl.exe`.
The new fallback method searches in the `ExecutablePath` path list for
the `ClToolExe` executable, which gives the correct answer in the case
of `clang-cl.exe`

Co-authored-by: Georgii Borovinskikh <[email protected]>
Co-authored-by: Michael Jabbour <[email protected]>
@georgii-borovinskikh-sonarsource georgii-borovinskikh-sonarsource merged commit a51af9d into master Dec 24, 2024
3 checks passed
@georgii-borovinskikh-sonarsource georgii-borovinskikh-sonarsource deleted the feature/cfamily-migration branch December 24, 2024 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants