User forums > Using Code::Blocks
Project tree and symlinks
inmarket:
This is still a problem with the latest version and makes the project explorer virtually unusable.
The files are stored correctly in the project file as relative paths without symlink conversion. It is the project explorer display that is converting the symlinks to a real path when it shouldn't.
The incorrectly resolved filenames are then sometimes being saved back into the project file (I am not sure under what conditions).
eg.
Project directory is "/my/path/to/project/directory/projectname"
This directory contains a symlink "x" to directory "/my/very/long/path"
Files from "x" initially get stored correctly in the project file as "x/filename".
It however gets displayed as either "../../../../../../../my/very/long/path/filename" or as "/my/very/long/path/filename" instead of as "x/filename". This also causes files in the project directory itself to be displayed as "/my/path/to/project/directory/projectname/filename" instead of just "filename".
Saving some project property MAY also cause the expanded filenames to be stored in the project file (not sure in what situations though).
christo:
If anyone is interested in support for symlinks in project tree in Linux, following change will help. I've been testing it for a while, works fine with clangd_client plugin. I've not tested with legacy CC.
https://github.com/josephch/codeblocks/commit/77557627211a80be39e668b3ca54137b5e3a15e0
1. While creating project/ adding files, use symlink path - do not expand to realpath. This makes project browser grouping useful.
2. In the project file map, use real path as the key. So same project file item is returned on calling GetFileByFilename relative path and real path.
Navigation
[0] Message Index
[*] Previous page
Go to full version