Opened 3 years ago

Closed 3 years ago

#61726 closed defect (fixed)

cmake +gui +qt5: patch phase failure

Reported by: mouse07410 (Mouse) Owned by: michaelld (Michael Dickens)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port: cmake

Description

$ port installed cmake
The following ports are currently installed:
  cmake @3.18.5_0+docs+gui+python38+qt5 (active)
$ sudo port upgrade cmake
--->  Computing dependencies for cmake
--->  Fetching archive for cmake
--->  Attempting to fetch cmake-3.19.1_0+docs+gui+python38+qt5.darwin_19.x86_64.tbz2 from http://atl.us.packages.macports.org/cmake
--->  Attempting to fetch cmake-3.19.1_0+docs+gui+python38+qt5.darwin_19.x86_64.tbz2 from https://cph.dk.packages.macports.org/cmake
--->  Attempting to fetch cmake-3.19.1_0+docs+gui+python38+qt5.darwin_19.x86_64.tbz2 from http://fco.it.packages.macports.org/cmake
--->  Fetching distfiles for cmake
--->  Attempting to fetch cmake-3.19.1.tar.bz2 from https://gitlab.kitware.com/cmake/cmake/-/archive/v3.19.1
--->  Verifying checksums for cmake                                                  
--->  Extracting cmake
--->  Applying patches to cmake
Error: Failed to patch cmake: command execution failed
Error: See /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/main.log for details.
Error: Follow https://guide.macports.org/#project.tickets to report a bug.
Error: No ports matched the given expression
$ cp /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/main.log ~/cmake-main.log.txt

It fails to apply QtDialog patch:

:debug:patch system:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_r
elease_tarballs_ports_devel_cmake/cmake/work/cmake-3.19.1" && /usr/bin/patch -p0 < '/opt/local/var/macports/sources/r
sync.macports.org/macports/release/tarballs/ports/devel/cmake/files/patch-qt5gui.diff'
:info:patch patching file Source/QtDialog/CMakeLists.txt
:info:patch Hunk #1 FAILED at 4.
:info:patch Hunk #2 FAILED at 98.
:info:patch Hunk #3 FAILED at 143.
:info:patch Hunk #4 FAILED at 160.
:info:patch Hunk #5 succeeded at 183 (offset -7 lines).
:info:patch Hunk #6 succeeded at 229 (offset -7 lines).
:info:patch Hunk #7 succeeded at 240 (offset -7 lines).
:info:patch 4 out of 7 hunks FAILED -- saving rejects to file Source/QtDialog/CMakeLists.txt.rej
:info:patch patching file CMakeLists.txt

MacOS Catalina 10.15.7, Xcode-12.2.

Full log attached.

Attachments (1)

cmake-main.log.txt (20.1 KB) - added by mouse07410 (Mouse) 3 years ago.
CMake upgrade/build log

Download all attachments as: .zip

Change History (14)

Changed 3 years ago by mouse07410 (Mouse)

Attachment: cmake-main.log.txt added

CMake upgrade/build log

comment:1 Changed 3 years ago by mf2k (Frank Schima)

Cc: michaelld removed
Owner: set to michaelld
Status: newassigned
Summary: CMake fails to build with +gui +qt5cmake +gui +qt5: patch phase failure

comment:2 Changed 3 years ago by thomasrussellmurphy (Thomas Russell Murphy)

I am also experiencing this on MacOS 10.14.6, Xcode 11.3.1.

This variant selection of cmake is a dependency of darktable, in my case.

:debug:patch system:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.19.1" && /usr/bin/patch -p0 < '/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/devel/cmake/files/patch-qt5gui.diff'
:info:patch patching file Source/QtDialog/CMakeLists.txt
:info:patch Hunk #1 FAILED at 4.
:info:patch Hunk #2 FAILED at 98.
:info:patch Hunk #3 FAILED at 143.
:info:patch Hunk #4 FAILED at 160.
:info:patch Hunk #5 succeeded at 183 (offset -7 lines).
:info:patch Hunk #6 succeeded at 229 (offset -7 lines).
:info:patch Hunk #7 succeeded at 240 (offset -7 lines).
:info:patch 4 out of 7 hunks FAILED -- saving rejects to file Source/QtDialog/CMakeLists.txt.rej
:info:patch patching file CMakeLists.txt
:info:patch Hunk #1 succeeded at 773 (offset 5 lines).
:info:patch Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.19.1" && /usr/bin/patch -p0 < '/opt/local/var/macports/sources/rsync.macports.org/release/tarballs/ports/devel/cmake/files/patch-qt5gui.diff'
:info:patch Exit code: 1
:error:patch Failed to patch cmake: command execution failed

comment:3 Changed 3 years ago by jdmccalpin (John D McCalpin)

Same failure mode (at different line numbers) with MacOS 10.14.6, Xcode 10.3, and qt4.

:info:archivefetch --->  cmake-3.19.1_0+gui+qt4.darwin_18.x86_64.tbz2 doesn't seem to exist in /opt/local/var/macports/incoming/verified
:debug:patch system:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.19.1" && /usr/bin/patch -p0 < '/opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/devel/cmake/files/patch-qt4gui.diff'
:info:patch patching file Source/QtDialog/CMakeLists.txt
:info:patch Hunk #1 FAILED at 3.
:info:patch Hunk #2 FAILED at 14.
:info:patch Hunk #3 FAILED at 58.
:info:patch Hunk #4 FAILED at 75.
:info:patch Hunk #5 succeeded at 98 (offset -7 lines).
:info:patch Hunk #6 succeeded at 144 (offset -7 lines).
:info:patch Hunk #7 succeeded at 155 (offset -7 lines).
:info:patch 4 out of 7 hunks FAILED -- saving rejects to file Source/QtDialog/CMakeLists.txt.rej
:info:patch patching file CMakeLists.txt
:info:patch Hunk #1 succeeded at 773 (offset 5 lines).
:info:patch Command failed:  cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_cmake/cmake/work/cmake-3.19.1" && /usr/bin/patch -p0 < '/opt/local/var/macports/sources/rsync.macports.org/macports/release/tarballs/ports/devel/cmake/files/patch-qt4gui.diff'

comment:4 Changed 3 years ago by mouse07410 (Mouse)

Here are the specifics, aka, the contents of the four .rej files that are responsible for the failure in the patch phase:

$ fd .rej$
Modules/BasicConfigVersion-AnyNewerVersion.cmake.in.rej
Modules/BasicConfigVersion-ExactVersion.cmake.in.rej
Modules/BasicConfigVersion-SameMajorVersion.cmake.in.rej
Modules/BasicConfigVersion-SameMinorVersion.cmake.in.rej
Source/QtDialog/CMakeLists.txt.rej
$ cat Modules/BasicConfigVersion-SameMajorVersion.cmake.in.rej
***************
*** 44,58 ****
  if("@CVF_ARCH_INDEPENDENT@")
    return()
  endif()
- 
- # if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it:
- if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "@CMAKE_SIZEOF_VOID_P@" STREQUAL "")
-   return()
- endif()
- 
- # check that the installed version has the same 32/64bit-ness as the one which is currently searching:
- if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "@CMAKE_SIZEOF_VOID_P@")
-   math(EXPR installedBits "@CMAKE_SIZEOF_VOID_P@ * 8")
-   set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)")
-   set(PACKAGE_VERSION_UNSUITABLE TRUE)
- endif()
--- 44,46 ----
  if("@CVF_ARCH_INDEPENDENT@")
    return()
  endif()
$ cat Modules/BasicConfigVersion-SameMinorVersion.cmake.in.rej
***************
*** 48,62 ****
  if("@CVF_ARCH_INDEPENDENT@")
    return()
  endif()
- 
- # if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it:
- if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "@CMAKE_SIZEOF_VOID_P@" STREQUAL "")
-   return()
- endif()
- 
- # check that the installed version has the same 32/64bit-ness as the one which is currently searching:
- if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "@CMAKE_SIZEOF_VOID_P@")
-   math(EXPR installedBits "@CMAKE_SIZEOF_VOID_P@ * 8")
-   set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)")
-   set(PACKAGE_VERSION_UNSUITABLE TRUE)
- endif()
--- 48,50 ----
  if("@CVF_ARCH_INDEPENDENT@")
    return()
  endif()
$ cat Modules/BasicConfigVersion-AnyNewerVersion.cmake.in.rej
***************
*** 34,48 ****
  if("@CVF_ARCH_INDEPENDENT@")
    return()
  endif()
- 
- # if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it:
- if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "@CMAKE_SIZEOF_VOID_P@" STREQUAL "")
-   return()
- endif()
- 
- # check that the installed version has the same 32/64bit-ness as the one which is currently searching:
- if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "@CMAKE_SIZEOF_VOID_P@")
-   math(EXPR installedBits "@CMAKE_SIZEOF_VOID_P@ * 8")
-   set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)")
-   set(PACKAGE_VERSION_UNSUITABLE TRUE)
- endif()
--- 34,36 ----
  if("@CVF_ARCH_INDEPENDENT@")
    return()
  endif()
$ cat Source/QtDialog/CMakeLists.txt.rej
***************
*** 4,10 ****
  project(QtDialog)
  CMake_OPTIONAL_COMPONENT(cmake-gui)
  find_package(Qt5Widgets QUIET)
- if (Qt5Widgets_FOUND)
    include_directories(${Qt5Widgets_INCLUDE_DIRS})
    add_definitions(${Qt5Widgets_DEFINITONS})
    macro(qt4_wrap_ui)
--- 4,12 ----
  project(QtDialog)
  CMake_OPTIONAL_COMPONENT(cmake-gui)
  find_package(Qt5Widgets QUIET)
+ if(NOT Qt5Widgets_FOUND)
+   message(FATAL_ERROR "Qt5 required but not found")
+ endif()
    include_directories(${Qt5Widgets_INCLUDE_DIRS})
    add_definitions(${Qt5Widgets_DEFINITONS})
    macro(qt4_wrap_ui)
***************
*** 96,114 ****
        get_filename_component(Qt_BIN_DIR "${Qt_BIN_DIR}" PATH)
      endif()
    endif()
- else()
-   set(QT_MIN_VERSION "4.4.0")
-   find_package(Qt4 REQUIRED)
-   if(NOT QT4_FOUND)
-     message(SEND_ERROR "Failed to find Qt 4.4 or greater.")
-     return()
-   endif()
- 
-   include(${QT_USE_FILE})
- 
-   set(CMake_QT_LIBRARIES ${QT_LIBRARIES})
- 
- endif()
  
  set(SRCS
    AddCacheEntry.cxx
--- 98,103 ----
        get_filename_component(Qt_BIN_DIR "${Qt_BIN_DIR}" PATH)
      endif()
    endif()
  
  set(SRCS
    AddCacheEntry.cxx
***************
*** 154,160 ****
  if(WIN32)
    set(SRCS ${SRCS} CMakeSetup.rc)
  endif()
- if(APPLE)
    set(SRCS ${SRCS} CMakeSetup.icns)
    set(MACOSX_BUNDLE_ICON_FILE CMakeSetup.icns)
    set_source_files_properties(CMakeSetup.icns PROPERTIES
--- 143,149 ----
  if(WIN32)
    set(SRCS ${SRCS} CMakeSetup.rc)
  endif()
+ if(APPLEBUNDLE)
    set(SRCS ${SRCS} CMakeSetup.icns)
    set(MACOSX_BUNDLE_ICON_FILE CMakeSetup.icns)
    set_source_files_properties(CMakeSetup.icns PROPERTIES
***************
*** 171,177 ****
  
  set(CMAKE_INCLUDE_CURRENT_DIR ON)
  
- add_executable(cmake-gui WIN32 MACOSX_BUNDLE ${SRCS} ${MANIFEST_FILE})
  target_link_libraries(cmake-gui CMakeLib ${QT_QTMAIN_LIBRARY} ${CMake_QT_LIBRARIES})
  
  if(WIN32)
--- 160,166 ----
  
  set(CMAKE_INCLUDE_CURRENT_DIR ON)
  
+ add_executable(cmake-gui WIN32 ${SRCS} ${MANIFEST_FILE})
  target_link_libraries(cmake-gui CMakeLib ${QT_QTMAIN_LIBRARY} ${CMake_QT_LIBRARIES})
  
  if(WIN32)
$ 

comment:5 Changed 3 years ago by mouse07410 (Mouse)

Ping?

This presumably small problem disrupts the workflow. :-(

comment:6 Changed 3 years ago by michaelld (Michael Dickens)

Almost there ...

comment:7 Changed 3 years ago by michaelld (Michael Dickens)

comment:8 Changed 3 years ago by michaelld (Michael Dickens)

Resolution: fixed
Status: assignedclosed

In db5a4e58cf534e2d199a826cb767f026b7a174f4/macports-ports (master):

cmake: fix Qt GUI to be great again!

Closes: #61706
Closes: #61726

comment:9 Changed 3 years ago by mouse07410 (Mouse)

Resolution: fixed
Status: closedreopened

No it is not fixed with Qt5 - same failure to patch. Unless sudo port selfupdate is not enough, and something needs to take a few more hours to propagate...?

Last edited 3 years ago by mouse07410 (Mouse) (previous) (diff)

comment:10 Changed 3 years ago by kencu (Ken)

qt5 variant 100% perfect with Michaels PR.

Give the port tree a few hours to update to you (or use a github port tree checkout).

Last edited 3 years ago by kencu (Ken) (previous) (diff)

comment:11 Changed 3 years ago by michaelld (Michael Dickens)

@mouse07410 : after sudo port sync or sudo port selfupdate, if you check out the new cmake Portfile there should be no +gui or +qt4 variants ... so, port variants cmake | grep qt should now show just qt5: Build Qt GUI using Qt5. If this is all true, then make sure to sudo port clean --all cmake, and then try upgrading / installing cmake again. If that fails, post the MacPorts logfile here. As @kencu notes: the fixes in my PR worked in testing by multiple people as well as I think all of the CI we throw at PRs ... so hopefully they work outside our little MP bubble too!

comment:12 Changed 3 years ago by mouse07410 (Mouse)

After doing all of the above, sudo port install cmake +docs +python38 +qt5 succeeded.

Thank you! Please feel free to close this ticket.

comment:13 Changed 3 years ago by michaelld (Michael Dickens)

Resolution: fixed
Status: reopenedclosed

Great! Thanks for reporting back & I'm glad of the success!

Note: See TracTickets for help on using tickets.