Meaning of -i and -hidir

Evan Laforge qdunkan at gmail.com
Sun Oct 24 02:17:28 UTC 2021


The issue uses consistency with -odir and -hieDir as a
rationalization.  I think it's not quite right because inputs can have
a search path while outputs don't, but if it is true that -odir
simultaneously sets the output and input dir for `*.o`, that seems
confusing too.  Shouldn't -odir set *only* output, and all inputs
should either be lumped under the `-i` search path, or even split up
into separate flags as outputs are?  If you are building in --make
mode then you will naturally want to read .o files from the last place
you wrote them, but in that case you can explicitly say so.  I'm not
actually advocating for this since I don't have a use for it at the
moment, and I don't want to potentially break every single user of ghc
--make, but it seemed to me that the argument for consistency could
run the other direction.

I think this issue is coming up due to a mismatch between the
traditional Make style builds which assume a single mutable input and
output directory, and the newer functional / hermetic style builds
which require immutable inputs and a mutable output.  It's a familiar
concept, just transposed to the file system!


More information about the ghc-devs mailing list