Bug 187374 - CMake's bundled libcurl is being built without ssl support
Summary: CMake's bundled libcurl is being built without ssl support
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-kde (group)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-03-08 13:40 UTC by John Szakmeister
Modified: 2014-03-10 13:00 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description John Szakmeister 2014-03-08 13:40:00 UTC
Dependencies are now being hosted more on GitHub, which uses ssl for everything--including to download archives.  Unfortunately, when using the "file(DOWNLOAD ...)" mechanism to download an archive from GitHub results in a zero-byte file and an error like:

    CMake Error at download-libuv.cmake:22 (message):
      error: downloading
      'https://github.com/joyent/libuv/archive/v0.11.21.tar.gz' failed
    
        status_code: 1
        status_string: "unsupported protocol"
        log: libcurl was built with SSL disabled, https: not supported!
    
      unsupported protocol

How-To-Repeat: Put this into a file (like download-libuv.cmake):

    file(DOWNLOAD
      "https://github.com/joyent/libuv/archive/v0.11.21.tar.gz"
      "/tmp/libuv/v0.11.21.tar.gz"
      SHOW_PROGRESS
      # EXPECTED_HASH;MD5=bc334c8da8618754ce9e2a4c5be73487
      # no TIMEOUT
      STATUS status
      LOG log)
    
    list(GET status 0 status_code)
    list(GET status 1 status_string)
    
    if(NOT status_code EQUAL 0)
      message(FATAL_ERROR "error: downloading 'https://github.com/joyent/libuv/archive/v0.11.21.tar.gz' failed
      status_code: ${status_code}
      status_string: ${status_string}
      log: ${log}
    ")
    endif()

Then run it with "cmake -P download-libuv.cmake".
Comment 1 John Szakmeister 2014-03-08 13:54:37 UTC
I should add that I installed cmake via "pkg install cmake".

Thanks.

-John
Comment 2 Raphael Kubo da Costa freebsd_committer freebsd_triage 2014-03-08 22:20:43 UTC
Responsible Changed
From-To: freebsd-ports-bugs->kde

Over to maintainer.
Comment 3 dfilter service freebsd_committer freebsd_triage 2014-03-08 23:16:55 UTC
Author: rakuco
Date: Sat Mar  8 23:16:42 2014
New Revision: 347541
URL: http://svnweb.freebsd.org/changeset/ports/347541
QAT: https://qat.redports.org/buildarchive/r347541/

Log:
  Enable use of OpenSSL in the bundled copy of libcurl.
  
  The default is off, which makes calls such as FILE(DOWNLOAD ...) from HTTPS
  locations fail.
  
  PR:		ports/187374
  MFH:		2014Q1

Modified:
  head/devel/cmake/Makefile
  head/devel/cmake/files/InitialCache.cmake

Modified: head/devel/cmake/Makefile
==============================================================================
--- head/devel/cmake/Makefile	Sat Mar  8 22:51:16 2014	(r347540)
+++ head/devel/cmake/Makefile	Sat Mar  8 23:16:42 2014	(r347541)
@@ -3,7 +3,7 @@
 
 PORTNAME=	cmake
 PORTVERSION=	2.8.12.1
-PORTREVISION?=	2
+PORTREVISION?=	3
 CATEGORIES=	devel
 MASTER_SITES=	http://downloads.cmake.org/files/v2.8/
 

Modified: head/devel/cmake/files/InitialCache.cmake
==============================================================================
--- head/devel/cmake/files/InitialCache.cmake	Sat Mar  8 22:51:16 2014	(r347540)
+++ head/devel/cmake/files/InitialCache.cmake	Sat Mar  8 23:16:42 2014	(r347541)
@@ -4,3 +4,7 @@
 # devel/qt4-corelib is not).
 # See https://mail.kde.org/pipermail/kde-freebsd/2013-July/015703.html
 set(BUILD_TESTING OFF CACHE BOOL "Build the testing tree.")
+
+# Explicitly enable use of OpenSSL in the bundled copy of libcurl, as it
+# defaults to off. See ports/187374.
+set(CMAKE_USE_OPENSSL ON CACHE BOOL "Use OpenSSL code with curl.")
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 4 Raphael Kubo da Costa freebsd_committer freebsd_triage 2014-03-08 23:22:50 UTC
State Changed
From-To: open->closed

Fixed, thanks for the report.
Comment 5 dfilter service freebsd_committer freebsd_triage 2014-03-08 23:35:20 UTC
Author: rakuco
Date: Sat Mar  8 23:35:13 2014
New Revision: 347543
URL: http://svnweb.freebsd.org/changeset/ports/347543
QAT: https://qat.redports.org/buildarchive/r347543/

Log:
  MFH: r347541
  
  Enable use of OpenSSL in the bundled copy of libcurl.
  
  The default is off, which makes calls such as FILE(DOWNLOAD ...) from HTTPS
  locations fail.
  
  PR:		ports/187374
  Approved by:	portmgr (miwi)

Modified:
  branches/2014Q1/devel/cmake/Makefile
  branches/2014Q1/devel/cmake/files/InitialCache.cmake
Directory Properties:
  branches/2014Q1/   (props changed)

Modified: branches/2014Q1/devel/cmake/Makefile
==============================================================================
--- branches/2014Q1/devel/cmake/Makefile	Sat Mar  8 23:24:34 2014	(r347542)
+++ branches/2014Q1/devel/cmake/Makefile	Sat Mar  8 23:35:13 2014	(r347543)
@@ -3,6 +3,7 @@
 
 PORTNAME=	cmake
 PORTVERSION=	2.8.12.1
+PORTREVISION?=	1
 CATEGORIES=	devel
 MASTER_SITES=	http://downloads.cmake.org/files/v2.8/
 

Modified: branches/2014Q1/devel/cmake/files/InitialCache.cmake
==============================================================================
--- branches/2014Q1/devel/cmake/files/InitialCache.cmake	Sat Mar  8 23:24:34 2014	(r347542)
+++ branches/2014Q1/devel/cmake/files/InitialCache.cmake	Sat Mar  8 23:35:13 2014	(r347543)
@@ -4,3 +4,7 @@
 # devel/qt4-corelib is not).
 # See https://mail.kde.org/pipermail/kde-freebsd/2013-July/015703.html
 set(BUILD_TESTING OFF CACHE BOOL "Build the testing tree.")
+
+# Explicitly enable use of OpenSSL in the bundled copy of libcurl, as it
+# defaults to off. See ports/187374.
+set(CMAKE_USE_OPENSSL ON CACHE BOOL "Use OpenSSL code with curl.")
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 6 John Szakmeister 2014-03-09 19:44:20 UTC
I'm not sure why it passed the ports build QA, but I can't build from
the ports collection right now.  It's failing with:

/usr/ports/devel/cmake/work/cmake-2.8.12.1/Utilities/cmcurl/multi.c:1708:11:
error: expected parameter declarator
CURLMcode curl_multi_socket(CURLM *multi_handle, curl_socket_t s,
          ^
/usr/local/include/curl/multi.h:296:63: note: expanded from macro
'curl_multi_socket'
#define curl_multi_socket(x,y,z) curl_multi_socket_action(x,y,0,z)
                                                              ^
/usr/ports/devel/cmake/work/cmake-2.8.12.1/Utilities/cmcurl/multi.c:1708:11:
error: expected ')'
/usr/local/include/curl/multi.h:296:63: note: expanded from macro
'curl_multi_socket'
#define curl_multi_socket(x,y,z) curl_multi_socket_action(x,y,0,z)
                                                              ^
/usr/ports/devel/cmake/work/cmake-2.8.12.1/Utilities/cmcurl/multi.c:1708:11:
note: to match this '('
/usr/local/include/curl/multi.h:296:58: note: expanded from macro
'curl_multi_socket'
#define curl_multi_socket(x,y,z) curl_multi_socket_action(x,y,0,z)
                                                         ^
/usr/ports/devel/cmake/work/cmake-2.8.12.1/Utilities/cmcurl/multi.c:1708:11:
error: conflicting types for 'curl_multi_socket_action'
CURLMcode curl_multi_socket(CURLM *multi_handle, curl_socket_t s,
          ^
/usr/local/include/curl/multi.h:296:34: note: expanded from macro
'curl_multi_socket'
#define curl_multi_socket(x,y,z) curl_multi_socket_action(x,y,0,z)
                                 ^
/usr/local/include/curl/multi.h:284:23: note: previous declaration is here
CURL_EXTERN CURLMcode curl_multi_socket_action(CURLM *multi_handle,
                      ^
[ 20%] Building C object
Utilities/cmlibarchive/libarchive/CMakeFiles/cmlibarchive.dir/archive_entry_xattr.c.o
/usr/ports/devel/cmake/work/cmake-2.8.12.1/Utilities/cmcurl/multi.c:1712:35:
error: use of undeclared identifier 'running_handles'
                                  running_handles);
                                  ^
4 errors generated.

For reference, it built fine with the last recipe (but without SSL
support), and if I comment out the CMAKE_USE_OPENSSL in the
InitialCache.cmake, it builds fine (but again, without SSL support).
It seems like something more is missing here. :-(

-John
Comment 7 Raphael Kubo da Costa freebsd_committer freebsd_triage 2014-03-10 10:13:57 UTC
John Szakmeister <john@szakmeister.net> writes:

>  I'm not sure why it passed the ports build QA, but I can't build from
>  the ports collection right now.  It's failing with:

It was fixed by r347674 (2.8.12.1_4) -- it passed QA because this
problem only shows up when security/openssl is installed.
Comment 8 John Szakmeister 2014-03-10 12:57:37 UTC
I suspected it might be something like that.  I tried the updated
port, and it worked!  Thank you very much for taking care of this.

-John