dascandy / evoke

Magic build tool
Apache License 2.0
167 stars 17 forks source link

evoke generates malformed compiler include argument #83

Closed tobiasherzke closed 3 years ago

tobiasherzke commented 3 years ago

On ubuntu 20.04, evoke creates a compiler argument -I./clude when it should generate -Iinclude or -I./include.

Here is a minimized example that demonstrates the error:

mkdir -p project/include project/src
cd project
echo '#include "project.hh"' >src/project.cpp
echo 'main(){}' >include/project.hh
evoke | cat

(Please ignore the source files' contents apart from the #include - this is just a minimized example. evoke behaves the same for real code.) evoke | cat is done so that evoke does not use terminal magic for its output. The output produced by evoke is:

g++ -fdiagnostics-color=always -c -o build/linux/obj/src/project.cpp.o src/project.cpp -I./clude
Error while running g++ -fdiagnostics-color=always -c -o build/linux/obj/src/project.cpp.o src/project.cpp -I./clude
src/project.cpp:1:10: fatal error: project.hh: No such file or directory
    1 | #include "project.hh"
      |          ^~~~~~~~~~~~
compilation terminated.

Note the -I./clude compiler parameter. As a workaround, I can create a symlink ln -s include/ clude, then compilation succeeds.

dascandy commented 3 years ago

Can you check if this is fixed on the buildStatus branch? That's where I'm currently developing and I recall fixing this; it's not on master because it accidentally sometimes produces a few multi-gigabyte files still

tobiasherzke commented 3 years ago

Yes, it is fixed on that branch. Thank you!

dascandy commented 3 years ago

Mind the .evoke.db file; I still need to look into why it sometimes grows huge.

dascandy commented 3 years ago

Filed that one as #84