Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Improve paths handling #155

Open
ivancho-ifa opened this issue Jun 15, 2023 · 2 comments
Open

Improve paths handling #155

ivancho-ifa opened this issue Jun 15, 2023 · 2 comments
Labels
bug Something isn't working compilation database clang-tidy didn't use a compilation database Windows Executed on Wimdows

Comments

@ivancho-ifa
Copy link

First of all, great Action!

I noticed that when setting an absolute path to the compilation database I receive wrong paths.

    - name: Run clang-tidy and clang-format 
      uses: cpp-linter/cpp-linter-action@v2
      id: linter
      env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
      with:
          style: file
          database: ${{github.workspace}}/out/build/${{matrix.arch}}-${{env.BUILD_TYPE}}
          thread-comments: true
          step-summary: true

Produces "D:\a\figures-counter\figures-counter\afigures-counterfigures-counter\out\build\x64-debug" instead of the correct path "D:\a\figures-counter\figures-counter\out\build\x64-debug"

The workaround is to omit the prefix and use relative path

database: out/build/${{matrix.arch}}-${{env.BUILD_TYPE}}
@2bndy5
Copy link
Collaborator

2bndy5 commented Jun 15, 2023

I think what's happening here might be related to using a Windows runner. The var github.workspace lost all it path delimiters: afigures-counterfigures-counter. This makes me wonder what stripped them. Typically python strings with \ have to be doubled (\\) to escape the misinterpreted reg-exp token. Otherwise you'd get strings with tokens like \a that mean "literal a".

What perplexes me more is that drive letter D: was stripped as well. I think I have the details to reproduce, and hopefully I can find a fix for this.

@2bndy5 2bndy5 added bug Something isn't working Windows Executed on Wimdows labels Jun 15, 2023
@2bndy5
Copy link
Collaborator

2bndy5 commented Dec 11, 2023

Paths on windows will be passed to cpp-linter's python package using powershell in the next release. I still have to do a little more testing to make sure clang-tidy can actually find the database on Windows runners where the database option is given an absolute path.

@2bndy5 2bndy5 added the compilation database clang-tidy didn't use a compilation database label Dec 11, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working compilation database clang-tidy didn't use a compilation database Windows Executed on Wimdows
Projects
None yet
Development

No branches or pull requests

2 participants