Does anyone know how to solve the issue with the file cache of the GExperts search? It always blows into my face when doing a search after changing my git branch and it had some files cached that don't exist anymore with the message:

Does anyone know how to solve the issue with the file cache of the GExperts search? It always blows into my face when doing a search after changing my git branch and it had some files cached that don't exist anymore with the message:

The file blabla.pas does not exist.

Search therefor does not work anymore until I switch back the branch or restart the IDE.

Comments

  1. IIRC, I had the same problem sometime ago,  but haven't experiencing the problem for at least one year, I don't know why.

    ReplyDelete
  2. Which "GExperts search" are you talking about? Grep? If yes, what are the settings you are using for the search? (e.g. current file/current project etc.)

    ReplyDelete
  3. Thomas Mueller yes, Grep. And I used directories in that case iirc. I specified the root source directory of my project.

    ReplyDelete
  4. Stefan Glienke and the error message was displayed during the actual search, not when you clicked on one of the search results?

    ReplyDelete
  5. When I did a new search after changing the branch - my guess is that the file cache is not properly handling files that have gone - I had the same issue when I renamed some file in the IDE and then did a new search

    ReplyDelete
  6. Stefan Glienke I'm looking at the source code right now and I can't see any caching being done on the directory or file list. Only when "previous search result files" is used, any caching is done at all. I may be missing something, I am not really familiar with the sources of the grep engine.

    ReplyDelete
  7. Stefan Glienke I just did a simple test: Search for something in a directory and subdirs, then delete one of the files found and do the search again. No error message, just one file less in the result. Could you please verify and describe the exact circumstances where you get the error?

    ReplyDelete
  8. I was not able to reproduce with directory but with project group
    - switching to feature/marshmallow branch in Spring4D
    - open the Spring4D project group
    - do a search for something that returns some files from the Persistence package
    - switch to develop
    - accept the "project has been changed blabla dialog"
    - hit "refresh search" -> blam, fullscreen dialog with a ton of EGXFilenotfound exceptions

    Unfortunately that error is a bit different from the other one because it occurs shortly after the search which actually returns results - the other one makes it impossible to do a search at all.

    Edit: After a quick look into the code I guess its the same issue. In one case its EGXFileNotFound where the search continues and in the original reported issue it was EFileNotFound where it did not continue.

    ReplyDelete
  9. OK, so it's not when you actually do a new search but when you click on "Refresh search". I'll try that one.

    ReplyDelete
  10. Interesting: I just found a problem with Grep that also raises a EGXFileNotFound exception: If the path for a unit in the .dproj file is different from the one in the .dpr file, the (Delphi 2007-) OTA  apparently returns the path from the .dproj file. When comiling, it apparently uses the path from the .dpr file. In my case it was the unit GX_MacroLibrary in GExperts which apparently was moved from Experts to Experts\MacroLibrary at one point, but only in the .dpr file. Unfortunately this is not a GExperts Grep bug but a bug in the Delphi IDE.

    ReplyDelete
  11. How ugly:

    if FromProject and (E is EGXFileNotFound) then
    E.Message := E.Message + ' Please check your dpr/dproj files and correct the path/filename referenced there.';

    I didn't even know changing an active exception's message was allowed in Delphi. It's also not using a resource string...

    ReplyDelete
  12. Thomas Mueller oh yes, that lead me to numerous discrepancies in the D2007 codebase at the current client. That message trick is by me BTW. Still haven't figured a better way to do that.

    ReplyDelete
  13. Thomas Mueller Are there any plans to work around the problem, apart from the modified exception message?

    ReplyDelete
  14. Nicholas Ring I still have to reproduce the actual problem, preferably without having to install a library that I don't use with a SCM that I'm not familiar with. Certainly not today, it's time to hit the sack.

    ReplyDelete
  15. Thomas Mueller Similar to Stefan Glienke, I get the same issue when switching branches within Git. If I can give you simple steps to reproduce (with Git), would you be open to that?

    I don't expect it to be fixed today... Yesterday would be fine ;-)

    ReplyDelete
  16. Nicholas Ring any simple to reproduce example will do. Please include the exact git commands to issue.
    Don't expect me to do much on it right now. I'm sick, haven't slept much for three nights in a row. Nothing serious, just the common cold, but lack of sleep isn't really helpful when trying to figure out bugs in code written by somebody else.

    ReplyDelete
  17. Thomas Mueller I think I might have to eat humble pie... I can't reproduce it, so I can't do any steps :'-(

    If do manage it, I will let you know.

    ReplyDelete

Post a Comment