Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 08 Aug 2023 23:16:28 +0200
From:      Daniel Engberg <diizzy@FreeBSD.org>
To:        Po-Chuan Hsieh <sunpoet@freebsd.org>
Cc:        ports-committers@freebsd.org, dev-commits-ports-all@freebsd.org, dev-commits-ports-main@freebsd.org
Subject:   Re: git: c25f0c013e88 - main - databases/libmemcached: Skip libcrypto.pc when using SSL from base system
Message-ID:  <ceaf40bb57164ed827707c3fe2ec7ba9@FreeBSD.org>
In-Reply-To: <CAMHz58S0ySYKaGEunnu4F7Sgbj_kHEhtpiAbUoJP5hRf3djzbg@mail.gmail.com>
References:  <202307091033.369AXqZ7055562@gitrepo.freebsd.org> <fd79ae5502e288a54ead898d61f17e28@FreeBSD.org> <CAMHz58S0ySYKaGEunnu4F7Sgbj_kHEhtpiAbUoJP5hRf3djzbg@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
--=_b670027eca2e6915f0cbea065c273be1
Content-Transfer-Encoding: 8bit
Content-Type: text/plain; charset=UTF-8;
 format=flowed



On 2023-08-06 15:48, Po-Chuan Hsieh wrote:

> On Tue, Aug 1, 2023 at 11:08 AM Daniel Engberg <diizzy@freebsd.org> 
> wrote:
> 
>> On 2023-07-09 12:33, Po-Chuan Hsieh wrote:
>>> The branch main has been updated by sunpoet:
>>> 
>>> URL:
>>> https://cgit.FreeBSD.org/ports/commit/?id=c25f0c013e88d84c620b2bb8c56158e9ca7f8bef
>>> 
>>> commit c25f0c013e88d84c620b2bb8c56158e9ca7f8bef
>>> Author:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
>>> AuthorDate: 2023-07-09 10:17:04 +0000
>>> Commit:     Po-Chuan Hsieh <sunpoet@FreeBSD.org>
>>> CommitDate: 2023-07-09 10:17:04 +0000
>>> 
>>> databases/libmemcached: Skip libcrypto.pc when using SSL from base
>>> system
>>> 
>>> - Bump PORTREVISION for package change
>>> ---
>>> databases/libmemcached/Makefile                  | 10 +++++++++-
>>> databases/libmemcached/files/extra-patch-openssl | 11 +++++++++++
>>> 2 files changed, 20 insertions(+), 1 deletion(-)
>>> 
>>> diff --git a/databases/libmemcached/Makefile
>>> b/databases/libmemcached/Makefile
>>> index e044f28499fd..71f031d3014f 100644
>>> --- a/databases/libmemcached/Makefile
>>> +++ b/databases/libmemcached/Makefile
>>> @@ -1,5 +1,6 @@
>>> PORTNAME=    libmemcached
>>> PORTVERSION= 1.1.4
>>> +PORTREVISION=        1
>>> CATEGORIES=  databases
>>> 
>>> MAINTAINER=  sunpoet@FreeBSD.org
>>> @@ -44,4 +45,11 @@ MURMUR_CMAKE_BOOL= ENABLE_HASH_MURMUR
>>> SASL_CMAKE_BOOL=     ENABLE_SASL
>>> SASL_LIB_DEPENDS=    libsasl2.so:security/cyrus-sasl2
>>> 
>>> -.include <bsd.port.mk [1]>
>>> +.include <bsd.port.pre.mk [2]>
>>> +
>>> +# Skip libcrypto.pc while using OpenSSL from base system on older
>>> FreeBSD versions which does not skip this file
>>> +.if ${SSL_DEFAULT} == base &&
>>> !exists(/usr/libdata/pkgconfig/libcrypto.pc)
>>> +EXTRA_PATCHES+=      ${PATCHDIR}/extra-patch-openssl
>>> +.endif
>>> +
>>> +.include <bsd.port.post.mk [3]>
>>> diff --git a/databases/libmemcached/files/extra-patch-openssl
>>> b/databases/libmemcached/files/extra-patch-openssl
>>> new file mode 100644
>>> index 000000000000..bf65fa7f4ece
>>> --- /dev/null
>>> +++ b/databases/libmemcached/files/extra-patch-openssl
>>> @@ -0,0 +1,11 @@
>>> +--- src/libhashkit/CMakeLists.txt.orig       2023-03-06 08:47:30 UTC
>>> ++++ src/libhashkit/CMakeLists.txt
>>> +@@ -45,7 +45,7 @@ if(ENABLE_OPENSSL_CRYPTO)
>>> +                 if(OPENSSL_CRYPTO_LIBRARY)
>>> +                         target_compile_definitions(libhashkit
>>> PRIVATE HAVE_OPENSSL_CRYPTO)
>>> +                         target_link_libraries(libhashkit PUBLIC
>>> OpenSSL::Crypto)
>>> +-                        pkgconfig_export(REQUIRES_PRIVATE 
>>> libcrypto)
>>> ++                        pkgconfig_export(REQUIRES_PRIVATE "")
>>> +                 else()
>>> +                         message(WARNING "Could not find
>>> OpenSSL::Crypto")
>>> +                 endif()
>> 
>> Hi,
>> 
>> Resending as I didn't get a reply last time,
>> 
>> I few things I noticed compared to the PR I submitted about this port.
>> 
>> -std=gnu++17 is set when unit tests are enabled so USES=
>> compiler:c++11-lang is incorrect
> 
> USES=compiler:c++11-lang for build is correct.
> I know that c++17 is required for the tests.
> But USES=compiler:c++11-lang is effectively the same as 
> USES=compiler:c++17-lang.
> 
>> Is there a reason why default filenames aren't used for patches?
> 
> The default filename comes from the path is OK. But it tells you 
> nothing but the path which is already in the diff header.
> Naming the patch file by its purpose is better here.
> 
>> Why are we using flex from base rather from ports?
> 
> What's wrong with flex from base? If you notice any issue, I'm happy to 
> fix it.
> 
>> That openssl patch can be improved by doing something like this,
>> https://cgit.freebsd.org/ports/tree/archivers/libarchive/Makefile#n124
>> 
>> Best regards,
>> Daniel

Hi,

While compiler:c++11-lang and compiler:c++17-lang is for now that 
doesn't mean it won't change in the future, if we can avoid unnecessary 
breakage I don't see why we shouldn't?

I get your argument however I'm not sure if we should deviate from 
Porters Handbook unless necessary, simply because of overall (treewide) 
maintenance instead of having ports with their own little quirks left 
and right which isn't going to benefit the project in the long run.

One major downside using libraries from base is that you may end up with 
different versions between support major versions of FreeBSD which may 
cause inconsistencies.

For example, 12 is still on 2.5.37 while 13+ is on 2.6.4

https://cgit.freebsd.org/src/log/contrib/flex?h=stable/12

https://cgit.freebsd.org/src/log/contrib/flex?h=stable/13

Best regards,

Daniel

Links:
------
[1] http://bsd.port.mk
[2] http://bsd.port.pre.mk
[3] http://bsd.port.post.mk
--=_b670027eca2e6915f0cbea065c273be1
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset=UTF-8

<html><head><meta http-equiv=3D"Content-Type" content=3D"text/html; charset=
=3DUTF-8" /></head><body style=3D'font-size: 10pt; font-family: Verdana,Gen=
eva,sans-serif'>
<p id=3D"reply-intro">On 2023-08-06 15:48, Po-Chuan Hsieh wrote:</p>
<blockquote type=3D"cite" style=3D"padding: 0 0.4em; border-left: #1010ff 2=
px solid; margin: 0">
<div id=3D"replybody1">
<div dir=3D"ltr">
<div dir=3D"ltr">On Tue, Aug 1, 2023 at 11:08=E2=80=AFAM Daniel Engberg &lt=
;<a href=3D"mailto:diizzy@freebsd.org" rel=3D"noreferrer">diizzy@freebsd.or=
g</a>&gt; wrote:</div>
<div class=3D"v1gmail_quote">
<blockquote class=3D"v1gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; bor=
der-left: 1px solid #cccccc; padding-left: 1ex;">On 2023-07-09 12:33, Po-Ch=
uan Hsieh wrote:<br />&gt; The branch main has been updated by sunpoet:<br =
/>&gt; <br />&gt; URL:<br />&gt; <a href=3D"https://cgit.FreeBSD.org/ports/=
commit/?id=3Dc25f0c013e88d84c620b2bb8c56158e9ca7f8bef" target=3D"_blank" re=
l=3D"noopener noreferrer">https://cgit.FreeBSD.org/ports/commit/?id=3Dc25f0=
c013e88d84c620b2bb8c56158e9ca7f8bef</a><br />&gt; <br />&gt; commit c25f0c0=
13e88d84c620b2bb8c56158e9ca7f8bef<br />&gt; Author:&nbsp; &nbsp; &nbsp;Po-C=
huan Hsieh &lt;sunpoet@FreeBSD.org&gt;<br />&gt; AuthorDate: 2023-07-09 10:=
17:04 +0000<br />&gt; Commit:&nbsp; &nbsp; &nbsp;Po-Chuan Hsieh &lt;sunpoet=
@FreeBSD.org&gt;<br />&gt; CommitDate: 2023-07-09 10:17:04 +0000<br />&gt; =
<br />&gt;&nbsp; &nbsp; &nbsp;databases/libmemcached: Skip libcrypto.pc whe=
n using SSL from base <br />&gt; system<br />&gt; <br />&gt;&nbsp; &nbsp; &=
nbsp;- Bump PORTREVISION for package change<br />&gt; ---<br />&gt;&nbsp; d=
atabases/libmemcached/Makefile&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nb=
sp; &nbsp; &nbsp; | 10 +++++++++-<br />&gt;&nbsp; databases/libmemcached/fi=
les/extra-patch-openssl | 11 +++++++++++<br />&gt;&nbsp; 2 files changed, 2=
0 insertions(+), 1 deletion(-)<br />&gt; <br />&gt; diff --git a/databases/=
libmemcached/Makefile <br />&gt; b/databases/libmemcached/Makefile<br />&gt=
; index e044f28499fd..71f031d3014f 100644<br />&gt; --- a/databases/libmemc=
ached/Makefile<br />&gt; +++ b/databases/libmemcached/Makefile<br />&gt; @@=
 -1,5 +1,6 @@<br />&gt;&nbsp; PORTNAME=3D&nbsp; &nbsp; libmemcached<br />&g=
t;&nbsp; PORTVERSION=3D 1.1.4<br />&gt; +PORTREVISION=3D&nbsp; &nbsp; &nbsp=
; &nbsp; 1<br />&gt;&nbsp; CATEGORIES=3D&nbsp; databases<br />&gt; <br />&g=
t;&nbsp; MAINTAINER=3D&nbsp; sunpoet@FreeBSD.org<br />&gt; @@ -44,4 +45,11 =
@@ MURMUR_CMAKE_BOOL=3D ENABLE_HASH_MURMUR<br />&gt;&nbsp; SASL_CMAKE_BOOL=
=3D&nbsp; &nbsp; &nbsp;ENABLE_SASL<br />&gt;&nbsp; SASL_LIB_DEPENDS=3D&nbsp=
; &nbsp; libsasl2.so:security/cyrus-sasl2<br />&gt; <br />&gt; -.include &l=
t;<a href=3D"http://bsd.port.mk" target=3D"_blank" rel=3D"noopener noreferr=
er">bsd.port.mk</a>&gt;<br />&gt; +.include &lt;<a href=3D"http://bsd.port.=
pre.mk" target=3D"_blank" rel=3D"noopener noreferrer">bsd.port.pre.mk</a>&g=
t;<br />&gt; +<br />&gt; +# Skip libcrypto.pc while using OpenSSL from base=
 system on older<br />&gt; FreeBSD versions which does not skip this file<b=
r />&gt; +.if ${SSL_DEFAULT} =3D=3D base &amp;&amp; <br />&gt; !exists(/usr=
/libdata/pkgconfig/libcrypto.pc)<br />&gt; +EXTRA_PATCHES+=3D&nbsp; &nbsp; =
&nbsp; ${PATCHDIR}/extra-patch-openssl<br />&gt; +.endif<br />&gt; +<br />&=
gt; +.include &lt;<a href=3D"http://bsd.port.post.mk" target=3D"_blank" rel=
=3D"noopener noreferrer">bsd.port.post.mk</a>&gt;<br />&gt; diff --git a/da=
tabases/libmemcached/files/extra-patch-openssl<br />&gt; b/databases/libmem=
cached/files/extra-patch-openssl<br />&gt; new file mode 100644<br />&gt; i=
ndex 000000000000..bf65fa7f4ece<br />&gt; --- /dev/null<br />&gt; +++ b/dat=
abases/libmemcached/files/extra-patch-openssl<br />&gt; @@ -0,0 +1,11 @@<br=
 />&gt; +--- src/libhashkit/CMakeLists.txt.orig&nbsp; &nbsp; &nbsp; &nbsp;2=
023-03-06 08:47:30 UTC<br />&gt; ++++ src/libhashkit/CMakeLists.txt<br />&g=
t; +@@ -45,7 +45,7 @@ if(ENABLE_OPENSSL_CRYPTO)<br />&gt; +&nbsp; &nbsp; &n=
bsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;if(OPENSSL_CRYPTO_LIBRARY)<br=
 />&gt; +&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nb=
sp; &nbsp; &nbsp; &nbsp;target_compile_definitions(libhashkit<br />&gt; PRI=
VATE HAVE_OPENSSL_CRYPTO)<br />&gt; +&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nb=
sp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;target_link_libraries(l=
ibhashkit PUBLIC<br />&gt; OpenSSL::Crypto)<br />&gt; +-&nbsp; &nbsp; &nbsp=
; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pkgconfig_=
export(REQUIRES_PRIVATE libcrypto)<br />&gt; ++&nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pkgconfig_export(RE=
QUIRES_PRIVATE "")<br />&gt; +&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nb=
sp; &nbsp; &nbsp;else()<br />&gt; +&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp=
; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;message(WARNING "Could no=
t find <br />&gt; OpenSSL::Crypto")<br />&gt; +&nbsp; &nbsp; &nbsp; &nbsp; =
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;endif()<br /><br />Hi,<br /><br />Resendi=
ng as I didn't get a reply last time,<br /><br />I few things I noticed com=
pared to the PR I submitted about this port.<br /><br />-std=3Dgnu++17 is s=
et when unit tests are enabled so USES=3D <br />compiler:c++11-lang is inco=
rrect</blockquote>
<div>&nbsp;</div>
USES=3Dcompiler:c++11-lang for build is correct.<br />I know that c++17 is =
required for the tests.<br />
<div>But USES=3Dcompiler:c++11-lang is effectively the same as USES=3Dcompi=
ler:c++17-lang.</div>
<div>&nbsp;</div>
<blockquote class=3D"v1gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; bor=
der-left: 1px solid #cccccc; padding-left: 1ex;">Is there a reason why defa=
ult filenames aren't used for patches?</blockquote>
<div>&nbsp;</div>
<div>The default filename comes from the path is OK.</div>
But it tells you nothing but the path which is already in the diff header.
<div>Naming the patch file by its purpose is better here.</div>
<div>&nbsp;</div>
<blockquote class=3D"v1gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; bor=
der-left: 1px solid #cccccc; padding-left: 1ex;">Why are we using flex from=
 base rather from ports?</blockquote>
<div>&nbsp;</div>
<div>What's wrong with flex from base? If you notice any issue, I'm happy t=
o fix it.</div>
<div>&nbsp;</div>
<blockquote class=3D"v1gmail_quote" style=3D"margin: 0px 0px 0px 0.8ex; bor=
der-left: 1px solid #cccccc; padding-left: 1ex;">That openssl patch can be =
improved by doing something like this, <br /><a href=3D"https://cgit.freebs=
d.org/ports/tree/archivers/libarchive/Makefile#n124" target=3D"_blank" rel=
=3D"noopener noreferrer">https://cgit.freebsd.org/ports/tree/archivers/liba=
rchive/Makefile#n124</a><br /><br />Best regards,<br />Daniel</blockquote>
</div>
</div>
</div>
</blockquote>
<p>Hi,</p>
<p>While compiler:c++11-lang and compiler:c++17-lang is for now that doesn'=
t mean it won't change in the future, if we can avoid unnecessary breakage =
I don't see why we shouldn't?</p>
<p>I get your argument however I'm not sure if we should deviate from Porte=
rs Handbook unless necessary, simply because of overall (treewide) maintena=
nce instead of having ports with their own little quirks left and right whi=
ch isn't going to benefit the project in the long run.</p>
<p>One major downside using libraries from base is that you may end up with=
 different versions between support major versions of FreeBSD which may cau=
se inconsistencies.</p>
<p>For example, 12 is still on 2.5.37 while 13+ is on 2.6.4</p>
<p><a href=3D"https://cgit.freebsd.org/src/log/contrib/flex?h=3Dstable/12">=
https://cgit.freebsd.org/src/log/contrib/flex?h=3Dstable/12</a></p>;
<p><a href=3D"https://cgit.freebsd.org/src/log/contrib/flex?h=3Dstable/13">=
https://cgit.freebsd.org/src/log/contrib/flex?h=3Dstable/13</a></p>;
<p>Best regards,</p>
<p>Daniel</p>

</body></html>

--=_b670027eca2e6915f0cbea065c273be1--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ceaf40bb57164ed827707c3fe2ec7ba9>