fpm icon indicating copy to clipboard operation
fpm copied to clipboard

Incremental Rebuild Failure

Open everythingfunctional opened this issue 2 years ago • 1 comments

Description

I think I've narrowed down the situation in which this occurs (for me at least). When modifying a submodule, sometimes it seems like it doesn't know to recreate the archive (*.a) file. My guess is that it doesn't see the dependence between the *.o file for a submodule and the subsequent library.

Expected Behaviour

Modifying any source file should always result in the correct things being recompiled and relinked.

Version of fpm

latest

Platform and Architecture

Linux, MacOS and Windows

Additional Information

No response

everythingfunctional avatar Dec 04 '23 18:12 everythingfunctional

It's because the dependency scanner treats submodules as modules,

https://github.com/fortran-lang/fpm/blob/1ae7351a840e572043e954207ec7c30b03cb3521/src/fpm_source_parsing.f90#L45-L46

There may be other misclassifications too (I had an issue before: https://github.com/fortran-lang/fpm/issues/1073).

I wonder if switching the classification of FPM_UNIT_SUBMODULE to FPM_UNIT_SUBPROGRAM would make the problem go away.

If not already, we should make it possible to inspect the dependencies. That would help debug such problems.

ivan-pi avatar Mar 14 '25 14:03 ivan-pi