[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#815231: cmake: FTBFS on kfreebsd, hurd: 2 tests fail: BuildDepends, RunCMake.Configure



Hi,

Andreas Beckmann wrote:
> The following tests FAILED:
> 	113 - BuildDepends (Failed)

I finally figured this out!

The BuildDepends test will fail when run on a filesystem not having
sub-second granularity.  So for example, it fails on kfreebsd UFS, and
whatever filesystem the hurd-i386 buildds have, and also maybe some
Linux fileystems too.

| if(EXISTS ${BuildDepends_BINARY_DIR}/Project/multi2-real.txt)
|   if(${BuildDepends_BINARY_DIR}/Project/multi2-real.txt
|       IS_NEWER_THAN ${BuildDepends_BINARY_DIR}/Project/multi2-stamp.txt)
|     message(STATUS "multi2-real.txt is newer than multi2-stamp.txt")
|   else()
|     message(SEND_ERROR "Project did not initially build properly: "
|       "multi2-real.txt is not newer than 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.

By reversing the operands and the logic, it is possible to test for
"multi2-stamp.txt newer than multi2-real.txt" as a failure condition,
and therefore "multi2-real.txt newer or equal to multi2-stamp.txt" will
be regarded a success, which is exactly what we want here.

A patch is attached.  I can't test it fully, because my kfreebsd systems
are not affected by this bug:  they use ZFS, which does have sub-second
file timestamps.  At least with this patch applied I didn't see any
regression, and on UFS... I feel lucky that this will fix it.


> 	292 - RunCMake.Configure (Failed)

I didn't look at that other test failure yet...

Regards,
-- 
Steven Chamberlain
steven@pyro.eu.org
Date: Wed, 06 Apr 2016 22:28:55 +0100
From: Steven Chamberlain <steven@pyro.eu.org>
Subject: Tests: allow newer or equal timestamps in BuildDepends

Allow timestamps to be newer *or equal* in BuildDepends, in case the
filesystem lacks sub-second granularity (such as UFS on FreeBSD).

The test logic is changed from A > B, to !(B > A), i.e. A >= B

--- a/Tests/BuildDepends/CMakeLists.txt
+++ b/Tests/BuildDepends/CMakeLists.txt
@@ -202,12 +202,12 @@
 endif()
 
 if(EXISTS ${BuildDepends_BINARY_DIR}/Project/multi2-real.txt)
-  if(${BuildDepends_BINARY_DIR}/Project/multi2-real.txt
-      IS_NEWER_THAN ${BuildDepends_BINARY_DIR}/Project/multi2-stamp.txt)
-    message(STATUS "multi2-real.txt is newer than multi2-stamp.txt")
-  else()
+  if(${BuildDepends_BINARY_DIR}/Project/multi2-stamp.txt
+      IS_NEWER_THAN ${BuildDepends_BINARY_DIR}/Project/multi2-real.txt)
     message(SEND_ERROR "Project did not initially build properly: "
-      "multi2-real.txt is not newer than multi2-stamp.txt")
+      "multi2-real.txt timestamp is not >= multi2-stamp.txt")
+  else()
+    message(STATUS "multi2-real.txt timestamp is >= multi2-stamp.txt")
   endif()
 else()
   message(SEND_ERROR "Project did not initially build properly: "
@@ -216,12 +216,12 @@
 
 if(TEST_MULTI3)
   if(EXISTS ${BuildDepends_BINARY_DIR}/Project/multi3-real.txt)
-    if(${BuildDepends_BINARY_DIR}/Project/multi3-real.txt
-        IS_NEWER_THAN ${BuildDepends_BINARY_DIR}/Project/multi3-stamp.txt)
-      message(STATUS "multi3-real.txt is newer than multi3-stamp.txt")
-    else()
+    if(${BuildDepends_BINARY_DIR}/Project/multi3-stamp.txt
+        IS_NEWER_THAN ${BuildDepends_BINARY_DIR}/Project/multi3-real.txt)
       message(SEND_ERROR "Project did not initially build properly: "
-        "multi3-real.txt is not newer than multi3-stamp.txt")
+        "multi3-real.txt timestamp is not >= multi3-stamp.txt")
+    else()
+      message(STATUS "multi3-real.txt timestamp is >= multi3-stamp.txt")
     endif()
   else()
     message(SEND_ERROR "Project did not initially build properly: "
@@ -405,12 +405,12 @@
 endif()
 
 if(EXISTS ${BuildDepends_BINARY_DIR}/Project/multi2-real.txt)
-  if(${BuildDepends_BINARY_DIR}/Project/multi2-real.txt
-      IS_NEWER_THAN ${BuildDepends_BINARY_DIR}/Project/multi2-stamp.txt)
-    message(STATUS "multi2-real.txt is newer than multi2-stamp.txt")
-  else()
+  if(${BuildDepends_BINARY_DIR}/Project/multi2-stamp.txt
+      IS_NEWER_THAN ${BuildDepends_BINARY_DIR}/Project/multi2-real.txt)
     message(SEND_ERROR "Project did not rebuild properly: "
-      "multi2-real.txt is not newer than multi2-stamp.txt")
+      "multi2-real.txt timestamp is not >= multi2-stamp.txt")
+  else()
+    message(STATUS "multi2-real.txt is >= multi2-stamp.txt")
   endif()
 else()
   message(SEND_ERROR "Project did not rebuild properly: "
@@ -419,12 +419,12 @@
 
 if(TEST_MULTI3)
   if(EXISTS ${BuildDepends_BINARY_DIR}/Project/multi3-real.txt)
-    if(${BuildDepends_BINARY_DIR}/Project/multi3-real.txt
-        IS_NEWER_THAN ${BuildDepends_BINARY_DIR}/Project/multi3-stamp.txt)
-      message(STATUS "multi3-real.txt is newer than multi3-stamp.txt")
-    else()
+    if(${BuildDepends_BINARY_DIR}/Project/multi3-stamp.txt
+        IS_NEWER_THAN ${BuildDepends_BINARY_DIR}/Project/multi3-real.txt)
       message(SEND_ERROR "Project did not rebuild properly: "
-        "multi3-real.txt is not newer than multi3-stamp.txt")
+        "multi3-real.txt timestamp is not >= multi3-stamp.txt")
+    else()
+      message(STATUS "multi3-real.txt is >= multi3-stamp.txt")
     endif()
   else()
     message(SEND_ERROR "Project did not rebuild properly: "

Attachment: signature.asc
Description: Digital signature


Reply to: