Added restat = 1 in the fortran dyndep example #2275
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Let's say you have a Fortran Project consisting of two files:
If you do it like the manual suggests, you run into a problem:
As you can see ninja rebuilds stuff even though nothing should get rebuild. The last two ninja calls should have printed
ninja: no work to do.
.I did some debugging and found that the following
build.ninja
file has the same problem:But why? The build.ninja file looks so correct!
The problem lies in the assumption that
f95 -o foo.o -c foo.f90
will generate foo.mod. This is only half-true:As you can see, the fortran compiler indeed created foo.mod. But it does not update the modification time of foo.mod if it already does exist. If I insert a restat
everything seems to work.
I'm using gfortran 12.2.1