Recent

Author Topic: Not updating the "Modified" time with recompile  (Read 703 times)

QEnnay

  • Full Member
  • ***
  • Posts: 110
Not updating the "Modified" time with recompile
« on: October 06, 2022, 01:02:47 am »
Hi, not sure i this is a Lazarus 2.0.12 thing or a Mint+MATE-21 thing.

I make a change to a project,  recompile and save.

But, the "Modified" date of the "new" binary does not change to today.

When I run that new binary, it shows the changes I had just made.

If I check properties of the "new" binary file I get

Quote
  Created Unknown
  Modified sep 28 2022   <-- this should be today
  Accessed oct 5 2022

If I delete the binary and recompile the correct date is applied.

Why is it not assigning the correct date? This has really screwed me as that binary has not been backed up since sep-28.

Linux-Mint 20.1 x64 + Cinnamon; Lenovo Flex 5 Ryzen 5 4500, 16GB memory
FPC: 3.2.0-1, Lazarus 2.0.12-0, all 64bit

MarkMLl

  • Hero Member
  • *****
  • Posts: 5563
Re: Not updating the "Modified" time with recompile
« Reply #1 on: October 06, 2022, 09:13:01 am »
That sounds like an OS thing. Check all three timestamps on the file (ls has options for it) and check the FS isn't mounted with the noatime option etc. (there's also probably FS-specific options to tune this sort of thing).

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

QEnnay

  • Full Member
  • ***
  • Posts: 110
Re: Not updating the "Modified" time with recompile
« Reply #2 on: October 06, 2022, 06:38:20 pm »
Thanks Mark, I mentioned the current 3-date-times in the OP and 3 looked OK, the third, "Creation" was "Unknown"

It is not an OS thing as I have now tried it on another laptop running Fedora and same thing is happening.
Deleting that binary and then recompiling it sets it that day's date and stays there.

Yesterday when writing the OP I had deleted it as mentioned. Today I made a small change to the internal Version number and compiled. It is still showing yesterdays' date.

It seems I have to delete the file for it to use the correct date.
Linux-Mint 20.1 x64 + Cinnamon; Lenovo Flex 5 Ryzen 5 4500, 16GB memory
FPC: 3.2.0-1, Lazarus 2.0.12-0, all 64bit

Fred vS

  • Hero Member
  • *****
  • Posts: 2836
    • StrumPract is the musicians best friend
Re: Not updating the "Modified" time with recompile
« Reply #3 on: October 06, 2022, 06:51:03 pm »
Hello.

Did you compile your project with the -B (build all) option?
Without it sometimes fpc has strange behaviour.
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

MarkMLl

  • Hero Member
  • *****
  • Posts: 5563
Re: Not updating the "Modified" time with recompile
« Reply #4 on: October 06, 2022, 07:43:52 pm »
It is not an OS thing as I have now tried it on another laptop running Fedora and same thing is happening.

I didn't mean "on one particular machine", I meant "not Lazarus".

However note Fred's comment, and you'll also find various discussion around the place relating to a hard-to-duplicate build failure (specifically, stuff not getting rebuilt) relating to certain types of path configuration and fixable only by doing a File -> Clean Directory (specifically, not by a Run -> Build or restarting the IDE).

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

PascalDragon

  • Hero Member
  • *****
  • Posts: 4744
  • Compiler Developer
Re: Not updating the "Modified" time with recompile
« Reply #5 on: October 07, 2022, 07:17:05 am »
Yesterday when writing the OP I had deleted it as mentioned. Today I made a small change to the internal Version number and compiled. It is still showing yesterdays' date.

It seems I have to delete the file for it to use the correct date.

Would you please check whether this also happens when you compile your project from the command line using fpc directly? Or can you reproduce it with a small application as well?

DomingoGP

  • New Member
  • *
  • Posts: 25
Re: Not updating the "Modified" time with recompile
« Reply #6 on: October 07, 2022, 02:14:24 pm »
Hello

I have detected a similar problem when building the Jedi Code Format application that when making changes they are not effective unless it is build with a "clean and build".
I have been able to isolate the problem in the project with only 2 units attached.

To test it, unzip the file in C:\ZZ to keep the same paths.
Load the project from the folder C:\ZZ FreePascalBuildBugCommandLineLazarus.

compile and run and then comment/uncomment line 17 of unit 2 and run again. The result is the same.
But I think the problem is with the FPC compiler, I have tried to build it with build.bat and then modify it and build it again and it shows the same result.

I don't know if I'm missing something, that's why I put it here before filling a bug report in the freepascal bugtracker.

Lazarus 2.2.2 (rev lazarus_2_2_2) FPC 3.2.2 i386-win32-win32/win64

PascalDragon

  • Hero Member
  • *****
  • Posts: 4744
  • Compiler Developer
Re: Not updating the "Modified" time with recompile
« Reply #7 on: October 08, 2022, 11:02:51 am »
I don't know if I'm missing something, that's why I put it here before filling a bug report in the freepascal bugtracker.

First of, you can adjust your batch file so that it is location independent (I also have the fpc executable in PATH, so no need for an absolute path either):

Code: [Select]
set CURDIR=%~dp0

fpc.exe -MObjFPC -Scghi -O1 -gw3 -gl -l -vewnhibq -Fi%CURDIR%\..\..\lib\i386-win32 -Fu%CURDIR%\..\..\CommandLine\Lazarus\ -FU%CURDIR%\..\..\lib\i386-win32\ -FE%CURDIR%\..\..\CommandLine\Lazarus\ -o%CURDIR%\..\..\CommandLine\Lazarus\project1.exe project1.lpr

Second, there is no unit2 in your example, only a unit1, so I'll assume you mean that.

Third: the problem seems to be related to your use of the in clause in the uses clause. Lazarus itself doesn't use this and also the modified time of the generated binary will change nevertheless, so this is a different problem than what's disecussed here. Though it would be nice if you'd report this nevertheless as it definitely should be fixed.

MarkMLl

  • Hero Member
  • *****
  • Posts: 5563
Re: Not updating the "Modified" time with recompile
« Reply #8 on: October 08, 2022, 11:06:27 am »
Third: the problem seems to be related to your use of the in clause in the uses clause. Lazarus itself doesn't use this and also the modified time of the generated binary will change nevertheless, so this is a different problem than what's disecussed here. Though it would be nice if you'd report this nevertheless as it definitely should be fixed.

Yes, that matches what I think I've seen in the past but never managed to pin down. However I might have seen other symptoms relating to -Fu or similar, again difficult to pin down, which might turn out to have a common underlying cause.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

DomingoGP

  • New Member
  • *
  • Posts: 25
Re: Not updating the "Modified" time with recompile
« Reply #9 on: October 08, 2022, 02:57:02 pm »

Quote
so this is a different problem than what's disecussed here

Sorry for the noise and thanks for your help. I filled a issue.

https://gitlab.com/freepascal.org/fpc/source/-/issues/39945

 

TinyPortal © 2005-2018