Recent

Author Topic: Lag in detect change in included files with $INCLUDE  (Read 416 times)

alantelles

  • New Member
  • *
  • Posts: 20
Lag in detect change in included files with $INCLUDE
« on: January 24, 2021, 08:32:48 pm »
Hello, y'all.

Many times, when I make changes to included sources and compile program the changes are not "taken account". The program is compiled without the changes I've done. Only after some time or some random "close-open" Lazarus the program is rightfully compiled. There is a logic in this behaviour or something I should have done that I didn't?

Edit: FPC 3.2.0, Lazarus 2.0.10, however it happened also in FPC 3.0.4 with Lazarus 2.0.6
« Last Edit: January 25, 2021, 12:24:33 pm by alantelles »
# compulsive coder
FPC 3.2.0, Lazarus 2.0.10

jamie

  • Hero Member
  • *****
  • Posts: 4188
Re: Lag in detect change in included files with $INCLUDE
« Reply #1 on: January 24, 2021, 09:06:31 pm »
did you try "Clean Up and Build all " ?
The only true wisdom is knowing you know nothing

MarkMLl

  • Hero Member
  • *****
  • Posts: 2065
Re: Lag in detect change in included files with $INCLUDE
« Reply #2 on: January 24, 2021, 09:41:56 pm »
OP: please tell us EXACTLY what version of compiler etc. you're using. That would be important under normal circumstances, but in this case you might be looking at a recently-introduced compiler bug.

Using FPC 3.2.0 and Lazarus 2.1.0 on Linux x86_64 I think I've been seeing something comparable.

Using this code:

Code: Pascal  [Select][+][-]
  1. program PythonDemo;
  2.  
  3. {$mode objfpc}{$H+}
  4.  
  5. { define DYNAMIC }
  6. {$define PYTHON2 }
  7.  
  8. ...
  9.  
  10. uses
  11.   {$IFDEF UNIX}
  12.   cthreads,
  13.   {$ENDIF}
  14.   Classes,
  15. {$ifdef DYNAMIC }
  16.   python_dynamic;                       (* "Python" is a shared-library object  *)
  17. {$note ===== Intending to link dynamically ===== }
  18. {$else          }
  19.   python;                               (* "Python" is a unit file              *)
  20. {$note ===== Intending to link statically ===== }
  21. {$endif DYNAMIC }
  22. ...
  23.  

if I change the define DYNAMIC state I see the main unit (excerpted above) recompile, but there appears to be no change of what file is actually linked... Lazarus's "Build all" doesn't fix it, it's necessary to do a "Clean directory". I've not yet tried to work through older versions.

MarkMLl
Turbo Pascal v1 on CCP/M-86, multitasking with LAN and graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.

alantelles

  • New Member
  • *
  • Posts: 20
Re: Lag in detect change in included files with $INCLUDE
« Reply #3 on: January 25, 2021, 12:26:12 pm »
OP: please tell us EXACTLY what version of compiler etc. you're using. That would be important under normal circumstances, but in this case you might be looking at a recently-introduced compiler bug.

Using FPC 3.2.0 and Lazarus 2.1.0 on Linux x86_64 I think I've been seeing something comparable.

Using this code:

Code: Pascal  [Select][+][-]
  1. program PythonDemo;
  2.  
  3. {$mode objfpc}{$H+}
  4.  
  5. { define DYNAMIC }
  6. {$define PYTHON2 }
  7.  
  8. ...
  9.  
  10. uses
  11.   {$IFDEF UNIX}
  12.   cthreads,
  13.   {$ENDIF}
  14.   Classes,
  15. {$ifdef DYNAMIC }
  16.   python_dynamic;                       (* "Python" is a shared-library object  *)
  17. {$note ===== Intending to link dynamically ===== }
  18. {$else          }
  19.   python;                               (* "Python" is a unit file              *)
  20. {$note ===== Intending to link statically ===== }
  21. {$endif DYNAMIC }
  22. ...
  23.  

if I change the define DYNAMIC state I see the main unit (excerpted above) recompile, but there appears to be no change of what file is actually linked... Lazarus's "Build all" doesn't fix it, it's necessary to do a "Clean directory". I've not yet tried to work through older versions.

MarkMLl

Edited to tell compiler version
# compulsive coder
FPC 3.2.0, Lazarus 2.0.10

MarkMLl

  • Hero Member
  • *****
  • Posts: 2065
Re: Lag in detect change in included files with $INCLUDE
« Reply #4 on: January 25, 2021, 12:33:19 pm »
Could you post a simple test project which demonstrates the problem?

MarkMLl
Turbo Pascal v1 on CCP/M-86, multitasking with LAN and graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.

alantelles

  • New Member
  • *
  • Posts: 20
Re: Lag in detect change in included files with $INCLUDE
« Reply #5 on: January 25, 2021, 07:51:38 pm »
I think it would not be able to reproduce because i think it's a "progressive" problem. As you use more included files the issue appears. It didn't happen until I have some more included files. There would be a lot of steps to reproduce in my project however, if you're realy interested I can leave it here
# compulsive coder
FPC 3.2.0, Lazarus 2.0.10

MarkMLl

  • Hero Member
  • *****
  • Posts: 2065
Re: Lag in detect change in included files with $INCLUDE
« Reply #6 on: January 25, 2021, 08:23:48 pm »
I'll try to take a bit of a look at it myself in the morning, and will report back.

MarkMLl
Turbo Pascal v1 on CCP/M-86, multitasking with LAN and graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.

MarkMLl

  • Hero Member
  • *****
  • Posts: 2065
Re: Lag in detect change in included files with $INCLUDE
« Reply #7 on: January 31, 2021, 04:04:50 pm »
My apologies for the delay looking at this. I've just been tinkering with simple include and unit files in the same directory using the attached test files without finding anything untoward. @alantelles Please could you see if you can duplicate your problem using some variant of these, and if not I think we could usefully start looking at the unitpath directive etc.

MarkMLl
Turbo Pascal v1 on CCP/M-86, multitasking with LAN and graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.

 

TinyPortal © 2005-2018