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

No such file or directory: 'clang-tidy-*' on macos #111

Closed
shenxianpeng opened this issue Oct 14, 2022 · 8 comments
Closed

No such file or directory: 'clang-tidy-*' on macos #111

shenxianpeng opened this issue Oct 14, 2022 · 8 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@shenxianpeng
Copy link
Collaborator

shenxianpeng commented Oct 14, 2022

Test action failed when running cpp-linter, it may be that clang-format and clang-tidy are not installed correctly on macOS.

https://github.com/cpp-linter/test-cpp-linter-action/actions/runs/3248892324/jobs/5330649416

@shenxianpeng shenxianpeng added the bug Something isn't working label Oct 14, 2022
@shenxianpeng shenxianpeng transferred this issue from cpp-linter/clang-tools-pip Oct 17, 2022
@shenxianpeng
Copy link
Collaborator Author

Form my test , it looks like was cpp-linter's failure on macOS. so I transfer issue to here(cpp-linter).

@shenxianpeng shenxianpeng added the help wanted Extra attention is needed label Oct 17, 2022
@shenxianpeng
Copy link
Collaborator Author

shenxianpeng commented Oct 17, 2022

When I installed clang-tools manually before running cpp-linter, the test action ran successfully. here is the job.


cpp-linter-action installed clang-tools path is /usr/local/opt/python@3.10/bin, this path can not be found by cpp-linter? @2bndy5

Run clang-tools -i 12 -b
/usr/local/opt/python@3.10/bin directory is not in your environment variable PATH.
downloading clang-format (version 12)
Installing clang-format-12 to /usr/local/opt/python@3.10/bin
symbolic link created /usr/local/opt/python@3.10/bin/clang-format
downloading clang-tidy (version 12)
Installing clang-tidy-12 to /usr/local/opt/python@3.10/bin
symbolic link created /usr/local/opt/python@3.10/bin/clang-tidy

manually installed clang-tools before running cpp-linter, the path is /Users/runner/hostedtoolcache/Python/3.10.7/x64/bin

Run pip install clang-tools
  
Collecting clang-tools
  Downloading clang_tools-0.6.2-py3-none-any.whl (10 kB)
Installing collected packages: clang-tools
Successfully installed clang-tools-0.6.2

Notice:  A new release of pip available: 22.2.2 -> 22.3
Notice:  To update, run: pip install --upgrade pip
downloading clang-format (version [12](https://github.com/shenxianpeng/test-repo/actions/runs/3262462546/jobs/5359632173#step:4:13))
Installing clang-format-12 to /Users/runner/hostedtoolcache/Python/3.10.7/x64/bin
symbolic link created /Users/runner/hostedtoolcache/Python/3.10.7/x64/bin/clang-format
downloading clang-tidy (version 12)
Installing clang-tidy-12 to /Users/runner/hostedtoolcache/Python/3.10.7/x64/bin
symbolic link created /Users/runner/hostedtoolcache/Python/3.10.7/x64/bin/clang-tidy

@2bndy5
Copy link
Collaborator

2bndy5 commented Oct 17, 2022

This seems more like an issue with clang-tools-pip or cpp-linter-action repo.

I assume the location for macOS is gotten from str(Path(sys.executable).parent) (which is used for anything but Linux - see the src here) is resolving differently depending on the location of the python executable.

I notice that you also manually setup python using actions/setup-python step on the successful test run (which resolved to /Users/runner/hostedtoolcache/Python/3.10.7/x64/bin). In the failed test run, the default version of python (that ships with the OS container) is used, which apparently exists in /usr/local/opt/python@3.10/bin/.

We have not mandated this (yet), but installing python with the github action seems to help resolve the install path as a folder that cpp-linter (& clang-tools-pip) can access. We could make a temp venv from a composite step so users are not burdened with an extra CI step (uses: actions/setup-python) just to use cpp-linter-action.

@2bndy5
Copy link
Collaborator

2bndy5 commented Oct 17, 2022

This might be more easily solved by addressing cpp-linter/clang-tools-pip#15 with a path we create in the user space (independent of the location for the python executable).

@2bndy5
Copy link
Collaborator

2bndy5 commented Oct 17, 2022

@shenxianpeng
Copy link
Collaborator Author

Making a temp venv from a composite step should be the faster way to resolve this problem. it will increase a little time.
This might be the better way to solve this problem by addressing cpp-linter/clang-tools-pip#15, but it may take longer.

@2bndy5
Copy link
Collaborator

2bndy5 commented Oct 18, 2022

We could do both solutions.

  1. resolve Better path defaults clang-tools-pip#15
  2. create a temp venv

@shenxianpeng shenxianpeng transferred this issue from cpp-linter/cpp-linter Oct 18, 2022
@2bndy5
Copy link
Collaborator

2bndy5 commented Oct 19, 2022

immediate solution with venv in #113 (made available in v2.1.3)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants