metomi / fab

Flexible build system for scientific software
https://metomi.github.io/fab/
Other
19 stars 11 forks source link

Use absolute path when compiling files #278

Open hiker opened 4 months ago

hiker commented 4 months ago

A very minor improvement:

ATM a relative path is used for the source file when calling the compiler (i.e. only the file name). This works because the subprocess is changing into the right directory when executing the compiler.

But this makes it harder to verify if the right files are compiled (e.g. I spent some time debugging based on the assumption it would compile a different version of the file, since I wasn't sure of the implicit 'chdir' done), and also does not allow you to simply copy&paste the compilation line (e.g. for testing).

I have a patch for this ready (but apparently can neither assign this to me, nor set a label :) ).

hiker commented 3 months ago

I have started with #289, since the a test that is failing now because of the usage of an absolute path (which gfortran adds to the .o file, so this changes the hash) - also fails for ifort. Depending on the outcome of #289, this PR can either be applied (if the test and handling of hashes is changed), or we can adds the CWD to the debug output message (or just close this as 'wont-fix').