Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2026-02

Unit dependencies

15 messages · 6 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Adriaan van Os

It seems, that if I make any change in a unit file, even if it is just a comment, then the change triggers a recompile of all dependent units. In theory, only a relevant change of the interface ABI of a unit would need to trigger a recompile of dependent units. Has this ever been considered (or even implemented) ?

Regards,

Adriaan van Os

Reply by email

Mattias Gaertner
to Adriaan van Os
Adriaan van Os wrote 5 lines
It seems, that if I make any change in  a unit file, even if it is just a comment, then the change triggers a recompile of all dependent units. In theory, only a relevant change of the interface ABI of a unit would need to trigger a recompile of dependent units. Has this ever been considered  (or even implemented) ?

I'm currently looking into it.

Mattias

Reply by email

Sven Barth
to Adriaan van Os: It seems, that if I make any change in a unit file, even if it is just a comment, then…

Adriaan van Os via fpc-devel schrieb am
Di., 3. Feb. 2026, 11:28:

Show quoted text 8 lines
It seems, that if I make any change in a unit file, even if it is just a comment, then the change triggers a recompile of all dependent units. In theory, only a relevant change of the interface ABI of a unit would need to trigger a recompile of dependent units. Has this ever been considered (or even implemented) ?

That is how it's already supposed to work. Due to reworking in the related parts of the compiler that doesn't work correctly anymore and needs to be fixed.

Regards,
Sven

Reply by email

Adriaan van Os
to Mattias Gaertner: I'm currently looking into it. Mattias
Mattias Gaertner wrote 10 lines
On 2/3/26 11:27, Adriaan van Os via fpc-devel wrote: > It seems, that if I make any change in a unit file, even if it is > just a comment, then the change triggers a recompile of all dependent > units. In theory, only a relevant change of the interface ABI of a > unit would need to trigger a recompile of dependent units. Has this > ever been considered (or even implemented) ? I'm currently looking into it.

That's great !

Another question. Has anybody considered running the external assembly (e.g. on macOS) in a separate process ? That would greatly reduce build times of large projects.

Regards,

Adriaan van Os

Reply by email

Sven Barth
to Adriaan van Os

Adriaan van Os via fpc-devel schrieb am
Di., 3. Feb. 2026, 20:07:

Show quoted text 18 lines
Mattias Gaertner via fpc-devel wrote: > > > On 2/3/26 11:27, Adriaan van Os via fpc-devel wrote: >> It seems, that if I make any change in a unit file, even if it is >> just a comment, then the change triggers a recompile of all dependent >> units. In theory, only a relevant change of the interface ABI of a >> unit would need to trigger a recompile of dependent units. Has this >> ever been considered (or even implemented) ? > > I'm currently looking into it. That's great ! Another question. Has anybody considered running the external assembly (e.g. on macOS) in a separate process ? That would greatly reduce build times of large projects.

Ehm... The external assembly *is* run in a separate process, that's the point of it being *external*.

Regards,
Sven

Reply by email

Adriaan van Os
to Sven Barth
Sven Barth wrote 8 lines
Another question. Has anybody considered running the external assembly (e.g. on macOS) in a separate process ? That would greatly reduce build times of large projects. Ehm... The external assembly *is* run in a separate process, that's the point of it being *external*.

You are right, of course. What I mean is — is the compiler waiting for that process to finiish ? It would have to wait before starting the linking phase, but not before starting compiling other units.

Regards,

Adriaan van Os

Reply by email

Michael Van Canneyt
to Adriaan van Os
Adriaan van Os wrote 15 lines
Sven Barth via fpc-devel wrote: > Another question. Has anybody considered running the external > assembly (e.g. on macOS) in a > separate process ? That would greatly reduce build times of large > projects. > > > Ehm... The external assembly *is* run in a separate process, that's the > point of it being *external*. You are right, of course. What I mean is — is the compiler waiting for that process to finiish ? It would have to wait before starting the linking phase, but not before starting compiling other units.

It would make the logic quite complex.
Not all platforms can handle this, sometimes the internal assembler is used, you have to make sure not to launch 200 assembler processes at once etc. The current approach has the advantage of simplicity.

Traditionally, make is used to parallelize (and fpmake supports it).

Michael.

Reply by email

Sven Barth
to Adriaan van Os: You are right, of course. What I mean is — is the compiler waiting for that process to…

Adriaan van Os schrieb am Mi., 4. Feb. 2026, 13:46:

Show quoted text 16 lines
Sven Barth via fpc-devel wrote: > Another question. Has anybody considered running the external > assembly (e.g. on macOS) in a > separate process ? That would greatly reduce build times of large > projects. > > > Ehm... The external assembly *is* run in a separate process, that's the > point of it being *external*. You are right, of course. What I mean is — is the compiler waiting for that process to finiish ? It would have to wait before starting the linking phase, but not before starting compiling other units.

The compiler needs to wait for the assembler to exit, it does not have a concept for asynchronously started processes.

Regards,
Sven

Reply by email

Adriaan van Os
to Michael Van Canneyt: It would make the logic quite complex. Not all platforms can handle this, sometimes the…
Michael Van Canneyt wrote 10 lines
> You are right, of course. What I mean is — is the compiler waiting for > that process to finiish ? It would have to wait before starting the > linking phase, but not before starting compiling other units. It would make the logic quite complex. Not all platforms can handle this, sometimes the internal assembler is used, you have to make sure not to launch 200 assembler processes at once etc. The current approach has the advantage of simplicity. Traditionally, make is used to parallelize (and fpmake supports it).

Yes, I have been thinking in that direction, create a rule where .o depends on and is created from .s. But then, you need a hardcoded list of units in the Makeffile ?

Regards,

Adriaan van Os

Reply by email

Hairy Pixels
to Sven Barth: Adriaan van Os via fpc-devel schrieb am Di., 3. Feb. 2026, 11:28: That is how it's…

On Feb 3, 2026 at 8:05:08 PM, Sven Barth via fpc-devel <

Show quoted text 18 lines
wrote: That is how it's already supposed to work. Due to reworking in the related parts of the compiler that doesn't work correctly anymore and needs to be fixed. Adriaan van Os via fpc-devel schrieb am Di., 3. Feb. 2026, 11:28: > It seems, that if I make any change in a unit file, even if it is just a > comment, then the change > triggers a recompile of all dependent units. In theory, only a relevant > change of the interface ABI > of a unit would need to trigger a recompile of dependent units. Has this > ever been considered (or > even implemented) ? >

I'm stuck on a compiler version from 2023 because of this. There were changes recently that caused a regression in performance but are they going to be fixed? Last time I tried to use a new version from 12 months ago already.

I tried to make a reproducible example but failed and gave up. Waiting 5 seconds when changing anything was too much.

Reply by email

Michael Van Canneyt
to Hairy Pixels
Hairy Pixels wrote 23 lines
On Feb 3, 2026 at 8:05:08 PM, Sven Barth via fpc-devel < > wrote: > That is how it's already supposed to work. Due to reworking in the related > parts of the compiler that doesn't work correctly anymore and needs to be > fixed. > Adriaan van Os via fpc-devel schrieb am > Di., 3. Feb. 2026, 11:28: > >> It seems, that if I make any change in a unit file, even if it is just a >> comment, then the change >> triggers a recompile of all dependent units. In theory, only a relevant >> change of the interface ABI >> of a unit would need to trigger a recompile of dependent units. Has this >> ever been considered (or >> even implemented) ? >> > > I'm stuck on a compiler version from 2023 because of this. There were changes recently that caused a regression in performance but are they going to be fixed? Last time I tried to use a new version from 12 months ago already.

We are still working on it. If you follow what happens on gitlab you'll see that extra tests are being added for just this work.

It's not easy, as it means reworking a 25 year old, very fragile, architecture.

Michael.

Reply by email

Michael Van Canneyt
to Adriaan van Os: Yes, I have been thinking in that direction, create a rule where .o depends on and is…
Adriaan van Os wrote 16 lines
Michael Van Canneyt via fpc-devel wrote: >> You are right, of course. What I mean is — is the compiler waiting for >> that process to finiish ? It would have to wait before starting the >> linking phase, but not before starting compiling other units. > > It would make the logic quite complex. Not all platforms can handle this, > sometimes the internal assembler is used, you have to make sure not to > launch 200 assembler processes at once etc. > The current approach has the advantage of simplicity. > > Traditionally, make is used to parallelize (and fpmake supports it). Yes, I have been thinking in that direction, create a rule where .o depends on and is created from .s. But then, you need a hardcoded list of units in the Makeffile ?

You could construct that based on the list of .ppu files. The compiler will always write the .ppu files, and they should match the assembler files (unless there are units that have no code, but that can be catered for)

Michael.

Reply by email

Martin Frb
to Hairy Pixels: On Feb 3, 2026 at 8:05:08 PM, Sven Barth via fpc-devel < I'm stuck on a compiler…
Hairy Pixels wrote 5 lines
I tried to make a reproducible example but failed and gave up.  Waiting 5 seconds when changing anything was too much.

Maybe I am simplifying this too much, and likely overlooking something....

But, the assembler generates the .o files => and they should only be needed for linking?

So... if you compile units only (which means no linking), or otherwise stop/defer the linking:
Could you not just wrap the assembler into a small program, that would start it into the background and return to the compiler pretending to be done?

Reply by email

Michael Van Canneyt
to Martin Frb
Martin Frb wrote 17 lines
On 04/02/2026 15:41, Hairy Pixels via fpc-devel wrote: > > > I tried to make a reproducible example but failed and gave up.  > Waiting 5 seconds when changing anything was too much. > Maybe I am simplifying this too much, and likely overlooking something.... But, the assembler generates the .o files => and they should only be needed for linking? So... if you compile units only (which means no linking), or otherwise stop/defer the linking: Could you not just wrap the assembler into a small program, that would start it into the background and return to the compiler pretending to be done?

But you can already do this with the -s option.
The compiler generates all needed files, and at the end produces a script that does the assembling and linking.

But in the end, if you want to test, you need to wait anyway till everything is assembled and linked...

Michael.

Reply by email

Adriaan van Os
to Martin Frb: Maybe I am simplifying this too much, and likely overlooking something.... But, the…
Martin Frb wrote 10 lines
Maybe I am simplifying this too much, and likely overlooking something.... But, the assembler generates the .o files => and they should only be needed for linking? So... if you compile units only (which means no linking), or otherwise stop/defer the linking: Could you not just wrap the assembler into a small program, that would start it into the background and return to the compiler pretending to be done?

Yes, that's exactly what I am thinking about.

Regards,

Adriaan van Os

Reply by email