[cmake-developers] Severe regression caused by #14972 fixes

Adam Strzelecki ono at java.pl
Tue Oct 7 14:21:58 EDT 2014


> From what I remember from the IRC discussion ...
> They are regular (not generated) source files that are listed as dependencies (but not outputs) of custom commands.

Okay now I get it. So actually 7243c951 (Ninja: Don't limit custom cmd side-effects to build folder (#14972)) is to blame not a33cf6d0 (Ninja: Consider only custom commands deps as side-effects (#14972)).

Previously in 2.8 only files in build folder might have been be side-effects, but as we have discussed with Brad this is pretty inaccurate assumption. So we have decided that ANY file that is dependency of custom command may be a side effect, therefore ReactOS files landing in "Unknown Build Time Dependencies." that serve only one purpose, to not bail out Ninja on very beginning if file does not exist as file may appear later on during build.

But it does NOT stop Ninja to properly relaunch custom command if the file gets modified. So I guess we may point to the wrong direction. Simple example:

-- test.txt
1 2 3 test

-- CMakeLists.txt
cmake_minimum_required(VERSION 2.6)

project(DependTest C)

add_custom_command(
  OUTPUT test-out.txt
  COMMAND cp test.txt test-out.txt
  DEPENDS test.txt)

add_custom_target(depend-test ALL
  cat test-out.txt
  DEPENDS test-out.txt)


(1) first run

$ ninja -v
[1/2] cd /tmp/depend && cp test.txt test-out.txt
[2/2] cd /tmp/depend && cat test-out.txt
1 2 3 test

(2) 2nd run

$ ninja -v
[1/1] cd /tmp/depend && cat test-out.txt
1 2 3 test

(3) touching test.txt

$ touch test.txt
$ ninja -v
[1/2] cd /tmp/depend && cp test.txt test-out.txt
[2/2] cd /tmp/depend && cat test-out.txt
1 2 3 test


So with proper test case and detailed reports, something more than vague "latest CMake makes our project not to compile anymore" I am unable to help, but I am willing to help. So please either provide test case, or some info how to run this problematic build (I have access to OSX, Linux or Windows system), or find me on #cmake IRC channel under "OnO".

--Adam


More information about the cmake-developers mailing list