Bug 264136 - security/py-paramiko: security/py-gssapi dependency should be OPTION'al
Summary: security/py-paramiko: security/py-gssapi dependency should be OPTION'al
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Sofian Brabez
URL:
Keywords: needs-patch
Depends on:
Blocks:
 
Reported: 2022-05-21 21:21 UTC by tjlegg
Modified: 2022-06-10 17:51 UTC (History)
4 users (show)

See Also:
koobs: maintainer-feedback? (sbz)


Attachments
disable gssapi build dependency by default (1.62 KB, patch)
2022-06-02 21:36 UTC, Sofian Brabez
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description tjlegg 2022-05-21 21:21:15 UTC
If you build from src with WITHOUT_KERBEROS in src.conf, then py-paramiko 2.11.0 will fail to build. Checking the documentation py-gssapi is optional for the py-paramiko build, so it would be helpful to have py-gssapi moved to a KERBEROS option in the py-paramiko port.

Can confirm the port builds successfully without the dependency on py-gssapi.
Comment 1 Kubilay Kocak freebsd_committer freebsd_triage 2022-05-22 01:33:36 UTC
^Triage: Dependency added in ports 1b67ae77ee77 (sbz), assign to committer.
Comment 2 John W. O'Brien 2022-05-24 23:54:48 UTC
By inspection, I conclude that "gssapi" is defined as a setuptools "extra", which is what should pull in the pyasn1 and gssapi optional dependencies. I would propose A) naming the new option after the upstream-defined extra (e.g. GSSAPI); and B) moving the devel/py-pyasn1 dependency under that option in addition to the security/py-gssapi dependency.

As an aside, if base is built WITHOUT_KERBEROS, a GSSAPI feature can still be satisfied in general via ports using GSSAPI_HEIMDAL or GSSAPI_MIT. As far as I know, it is still up to the base builder to coordinate with the ports builder to ensure that the options each employs are compatible.
Comment 3 Kubilay Kocak freebsd_committer freebsd_triage 2022-05-25 00:01:29 UTC
Confirming its an optional dependency:

extras_require = {
    "gssapi": [
        "pyasn1>=0.1.7",
        'gssapi>=1.4.1;platform_system!="Windows"',

[1] https://github.com/paramiko/paramiko/blob/2.11.0/setup.py#L37
Comment 4 tjlegg 2022-05-25 11:19:49 UTC
(In reply to John W. O'Brien from comment #2)
You are right.

Checking /usr/ports/Mk there is /usr/ports/Mk/Uses/gssapi.mk which handles these cases including the installed ports.

So a GSSAPI option is the correct path.
Comment 5 Sofian Brabez freebsd_committer freebsd_triage 2022-06-02 21:36:09 UTC
Created attachment 234398 [details]
disable gssapi build dependency by default
Comment 6 Sofian Brabez freebsd_committer freebsd_triage 2022-06-02 21:36:23 UTC
Hi,

Thanks for noticing that, can you confirm me the following patch in attachment is fixing your issue when building security/py-paramiko without Kerberos support in base?

The patch conditionally add the gssapi to the build dependencies only if the  GSSAPI option is enabled. It's disabled by default to keep the same behaviour
Comment 7 commit-hook freebsd_committer freebsd_triage 2022-06-08 17:11:54 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=9acae4e20c4b09ee0c35edc0db44c4ecc616ba7c

commit 9acae4e20c4b09ee0c35edc0db44c4ecc616ba7c
Author:     Sofian Brabez <sbz@FreeBSD.org>
AuthorDate: 2022-06-02 21:22:24 +0000
Commit:     Sofian Brabez <sbz@FreeBSD.org>
CommitDate: 2022-06-08 17:10:54 +0000

    security/py-paramiko: add GSSAPI option

    GSSAPI is considered as an extra feature in paramiko. Building support
    for it requires to have Kerberos (either MIT or Heimdal). Add support
    for it as an OPTION disabled by default.

    PR:             264136

 security/py-paramiko/Makefile | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)
Comment 8 Sofian Brabez freebsd_committer freebsd_triage 2022-06-10 17:51:13 UTC
No feedback from report. Fix was committed.