Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 930720 - dev-libs/libgit2 doesn't work with SSH
Summary: dev-libs/libgit2 doesn't work with SSH
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Michał Górny
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-04-26 16:58 UTC by Mark Harmstone
Modified: 2024-04-26 18:55 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Harmstone 2024-04-26 16:58:53 UTC
The libgit2 ebuild isn't setting the USE_SSH option correctly. It's setting it to "yes", which CMake ignores, when it should be "ON".

--- a/dev-libs/libgit2/libgit2-1.8.0.ebuild  2024-04-11 22:41:04.000000000 +0100
+++ b/dev-libs/libgit2/libgit2-1.8.0.ebuild       2024-04-26 17:50:30.608122949 +0100
@@ -39,7 +39,7 @@
 src_configure() {
        local mycmakeargs=(
                -DBUILD_TESTS=$(usex test)
-               -DUSE_SSH=$(usex ssh)
+               -DUSE_SSH=$(usex ssh ON OFF)
                -DUSE_GSSAPI=$(usex gssapi ON OFF)
                -DUSE_HTTP_PARSER=system
                -DREGEX_BACKEND=pcre2



Reproducible: Always
Comment 1 Ionen Wolkens gentoo-dev 2024-04-26 17:05:07 UTC
(In reply to Mark Harmstone from comment #0)
> The libgit2 ebuild isn't setting the USE_SSH option correctly. It's setting
> it to "yes", which CMake ignores, when it should be "ON".
To clarify, *cmake* does recognize "yes" for boolean checks and typically don't need to worry about this, however this specific package is doing a string check for either exactly ON or some other values, aka:

cmake/SelectSSH.cmake:if(USE_SSH STREQUAL "exec")
cmake/SelectSSH.cmake:elseif(USE_SSH STREQUAL ON OR USE_SSH STREQUAL "libssh2")
Comment 2 Mark Harmstone 2024-04-26 17:08:22 UTC
(In reply to Ionen Wolkens from comment #1)
> (In reply to Mark Harmstone from comment #0)
> > The libgit2 ebuild isn't setting the USE_SSH option correctly. It's setting
> > it to "yes", which CMake ignores, when it should be "ON".
> To clarify, *cmake* does recognize "yes" for boolean checks and typically
> don't need to worry about this, however this specific package is doing a
> string check for either exactly ON or some other values, aka:
> 
> cmake/SelectSSH.cmake:if(USE_SSH STREQUAL "exec")
> cmake/SelectSSH.cmake:elseif(USE_SSH STREQUAL ON OR USE_SSH STREQUAL
> "libssh2")

Thanks. So is this a bug with the ebuild or a bug with libgit2?
Comment 3 Ionen Wolkens gentoo-dev 2024-04-26 17:14:24 UTC
(In reply to Mark Harmstone from comment #2)
> Thanks. So is this a bug with the ebuild or a bug with libgit2?
Well, libgit2 is misleading by having something that looks like a boolean not be treated like one so it could be improved, but has to be fixed in the ebuild for now either way.
Comment 4 Ionen Wolkens gentoo-dev 2024-04-26 17:16:23 UTC
(In reply to Ionen Wolkens from comment #3)
> (In reply to Mark Harmstone from comment #2)
> > Thanks. So is this a bug with the ebuild or a bug with libgit2?
> Well, libgit2 is misleading by having something that looks like a boolean
> not be treated like one so it could be improved, but has to be fixed in the
> ebuild for now either way.
Well, guess they do give a mention in the description fwiw, e.g.

option(USE_SSH                 "Enable SSH support. Can be set to a specific backend" OFF)
option(USE_HTTPS               "Enable HTTPS support. Can be set to a specific backend" ON)
option(USE_SHA1                "Enable SHA1. Can be set to CollisionDetection(ON)/HTTPS" ON)
option(USE_SHA256              "Enable SHA256. Can be set to HTTPS/Builtin" ON)

Still a bit weird, but ah well.
Comment 5 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2024-04-26 18:14:35 UTC
Thanks for the report.  Indeed the behavior changed in 1.8.0.
Comment 6 Larry the Git Cow gentoo-dev 2024-04-26 18:55:12 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5f21425212e06d6d8f91f3ce848a9fa9ec3048a6

commit 5f21425212e06d6d8f91f3ce848a9fa9ec3048a6
Author:     Michał Górny <mgorny@gentoo.org>
AuthorDate: 2024-04-26 18:15:02 +0000
Commit:     Michał Górny <mgorny@gentoo.org>
CommitDate: 2024-04-26 18:55:01 +0000

    dev-libs/libgit2: Fix handling USE=ssh
    
    Closes: https://bugs.gentoo.org/930720
    Signed-off-by: Michał Górny <mgorny@gentoo.org>

 dev-libs/libgit2/{libgit2-1.8.0.ebuild => libgit2-1.8.0-r1.ebuild} | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)