[Pkg-cmake-team] Bug#900240: cmake: FTBFS on hurd-i386

Petter Reinholdtsen pere at hungry.com
Sat Aug 11 20:09:37 BST 2018


[Svante Signell]
> Currently cmake FTBFS on GNU/Hurd due to a PATH_MAX issue. Attached is
> the patch path_max.patch also provided by the first attachment in this
> bug #900240, there named path_max.path. With the attached patch and the
> upcoming bug report on linux-any, providing
> Source_Modules_FindLibUV.cmake.diff cmake builds fine. 

I tested the patch, and it seem to solve the problem.  I hope this issue
can be fixed soon, as the missing cmake is blocking a lot of builds.

But one of the 496 tests failed:

426/496 Test #426: RunCMake.CPack_DEB .....................................***Failed  136.49 sec
-- CUSTOM_NAMES-COMPONENT-type - PASSED
-- CUSTOM_NAMES-COMPONENT-type-Build - PASSED
-- DEB/CUSTOM_NAMES-COMPONENT-type - PASSED
-- DEFAULT_PERMISSIONS-CMAKE_var_set-subtest-MONOLITHIC-type - PASSED
-- DEB/DEFAULT_PERMISSIONS-CMAKE_var_set-subtest-MONOLITHIC-type - PASSED
-- DEFAULT_PERMISSIONS-CMAKE_var_set-subtest-COMPONENT-type - PASSED
-- DEB/DEFAULT_PERMISSIONS-CMAKE_var_set-subtest-COMPONENT-type - PASSED
-- DEFAULT_PERMISSIONS-CPACK_var_set-subtest-MONOLITHIC-type - PASSED
-- DEB/DEFAULT_PERMISSIONS-CPACK_var_set-subtest-MONOLITHIC-type - PASSED
-- DEFAULT_PERMISSIONS-CPACK_var_set-subtest-COMPONENT-type - PASSED
-- DEB/DEFAULT_PERMISSIONS-CPACK_var_set-subtest-COMPONENT-type - PASSED
-- DEFAULT_PERMISSIONS-both_set-subtest-MONOLITHIC-type - PASSED
-- DEB/DEFAULT_PERMISSIONS-both_set-subtest-MONOLITHIC-type - PASSED
-- DEFAULT_PERMISSIONS-both_set-subtest-COMPONENT-type - PASSED
-- DEB/DEFAULT_PERMISSIONS-both_set-subtest-COMPONENT-type - PASSED
-- DEFAULT_PERMISSIONS-invalid_CMAKE_var-subtest-MONOLITHIC-type - PASSED
-- DEB/DEFAULT_PERMISSIONS-invalid_CMAKE_var-subtest-MONOLITHIC-type - PASSED
-- DEFAULT_PERMISSIONS-invalid_CMAKE_var-subtest-COMPONENT-type - PASSED
-- DEB/DEFAULT_PERMISSIONS-invalid_CMAKE_var-subtest-COMPONENT-type - PASSED
-- DEFAULT_PERMISSIONS-invalid_CPACK_var-subtest-MONOLITHIC-type - PASSED
-- DEB/DEFAULT_PERMISSIONS-invalid_CPACK_var-subtest-MONOLITHIC-type - PASSED
-- DEFAULT_PERMISSIONS-invalid_CPACK_var-subtest-COMPONENT-type - PASSED
-- DEB/DEFAULT_PERMISSIONS-invalid_CPACK_var-subtest-COMPONENT-type - PASSED
-- DEPENDENCIES-COMPONENT-type - PASSED
-- DEPENDENCIES-COMPONENT-type-Build - PASSED
-- DEB/DEPENDENCIES-COMPONENT-type - PASSED
-- EMPTY_DIR-MONOLITHIC-type - PASSED
-- EMPTY_DIR-MONOLITHIC-type-Build - PASSED
-- DEB/EMPTY_DIR-MONOLITHIC-type - PASSED
-- EMPTY_DIR-COMPONENT-type - PASSED
-- EMPTY_DIR-COMPONENT-type-Build - PASSED
-- DEB/EMPTY_DIR-COMPONENT-type - PASSED
-- VERSION-MONOLITHIC-type - PASSED
-- DEB/VERSION-MONOLITHIC-type - PASSED
-- VERSION-COMPONENT-type - PASSED
-- DEB/VERSION-COMPONENT-type - PASSED
-- EXTRA-COMPONENT-type - PASSED
-- DEB/EXTRA-COMPONENT-type - PASSED
-- GENERATE_SHLIBS-soversion_not_zero-subtest-COMPONENT-type - PASSED
-- GENERATE_SHLIBS-soversion_not_zero-subtest-COMPONENT-type-Build - PASSED
CMake Error at /home/pere/cmake-3.12.1/Tests/RunCMake/RunCMake.cmake:150 (message):
  DEB/GENERATE_SHLIBS-soversion_not_zero-subtest-COMPONENT-type - FAILED:

  Result is [1], not [0].

  stderr does not match that expected.

  Command was:

   command> "/home/pere/cmake-3.12.1/Build/bin/cmake" "-DRunCMake_TEST=GENERATE_SHLIBS-soversion_not_zero-subtest-COMPONENT-type" "-DRunCMake_TEST_FILE_PREFIX=GENERATE_SHLIBS" "-DRunCMake_SUBTEST_SUFFIX=soversion_not_zero" "-DGENERATOR_TYPE=DEB" "-DPACKAGING_TYPE=COMPONENT" "-Dsrc_dir=/home/pere/cmake-3.12.1/Tests/RunCMake/CPack" "-Dbin_dir=/home/pere/cmake-3.12.1/Build/Tests/RunCMake/DEB/CPack/GENERATE_SHLIBS-build-soversion_not_zero-subtest" "-Dconfig_file=/home/pere/cmake-3.12.1/Build/Tests/RunCMake/CPack/conf/DEB_config.cmake" "-P" "/home/pere/cmake-3.12.1/Tests/RunCMake/CPack/VerifyResult.cmake"

  Actual stdout:

   actual-out> 

  Expected stderr to match:

   expect-err> ^$

  Actual stderr:

   actual-err> CMake Error at /home/pere/cmake-3.12.1/Tests/RunCMake/CPack/DEB/Helpers.cmake:144 (message):
   actual-err>   Expected Debian control file does not exist: 'shlibs' Extra: install files
   actual-err>   '/home/pere/cmake-3.12.1/Build/Tests/RunCMake/DEB/CPack/GENERATE_SHLIBS-build-soversion_not_zero-subtest/data_shlibs/usr/foo/libtest_lib.so:
   actual-err>   symbolic link to libtest_lib.so.0.8
   actual-err> 
   actual-err>   
   actual-err>   ;/home/pere/cmake-3.12.1/Build/Tests/RunCMake/DEB/CPack/GENERATE_SHLIBS-build-soversion_not_zero-subtest/data_shlibs/usr/foo/libtest_lib.so.0.8:
   actual-err>   ELF 32-bit LSB pie executable, Intel 80386, version 1 (SYSV), dynamically
   actual-err>   linked, BuildID[sha1]=dd4771c7b0eef02c878a458492e8b02797b12a0a, with
   actual-err>   debug_info, not stripped
   actual-err> 
   actual-err>   '; readelf "
   actual-err> 
   actual-err>   "
   actual-err> Call Stack (most recent call first):
   actual-err>   /home/pere/cmake-3.12.1/Tests/RunCMake/CPack/tests/GENERATE_SHLIBS/VerifyResult.cmake:9 (verifyDebControl)
   actual-err>   /home/pere/cmake-3.12.1/Tests/RunCMake/CPack/VerifyResult.cmake:129 (include)

Call Stack (most recent call first):
  /home/pere/cmake-3.12.1/Tests/RunCMake/RunCMake.cmake:164 (run_cmake)
  /home/pere/cmake-3.12.1/Tests/RunCMake/CPack/CPackTestHelpers.cmake:98 (run_cmake_command)
  /home/pere/cmake-3.12.1/Tests/RunCMake/CPack/CPackTestHelpers.cmake:123 (run_cpack_test_common_)
  /home/pere/cmake-3.12.1/Tests/RunCMake/CPack/RunCMakeTest.cmake:16 (run_cpack_test_subtests)


-- GENERATE_SHLIBS-soversion_zero-subtest-COMPONENT-type - PASSED
-- GENERATE_SHLIBS-soversion_zero-subtest-COMPONENT-type-Build - PASSED
CMake Error at /home/pere/cmake-3.12.1/Tests/RunCMake/RunCMake.cmake:150 (message):
  DEB/GENERATE_SHLIBS-soversion_zero-subtest-COMPONENT-type - FAILED:

  Result is [1], not [0].

  stderr does not match that expected.

  Command was:

   command> "/home/pere/cmake-3.12.1/Build/bin/cmake" "-DRunCMake_TEST=GENERATE_SHLIBS-soversion_zero-subtest-COMPONENT-type" "-DRunCMake_TEST_FILE_PREFIX=GENERATE_SHLIBS" "-DRunCMake_SUBTEST_SUFFIX=soversion_zero" "-DGENERATOR_TYPE=DEB" "-DPACKAGING_TYPE=COMPONENT" "-Dsrc_dir=/home/pere/cmake-3.12.1/Tests/RunCMake/CPack" "-Dbin_dir=/home/pere/cmake-3.12.1/Build/Tests/RunCMake/DEB/CPack/GENERATE_SHLIBS-build-soversion_zero-subtest" "-Dconfig_file=/home/pere/cmake-3.12.1/Build/Tests/RunCMake/CPack/conf/DEB_config.cmake" "-P" "/home/pere/cmake-3.12.1/Tests/RunCMake/CPack/VerifyResult.cmake"

  Actual stdout:

   actual-out> 

  Expected stderr to match:

   expect-err> ^$

  Actual stderr:

   actual-err> CMake Error at /home/pere/cmake-3.12.1/Tests/RunCMake/CPack/DEB/Helpers.cmake:144 (message):
   actual-err>   Expected Debian control file does not exist: 'shlibs' Extra: install files
   actual-err>   '/home/pere/cmake-3.12.1/Build/Tests/RunCMake/DEB/CPack/GENERATE_SHLIBS-build-soversion_zero-subtest/data_shlibs/usr/foo/libtest_lib.so:
   actual-err>   symbolic link to libtest_lib.so.0
   actual-err> 
   actual-err>   
   actual-err>   ;/home/pere/cmake-3.12.1/Build/Tests/RunCMake/DEB/CPack/GENERATE_SHLIBS-build-soversion_zero-subtest/data_shlibs/usr/foo/libtest_lib.so.0:
   actual-err>   ELF 32-bit LSB pie executable, Intel 80386, version 1 (SYSV), dynamically
   actual-err>   linked, BuildID[sha1]=38ff16f7199f1977d05e2eed1242c7c88a383db6, with
   actual-err>   debug_info, not stripped
   actual-err> 
   actual-err>   '; readelf "
   actual-err> 
   actual-err>   "
   actual-err> Call Stack (most recent call first):
   actual-err>   /home/pere/cmake-3.12.1/Tests/RunCMake/CPack/tests/GENERATE_SHLIBS/VerifyResult.cmake:9 (verifyDebControl)
   actual-err>   /home/pere/cmake-3.12.1/Tests/RunCMake/CPack/VerifyResult.cmake:129 (include)

Call Stack (most recent call first):
  /home/pere/cmake-3.12.1/Tests/RunCMake/RunCMake.cmake:164 (run_cmake)
  /home/pere/cmake-3.12.1/Tests/RunCMake/CPack/CPackTestHelpers.cmake:98 (run_cmake_command)
  /home/pere/cmake-3.12.1/Tests/RunCMake/CPack/CPackTestHelpers.cmake:123 (run_cpack_test_common_)
  /home/pere/cmake-3.12.1/Tests/RunCMake/CPack/RunCMakeTest.cmake:16 (run_cpack_test_subtests)


-- GENERATE_SHLIBS_LDCONFIG-COMPONENT-type - PASSED
-- GENERATE_SHLIBS_LDCONFIG-COMPONENT-type-Build - PASSED
CMake Error at /home/pere/cmake-3.12.1/Tests/RunCMake/RunCMake.cmake:150 (message):
  DEB/GENERATE_SHLIBS_LDCONFIG-COMPONENT-type - FAILED:

  Result is [1], not [0].

  stderr does not match that expected.

  Command was:

   command> "/home/pere/cmake-3.12.1/Build/bin/cmake" "-DRunCMake_TEST=GENERATE_SHLIBS_LDCONFIG-COMPONENT-type" "-DRunCMake_TEST_FILE_PREFIX=GENERATE_SHLIBS_LDCONFIG" "-DRunCMake_SUBTEST_SUFFIX=" "-DGENERATOR_TYPE=DEB" "-DPACKAGING_TYPE=COMPONENT" "-Dsrc_dir=/home/pere/cmake-3.12.1/Tests/RunCMake/CPack" "-Dbin_dir=/home/pere/cmake-3.12.1/Build/Tests/RunCMake/DEB/CPack/GENERATE_SHLIBS_LDCONFIG-build" "-Dconfig_file=/home/pere/cmake-3.12.1/Build/Tests/RunCMake/CPack/conf/DEB_config.cmake" "-P" "/home/pere/cmake-3.12.1/Tests/RunCMake/CPack/VerifyResult.cmake"

  Actual stdout:

   actual-out> 

  Expected stderr to match:

   expect-err> ^$

  Actual stderr:

   actual-err> CMake Error at /home/pere/cmake-3.12.1/Tests/RunCMake/CPack/DEB/Helpers.cmake:144 (message):
   actual-err>   Expected Debian control file does not exist: 'shlibs' Extra: install files
   actual-err>   '/home/pere/cmake-3.12.1/Build/Tests/RunCMake/DEB/CPack/GENERATE_SHLIBS_LDCONFIG-build/data_shlibs/usr/lib/libtest_lib.so.0.8:
   actual-err>   ELF 32-bit LSB pie executable, Intel 80386, version 1 (SYSV), dynamically
   actual-err>   linked, BuildID[sha1]=dfa3ab0e1cc5aeb84dd5f655ef53977fb87b0aa1, with
   actual-err>   debug_info, not stripped
   actual-err> 
   actual-err>   '; readelf "
   actual-err> 
   actual-err>   "
   actual-err> Call Stack (most recent call first):
   actual-err>   /home/pere/cmake-3.12.1/Tests/RunCMake/CPack/tests/GENERATE_SHLIBS_LDCONFIG/VerifyResult.cmake:8 (verifyDebControl)
   actual-err>   /home/pere/cmake-3.12.1/Tests/RunCMake/CPack/VerifyResult.cmake:129 (include)

Call Stack (most recent call first):
  /home/pere/cmake-3.12.1/Tests/RunCMake/RunCMake.cmake:164 (run_cmake)
  /home/pere/cmake-3.12.1/Tests/RunCMake/CPack/CPackTestHelpers.cmake:98 (run_cmake_command)
  /home/pere/cmake-3.12.1/Tests/RunCMake/CPack/CPackTestHelpers.cmake:116 (run_cpack_test_common_)
  /home/pere/cmake-3.12.1/Tests/RunCMake/CPack/RunCMakeTest.cmake:17 (run_cpack_test)


-- LONG_FILENAMES-MONOLITHIC-type - PASSED
-- DEB/LONG_FILENAMES-MONOLITHIC-type - PASSED
-- MINIMAL-MONOLITHIC-type - PASSED
-- DEB/MINIMAL-MONOLITHIC-type - PASSED
-- MINIMAL-COMPONENT-type - PASSED
-- DEB/MINIMAL-COMPONENT-type - PASSED
-- PER_COMPONENT_FIELDS-COMPONENT-type - PASSED
-- DEB/PER_COMPONENT_FIELDS-COMPONENT-type - PASSED
-- MD5SUMS-MONOLITHIC-type - PASSED
-- DEB/MD5SUMS-MONOLITHIC-type - PASSED
-- MD5SUMS-COMPONENT-type - PASSED
-- DEB/MD5SUMS-COMPONENT-type - PASSED
-- DEB_PACKAGE_VERSION_BACK_COMPATIBILITY-MONOLITHIC-type - PASSED
-- DEB/DEB_PACKAGE_VERSION_BACK_COMPATIBILITY-MONOLITHIC-type - PASSED
-- DEB_PACKAGE_VERSION_BACK_COMPATIBILITY-COMPONENT-type - PASSED
-- DEB/DEB_PACKAGE_VERSION_BACK_COMPATIBILITY-COMPONENT-type - PASSED

        Start 427: RunCMake.CPack_7Z
427/496 Test #427: RunCMake.CPack_7Z ......................................   Passed    9.31 sec
        Start 428: RunCMake.CPack_TBZ2


Btw, I had a look at the patch, and perhaps it is better to not depend on lstat(),
as it fail in files like /proc/*/exe, where size is always 0.  Here is an
alternative proposal:

Index: cmake-3.12.1/Utilities/cmlibuv/src/unix/fs.c
===================================================================
--- cmake-3.12.1.orig/Utilities/cmlibuv/src/unix/fs.c
+++ cmake-3.12.1/Utilities/cmlibuv/src/unix/fs.c
@@ -426,6 +426,7 @@ static ssize_t uv__fs_scandir(uv_fs_t* r
 }
 
 
+#if _POSIX_VERSION < 200809L
 static ssize_t uv__fs_pathmax_size(const char* path) {
   ssize_t pathmax;
 
@@ -441,12 +442,52 @@ static ssize_t uv__fs_pathmax_size(const
 
   return pathmax;
 }
+#endif
 
 static ssize_t uv__fs_readlink(uv_fs_t* req) {
+  ssize_t size = 1024;
   ssize_t len;
   char* buf;
+  while (1) {
+    buf = uv__malloc(size + 1);
 
-  len = uv__fs_pathmax_size(req->path);
+    if (buf == NULL) {
+      errno = ENOMEM;
+      return -1;
+    }
+
+#if defined(__MVS__)
+   len = os390_readlink(req->path, buf, size);
+#else
+   len = readlink(req->path, buf, size);
+#endif
+
+   if (len == -1) {
+     uv__free(buf);
+     return -1;
+   }
+
+   if (len < size) {
+     buf[len] = '\0';
+     req->ptr = buf;
+     return 0;
+   }
+   free(buf);
+   size *= 2;
+  }
+}
+
+static ssize_t uv__fs_readlink(uv_fs_t* req) {
+  ssize_t len;
+  char* buf;
+  struct stat st;
+  int ret;
+
+  ret = lstat(req->path, &st);
+  if (ret != 0) {
+    return -1;
+  }
+  len = st.st_size;
   buf = uv__malloc(len + 1);
 
   if (buf == NULL) {
@@ -473,9 +514,16 @@ static ssize_t uv__fs_readlink(uv_fs_t*
 }
 
 static ssize_t uv__fs_realpath(uv_fs_t* req) {
-  ssize_t len;
   char* buf;
 
+#if _POSIX_VERSION >= 200809L
+  buf = realpath(req->path, NULL);
+  if (buf == NULL) {
+    return -1;
+  }
+#else
+  ssize_t len;
+
   len = uv__fs_pathmax_size(req->path);
   buf = uv__malloc(len + 1);
 
@@ -488,6 +536,7 @@ static ssize_t uv__fs_realpath(uv_fs_t*
     uv__free(buf);
     return -1;
   }
+#endif
 
   req->ptr = buf;
 
-- 
Happy hacking
Petter Reinholdtsen



More information about the Pkg-cmake-team mailing list