[Pkg-cmake-team] Bug#815231: cmake: FTBFS on kfreebsd, hurd: 2 tests fail: BuildDepends, RunCMake.Configure

Brad King brad.king at kitware.com
Thu Apr 7 12:43:08 UTC 2016


On 04/06/2016 05:42 PM, Steven Chamberlain wrote:
> |   if(${BuildDepends_BINARY_DIR}/Project/multi2-real.txt
> |       IS_NEWER_THAN ${BuildDepends_BINARY_DIR}/Project/multi2-stamp.txt)
> 
> If multi2-real.txt and multi2-stamp.txt are created within 1 second of
> each other, the test will most likely fail on those filesystems.
> 
> I think the testcase should allow something like "newer or equal to".
> I don't know if there's a CMake macro to do exactly that.

FYI, the IS_NEWER_THAN check actually documents that it returns true
when the times are exactly equal:

  https://cmake.org/cmake/help/v3.5/command/if.html
  "If the file time stamps are exactly the same, an IS_NEWER_THAN
  comparison returns true, so that any dependent build operations
  will occur in the event of a tie."

One can confirm this in the implementation here:

  https://cmake.org/gitweb?p=cmake.git;a=blob;f=Source/cmConditionEvaluator.cxx;hb=v3.5.1#l720
  "fileIsNewer==1 || fileIsNewer==0"

This change was made to CMake long ago specifically to fix cases on
filesystems with low time resolution.  Upstream CMake nightly testing
runs on some filesystems with 1s resolution, such as HFS on OS X.

The failures under discussion here are indeed strange.  Thanks for
investigating!

-Brad



More information about the Pkg-cmake-team mailing list