[cmake-developers] Unexpected bad status for file DOWNLOAD for http://*.xz URLs

Alan W. Irwin irwin at beluga.phys.uvic.ca
Thu Jul 11 19:30:18 EDT 2013


These commands

file(DOWNLOAD
"http://download.gnome.org/sources/glib/2.32/glib-2.32.1.tar.xz"
"/home/software/plplot_svn/HEAD/plplot_allura/cmake/build_projects/cmake_downloaded_glib-2.32.1.tar.xz"
SHOW_PROGRESS STATUS status)
message(STATUS "Download status = ${status}")

instantly give me the following results:

-- [download 0% complete]
-- Download status = 1;"unsupported protocol"

with a zero-length cmake_downloaded_glib-2.32.1.tar.xz produced.

Yet when I use wget to obtain
http://download.gnome.org/sources/glib/2.32/glib-2.32.1.tar.xz there
are no problems.  i.e.,

software at raven> wget http://download.gnome.org/sources/glib/2.32/glib-2.32.1.tar.xz
--2013-07-11 16:04:21--  http://download.gnome.org/sources/glib/2.32/glib-2.32.1.tar.xz
Resolving download.gnome.org (download.gnome.org)... 209.132.180.168, 209.132.180.180
Connecting to download.gnome.org (download.gnome.org)|209.132.180.168|:80... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://download.gnome.org/sources/glib/2.32/glib-2.32.1.tar.xz [following]
--2013-07-11 16:04:21--  https://download.gnome.org/sources/glib/2.32/glib-2.32.1.tar.xz
Connecting to download.gnome.org (download.gnome.org)|209.132.180.168|:443... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: http://ftp.gnome.org/pub/GNOME/sources/glib/2.32/glib-2.32.1.tar.xz [following]
--2013-07-11 16:04:22--  http://ftp.gnome.org/pub/GNOME/sources/glib/2.32/glib-2.32.1.tar.xz
Resolving ftp.gnome.org (ftp.gnome.org)... 130.239.18.137, 130.239.18.138, 130.239.18.163, ...
Connecting to ftp.gnome.org (ftp.gnome.org)|130.239.18.137|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 6138200 (5.9M) [application/x-xz]
Saving to: `glib-2.32.1.tar.xz.1'

100%[===========================================================================>] 6,138,200    956K/s   in 12s

2013-07-11 16:04:35 (508 KB/s) - `glib-2.32.1.tar.xz.1' saved [6138200/6138200]


If I do the equivalent CMake commands above for some random *.tar.gz
the result was

-- [download 25% complete]
-- [download 100% complete]
-- Download status = 0;"no error"

with a full file downloaded.

So I don't think I have any syntax error in the above CMake logic.

One explanation is CMake might be having trouble with the http
protocol when there is a tar.xz suffix on the URL.  To check that
hypothesis, I also tried downloading
http://download.gnome.org/sources/gcr/3.4/gcr-3.4.1.tar.xz and got the
same bad status.

But why should CMake care in the slightest about the tar.xz suffix on the
file that is downloaded?  Shouldn't it just download the file come
hell or high water?

BTW, I also just discovered that cmake has no trouble unpacking a
*.tar.xz file using, e.g.,

cmake -E tar xfz glib-2.32.1.tar.xz

I also found that some small changes had to be made to
ExternalProjects.cmake to allow files of the form *.tar.xz to be
processed further (e.g., by the above cmake -E tar command).  I plan
to submit that patch to your bug tracker.  But aside from that one
issue (fixed with a patch) and the above strange issue with *.tar.xz
files that cannot be downloaded with file(DOWNLOAD), the rest of my
use of ExternalProject.cmake should be okay for build_projects (where
I have discovered that many downloadable source tarballs are in the
*.tar.xz form).

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state
implementation for stellar interiors (freeeos.sf.net); the Time
Ephemerides project (timeephem.sf.net); PLplot scientific plotting
software package (plplot.sf.net); the libLASi project
(unifont.org/lasi); the Loads of Linux Links project (loll.sf.net);
and the Linux Brochure Project (lbproject.sf.net).
__________________________

Linux-powered Science
__________________________



More information about the cmake-developers mailing list