View Issue Details

IDProjectCategoryView StatusLast Update
0027421LazarusIDEpublic2020-11-23 20:52
ReporterMichael Van Canneyt Assigned ToJuha Manninen  
Status feedbackResolutionopen 
Product Version1.5 (SVN) 
Summary0027421: Files cached too aggressively in package dialog.
DescriptionLazarus keeps files in cache and does not check for renewal at all locations.
Steps To Reproduce- Outside lazarus, create Unit with file name differing from name in unit clause
  (e.g. file testu.pp, unit testa)
- Create new package.
- select 'Add other items'
- Use 'Add files from directory' to add the unit.
- Press 'Add files to package'
- Lazarus warns that the names differ. Abort.
- Outside lazarus, fix the unit clause
- Inside lazarus, press again 'Add files to package'
-> Lazarus does not detect the file change and warns again that the names differ, despite the fact that the file has been fixed.

Presumably, it keeps the files in memory cache.

I have attached a zip with a test package and unit.

Additional InformationThe new 'add' button in the package manager does not check the filename vs. unitname, and displays no warning, this is even worse IMHO.

A suspected related problem is that files that are in cache, but not in the editor, which are updated through SVN, are also not detected as updated and when opened, edited and saved, overwrite the updated version with the older versions in memory.
This is harder to reproduce reliably but has bugged us on more than one occasion.
As a result we now routinely close lazarus prior to running svn update.

I suggest a button 'clear file cache' that clears file in the cache which are not open in some dialog. Similar in functionality to 'Clear browser history' in a web browser.
TagsNo tags attached.
Fixed in Revision
Attached Files


Michael Van Canneyt

2015-02-08 12:04

administrator (662 bytes)

Mattias Gaertner

2015-02-08 12:21

manager   ~0080858

The file cache is invalidated every time the IDE gets activated, i.e. when you switch back from another application to the IDE. It sounds as if the activate is broken on your system.

What OS, window manager?

Michael Van Canneyt

2015-02-08 13:06

administrator   ~0080859

Linux, Kubunutu, KDE 64-bit. Lazarus GTK2 widgetset.

Maybe it has something to do with the fact that there is a modal dialog opened.

The SVN problem I mentioned is noticeable both on Windows and Linux.

As an aside: The activivation of Lazarus is but one use-case, it is not a guarantee.

Real-life example:
At 18:00 a scheduled script updates all SVN sources on my desktop PC at home.
If Lazarus is opened and active at 18:00 (which is the case more often than not), it does not detect the changes.


2015-02-09 08:54

developer   ~0080873

I faced a more or less similar issue about 2 weeks ago with a project. I changed the .pas and .lfm of an opened project with a text editor, and reopened the project with Lazarus. Lazarus showed the unedited files! A restart of Lazarus was necessary to get it to show the edited files.

Michael Van Canneyt

2015-02-09 11:33

administrator   ~0080877

Maybe I should point out that most of the time, Lazarus does indeed detect the change in files and offers to reload them.

It is just when this dialog is active and used that it does not seem to detect the change in files.

The only difference with other cases I can think of is that the file is not actually in use anywhere yet (I am exactly trying to use it), so maybe this is the cause ?

Mattias Gaertner

2015-02-09 12:04

manager   ~0080879

The modal dialog might be a problem. I have to check this.

Reopening a project does indeed not reload all files. -> Bug

Juha Manninen

2020-10-31 16:01

developer   ~0126680

Last edited: 2020-11-02 11:10

View 2 revisions

I improved the checks in r64094. Now a check of filename vs. unitname works when adding a unit for both packages and project.
Dummy question: how exactly you reopen a project? From menu Project -> Open Recent Project?
Or do you mean reopening when the project info .lpi file got changed externally?

Juha Manninen

2020-11-23 20:52

developer   ~0127145

Please test with current trunk.
The change of files is still checked only at activation of Lazarus. Changing that would require big changes and eat resources. Maybe updating from SVN by timer is not a good idea.

Issue History

Date Modified Username Field Change
2015-02-08 12:04 Michael Van Canneyt New Issue
2015-02-08 12:04 Michael Van Canneyt File Added:
2015-02-08 12:05 Michael Van Canneyt Additional Information Updated View Revisions
2015-02-08 12:21 Mattias Gaertner Note Added: 0080858
2015-02-08 12:21 Mattias Gaertner Assigned To => Mattias Gaertner
2015-02-08 12:21 Mattias Gaertner Status new => feedback
2015-02-08 13:06 Michael Van Canneyt Note Added: 0080859
2015-02-08 13:06 Michael Van Canneyt Status feedback => assigned
2015-02-09 08:54 Stephano Note Added: 0080873
2015-02-09 11:33 Michael Van Canneyt Note Added: 0080877
2015-02-09 12:04 Mattias Gaertner Note Added: 0080879
2020-09-02 23:19 Juha Manninen Assigned To Mattias Gaertner => Juha Manninen
2020-10-31 16:01 Juha Manninen Status assigned => feedback
2020-10-31 16:01 Juha Manninen Note Added: 0126680
2020-11-02 11:10 Juha Manninen Note Edited: 0126680 View Revisions
2020-11-23 20:52 Juha Manninen Note Added: 0127145