Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 12 Jan 2020 13:37:27 -0500
From:      Steve Wills <swills@FreeBSD.org>
To:        Matthias Andree <mandree@FreeBSD.org>, ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   Re: svn commit: r522784 - in head/databases: db5 db6
Message-ID:  <8e8949eb-539f-9148-a3ce-1ba795ea54f4@FreeBSD.org>
In-Reply-To: <202001121247.00CCls05090533@repo.freebsd.org>
References:  <202001121247.00CCls05090533@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------B140CE176B30A84B2741222D
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit

Hi,

On 1/12/20 7:47 AM, Matthias Andree wrote:
> Author: mandree
> Date: Sun Jan 12 12:47:53 2020
> New Revision: 522784
> URL: https://svnweb.freebsd.org/changeset/ports/522784
> 
> Log:
>    databases/db6, db5: fix JAVA-enabled build, suppress sed failed warnings
>    
>    Add JAVA_VERSION="7 8" to db6
>    Add REWARNFILE=/dev/null to db6 and db5

Individual ports aren't meant to set REWARNFILE. See below.

>    Reported by: Tommy P <tommyhp2@gmail.com>
>    PR:          243278
>    MFH:         2020Q1 (blanket, fix broken build)
> 
> Modified:
>    head/databases/db5/Makefile
>    head/databases/db6/Makefile
> 
> Modified: head/databases/db5/Makefile
> ==============================================================================
> --- head/databases/db5/Makefile	Sun Jan 12 12:45:05 2020	(r522783)
> +++ head/databases/db5/Makefile	Sun Jan 12 12:47:53 2020	(r522784)
> @@ -38,6 +38,9 @@ USE_LDCONFIG=	yes
>   PLIST_SUB=	BDBMAJ=${BDBMAJ} BDBVER=${BDBVER}
>   MAKE_ARGS+=	docdir=${DOCSDIR}
>   CFLAGS+=	-Wall -Wextra
> +# we use REINPLACE_CMD with a glob that matches
> +# too broadly, suppress 'sed failed' warnings:
> +REWARNFILE=    /dev/null

Indeed the glob is too broad, but if the 5 files that this applies to 
were listed individually, that would still be replacing static content 
with sed, rather than a patch, which is not what section 4.4.3 of the 
Porters Handbook says:

https://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/slow-patch.html

I think this should look more like the attached patch. Similar changes 
are needed for db6.

Steve

--------------B140CE176B30A84B2741222D
Content-Type: text/x-patch; charset=UTF-8;
 name="db5_reinplace.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="db5_reinplace.diff"

diff --git databases/db5/Makefile databases/db5/Makefile
index 03742489f772..c4b58da879df 100644
--- databases/db5/Makefile
+++ databases/db5/Makefile
@@ -78,10 +78,6 @@ CONFIGURE_ARGS+=	--enable-posixmutexes
 CONFIGURE_ARGS+=	--with-mutex=POSIX/pthreads
 .endif
 
-post-patch:
-	${REINPLACE_CMD} -e '/^DOCLIST/{s/csharp//;}' ${WRKSRC}/../dist/Makefile.in
-	${REINPLACE_CMD} -Ee 's/[[:<:]]atomic_init[[:>:]]/db_atomic_init/g' ${WRKSRC}/../src/mp/mp* ${WRKSRC}/../src/mutex/mut_*
-
 post-install:
 .for i in ${DBLIBS}
 	${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib/${PORTNAME}/${i}-${BDBVER}.so.0
diff --git databases/db5/files/patch-dist_Makefile.in databases/db5/files/patch-dist_Makefile.in
new file mode 100644
index 000000000000..a757ead54324
--- /dev/null
+++ databases/db5/files/patch-dist_Makefile.in
@@ -0,0 +1,11 @@
+--- dist/Makefile.in.orig	2013-09-09 15:35:02 UTC
++++ dist/Makefile.in
+@@ -1156,7 +1156,7 @@ uninstall_utilities:
+ 
+ # We install csharp docs even on UNIX so we don't have a 
+ # broken link on the landing page.
+-DOCLIST=api_reference articles bdb-sql collections csharp \
++DOCLIST=api_reference articles bdb-sql collections \
+ 	gsg gsg_db_rep gsg_txn index.html installation java \
+ 	license porting programmer_reference upgrading
+ 
diff --git databases/db5/files/patch-src_mp_mp__fget.c databases/db5/files/patch-src_mp_mp__fget.c
new file mode 100644
index 000000000000..e8ca644f3a5a
--- /dev/null
+++ databases/db5/files/patch-src_mp_mp__fget.c
@@ -0,0 +1,20 @@
+--- src/mp/mp_fget.c.orig	2013-09-09 15:35:09 UTC
++++ src/mp/mp_fget.c
+@@ -649,7 +649,7 @@ alloc:		/* Allocate a new buffer header and data space
+ 
+ 		/* Initialize enough so we can call __memp_bhfree. */
+ 		alloc_bhp->flags = 0;
+-		atomic_init(&alloc_bhp->ref, 1);
++		db_atomic_init(&alloc_bhp->ref, 1);
+ #ifdef DIAGNOSTIC
+ 		if ((uintptr_t)alloc_bhp->buf & (sizeof(size_t) - 1)) {
+ 			__db_errx(env, DB_STR("3025",
+@@ -955,7 +955,7 @@ alloc:		/* Allocate a new buffer header and data space
+ 			MVCC_MPROTECT(bhp->buf, mfp->pagesize,
+ 			    PROT_READ);
+ 
+-		atomic_init(&alloc_bhp->ref, 1);
++		db_atomic_init(&alloc_bhp->ref, 1);
+ 		MUTEX_LOCK(env, alloc_bhp->mtx_buf);
+ 		alloc_bhp->priority = bhp->priority;
+ 		alloc_bhp->pgno = bhp->pgno;
diff --git databases/db5/files/patch-src_mp_mp__mvcc.c databases/db5/files/patch-src_mp_mp__mvcc.c
new file mode 100644
index 000000000000..c6cb024d7888
--- /dev/null
+++ databases/db5/files/patch-src_mp_mp__mvcc.c
@@ -0,0 +1,20 @@
+--- src/mp/mp_mvcc.c.orig	2013-09-09 15:35:09 UTC
++++ src/mp/mp_mvcc.c
+@@ -276,7 +276,7 @@ __memp_bh_freeze(dbmp, infop, hp, bhp, need_frozenp)
+ #else
+ 	memcpy(frozen_bhp, bhp, SSZA(BH, buf));
+ #endif
+-	atomic_init(&frozen_bhp->ref, 0);
++	db_atomic_init(&frozen_bhp->ref, 0);
+ 	if (mutex != MUTEX_INVALID)
+ 		frozen_bhp->mtx_buf = mutex;
+ 	else if ((ret = __mutex_alloc(env, MTX_MPOOL_BH,
+@@ -428,7 +428,7 @@ __memp_bh_thaw(dbmp, infop, hp, frozen_bhp, alloc_bhp)
+ #endif
+ 		alloc_bhp->mtx_buf = mutex;
+ 		MUTEX_LOCK(env, alloc_bhp->mtx_buf);
+-		atomic_init(&alloc_bhp->ref, 1);
++		db_atomic_init(&alloc_bhp->ref, 1);
+ 		F_CLR(alloc_bhp, BH_FROZEN);
+ 	}
+ 
diff --git databases/db5/files/patch-src_mp_mp__region.c databases/db5/files/patch-src_mp_mp__region.c
new file mode 100644
index 000000000000..9eb4ba68019c
--- /dev/null
+++ databases/db5/files/patch-src_mp_mp__region.c
@@ -0,0 +1,20 @@
+--- src/mp/mp_region.c.orig	2013-09-09 15:35:09 UTC
++++ src/mp/mp_region.c
+@@ -245,7 +245,7 @@ __memp_init(env, dbmp, reginfo_off, htab_buckets, max_
+ 			     MTX_MPOOL_FILE_BUCKET, 0, &htab[i].mtx_hash)) != 0)
+ 				return (ret);
+ 			SH_TAILQ_INIT(&htab[i].hash_bucket);
+-			atomic_init(&htab[i].hash_page_dirty, 0);
++			db_atomic_init(&htab[i].hash_page_dirty, 0);
+ 		}
+ 
+ 		/*
+@@ -302,7 +302,7 @@ no_prealloc:
+ 		} else
+ 			hp->mtx_hash = mtx_base + (i % dbenv->mp_mtxcount);
+ 		SH_TAILQ_INIT(&hp->hash_bucket);
+-		atomic_init(&hp->hash_page_dirty, 0);
++		db_atomic_init(&hp->hash_page_dirty, 0);
+ #ifdef HAVE_STATISTICS
+ 		hp->hash_io_wait = 0;
+ 		hp->hash_frozen = hp->hash_thawed = hp->hash_frozen_freed = 0;
diff --git databases/db5/files/patch-src_mutex_mut__method.c databases/db5/files/patch-src_mutex_mut__method.c
new file mode 100644
index 000000000000..0b01940506d5
--- /dev/null
+++ databases/db5/files/patch-src_mutex_mut__method.c
@@ -0,0 +1,11 @@
+--- src/mutex/mut_method.c.orig	2013-09-09 15:35:09 UTC
++++ src/mutex/mut_method.c
+@@ -474,7 +474,7 @@ atomic_compare_exchange(env, v, oldval, newval)
+ 	MUTEX_LOCK(env, mtx);
+ 	ret = atomic_read(v) == oldval;
+ 	if (ret)
+-		atomic_init(v, newval);
++		db_atomic_init(v, newval);
+ 	MUTEX_UNLOCK(env, mtx);
+ 
+ 	return (ret);
diff --git databases/db5/files/patch-src_mutex_mut__tas.c databases/db5/files/patch-src_mutex_mut__tas.c
new file mode 100644
index 000000000000..03e955c820d5
--- /dev/null
+++ databases/db5/files/patch-src_mutex_mut__tas.c
@@ -0,0 +1,20 @@
+--- src/mutex/mut_tas.c.orig	2013-09-09 15:35:09 UTC
++++ src/mutex/mut_tas.c
+@@ -47,7 +47,7 @@ __db_tas_mutex_init(env, mutex, flags)
+ 
+ #ifdef HAVE_SHARED_LATCHES
+ 	if (F_ISSET(mutexp, DB_MUTEX_SHARED))
+-		atomic_init(&mutexp->sharecount, 0);
++		db_atomic_init(&mutexp->sharecount, 0);
+ 	else
+ #endif
+ 	if (MUTEX_INIT(&mutexp->tas)) {
+@@ -536,7 +536,7 @@ __db_tas_mutex_unlock(env, mutex)
+ 			F_CLR(mutexp, DB_MUTEX_LOCKED);
+ 			/* Flush flag update before zeroing count */
+ 			MEMBAR_EXIT();
+-			atomic_init(&mutexp->sharecount, 0);
++			db_atomic_init(&mutexp->sharecount, 0);
+ 		} else {
+ 			DB_ASSERT(env, sharecount > 0);
+ 			MEMBAR_EXIT();

--------------B140CE176B30A84B2741222D--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?8e8949eb-539f-9148-a3ce-1ba795ea54f4>