-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
cppcheck on Windows search the wrong cfg folder. #19
Comments
Sorry for the long delay. I'm not a Windows user, so hard to tell what exactly the problem is. (P.S. I've added you as co-maintainer in #22.) Also on other OSs, the cfg files are installed in @timsnyder: do you have by any chance experience with Windows? |
Hi, Can we do something about it? Thanks, |
@pcasenove Thanks for reaching out! It should be possible to fix this. Would you know how? I don't have a windows machine at my disposal (and also lack experience with said OS). |
I have this on Linux (Centos 7) and I don't have a windows machine at hand either to test. If you prefer, I can open another issue on this, for linux only. |
I'm sorry, I did not ready carefully. Fixing the patch would be great. I don't have much time at this stage to look into it. |
OK... looking at the cppcheck code, it seems that the code to load std.cfg file has changed, explaining the crash: the patch is not applied I think... |
Using this make command in the build script seems to fix (for us): |
Seems reasonable. To avoid similar problems in future, we should make a PR with changed tests, which result in this type of error, and then fix it. |
I am currently seeing this issue on windows with cppcheck 2.6.2. Is there any resolution/fix here? |
Can you try the suggestion by @pcasenove? Does this work for you? I'm not a Windows user myself, so it would be good to have a contributor for this feedstock who can fix and test the recipe on Windows. |
I took a serious look at this today and suspect that it has to do with limitations conda has in it's implementation of PREFIX substitution in binary files on windows (see https://github.com/conda/conda/blob/0fa068f7d54e685d66468d0eefe13379743dc125/conda/core/portability.py#L86-L92). Looking at v1.7.2, it seems that I'll see if I can come up with something that will work on both Linux and Windows. I'm thinking of having something that will look with a path relative to where the executable is installed and lookup the executable path with something like https://github.com/gpakosz/whereami |
The conan folks are also struggling with this behavior. I found conan-io/conan-center-index#10423 (comment) with some interesting pointers and discussions on the behavior of cppcheck. |
They submitted a patch for mac in danmar/cppcheck#4071, and looking in between the two additions of their patch I see I was concerned about |
I'm beginning to think that since we shouldn't be setting Now, I just need to figure out how to get cmake to not set |
Of course, the cmake lists just throw it in and don't have it behind any kind of option... I'm going to see what happens if I patch to remove The unit tests run and don't care whether they can read the cfg. However, the |
The output from the
I suspect that the test might not actually be testing anything. |
I fired up my Windows VM and installed the 2.7.5 package and looked at the @senecal-whoop do you still see the issue with the latest version of the package? If so, could you copy paste the exact cmdline and output you are seeing into this ticket? |
We had reports on this before but so far it seems to be working as intended, but the work is still ongoing. Starting with 2.15.0 you can use the |
I'm currently getting the following output from
The As far as I can tell, there's no way to specify a |
Thanks. The important information was already visible in an earlier comment but I missed that. The problem is
That is a location on the build system and I am not 100% sure but that probably requires us to expand that in code which is currently not done. I think this is covered by the existing ticket https://trac.cppcheck.net/ticket/13505. |
Currently when you run
cppcheck
onconda-forge
on Windows, it will search the cfg files under%CONDA_PREFIX%\Library\bin
or%CONDA_PREFIX%\Library\bin\cfg
. However, those files are under%CONDA_PREFIX%\Library\share\cppcheck\cfg
. I am not yet sure how to instruct the Cppcheck to search a different path, and keep a record here.The text was updated successfully, but these errors were encountered: