MantisBT - CMake
View Issue Details
0014855CMakeCMakepublic2014-03-31 15:062014-10-06 10:33
hansmi 
Brad King 
normalminoralways
closedfixed 
x86 (32 bit)Windows8
CMake 2.8.12.2 
CMake 3.1CMake 3.1 
0014855: Unpacking Qt 5.2.1 source distribution fails (ExternalProject_Add)
The Qt project offers their source code as a ZIP file for Windows systems[1]. CMake fails to extract the file with the error message “archive_read_next_header(): Invalid central directory signature”[2] when using it as an external project via ExternalProject_Add. Upstream libarchive fixed an issue in this direction, which may be related: <http://code.google.com/p/libarchive/issues/detail?id=257>. [^]

[1] http://download.qt-project.org/official_releases/qt/5.2/5.2.1/single/qt-everywhere-opensource-src-5.2.1.zip.mirrorlist [^]
[2]
C:\build>mingw32-make -j4 qt5
-- Configuring done
-- Generating done
-- Build files have been written to: C:/build
[ 12%] Creating directories for 'qt5'
[ 25%] Performing download step (download, verify and extract) for 'qt5'
-- downloading...
     src='http://download.qt-project.org/official_releases/qt/5.2/5.2.1/single/qt-everywhere-opensource-src-5.2.1.zip' [^]
     dst='C:/build/qt5-download/qt-everywhere-opensource-src-5.2.1.zip'
     timeout='none'
-- downloading... done
-- verifying file...
     file='C:/build/qt5-download/qt-everywhere-opensource-src-5.2.1.zip'
-- verifying file... done
-- extracting...
     src='C:/build/qt5-download/qt-everywhere-opensource-src-5.2.1.zip'
     dst='C:/build/qt5-src'
-- extracting... [tar xfz]
CMake Error: Problem with archive_read_next_header(): Invalid central directory signature
CMake Error: Problem extracting tar: C:/build/qt5-download/qt-everywhere-opensource-src-5.2.1.zip
-- extracting... [error clean up]
[…]
include(ExternalProject)

ExternalProject_Add(qt5
  TMP_DIR qt5-tmp
  STAMP_DIR qt5-stamp
  DOWNLOAD_DIR qt5-download
  SOURCE_DIR qt5-src
  BINARY_DIR qt5-binary
  INSTALL_DIR qt5
  URL "http://download.qt-project.org/official_releases/qt/5.2/5.2.1/single/qt-everywhere-opensource-src-5.2.1.zip" [^]
  URL_MD5 7fea4e018220739251f9206d690076d0
  BUILD_IN_SOURCE 0
  )
No tags attached.
Issue History
2014-03-31 15:06hansmiNew Issue
2014-03-31 15:15David ColeNote Added: 0035588
2014-03-31 15:17Brad KingNote Added: 0035589
2014-03-31 15:34hansmiNote Added: 0035590
2014-03-31 15:44Brad KingNote Added: 0035591
2014-04-14 09:37Brad KingNote Added: 0035692
2014-04-14 09:37Brad KingAssigned To => Brad King
2014-04-14 09:37Brad KingStatusnew => resolved
2014-04-14 09:37Brad KingResolutionopen => fixed
2014-04-14 09:37Brad KingFixed in Version => CMake 3.1
2014-04-14 09:37Brad KingTarget Version => CMake 3.1
2014-10-06 10:33Robert MaynardNote Added: 0036972
2014-10-06 10:33Robert MaynardStatusresolved => closed

Notes
(0035588)
David Cole   
2014-03-31 15:15   
As a workaround, until this is addressed/fixed, you can simply switch to using the *.tar.gz file -- that works, even on Windows. I just built Qt 5.2.1 that way last week actually.

However, I had to patch the source tree to add missing ".gitignore" files (at the root and in qtbase) in order to get "configure.bat" to work properly...
(0035589)
Brad King   
2014-03-31 15:17   
CMake supports building against an external libarchive. Can you please try building upstream libarchive and CMake from source with CMAKE_USE_SYSTEM_LIBRARY_LIBARCHIVE on?
(0035590)
hansmi   
2014-03-31 15:34   
Thank you for the quick responses! I first reproduced the issue on my main Linux machine running Debian Jessie/testing. Then I proceeded to build libarchive from upstream's Git master branch (revision 00f4bd8) and linked a custom CMake build against it. I can confirm that the archive can now be unpacked.
(0035591)
Brad King   
2014-03-31 15:44   
Re 0014855:0035590: Great, thanks for trying that so quickly. I will look at updating CMake's builtin libarchive.
(0035692)
Brad King   
2014-04-14 09:37   
I've updated libarchive in our Git master branch:

 Merge topic 'update-libarchive'
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=11a6b3d5 [^]
(0036972)
Robert Maynard   
2014-10-06 10:33   
Closing resolved issues that have not been updated in more than 4 months.