Bug 252283 - security/gpgme: fix constness
Summary: security/gpgme: fix constness
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Jason E. Hale
URL:
Keywords:
: 252267 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-12-30 14:03 UTC by Adriaan de Groot
Modified: 2021-01-01 11:35 UTC (History)
2 users (show)

See Also:
jhale: maintainer-feedback+


Attachments
Fix constness (1.83 KB, patch)
2020-12-30 14:03 UTC, Adriaan de Groot
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Adriaan de Groot freebsd_committer 2020-12-30 14:03:02 UTC
Created attachment 221102 [details]
Fix constness

The 1.15.0 release of gpgme-cpp adds a `Signature::operator<` which is missing a const. In 6a6d2a27648, Signature got an operator< . This is used in *security/libkleo*, for instance, to sort the signatures for display.

The build failure looks like this (trimmed for brevity, on 13-):


===
/usr/include/c++/v1/algorithm:715:71: error: invalid operands to binary 
expression ('const GpgME::UserID::Signature' and 'const 
GpgME::UserID::Signature')
    bool operator()(const _T1& __x, const _T1& __y) const {return __x < __y;}

/wrkdirs/usr/ports/security/libkleo/work/libkleo-20.12.0/src/models/
useridlistmodel.cpp:203:14: note: in instantiation of function template 
specialization 'std::__1::sort<GpgME::UserID::Signature>' requested here
        std::sort(sigs.begin(), sigs.end());
===

The attached patch has been submitted upstream as well.
Comment 1 Adriaan de Groot freebsd_committer 2020-12-30 23:47:31 UTC
*** Bug 252267 has been marked as a duplicate of this bug. ***
Comment 2 commit-hook freebsd_committer 2021-01-01 02:30:37 UTC
A commit references this bug:

Author: jhale
Date: Fri Jan  1 02:29:40 UTC 2021
New revision: 559796
URL: https://svnweb.freebsd.org/changeset/ports/559796

Log:
  security/gpgme-cpp: Fix constness

  The 1.15.0 release of gpgme-cpp adds a `Signature::operator<` which is missing
  a const. In 6a6d2a27648, Signature got an operator< . This is used in
  *security/libkleo*, for instance, to sort the signatures for display.

  The build failure looks like this (trimmed for brevity, on 13-):

  ===
  /usr/include/c++/v1/algorithm:715:71: error: invalid operands to binary
  expression ('const GpgME::UserID::Signature' and 'const
  GpgME::UserID::Signature')
      bool operator()(const _T1& __x, const _T1& __y) const {return __x < __y;}

  /wrkdirs/usr/ports/security/libkleo/work/libkleo-20.12.0/src/models/
  useridlistmodel.cpp:203:14: note: in instantiation of function template
  specialization 'std::__1::sort<GpgME::UserID::Signature>' requested here
          std::sort(sigs.begin(), sigs.end());
  ===

  PR:		252283
  Submitted by:	adridg

Changes:
  head/security/gpgme/files/patch-git-key.h
  head/security/gpgme-cpp/Makefile
Comment 3 Jason E. Hale freebsd_committer 2021-01-01 02:32:02 UTC
Committed, thanks! I bumped PORTREVISION on gpgme-cpp instead of gpgme.
Comment 4 Adriaan de Groot freebsd_committer 2021-01-01 11:35:48 UTC
I was informed by the upstream maintainer that this change is not binary-compatible -- the constness is encoded in the symbol name -- so upstream is going to add a const operator< alongside. So a next release (1.5.1) can drop this patch again, but there's some small risk to software built against 1.5.0 and not re-build against 1.5.0_1. I don't think that's *really* much of an issue in our ports and packages though.