Bug 248164

Summary: devel/libvirt: And other ports fail to configure with security/libssh2: configure: error: You must install the libssh2 >= 1.3
Product: Ports & Packages Reporter: dgilbert
Component: Individual Port(s)Assignee: Roman Bogorodskiy <novel>
Status: Closed FIXED    
Severity: Affects Some People CC: james, novel
Priority: --- Keywords: needs-qa
Version: LatestFlags: bugzilla: maintainer-feedback? (sbz)
koobs: maintainer-feedback? (novel)
Hardware: Any   
OS: Any   
Attachments:
Description Flags
poudriere log for port build.
none
Patch for libssh2
none
libssh2 build log post patch
none
libvirt build log post patch none

Description dgilbert 2020-07-22 04:23:54 UTC
Created attachment 216650 [details]
poudriere log for port build.

libvert claims to want libssh2 >= 1.3.  Bad numbering scheme, but port is 1.9.0_2,3.  misc/mc is also failing (it wants >= 1.2.5).

Now... It would seem that libvert can be build without libssh2 --- but it also seems like it should be a simple fix (that I'm missing at the moment).

I've updated my poudriere jail to 12.1p7.  That's not it.  It also happens on my 11.4 build (and may happen on 11.3 --- that one isn't done).

Builds and build details at https://pkg.daveg.ca/

(but I've attached the build log for 12.1p7 for this port)
Comment 1 James French 2020-07-22 05:14:10 UTC
I'm unable to recreate this using either the default options for libssh2 & libssh  or your specific selection of options for those ports. I'm wondering if there is some issue with your build of the libssh2 package. It may be worth rebuilding it (remove it from the poudriere package dir and let it recreate it).

Are you able to post a config.log from one of these packages (poudriere testport -i) so we can see what's going on please? Might be worth poking around and seeing if libssh2 is actually installed correctly in the jail.

In any case, I am fairly certain this bug isn't an issue with devel/libvirt and is either setup related or an issue with security/libssh2.
Comment 2 James French 2020-07-22 09:00:09 UTC
On a bit of further poking, I *was* able to recreate this. I may have built the wrong set when running poudriere testport which is why I couldn't get it to go earlier.

You have security/libssh2 configured with GCRYPT=on. This is the option that is causing this to fail. Incidentally, you have libssh configured with GCRYPT=off - not sure if this is intended or not.

I'll poke libssh2 a bit more and see if I can figure out what the difference is.
Comment 3 James French 2020-07-22 10:41:31 UTC
Ok, this is definitely a security/libssh2 bug, the pkg-config file does not get properly set up for gcrypt. So it still looks for open/libressl in /use/local instead - which Poudriere won't have installed.

I'm out of time to troubleshoot for right now . I'll come back to it in a few hours unless someone submits a patch in the interim.
Comment 4 Roman Bogorodskiy freebsd_committer freebsd_triage 2020-07-22 11:31:00 UTC
Looks like the libssh2 port is using configure flags (--with-gcrypt, --with-openssl) there were renamed quite some time ago:

https://github.com/libssh2/libssh2/commit/e70e71a3b18b43064b03e460a645dac152c9122c#diff-67e997bcfdac55191033d57a16d1408a
Comment 5 James French 2020-07-22 11:56:07 UTC
Created attachment 216654 [details]
Patch for libssh2

Ah perfect, correcting those options seems to properly resolve everything. The existing logic in the port should stay to address SSL if using something other than base.

Build logs to follow.
Comment 6 James French 2020-07-22 12:17:44 UTC
Created attachment 216655 [details]
libssh2 build log post patch
Comment 7 James French 2020-07-22 12:19:10 UTC
Created attachment 216656 [details]
libvirt build log post patch
Comment 8 commit-hook freebsd_committer freebsd_triage 2020-08-08 05:17:06 UTC
A commit references this bug:

Author: novel
Date: Sat Aug  8 05:17:01 UTC 2020
New revision: 544360
URL: https://svnweb.freebsd.org/changeset/ports/544360

Log:
  security/libssh2: fix the GCRYPT option

  The port uses the old crypto configure flags:
  --with-libgcrypt and --with-openssl. These flags
  are no longer supported.

  Besides from the obvious effect of the actual port configuration
  not matching user intent, it also produces incorrect pkg-config
  file for the given set of dependencies, and other ports that
  depend on libssh2 fail when it's configured with GCRYPT=on.

  Fix by using the proper configure arguments:
  --with-crypto=libgcrypt and --with-crypto=openssl.

  PR:		248164
  Submitted by:	dgilbert@eicat.ca (bug report), James French (patch)
  Approved by:	maintainer timeout

Changes:
  head/security/libssh2/Makefile
Comment 9 Roman Bogorodskiy freebsd_committer freebsd_triage 2020-08-08 05:20:06 UTC
Committed, thanks for reporting and submitting patches.