Samurai always rebuilds the entire DLang project w/ meson whereas Ninja does not
Cogitri opened this issue · comments
Hello,
when building a DLang project w/ meson and samurai the entire project is rebuilt every time.
Steps to reproduce
- Clone a D project which uses meson for building (e.g. https://github.com/Cogitri/corecollector)
- Run meson build
- Run samu -C build (it rebuilds everything)
- Run samu -C build (it rebuilds everything again)
Expected behaviour:
- Run meson build
- Run samu -C build (it rebuilds everything)
- Run samu -C build (it says nothing to do)
This works correctly when using ninja. If I do:
- Run meson build
- Run ninja -C build (it rebuilds nothing)
- Run samu -C build (it says nothing to do)
It works too.
Downstream report: https://gitlab.alpinelinux.org/alpine/aports/issues/11325
This was fixed in 9d15bff.
The issue is that the d_COMPILER
rule specifies a depfile
and deps = gcc
, but does not actually write the dependency file (might be worth investigating why this happens).
Prior to that commit, this caused the output to be considered dirty (which actually matches ninja's behavior when only depfile
is set). Now, we match ninja's behavior and treat a missing depfile
as empty iff deps
is specified.
I'm planning to make a new release in the next few days, so you can either wait for that, or apply that patch.
Ah, thank you. I think we can wait until then :)