Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 17 Jun 2023 21:46:57 GMT
From:      Rodrigo Osorio <rodrigo@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: 74d9fa77b3a7 - main - www/c-icap: Fix invalid integer conversion with llvm15+
Message-ID:  <202306172146.35HLkvum044752@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by rodrigo:

URL: https://cgit.FreeBSD.org/ports/commit/?id=74d9fa77b3a72e7745f21e5cf3a56557b4f935fd

commit 74d9fa77b3a72e7745f21e5cf3a56557b4f935fd
Author:     Rodrigo Osorio <rodrigo@FreeBSD.org>
AuthorDate: 2023-06-17 21:21:31 +0000
Commit:     Rodrigo Osorio <rodrigo@FreeBSD.org>
CommitDate: 2023-06-17 21:34:32 +0000

    www/c-icap: Fix invalid integer conversion with llvm15+
    
    Fix invalid pointer conversion with llvm15+. This issue
    has been corrected previously by asking the compile to ignore
    the errors using CFLAGS -Wno-error=int-conversion.
    This flag is now removed and the errors properly fixed.
    
    Also fix the some of the paths in the default configuration
    to match the FreeBSD HIER.
    
    PR:             271810
    Reported by:    fluffy
---
 www/c-icap/Makefile                   |  5 +----
 www/c-icap/files/patch-c-icap.conf.in | 27 ++++++++++++++++++++++++++-
 www/c-icap/files/patch-commands.c     | 11 +++++++++++
 www/c-icap/files/patch-mpmt__server.c | 15 +++++++++++++++
 www/c-icap/files/patch-txt__format.c  | 11 +++++++++++
 5 files changed, 64 insertions(+), 5 deletions(-)

diff --git a/www/c-icap/Makefile b/www/c-icap/Makefile
index c1d2881aeb5e..35564e152e85 100644
--- a/www/c-icap/Makefile
+++ b/www/c-icap/Makefile
@@ -1,5 +1,6 @@
 PORTNAME=	c-icap
 PORTVERSION=	0.5.10
+PORTREVISION=	1
 PORTEPOCH=	2
 CATEGORIES=	www
 MASTER_SITES=	SF/${PORTNAME}/${PORTNAME}/0.5.x/
@@ -68,10 +69,6 @@ BDB_CONFIGURE_OFF=	--with-bdb=no
 
 .include <bsd.port.pre.mk>
 
-.if ${OPSYS} == FreeBSD && ( ${OSVERSION} >= 1400079 || ( ${OSVERSION} >= 1302505 && ${OSVERSION} < 1400000 ))
-CFLAGS+=	-Wno-error=int-conversion
-.endif
-
 post-patch:
 	@${REINPLACE_CMD} \
 		-e 's|@prefix@/var/log|/var/log/c-icap|g' \
diff --git a/www/c-icap/files/patch-c-icap.conf.in b/www/c-icap/files/patch-c-icap.conf.in
index 1e795e66ecac..62449a4eeecc 100644
--- a/www/c-icap/files/patch-c-icap.conf.in
+++ b/www/c-icap/files/patch-c-icap.conf.in
@@ -1,4 +1,4 @@
---- c-icap.conf.in.orig	2018-09-12 13:40:37 UTC
+--- c-icap.conf.in.orig	2020-09-14 14:17:26 UTC
 +++ c-icap.conf.in
 @@ -132,7 +132,7 @@ MaxRequestsPerChild  0
  #	Port [::1]:1346
@@ -9,3 +9,28 @@
  
  # TAG: TlsPort
  # Format: TlsPort [address:]port [tls-method=method] [cert=path_to_pem_cert] [key=path_to_pem_key] [client_ca=path_to_pem_file] [ciphers=ciph1:ciph2...] [tls_options=[!]Opt1|[!]Opt2|...]
+@@ -602,8 +602,8 @@ RemoteProxyUserHeaderEncoded on
+ #	store debugging information, errors and other
+ #	information about the c-icap server.
+ # Default:
+-#	ServerLog @prefix@/var/log/server.log
+-ServerLog @prefix@/var/log/server.log
++#	ServerLog /var/log/c-icap/server.log
++ServerLog /var/log/c-icap/server.log
+ 
+ # TAG: AccessLog
+ # Format: AccessLog LogFile [LogFormat] [[!]acl1] [[!]acl2] [...]
+@@ -615,10 +615,10 @@ ServerLog @prefix@/var/log/server.log
+ #	This directive can be used more than once to specify more than
+ #	one access log files
+ # Default:
+-#	AccessLog @prefix@/var/log/access.log
++#	AccessLog /var/log/c-icap/access.log
+ # Example:
+-#	AccessLog @prefix@/var/log/access.log MyFormat all
+-AccessLog @prefix@/var/log/access.log
++#	AccessLog /var/log/c-icap/access.log MyFormat all
++AccessLog /var/log/c-icap/access.log
+ 
+ # TAG: Logger
+ # Format: Logger LoggerName
diff --git a/www/c-icap/files/patch-commands.c b/www/c-icap/files/patch-commands.c
new file mode 100644
index 000000000000..0eab874c4135
--- /dev/null
+++ b/www/c-icap/files/patch-commands.c
@@ -0,0 +1,11 @@
+--- commands.c.orig	2021-09-14 10:21:46 UTC
++++ commands.c
+@@ -233,7 +233,7 @@ void ci_command_schedule_on(const char *name, void *da
+     sch.when = time;
+     sch.data = data;
+     if (ci_list_search(COMMANDS_QUEUE, &sch)) {
+-        ci_debug_printf(7, "command %s already scheduled for execution on %ld, ignore\n", name, time);
++        ci_debug_printf(7, "command %s already scheduled for execution on %" PRId64 ", ignore\n", name, (uint64_t)time);
+         return;
+     }
+     ci_thread_mutex_lock(&COMMANDS_MTX);
diff --git a/www/c-icap/files/patch-mpmt__server.c b/www/c-icap/files/patch-mpmt__server.c
new file mode 100644
index 000000000000..856677fbfe85
--- /dev/null
+++ b/www/c-icap/files/patch-mpmt__server.c
@@ -0,0 +1,15 @@
+Invalid integer/pointer conversion.  Already fixed upstream:
+https://github.com/c-icap/c-icap-server/commit/8ef8966237865ec699ab16d208ff56edaac4ff7b
+
+Index: mpmt_server.c
+--- mpmt_server.c.orig	2021-09-02 14:45:30 UTC
++++ mpmt_server.c
+@@ -75,7 +75,7 @@ server_decl_t **threads_list = NULL;
+ 
+ ci_thread_mutex_t threads_list_mtx;
+ server_decl_t **threads_list = NULL;
+-ci_thread_t listener_thread_id = -1;
++ci_thread_t listener_thread_id;
+ int listener_running = 0;
+ 
+ ci_thread_cond_t free_server_cond;
diff --git a/www/c-icap/files/patch-txt__format.c b/www/c-icap/files/patch-txt__format.c
new file mode 100644
index 000000000000..50e1c92d9569
--- /dev/null
+++ b/www/c-icap/files/patch-txt__format.c
@@ -0,0 +1,11 @@
+--- txt_format.c.orig	2018-11-09 09:42:02 UTC
++++ txt_format.c
+@@ -417,7 +417,7 @@ int fmt_seconds(ci_request_t *req, char *buf,int len, 
+ {
+     time_t tm;
+     time(&tm);
+-    return snprintf(buf, len, "%ld", tm);
++    return snprintf(buf, len, "%" PRId64 , (uint64_t) tm);
+ }
+ 
+ int fmt_httpclientip(ci_request_t *req, char *buf,int len, const char *param)



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