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

Check for looping symlinks when building PHP projects #3401

Merged
merged 2 commits into from
Jun 8, 2024

Conversation

AJenbo
Copy link
Collaborator

@AJenbo AJenbo commented Jun 7, 2024

Fixes #3396

Finally located the issue for the IDE getting stuck on some project, this has brought so much pain over the last few years 😭
(I had gotten used to removing the vendor folder before starting CodeLite, or loading a different project and adding search paths)

The solution here is to resolve each folder before scanning it and then keeping track of the resolved paths, if we encounter a real path we have already seen previously we do not visit the symlink.
The alternative could be to simply not follow symlinks, but this feels like a better solution as it supports cases where the symlinks are relevant, but avoids cases where they are self nesting.

@AJenbo AJenbo added the PHP label Jun 7, 2024
@eranif
Copy link
Owner

eranif commented Jun 8, 2024

Actually, a more correct fix would be to switch to the general purpose clFilesScanner (in file clFilesCollector.cpp) class which already keep tracks of visited folders and resolves symbolic links

@eranif eranif merged commit 6ad26de into eranif:master Jun 8, 2024
3 checks passed
@AJenbo AJenbo deleted the php-sym-loop branch June 8, 2024 17:16
@AJenbo
Copy link
Collaborator Author

AJenbo commented Jun 8, 2024

Actually, a more correct fix would be to switch to the general purpose clFilesScanner (in file clFilesCollector.cpp) class which already keep tracks of visited folders and resolves symbolic links

I took a quick stab at this, one thing I noticed is that clFilesScanner does not have support for empty folders. Another thing that I noticed is that the progress bar stopped around 33% after the switch, but I'm not sure why that is, could just be my implementation.

I'm not sure what the best way to add folder support to the general scanner would be... and I still have a few modern PHP features that I would like to focus on adding support for first :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Infinit indexing on looping symlinks
3 participants