Store only the base name of a source file in the fsmod file#321
Store only the base name of a source file in the fsmod file#321
Conversation
Show a warning if we cannot find the original source file. This should help prevent some silent failures.
|
Ok, thoughts:
plus side:
|
|
How problematic do you see the first couple of points being? (note this fixes this issue in CamFort: camfort/camfort#207) |
I had originally envisioned the .fsmod files as being something that could be collected separately as part of a build system, like .o files going into a build/ dir. I could relax that view personally, I don't know if there are any people out there using .fsmod files in this way (collecting them in a separate dir from the source) who might object to changes. Largely, I think this pull request does make things cleaner, aside from that. |
|
I'm not sure why there's a problem with ghc 9.0, the other ones seem to work though. Seems to be a linking problem with th-orphans - unrelated? |
The problem fixed itself. Best kind of problems. 😄 |
|
One idea, going back to the fundamental conflict, is perhaps to store a SHA1 hash of the original Fortran file, rather than its path. At least then there is something that can be compared, given different Fortran files of the same name (or perhaps different revisions in time of the 'same file'). |
|
Yes this is a great idea... perhaps we should do this! |
Replaces timestamp-based validation with content hash to detect source file changes reliably. ModFile format breaking change, version bump to 0.17.0.
ae7d9c0 to
db20660
Compare
|
sorry need to review - will do next week. does it solve the the camfort issue camfort/camfort#207? |
|
I'm making a new camfort branch |
Previously
.fsmodfiles were storing the file filename, which makes them not very portable when using a tool at a different relative directory to the fsmod (this was the underlying issue behind camfort/camfort#190 in CamFort.This simple fix stores only the files base name in the fsmod file which makes them more portable/referable from different directory contexts.