-
Notifications
You must be signed in to change notification settings - Fork 117
Description
The only local paths that work reliably are links that point to a directory within the package.
If you run the "hello_complex" twice it will fail on the second build because of how canon_path assumes all pathnames are relative to the top of the project, and so does not handle pathnames starting with a relative path correctly, and the cache ends up storing something like ".complex_path" instead of "../complex_path"; and full pathnames are stymied by the project dir prefix being appended to the front as "./" so "/share/fpm/..." becomes "./share/fpm/...".
This is particularly vexing for anyone working with packages off-line or at a site with no WWW packages, which is a significant Fortran user base.
It was relatively easy to fix when you could make the assumption all the platforms are Posix and so you can call realpath(3c), and SOME Fortran compilers actually call realpath(3c) when you do an INQUIRE by name (but there is no requirement in the standard for that, and gfortran does not do that).
So either everything has to be bundled into a single package directory or all dependencies have to be from a git repository,
or for some cases you have to delete the build directory between each build.
Should the solution be to pursue a real canonical name routine that would be useful for stdlib also? (I hear that in some circumstances there is no such thing on some Windows machines,but you can usually get "close enough" on normal MSWIndows boxes) or should the current solution be patched up or should the program only support "internal" package copies? The canon_path routine is pretty easy to change to handle paths outside of the project directory, which gets rid of the bad cache files being generated with corrupted relative pathnames, but a real realpath(3c) would have other uses (it is of course trivial to call realpath(3c) itself on POSIX platforms).
It also raises the question of having as part of the QA a complete build of some complex packages that runs TWICE.