-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Load cfg
files relative to executable before considering FILESDIR
.
#4424
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
Conversation
This needs some unit tests to make sure this actually works as expected for all cases. |
In a installed Cppcheck .. it sounds best to look in the FILESDIR first. I am not sure if it should even look in the executable path if the FILESDIR is set. |
Old topic but not yet fixed. Curious to add an absolute path in the code, event if it is configurable on build time. But here what we can add to current behaviour :
Thought ? |
I feel I can accept both your suggestions.. if you feel that there is a real use case.. |
We need a single proper implementation of the lookup and tests for that. We also need to document the lookup order. I will also try to get feedback on some known maintainers on how they use it and how they expect it to work.
Relative paths are bad idea.
That makes sense. |
well this is how Cppcheck works in Windows. And the cppcheck premium also uses a relative path. |
I filed https://trac.cppcheck.net/ticket/12240 about this. The user configuration should always override the system one otherwise a local binary is not usable at all.
I also agree that looking in the We should probably also add user folder lookup and a command-line option. So the order would look like this
The command-line option could help with comparing different configurations more easily without copying them around. Since the binary folder only seems necessary for development we could add a build flag to disable it so installed binaries are "safer". |
…a relative path. A second macro BINDIR can be used in combination to indicate an optional binary folder where the program is installed (e.g. the bin part from /usr/bin). When FILESDIR is a relative path, the computed files dir will be the concatenation of the executable parent path [- BINDIR>] + <FILESDIR>. If FILESDIR is an absolute path, it is used unmodified. This is a possible solution to danmar#4424.
After adding logging for this it shows that this is already working as intended.
The loop which processes the path is doing Not closing this yet as the additional concerns still need to be tracked in tickets. |
good 👍 |
Closing as there is a much better understanding and test coverage of what it is going on - as well as various fixes. Any future discussion should be done in #7613. |
This is a very old change and after reviewing the code for the loading of non-
cfg
files it turns out that the existing behavior is actually a bug. All the other code was already preferring the application dir to theFILESDIR
.Original commit message: