Hadrian's C dependency file rules are nonsense
Hadrian's dependency file rules for C files appears to be utter nonsense, which breaks some newer C compilers. Specifically,
| Run Cc FindCDependencies Stage0: utils/unlit/fs.c => _build/stage0/utils/unlit/build/c/fs.o.d
gcc: warning: c: linker input file unused because linking not done
gcc: error: c: linker input file not found: No such file or directory
<command line>: does not exist: /tmp/2848417-92.c
Error when running Shake build system:
at action, called at src/Rules.hs:40:19 in main:Rules
at need, called at src/Rules.hs:62:5 in main:Rules
* Depends on: _build/stage0/lib/bin/unlit
at need, called at src/Rules/Program.hs:125:5 in main:Rules.Program
* Depends on: _build/stage0/utils/unlit/build/c/fs.o
at cmd', called at src/Builder.hs:322:23 in main:Builder
at cmd, called at src/Builder.hs:424:8 in main:Builder
* Raised the exception:
Development.Shake.cmd, system command failed
Command line: /usr/bin/gcc -E -MM -MG -MF _build/stage0/utils/unlit/build/c/fs.o.d -MT _build/stage0/utils/unlit/build/c/fs.o -I_build/stage0/lib -I_build/stage0/utils/unlit/build -I -x c utils/unlit/fs.c
Exit code: 1
Notice that in the command line we are passing the path of an object file despite the fact that we are invoking gcc
in -M
mode. GCC is quite right to complain about this.