michaelforney / samurai

ninja-compatible build tool written in C

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

  1. Clone a D project which uses meson for building (e.g. https://github.com/Cogitri/corecollector)
  2. Run meson build
  3. Run samu -C build (it rebuilds everything)
  4. Run samu -C build (it rebuilds everything again)

Expected behaviour:

  1. Run meson build
  2. Run samu -C build (it rebuilds everything)
  3. Run samu -C build (it says nothing to do)

This works correctly when using ninja. If I do:

  1. Run meson build
  2. Run ninja -C build (it rebuilds nothing)
  3. 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 :)