Recent

Author Topic: Lazarus doesn't recompile changed units  (Read 3188 times)

Grahame Grieve

  • Full Member
  • ***
  • Posts: 110
Lazarus doesn't recompile changed units
« on: September 10, 2020, 02:28:19 am »
So I am porting a rather large project to Lazarus. I'm finding that if I change a unit that has already been compiled, then I need to do a clean and build, otherwise the unit I've changed won't be recompiled.

I can't find any settings related to this...

af0815

  • Hero Member
  • *****
  • Posts: 586
Re: Lazarus doesn't recompile changed units
« Reply #1 on: September 10, 2020, 06:53:17 am »
Is the changed source correct touched with a newer date/time than the old version.

What System is used Windows, Linux or Mac ?

I have this seen only if the sourcefile (and compiled file) have not correct dates, maybe in future by accident.
regards
Andreas

Thaddy

  • Hero Member
  • *****
  • Posts: 10573
Re: Lazarus doesn't recompile changed units
« Reply #2 on: September 10, 2020, 11:02:26 am »
-B
With that I mean a rebuilt is usually unavoidable.
« Last Edit: September 10, 2020, 11:13:39 am by Thaddy »

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3886
  • I like bugs.
Re: Lazarus doesn't recompile changed units
« Reply #3 on: September 10, 2020, 11:07:33 am »
The compiler does not notice if an .inc file is changed. With unit files it should work correctly.
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux.

marcov

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8896
  • FPC developer.
Re: Lazarus doesn't recompile changed units
« Reply #4 on: September 10, 2020, 11:46:08 am »
If you can't reproduce with a small project, compiling the project with -vt might also give some insight. That logs recompilation decisions.

Ñuño_Martínez

  • Hero Member
  • *****
  • Posts: 1072
    • Burdjia
Re: Lazarus doesn't recompile changed units
« Reply #5 on: September 10, 2020, 11:47:27 am »
Also, INLINEd procedures/methods doesn't force recompilation of units that use such procedure/method while INTERFACE declaration doesn't change, so behavior doesn't change.
Are you interested in game programming? Join the Pascal Game Development community!
Also visit the Game Development Portal

Grahame Grieve

  • Full Member
  • ***
  • Posts: 110
Re: Lazarus doesn't recompile changed units
« Reply #6 on: September 12, 2020, 02:08:34 am »
I'm changing the interface of compiled units, so it's not one of the edge cases. It's happening all the time, not just occasionally or once off.

The .pas file is 6 minutes more recent that the .ppu and .or files for it. It doesn't make any difference whether it's in the project or just on the search path.  It doesn't matter whether the file is open in the IDE or not

No, I can't reproduce this with a small project. It only happens (so far) with my very large project (~320 units in the .lpr, and that's about half what's in the project)

Grahame Grieve

  • Full Member
  • ***
  • Posts: 110
Re: Lazarus doesn't recompile changed units
« Reply #7 on: September 12, 2020, 02:09:10 am »
how do I compile with -vt?

furious programming

  • Sr. Member
  • ****
  • Posts: 468
  • I click a little.
    • TreeStructInfo — format for text and binary configuration files
Re: Lazarus doesn't recompile changed units
« Reply #8 on: September 12, 2020, 02:13:29 am »
Check this option in the Project Options window (see attachment).
Lazarus 2.0.10 with FPC 3.2.0 (SVN Revision 63526), Windows XP (all 32-bit)

Grahame Grieve

  • Full Member
  • ***
  • Posts: 110
Re: Lazarus doesn't recompile changed units
« Reply #9 on: September 12, 2020, 03:00:07 am »
It didn't make any difference; there's no additional notes in the output

jamie

  • Hero Member
  • *****
  • Posts: 3791
Re: Lazarus doesn't recompile changed units
« Reply #10 on: September 12, 2020, 03:17:40 am »
have you tried the "Always BUILD even if nothing changes"?

Its in the Project objects under misc.....

The only true wisdom is knowing you know nothing

Grahame Grieve

  • Full Member
  • ***
  • Posts: 110
Re: Lazarus doesn't recompile changed units
« Reply #11 on: September 12, 2020, 03:33:56 am »
I just did, and still nothing is rebuilt.

avra

  • Hero Member
  • *****
  • Posts: 2044
    • Additional info
Re: Lazarus doesn't recompile changed units
« Reply #12 on: September 12, 2020, 09:16:27 pm »
That is not a normal behavior so you should try Lazarus reinstallation
ct2laz - Conversion between Lazarus and CodeTyphon
bithelpers - Bit manipulation for standard types
pasettimino - Siemens S7 PLC lib

Grahame Grieve

  • Full Member
  • ***
  • Posts: 110
Re: Lazarus doesn't recompile changed units
« Reply #13 on: September 15, 2020, 08:56:23 am »
ok. I reinstalled. Didn't make any difference. It's just the one very large project that does this; I can't reproduce it with smaller projects

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 6710
  • Debugger - SynEdit - and more
    • wiki
Re: Lazarus doesn't recompile changed units
« Reply #14 on: September 15, 2020, 10:15:17 am »
- Are all the units in the project? (listed in project inspector?)
- Or if they are in packages, are they listed in that package?

It may not be enough that they are in the relevant folder, they should be in the project/package inspector.

Are they all in the same folder, or are they in different sub/folders? How are other folders included.


And one case that sometimes may cause issues: Circular unit references, in combination with inline or generics. (Not sure about the exact circumstances needed to get an issue)

 

TinyPortal © 2005-2018